1 122c3632SJürgen Schmidt#**************************************************************
2 122c3632SJürgen Schmidt#
3 122c3632SJürgen Schmidt#  Licensed to the Apache Software Foundation (ASF) under one
4 122c3632SJürgen Schmidt#  or more contributor license agreements.  See the NOTICE file
5 122c3632SJürgen Schmidt#  distributed with this work for additional information
6 122c3632SJürgen Schmidt#  regarding copyright ownership.  The ASF licenses this file
7 122c3632SJürgen Schmidt#  to you under the Apache License, Version 2.0 (the
8 122c3632SJürgen Schmidt#  "License"); you may not use this file except in compliance
9 122c3632SJürgen Schmidt#  with the License.  You may obtain a copy of the License at
10 122c3632SJürgen Schmidt#
11 122c3632SJürgen Schmidt#    http://www.apache.org/licenses/LICENSE-2.0
12 122c3632SJürgen Schmidt#
13 122c3632SJürgen Schmidt#  Unless required by applicable law or agreed to in writing,
14 122c3632SJürgen Schmidt#  software distributed under the License is distributed on an
15 122c3632SJürgen Schmidt#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 122c3632SJürgen Schmidt#  KIND, either express or implied.  See the License for the
17 122c3632SJürgen Schmidt#  specific language governing permissions and limitations
18 122c3632SJürgen Schmidt#  under the License.
19 cdf0e10cSrcweir#
20 122c3632SJürgen Schmidt#**************************************************************
21 cdf0e10cSrcweir
22 cdf0e10cSrcweir# Builds the Forms example of the Developers Guide.
23 cdf0e10cSrcweir
24 cdf0e10cSrcweirPRJ=../../..
25 cdf0e10cSrcweirSETTINGS=$(PRJ)/settings
26 cdf0e10cSrcweir
27 cdf0e10cSrcweirinclude $(SETTINGS)/settings.mk
28 cdf0e10cSrcweirinclude $(SETTINGS)/std.mk
29 cdf0e10cSrcweirinclude $(SETTINGS)/dk.mk
30 cdf0e10cSrcweir
31 cdf0e10cSrcweir# Define non-platform/compiler specific settings
32 cdf0e10cSrcweirSAMPLE_NAME=FormsExamples
33 cdf0e10cSrcweirSAMPLE_CLASS_OUT=$(OUT_CLASS)/$(SAMPLE_NAME)
34 cdf0e10cSrcweirSAMPLE_GEN_OUT=$(OUT_MISC)/$(SAMPLE_NAME)
35 cdf0e10cSrcweir
36 cdf0e10cSrcweirAPP1_NAME=DataAwareness
37 cdf0e10cSrcweirAPP1_CLASS_OUT=$(SAMPLE_CLASS_OUT)/$(APP1_NAME)
38 cdf0e10cSrcweirAPP1_JAR=$(SAMPLE_CLASS_OUT)/$(APP1_NAME).jar
39 cdf0e10cSrcweirAPP2_NAME=ValueBinding
40 cdf0e10cSrcweirAPP2_CLASS_OUT=$(SAMPLE_CLASS_OUT)/$(APP2_NAME)
41 cdf0e10cSrcweirAPP2_JAR=$(SAMPLE_CLASS_OUT)/$(APP2_NAME).jar
42 cdf0e10cSrcweirAPP3_NAME=SpreadsheetValueBinding
43 cdf0e10cSrcweirAPP3_CLASS_OUT=$(SAMPLE_CLASS_OUT)/$(APP3_NAME)
44 cdf0e10cSrcweirAPP3_JAR=$(SAMPLE_CLASS_OUT)/$(APP3_NAME).jar
45 cdf0e10cSrcweirAPP4_NAME=ControlValidation
46 cdf0e10cSrcweirAPP4_CLASS_OUT=$(SAMPLE_CLASS_OUT)/$(APP4_NAME)
47 cdf0e10cSrcweirAPP4_JAR=$(SAMPLE_CLASS_OUT)/$(APP4_NAME).jar
48 cdf0e10cSrcweir
49 cdf0e10cSrcweirCOMMON_CLASS_OUT = $(SAMPLE_CLASS_OUT)/common
50 cdf0e10cSrcweirCOMMON_JAVAFILES  = \
51 cdf0e10cSrcweir	ButtonOperator.java \
52 cdf0e10cSrcweir	ComponentTreeTraversal.java \
53 cdf0e10cSrcweir	ControlLock.java \
54 cdf0e10cSrcweir	DocumentHelper.java \
55 cdf0e10cSrcweir	DocumentType.java \
56 cdf0e10cSrcweir	DocumentViewHelper.java \
57 cdf0e10cSrcweir	FLTools.java \
58 cdf0e10cSrcweir	FormLayer.java \
59 cdf0e10cSrcweir	GridFieldValidator.java \
60 cdf0e10cSrcweir	InteractionRequest.java \
61 cdf0e10cSrcweir	KeyGenerator.java \
62 cdf0e10cSrcweir	SalesFilter.java \
63 cdf0e10cSrcweir	UNO.java \
64 cdf0e10cSrcweir	SpreadsheetView.java \
65 cdf0e10cSrcweir	WaitForInput.java \
66 cdf0e10cSrcweir	DocumentBasedExample.java \
67 cdf0e10cSrcweir	TableCellTextBinding.java \
68 cdf0e10cSrcweir	SpreadsheetDocument.java \
69 cdf0e10cSrcweir	NumericValidator.java \
70 cdf0e10cSrcweir	TextValidator.java \
71 cdf0e10cSrcweir	BooleanValidator.java \
72 cdf0e10cSrcweir	ListSelectionValidator.java \
73 cdf0e10cSrcweir	DateValidator.java \
74 cdf0e10cSrcweir	TimeValidator.java \
75 cdf0e10cSrcweir	ControlValidator.java \
76 cdf0e10cSrcweir	SingleControlValidation.java \
77 cdf0e10cSrcweir	HsqlDatabase.java \
78 cdf0e10cSrcweir	RowSet.java \
79 cdf0e10cSrcweir	URLHelper.java
80 cdf0e10cSrcweir
81 cdf0e10cSrcweirCOMMON_CLASSFILES = $(patsubst %.java,$(COMMON_CLASS_OUT)/%.class,$(COMMON_JAVAFILES))
82 cdf0e10cSrcweir
83 cdf0e10cSrcweirSDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
84 cdf0e10cSrcweir		$(PATH_SEPARATOR)$(SAMPLE_CLASS_OUT)\
85 cdf0e10cSrcweir		$(PATH_SEPARATOR)$(COMMON_CLASS_OUT))
86 cdf0e10cSrcweir
87 cdf0e10cSrcweir
88 cdf0e10cSrcweir# Targets
89 cdf0e10cSrcweir.PHONY: ALL
90 cdf0e10cSrcweirALL : \
91 cdf0e10cSrcweir    FormsExample
92 cdf0e10cSrcweir
93 cdf0e10cSrcweirinclude $(SETTINGS)/stdtarget.mk
94 cdf0e10cSrcweir
95 cdf0e10cSrcweir$(COMMON_CLASSFILES) : $(COMMON_JAVAFILES)
96 cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
97 cdf0e10cSrcweir	$(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(COMMON_CLASS_OUT) $^
98 cdf0e10cSrcweir
99 cdf0e10cSrcweir# rule for client/example application manifest file
100 cdf0e10cSrcweir$(SAMPLE_GEN_OUT)/%.mf :
101 cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
102 cdf0e10cSrcweir	@echo Main-Class: com.sun.star.lib.loader.Loader> $@
103 cdf0e10cSrcweir	$(ECHOLINE)>> $@
104 cdf0e10cSrcweir	@echo Name: com/sun/star/lib/loader/Loader.class>> $@
105 cdf0e10cSrcweir	@echo Application-Class: $*>> $@
106 cdf0e10cSrcweir
107 cdf0e10cSrcweir$(APP1_CLASS_OUT)/$(APP1_NAME).class : $(APP1_NAME).java $(COMMON_CLASSFILES)
108 cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
109 cdf0e10cSrcweir	$(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(APP1_CLASS_OUT) $<
110 cdf0e10cSrcweir
111 cdf0e10cSrcweir$(APP2_CLASS_OUT)/$(APP2_NAME).class : $(APP2_NAME).java $(COMMON_CLASSFILES)
112 cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
113 cdf0e10cSrcweir	$(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(APP2_CLASS_OUT) $<
114 cdf0e10cSrcweir
115 cdf0e10cSrcweir$(APP3_CLASS_OUT)/$(APP3_NAME).class : $(APP3_NAME).java $(COMMON_CLASSFILES)
116 cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
117 cdf0e10cSrcweir	$(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(APP3_CLASS_OUT) $<
118 cdf0e10cSrcweir
119 cdf0e10cSrcweir$(APP4_CLASS_OUT)/$(APP4_NAME).class : $(APP4_NAME).java $(COMMON_CLASSFILES)
120 cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
121 cdf0e10cSrcweir	$(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(APP4_CLASS_OUT) $<
122 cdf0e10cSrcweir
123 cdf0e10cSrcweir$(APP1_JAR) : $(SAMPLE_GEN_OUT)/$(APP1_NAME).mf $(APP1_CLASS_OUT)/$(APP1_NAME).class $(COMMON_CLASSFILES)
124 cdf0e10cSrcweir	-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
125 cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
126 cdf0e10cSrcweir	+$(SDK_JAR) cvfm $@ $< -C $(APP1_CLASS_OUT) .
127 cdf0e10cSrcweir	+$(SDK_JAR) uvf $@ -C $(COMMON_CLASS_OUT) .
128 cdf0e10cSrcweir	+$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
129 cdf0e10cSrcweir
130 cdf0e10cSrcweir$(APP2_JAR) : $(SAMPLE_GEN_OUT)/$(APP2_NAME).mf $(APP2_CLASS_OUT)/$(APP2_NAME).class $(COMMON_CLASSFILES)
131 cdf0e10cSrcweir	-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
132 cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
133 cdf0e10cSrcweir	+$(SDK_JAR) cvfm $@ $< -C $(APP2_CLASS_OUT) .
134 cdf0e10cSrcweir	+$(SDK_JAR) uvf $@ -C $(COMMON_CLASS_OUT) .
135 cdf0e10cSrcweir	+$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
136 cdf0e10cSrcweir
137 cdf0e10cSrcweir$(APP3_JAR) : $(SAMPLE_GEN_OUT)/$(APP3_NAME).mf $(APP3_CLASS_OUT)/$(APP3_NAME).class $(COMMON_CLASSFILES)
138 cdf0e10cSrcweir	-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
139 cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
140 cdf0e10cSrcweir	+$(SDK_JAR) cvfm $@ $< -C $(APP3_CLASS_OUT) .
141 cdf0e10cSrcweir	+$(SDK_JAR) uvf $@ -C $(COMMON_CLASS_OUT) .
142 cdf0e10cSrcweir	+$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
143 cdf0e10cSrcweir
144 cdf0e10cSrcweir$(APP4_JAR) : $(SAMPLE_GEN_OUT)/$(APP4_NAME).mf $(APP4_CLASS_OUT)/$(APP4_NAME).class $(COMMON_CLASSFILES)
145 cdf0e10cSrcweir	-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
146 cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
147 cdf0e10cSrcweir	+$(SDK_JAR) cvfm $@ $< -C $(APP4_CLASS_OUT) .
148 cdf0e10cSrcweir	+$(SDK_JAR) uvf $@ -C $(COMMON_CLASS_OUT) .
149 cdf0e10cSrcweir	+$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
150 cdf0e10cSrcweir
151 cdf0e10cSrcweirFormsExample : $(APP1_JAR)  $(APP2_JAR)  $(APP3_JAR)  $(APP4_JAR)
152 cdf0e10cSrcweir	@echo --------------------------------------------------------------------------------
153 cdf0e10cSrcweir	@echo "$(QM)$(APP1_NAME)$(QM)" demonstrates various things around data aware controls.
154 cdf0e10cSrcweir	@echo "$(QM)$(APP2_NAME)$(QM)" demonstrates the use of value bindings for form controls.
155 cdf0e10cSrcweir	@echo "$(QM)$(APP3_NAME)$(QM)" demonstrates the usage of the com.sun.star.table.CellValueBinding service
156 cdf0e10cSrcweir	@echo "$(QM)$(APP4_NAME)$(QM)" demonstrates the form control validation API
157 cdf0e10cSrcweir
158 cdf0e10cSrcweir	@echo Please use one of the following commands to run an example:
159 cdf0e10cSrcweir	@echo -
160 cdf0e10cSrcweir	@echo $(MAKE) $(APP1_NAME).run
161 cdf0e10cSrcweir	@echo $(MAKE) $(APP2_NAME).run
162 cdf0e10cSrcweir	@echo $(MAKE) $(APP3_NAME).run
163 cdf0e10cSrcweir	@echo $(MAKE) $(APP4_NAME).run
164 cdf0e10cSrcweir	@echo -
165 *a893be29SPedro Giffuni	@echo Note: The data awareness example needs a running data source with name
166 cdf0e10cSrcweir	@echo $(SQM)      $(SQM)"$(QM)OO_SDK_Demo_DB$(QM)". Make sure that you have created such a data source,
167 cdf0e10cSrcweir	@echo -
168 cdf0e10cSrcweir	@echo The document "$(QM)ProgrammaticScriptAssignment.odt$(QM)" demonstrates
169 cdf0e10cSrcweir	@echo how you can programmatically create form controls, and associated
170 cdf0e10cSrcweir	@echo scripts with certain events.
171 cdf0e10cSrcweir	@echo -
172 cdf0e10cSrcweir	@echo $(MAKE) ProgrammaticScriptAssignment.odt.load
173 cdf0e10cSrcweir	@echo --------------------------------------------------------------------------------
174 cdf0e10cSrcweir
175 cdf0e10cSrcweirProgrammaticScriptAssignment.odt.load : $(COMP_REGISTERFLAG)
176 cdf0e10cSrcweir	"$(OFFICE_PROGRAM_PATH)$(PS)soffice" $(basename $@)
177 cdf0e10cSrcweir
178 cdf0e10cSrcweir%.run: $(SAMPLE_CLASS_OUT)/%.jar
179 cdf0e10cSrcweir	$(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $<
180 cdf0e10cSrcweir
181 cdf0e10cSrcweir.PHONY: clean
182 cdf0e10cSrcweirclean :
183 cdf0e10cSrcweir	-$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_CLASS_OUT))
184 cdf0e10cSrcweir	-$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_GEN_OUT))
185