1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22#************************************************************************* 23# 24# The Contents of this file are made available subject to the terms of 25# the BSD license. 26# 27# Copyright 2000, 2010 Oracle and/or its affiliates. 28# All rights reserved. 29# 30# Redistribution and use in source and binary forms, with or without 31# modification, are permitted provided that the following conditions 32# are met: 33# 1. Redistributions of source code must retain the above copyright 34# notice, this list of conditions and the following disclaimer. 35# 2. Redistributions in binary form must reproduce the above copyright 36# notice, this list of conditions and the following disclaimer in the 37# documentation and/or other materials provided with the distribution. 38# 3. Neither the name of Sun Microsystems, Inc. nor the names of its 39# contributors may be used to endorse or promote products derived 40# from this software without specific prior written permission. 41# 42# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 43# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 44# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 45# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 46# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 47# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 48# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 49# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 50# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 51# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 52# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 53# 54#************************************************************************** 55 56# Builds the Forms example of the Developers Guide. 57 58PRJ=../../.. 59SETTINGS=$(PRJ)/settings 60 61include $(SETTINGS)/settings.mk 62include $(SETTINGS)/std.mk 63include $(SETTINGS)/dk.mk 64 65# Define non-platform/compiler specific settings 66SAMPLE_NAME=FormsExamples 67SAMPLE_CLASS_OUT=$(OUT_CLASS)/$(SAMPLE_NAME) 68SAMPLE_GEN_OUT=$(OUT_MISC)/$(SAMPLE_NAME) 69 70APP1_NAME=DataAwareness 71APP1_CLASS_OUT=$(SAMPLE_CLASS_OUT)/$(APP1_NAME) 72APP1_JAR=$(SAMPLE_CLASS_OUT)/$(APP1_NAME).jar 73APP2_NAME=ValueBinding 74APP2_CLASS_OUT=$(SAMPLE_CLASS_OUT)/$(APP2_NAME) 75APP2_JAR=$(SAMPLE_CLASS_OUT)/$(APP2_NAME).jar 76APP3_NAME=SpreadsheetValueBinding 77APP3_CLASS_OUT=$(SAMPLE_CLASS_OUT)/$(APP3_NAME) 78APP3_JAR=$(SAMPLE_CLASS_OUT)/$(APP3_NAME).jar 79APP4_NAME=ControlValidation 80APP4_CLASS_OUT=$(SAMPLE_CLASS_OUT)/$(APP4_NAME) 81APP4_JAR=$(SAMPLE_CLASS_OUT)/$(APP4_NAME).jar 82 83COMMON_CLASS_OUT = $(SAMPLE_CLASS_OUT)/common 84COMMON_JAVAFILES = \ 85 ButtonOperator.java \ 86 ComponentTreeTraversal.java \ 87 ControlLock.java \ 88 DocumentHelper.java \ 89 DocumentType.java \ 90 DocumentViewHelper.java \ 91 FLTools.java \ 92 FormLayer.java \ 93 GridFieldValidator.java \ 94 InteractionRequest.java \ 95 KeyGenerator.java \ 96 SalesFilter.java \ 97 UNO.java \ 98 SpreadsheetView.java \ 99 WaitForInput.java \ 100 DocumentBasedExample.java \ 101 TableCellTextBinding.java \ 102 SpreadsheetDocument.java \ 103 NumericValidator.java \ 104 TextValidator.java \ 105 BooleanValidator.java \ 106 ListSelectionValidator.java \ 107 DateValidator.java \ 108 TimeValidator.java \ 109 ControlValidator.java \ 110 SingleControlValidation.java \ 111 HsqlDatabase.java \ 112 RowSet.java \ 113 URLHelper.java 114 115COMMON_CLASSFILES = $(patsubst %.java,$(COMMON_CLASS_OUT)/%.class,$(COMMON_JAVAFILES)) 116 117SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\ 118 $(PATH_SEPARATOR)$(SAMPLE_CLASS_OUT)\ 119 $(PATH_SEPARATOR)$(COMMON_CLASS_OUT)) 120 121 122# Targets 123.PHONY: ALL 124ALL : \ 125 FormsExample 126 127include $(SETTINGS)/stdtarget.mk 128 129$(COMMON_CLASSFILES) : $(COMMON_JAVAFILES) 130 -$(MKDIR) $(subst /,$(PS),$(@D)) 131 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(COMMON_CLASS_OUT) $^ 132 133# rule for client/example application manifest file 134$(SAMPLE_GEN_OUT)/%.mf : 135 -$(MKDIR) $(subst /,$(PS),$(@D)) 136 @echo Main-Class: com.sun.star.lib.loader.Loader> $@ 137 $(ECHOLINE)>> $@ 138 @echo Name: com/sun/star/lib/loader/Loader.class>> $@ 139 @echo Application-Class: $*>> $@ 140 141$(APP1_CLASS_OUT)/$(APP1_NAME).class : $(APP1_NAME).java $(COMMON_CLASSFILES) 142 -$(MKDIR) $(subst /,$(PS),$(@D)) 143 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(APP1_CLASS_OUT) $< 144 145$(APP2_CLASS_OUT)/$(APP2_NAME).class : $(APP2_NAME).java $(COMMON_CLASSFILES) 146 -$(MKDIR) $(subst /,$(PS),$(@D)) 147 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(APP2_CLASS_OUT) $< 148 149$(APP3_CLASS_OUT)/$(APP3_NAME).class : $(APP3_NAME).java $(COMMON_CLASSFILES) 150 -$(MKDIR) $(subst /,$(PS),$(@D)) 151 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(APP3_CLASS_OUT) $< 152 153$(APP4_CLASS_OUT)/$(APP4_NAME).class : $(APP4_NAME).java $(COMMON_CLASSFILES) 154 -$(MKDIR) $(subst /,$(PS),$(@D)) 155 $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(APP4_CLASS_OUT) $< 156 157$(APP1_JAR) : $(SAMPLE_GEN_OUT)/$(APP1_NAME).mf $(APP1_CLASS_OUT)/$(APP1_NAME).class $(COMMON_CLASSFILES) 158 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) 159 -$(MKDIR) $(subst /,$(PS),$(@D)) 160 +$(SDK_JAR) cvfm $@ $< -C $(APP1_CLASS_OUT) . 161 +$(SDK_JAR) uvf $@ -C $(COMMON_CLASS_OUT) . 162 +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES) 163 164$(APP2_JAR) : $(SAMPLE_GEN_OUT)/$(APP2_NAME).mf $(APP2_CLASS_OUT)/$(APP2_NAME).class $(COMMON_CLASSFILES) 165 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) 166 -$(MKDIR) $(subst /,$(PS),$(@D)) 167 +$(SDK_JAR) cvfm $@ $< -C $(APP2_CLASS_OUT) . 168 +$(SDK_JAR) uvf $@ -C $(COMMON_CLASS_OUT) . 169 +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES) 170 171$(APP3_JAR) : $(SAMPLE_GEN_OUT)/$(APP3_NAME).mf $(APP3_CLASS_OUT)/$(APP3_NAME).class $(COMMON_CLASSFILES) 172 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) 173 -$(MKDIR) $(subst /,$(PS),$(@D)) 174 +$(SDK_JAR) cvfm $@ $< -C $(APP3_CLASS_OUT) . 175 +$(SDK_JAR) uvf $@ -C $(COMMON_CLASS_OUT) . 176 +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES) 177 178$(APP4_JAR) : $(SAMPLE_GEN_OUT)/$(APP4_NAME).mf $(APP4_CLASS_OUT)/$(APP4_NAME).class $(COMMON_CLASSFILES) 179 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) 180 -$(MKDIR) $(subst /,$(PS),$(@D)) 181 +$(SDK_JAR) cvfm $@ $< -C $(APP4_CLASS_OUT) . 182 +$(SDK_JAR) uvf $@ -C $(COMMON_CLASS_OUT) . 183 +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES) 184 185FormsExample : $(APP1_JAR) $(APP2_JAR) $(APP3_JAR) $(APP4_JAR) 186 @echo -------------------------------------------------------------------------------- 187 @echo "$(QM)$(APP1_NAME)$(QM)" demonstrates various things around data aware controls. 188 @echo "$(QM)$(APP2_NAME)$(QM)" demonstrates the use of value bindings for form controls. 189 @echo "$(QM)$(APP3_NAME)$(QM)" demonstrates the usage of the com.sun.star.table.CellValueBinding service 190 @echo "$(QM)$(APP4_NAME)$(QM)" demonstrates the form control validation API 191 192 @echo Please use one of the following commands to run an example: 193 @echo - 194 @echo $(MAKE) $(APP1_NAME).run 195 @echo $(MAKE) $(APP2_NAME).run 196 @echo $(MAKE) $(APP3_NAME).run 197 @echo $(MAKE) $(APP4_NAME).run 198 @echo - 199 @echo Note: The data awareness example needs a running data source whith name 200 @echo $(SQM) $(SQM)"$(QM)OO_SDK_Demo_DB$(QM)". Make sure that you have created such a data source, 201 @echo - 202 @echo The document "$(QM)ProgrammaticScriptAssignment.odt$(QM)" demonstrates 203 @echo how you can programmatically create form controls, and associated 204 @echo scripts with certain events. 205 @echo - 206 @echo $(MAKE) ProgrammaticScriptAssignment.odt.load 207 @echo -------------------------------------------------------------------------------- 208 209ProgrammaticScriptAssignment.odt.load : $(COMP_REGISTERFLAG) 210 "$(OFFICE_PROGRAM_PATH)$(PS)soffice" $(basename $@) 211 212%.run: $(SAMPLE_CLASS_OUT)/%.jar 213 $(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $< 214 215.PHONY: clean 216clean : 217 -$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) 218 -$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_GEN_OUT)) 219