diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2011-03-07 16:31:11 +0100 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2011-03-07 16:31:11 +0100 |
commit | e4d3fd6faea32f954923690a111c2466bea1d0c9 (patch) | |
tree | 22277c583c9735e236715002129b1698eb597a06 /odk/examples/java | |
parent | af67f29984bd8c83fac33e0ceca8eefdd7f652e6 (diff) | |
parent | 127c6e0da8657f19392081d7c4da2754c2b9bd09 (diff) |
CWS-TOOLING: integrate CWS jsc340ooo/DEV300_m106ooo/DEV300_m105ooo/DEV300_m104ooo/DEV300_m103ooo/DEV300_m102
Diffstat (limited to 'odk/examples/java')
-rwxr-xr-x[-rw-r--r--] | odk/examples/java/EmbedDocument/EmbeddedObject/Makefile | 12 | ||||
-rw-r--r-- | odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.components | 8 | ||||
-rwxr-xr-x | odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java | 14 | ||||
-rw-r--r-- | odk/examples/java/MinimalComponent/Makefile | 18 | ||||
-rw-r--r-- | odk/examples/java/MinimalComponent/MinimalComponent.components | 8 | ||||
-rw-r--r-- | odk/examples/java/MinimalComponent/MinimalComponent.java | 14 | ||||
-rw-r--r-- | odk/examples/java/PropertySet/Makefile | 10 | ||||
-rw-r--r-- | odk/examples/java/PropertySet/PropTest.components | 8 | ||||
-rw-r--r-- | odk/examples/java/PropertySet/PropTest.java | 14 | ||||
-rw-r--r-- | odk/examples/java/Spreadsheet/CalcAddins.components | 9 | ||||
-rw-r--r-- | odk/examples/java/Spreadsheet/CalcAddins.java | 16 | ||||
-rw-r--r-- | odk/examples/java/Spreadsheet/Makefile | 58 | ||||
-rw-r--r-- | odk/examples/java/ToDo/Makefile | 10 | ||||
-rw-r--r-- | odk/examples/java/ToDo/ToDo.components | 8 | ||||
-rw-r--r-- | odk/examples/java/ToDo/ToDo.java | 12 |
15 files changed, 145 insertions, 74 deletions
diff --git a/odk/examples/java/EmbedDocument/EmbeddedObject/Makefile b/odk/examples/java/EmbedDocument/EmbeddedObject/Makefile index 6b75f4ed..62fb17e5 100644..100755 --- a/odk/examples/java/EmbedDocument/EmbeddedObject/Makefile +++ b/odk/examples/java/EmbedDocument/EmbeddedObject/Makefile @@ -57,6 +57,7 @@ COMP_JAR=$(SAMPLE_CLASS_OUT)/$(COMP_JAR_NAME) COMP_JAR_MANIFEST=$(COMP_GEN_OUT)/$(COMP_NAME).Manifest COMP_UNOPKG_MANIFEST = $(COMP_GEN_OUT)/META-INF/manifest.xml COMP_REGISTERFLAG=$(COMP_GEN_OUT)$(PS)java_$(COMP_NAME)_register_component.flag +COMP_COMPONENTS=$(COMP_NAME).components PACKAGE = org/openoffice/examples/embedding @@ -99,18 +100,19 @@ $(COMP_GEN_OUT)/%/manifest.xml : -$(MKDIR) $(subst /,$(PS),$(@D)) @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@ @echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@ - @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@ - @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).uno.jar$(QM)"/$(CSEP) >> $@ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(SAMPLE_NAME).xcu$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@ + @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ # rule for component package file -$(COMP_PACKAGE) : $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) +$(COMP_PACKAGE) : $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_NAME).components -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) - $(SDK_ZIP) $@ $(COMP_JAR_NAME) $(SAMPLE_NAME).xcu - cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_ZIP) $@ $(COMP_JAR_NAME) + $(SDK_ZIP) $@ $(SAMPLE_NAME).xcu + $(SDK_ZIP) $@ -u $(COMP_NAME).components + cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_ZIP) -u $@ $(COMP_JAR_NAME) cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u $@ META-INF/manifest.xml $(COMP_REGISTERFLAG) : $(COMP_PACKAGE) diff --git a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.components b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.components new file mode 100644 index 00000000..421706f7 --- /dev/null +++ b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.components @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<components xmlns="http://openoffice.org/2010/uno-components"> + <component loader="com.sun.star.loader.Java2" uri="OwnEmbeddedObject.uno.jar"> + <implementation name="org.openoffice.examples.embedding.OwnEmbeddedObjectFactory"> + <service name="org.openoffice.examples.embedding.Factory69474366FD6F480683748EDD1B6E771D"/> + </implementation> + </component> +</components> diff --git a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java index 525d13e6..09f1dd94 100755 --- a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java +++ b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java @@ -37,11 +37,15 @@ public final class OwnEmbeddedObjectFactory extends WeakBase return xFactory; } - public static boolean __writeRegistryServiceInfo( XRegistryKey xRegistryKey ) { - return Factory.writeRegistryServiceInfo(m_implementationName, - m_serviceNames, - xRegistryKey); - } + // This method not longer necessary since OOo 3.4 where the component registration + // was changed to passive component registration. For more details see + // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration + +// public static boolean __writeRegistryServiceInfo( XRegistryKey xRegistryKey ) { +// return Factory.writeRegistryServiceInfo(m_implementationName, +// m_serviceNames, +// xRegistryKey); +// } // com.sun.star.lang.XServiceInfo: public String getImplementationName() { diff --git a/odk/examples/java/MinimalComponent/Makefile b/odk/examples/java/MinimalComponent/Makefile index 8fd4ade8..23530a89 100644 --- a/odk/examples/java/MinimalComponent/Makefile +++ b/odk/examples/java/MinimalComponent/Makefile @@ -61,6 +61,7 @@ COMP_JAR=$(SAMPLE_CLASS_OUT)/$(COMP_JAR_NAME) COMP_JAR_MANIFEST=$(COMP_GEN_OUT)/$(COMP_NAME).uno.Manifest COMP_UNOPKG_MANIFEST = $(COMP_GEN_OUT)/META-INF/manifest.xml COMP_REGISTERFLAG=$(COMP_GEN_OUT)$(PS)java_$(COMP_NAME)_register_component.flag +COMP_COMPONENTS=$(COMP_NAME).components APP1_NAME=TestMinimalComponent APP1_CLASS_OUT=$(SAMPLE_CLASS_OUT)/$(APP1_NAME) @@ -152,19 +153,20 @@ $(COMP_JAR) : $(COMP_JAR_MANIFEST) $(COMP_CLASSFILES) $(COMP_GEN_OUT)/%/manifest.xml : -$(MKDIR) $(subst /,$(PS),$(@D)) @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@ - @echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP) >> $@ - @echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@ - @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-typelibrary;type=RDB$(QM)" >> $@ - @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(SAMPLE_GEN_OUT)/,,$(@D))).uno.rdb$(QM)"/$(CSEP) >> $@ - @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@ - @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(SAMPLE_GEN_OUT)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@ + @echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP)>> $@ + @echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP)>> $@ + @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-typelibrary;type=RDB$(QM)">> $@ + @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(SAMPLE_GEN_OUT)/,,$(@D))).uno.rdb$(QM)"/$(CSEP)>> $@ + @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@ + @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ # rule for component package file -$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) +$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_NAME).components -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) - cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) ../../../bin/$(@F) $(COMP_RDB_NAME) + $(SDK_ZIP) $@ $(COMP_NAME).components + cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u ../../../bin/$(@F) $(COMP_RDB_NAME) cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_JAR_NAME) cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml diff --git a/odk/examples/java/MinimalComponent/MinimalComponent.components b/odk/examples/java/MinimalComponent/MinimalComponent.components new file mode 100644 index 00000000..9e413f2b --- /dev/null +++ b/odk/examples/java/MinimalComponent/MinimalComponent.components @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<components xmlns="http://openoffice.org/2010/uno-components"> + <component loader="com.sun.star.loader.Java2" uri="MinimalComponent.uno.jar"> + <implementation name="MinimalComponent$_MinimalComponent"> + <service name="org.openoffice.MinimalComponent"/> + </implementation> + </component> +</components> diff --git a/odk/examples/java/MinimalComponent/MinimalComponent.java b/odk/examples/java/MinimalComponent/MinimalComponent.java index ef75cb28..b88d529e 100644 --- a/odk/examples/java/MinimalComponent/MinimalComponent.java +++ b/odk/examples/java/MinimalComponent/MinimalComponent.java @@ -163,9 +163,13 @@ public class MinimalComponent { * @param regKey the registryKey * @see com.sun.star.comp.loader.JavaLoader */ - public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { - return Factory.writeRegistryServiceInfo(_MinimalComponent.class.getName(), - _MinimalComponent.getServiceNames(), - regKey); - } + // This method not longer necessary since OOo 3.4 where the component registration + // was changed to passive component registration. For more details see + // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration + +// public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { +// return Factory.writeRegistryServiceInfo(_MinimalComponent.class.getName(), +// _MinimalComponent.getServiceNames(), +// regKey); +// } } diff --git a/odk/examples/java/PropertySet/Makefile b/odk/examples/java/PropertySet/Makefile index 0a382d15..7a79f340 100644 --- a/odk/examples/java/PropertySet/Makefile +++ b/odk/examples/java/PropertySet/Makefile @@ -52,6 +52,7 @@ COMP_JAR=$(COMP_CLASS_OUT)/$(COMP_JAR_NAME) COMP_JAR_MANIFEST=$(COMP_CLASS_OUT)/$(COMP_NAME).uno.Manifest COMP_UNOPKG_MANIFEST = $(COMP_GEN_OUT)/META-INF/manifest.xml COMP_REGISTERFLAG=$(COMP_GEN_OUT)$(PS)java_$(COMP_NAME)_register_component.flag +COMP_COMPONENTS=$(COMP_NAME).components COMP_JAVAFILES = PropTest.java @@ -89,15 +90,16 @@ $(COMP_GEN_OUT)/%/manifest.xml : @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@ @echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP) >> $@ @echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@ - @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@ - @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_MISC)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@ + @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ # rule for component package file -$(COMP_PACKAGE) : $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) +$(COMP_PACKAGE) : $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_NAME).components -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) - cd $(subst /,$(PS),$(COMP_CLASS_OUT)) && $(SDK_ZIP) ../../bin/$(@F) $(<F) + $(SDK_ZIP) $@ $(COMP_NAME).components + cd $(subst /,$(PS),$(COMP_CLASS_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) $(<F) cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) META-INF/manifest.xml diff --git a/odk/examples/java/PropertySet/PropTest.components b/odk/examples/java/PropertySet/PropTest.components new file mode 100644 index 00000000..320e3511 --- /dev/null +++ b/odk/examples/java/PropertySet/PropTest.components @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<components xmlns="http://openoffice.org/2010/uno-components"> + <component loader="com.sun.star.loader.Java2" uri="PropTest.uno.jar"> + <implementation name="PropTest"> + <service name="PropTest"/> + </implementation> + </component> +</components> diff --git a/odk/examples/java/PropertySet/PropTest.java b/odk/examples/java/PropertySet/PropTest.java index fded3c08..cbd3042e 100644 --- a/odk/examples/java/PropertySet/PropTest.java +++ b/odk/examples/java/PropertySet/PropTest.java @@ -257,9 +257,13 @@ public class PropTest extends PropertySet implements XServiceInfo return xSingleServiceFactory; } - public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) - { - return FactoryHelper.writeRegistryServiceInfo( PropTest.class.getName(), - PropTest.__serviceName, regKey); - } + // This method not longer necessary since OOo 3.4 where the component registration + // was changed to passive component registration. For more details see + // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration + +// public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) +// { +// return FactoryHelper.writeRegistryServiceInfo( PropTest.class.getName(), +// PropTest.__serviceName, regKey); +// } } diff --git a/odk/examples/java/Spreadsheet/CalcAddins.components b/odk/examples/java/Spreadsheet/CalcAddins.components new file mode 100644 index 00000000..c16c4a3a --- /dev/null +++ b/odk/examples/java/Spreadsheet/CalcAddins.components @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<components xmlns="http://openoffice.org/2010/uno-components"> + <component loader="com.sun.star.loader.Java2" uri="CalcAddins.uno.jar"> + <implementation name="CalcAddins$_CalcAddins"> + <service name="org.openoffice.sheet.addin.CalcAddins"/> + <service name="com.sun.star.sheet.AddIn"/> + </implementation> + </component> +</components> diff --git a/odk/examples/java/Spreadsheet/CalcAddins.java b/odk/examples/java/Spreadsheet/CalcAddins.java index 0f0fddad..63641256 100644 --- a/odk/examples/java/Spreadsheet/CalcAddins.java +++ b/odk/examples/java/Spreadsheet/CalcAddins.java @@ -295,10 +295,14 @@ public class CalcAddins { * @param regKey the registryKey * @see com.sun.star.comp.loader.JavaLoader */ - public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { - return FactoryHelper.writeRegistryServiceInfo(_CalcAddins.class.getName(), - _CalcAddins.__serviceName, regKey) - && FactoryHelper.writeRegistryServiceInfo(_CalcAddins.class.getName(), - _CalcAddins.ADDIN_SERVICE, regKey); - } + // This method not longer necessary since OOo 3.4 where the component registration + // was changed to passive component registration. For more details see + // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration + +// public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { +// return FactoryHelper.writeRegistryServiceInfo(_CalcAddins.class.getName(), +// _CalcAddins.__serviceName, regKey) +// && FactoryHelper.writeRegistryServiceInfo(_CalcAddins.class.getName(), +// _CalcAddins.ADDIN_SERVICE, regKey); +// } } diff --git a/odk/examples/java/Spreadsheet/Makefile b/odk/examples/java/Spreadsheet/Makefile index 4a251ae2..52d73a44 100644 --- a/odk/examples/java/Spreadsheet/Makefile +++ b/odk/examples/java/Spreadsheet/Makefile @@ -53,16 +53,17 @@ APP2_JAR=$(OUT_COMP_CLASS)/$(APP2_NAME).jar APP3_NAME=ChartTypeChange APP3_JAR=$(OUT_COMP_CLASS)/$(APP3_NAME).jar -COMPONENT_NAME=CalcAddins -COMPONENT_RDB_NAME=$(COMPONENT_NAME).uno.rdb -COMPONENT_RDB=$(OUT_COMP_GEN)/$(COMPONENT_RDB_NAME) -COMPONENT_PACKAGE=$(OUT_BIN)/$(COMPONENT_NAME).$(UNOOXT_EXT) -COMPONENT_PACKAGE_URL=$(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMPONENT_NAME).$(UNOOXT_EXT)") -COMPONENT_JAR_NAME=$(COMPONENT_NAME).uno.jar -COMPONENT_JAR=$(OUT_COMP_CLASS)/$(COMPONENT_JAR_NAME) -COMPONENT_MANIFESTFILE=$(OUT_COMP_CLASS)/$(COMPONENT_NAME).uno.Manifest -COMPONENT_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMPONENT_NAME)/META-INF/manifest.xml -REGISTERFLAG=$(OUT_MISC)$(PS)java_$(COMPONENT_NAME)_register_component.flag +COMP_NAME=CalcAddins +COMP_RDB_NAME=$(COMP_NAME).uno.rdb +COMP_RDB=$(OUT_COMP_GEN)/$(COMP_RDB_NAME) +COMP_PACKAGE=$(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT) +COMP_PACKAGE_URL=$(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)") +COMP_JAR_NAME=$(COMP_NAME).uno.jar +COMP_JAR=$(OUT_COMP_CLASS)/$(COMP_JAR_NAME) +COMP_MANIFESTFILE=$(OUT_COMP_CLASS)/$(COMP_NAME).uno.Manifest +COMP_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP_NAME)/META-INF/manifest.xml +COMP_REGISTERFLAG=$(OUT_MISC)$(PS)java_$(COMP_NAME)_register_component.flag +COMP_COMPONENTS=$(COMP_NAME).components IDLFILES = XCalcAddins.idl @@ -80,11 +81,11 @@ GENURDFILES = $(patsubst %.idl,$(OUT_COMP_GEN)/%.urd,$(IDLFILES)) COMPCLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/%.class,$(COMPJAVAFILES)) #COMPCLASSFILES += $(subst $(OUT_COMP_GEN),$(OUT_COMP_CLASS),$(GENJAVAFILES:.java=.class)) -$(COMPONENT_NAME)_CLASSFILES = $(COMPONENT_NAME).class \ - $(COMPONENT_NAME)$(QUOTE)$$_$(COMPONENT_NAME).class +$(COMP_NAME)_CLASSFILES = $(COMP_NAME).class \ + $(COMP_NAME)$(QUOTE)$$_$(COMP_NAME).class -#$(COMPONENT_NAME)_CLASSFILES += $(subst $(OUT_COMP_GEN)/,,$(GENJAVAFILES:.java=.class)) -$(COMPONENT_NAME)_CLASSFILES += $(subst $(OUT_COMP_CLASS)/,,$(GENCLASSFILES)) +#$(COMP_NAME)_CLASSFILES += $(subst $(OUT_COMP_GEN)/,,$(GENJAVAFILES:.java=.class)) +$(COMP_NAME)_CLASSFILES += $(subst $(OUT_COMP_CLASS)/,,$(GENCLASSFILES)) SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\ $(PATH_SEPARATOR)$(OUT_COMP_CLASS)) @@ -110,10 +111,10 @@ $(OUT_COMP_GEN)/%.rdb : $(GENURDFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) $(REGMERGE) $@ /UCR $(GENURDFILES) -#$(OUT_COMP_GEN)/%.java : $(COMPONENT_RDB) -$(GENCLASSFILES) : $(COMPONENT_RDB) +#$(OUT_COMP_GEN)/%.java : $(COMP_RDB) +$(GENCLASSFILES) : $(COMP_RDB) -$(MKDIR) $(subst /,$(PS),$(@D)) - $(JAVAMAKER) -BUCR -nD $(GENTYPELIST) -O$(OUT_COMP_CLASS) $(COMPONENT_RDB) -X$(URE_TYPES) -X$(OFFICE_TYPES) + $(JAVAMAKER) -BUCR -nD $(GENTYPELIST) -O$(OUT_COMP_CLASS) $(COMP_RDB) -X$(URE_TYPES) -X$(OFFICE_TYPES) $(OUT_COMP_CLASS)/%.class : %.java -$(MKDIR) $(subst /,$(PS),$(@D)) @@ -139,7 +140,7 @@ $(OUT_COMP_CLASS)/%.jar : $(OUT_COMP_CLASS)/%.mf $(OUT_COMP_CLASS)/%.class +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES) # rule for component jar file -$(COMPONENT_JAR) : $(COMPONENT_MANIFESTFILE) $(COMPCLASSFILES) +$(COMP_JAR) : $(COMP_MANIFESTFILE) $(COMPCLASSFILES) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(<F) $($(basename $(basename $(@F)))_CLASSFILES) @@ -152,24 +153,25 @@ $(OUT_COMP_CLASS)/%/manifest.xml : @echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-typelibrary;type=RDB$(QM)" >> $@ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).uno.rdb$(QM)"/$(CSEP) >> $@ - @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@ - @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@ + @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ # rule for component package file -$(COMPONENT_PACKAGE) : $(COMPONENT_RDB) $(COMPONENT_JAR) $(COMPONENT_UNOPKG_MANIFEST) +$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_NAME).components -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) $(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_COMP_CLASS)) - cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) ../../bin/$(@F) $(COMPONENT_RDB_NAME) $(COMPONENT_JAR_NAME) + $(SDK_ZIP) $@ -u $(COMP_NAME).components + cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_RDB_NAME) $(COMP_JAR_NAME) cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml $(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_COMP_CLASS)/$(<F))) -$(REGISTERFLAG) : $(COMPONENT_PACKAGE) +$(COMP_REGISTERFLAG) : $(COMP_PACKAGE) ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES" -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) - $(DEPLOYTOOL) $(COMPONENT_PACKAGE_URL) + $(DEPLOYTOOL) $(COMP_PACKAGE_URL) @echo flagged > $(subst /,$(PS),$@) else @echo -------------------------------------------------------------------------------- @@ -183,7 +185,7 @@ $(APP1_JAR) : $(OUT_COMP_CLASS)/$(APP1_NAME).mf $(OUT_COMP_CLASS)/$(APP1_NAME).c $(APP2_JAR) : $(OUT_COMP_CLASS)/$(APP2_NAME).mf $(OUT_COMP_CLASS)/$(APP2_NAME).class $(APP3_JAR) : $(OUT_COMP_CLASS)/$(APP3_NAME).mf $(OUT_COMP_CLASS)/$(APP3_NAME).class -$(EXAMPLE_NAME) : $(REGISTERFLAG) $(APP1_JAR) $(APP2_JAR) $(APP3_JAR) +$(EXAMPLE_NAME) : $(COMP_REGISTERFLAG) $(APP1_JAR) $(APP2_JAR) $(APP3_JAR) @echo -------------------------------------------------------------------------------- @echo Please use the following command to execute the examples! @echo - @@ -202,12 +204,12 @@ $(EXAMPLE_NAME) : $(REGISTERFLAG) $(APP1_JAR) $(APP2_JAR) $(APP3_JAR) %.run: $(OUT_COMP_CLASS)/%.jar $(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $< -CalcAddins.ods.load : $(REGISTERFLAG) +CalcAddins.ods.load : $(COMP_REGISTERFLAG) "$(OFFICE_PROGRAM_PATH)$(PS)soffice" $(basename $@) .PHONY: clean clean : -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS)) -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN)) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_PACKAGE_URL))) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG))) + -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL))) + -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_REGISTERFLAG))) diff --git a/odk/examples/java/ToDo/Makefile b/odk/examples/java/ToDo/Makefile index 476ff662..d597e969 100644 --- a/odk/examples/java/ToDo/Makefile +++ b/odk/examples/java/ToDo/Makefile @@ -54,6 +54,7 @@ COMP_JAR=$(COMP_CLASS_OUT)/$(COMP_JAR_NAME) COMP_JAR_MANIFEST=$(COMP_CLASS_OUT)/$(COMP_NAME).uno.Manifest COMP_UNOPKG_MANIFEST = $(COMP_GEN_OUT)/META-INF/manifest.xml COMP_REGISTERFLAG=$(COMP_GEN_OUT)$(PS)java_$(COMP_NAME)_register_component.flag +COMP_COMPONENTS=$(COMP_NAME).components IDLFILES = XToDo.idl \ ToDo.idl @@ -121,15 +122,16 @@ $(COMP_GEN_OUT)/%/manifest.xml : @echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-typelibrary;type=RDB$(QM)" >> $@ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_MISC)/,,$(@D))).uno.rdb$(QM)"/$(CSEP) >> $@ - @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=Java$(QM)" >> $@ - @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_MISC)/,,$(@D))).uno.jar$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@ + @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ # rule for component package file -$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) +$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_NAME).components -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) - cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) ../../bin/$(@F) $(COMP_RDB_NAME) + $(SDK_ZIP) $@ $(COMP_NAME).components + cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_RDB_NAME) cd $(subst /,$(PS),$(COMP_CLASS_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_JAR_NAME) cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) META-INF/manifest.xml diff --git a/odk/examples/java/ToDo/ToDo.components b/odk/examples/java/ToDo/ToDo.components new file mode 100644 index 00000000..0b667b96 --- /dev/null +++ b/odk/examples/java/ToDo/ToDo.components @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<components xmlns="http://openoffice.org/2010/uno-components"> + <component loader="com.sun.star.loader.Java2" uri="ToDo.uno.jar"> + <implementation name="ToDo$ToDoImpl"> + <service name="org.openoffice.ToDo"/> + </implementation> + </component> +</components> diff --git a/odk/examples/java/ToDo/ToDo.java b/odk/examples/java/ToDo/ToDo.java index df6310b3..2fee074e 100644 --- a/odk/examples/java/ToDo/ToDo.java +++ b/odk/examples/java/ToDo/ToDo.java @@ -957,9 +957,13 @@ public class ToDo { * @param regKey the registryKey * @see com.sun.star.comp.loader.JavaLoader */ - public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { - return Factory.writeRegistryServiceInfo(ToDoImpl.class.getName(), - ToDoImpl.getServiceNames(), regKey); - } + // This method not longer necessary since OOo 3.4 where the component registration + // was changed to passive component registration. For more details see + // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration + +// public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { +// return Factory.writeRegistryServiceInfo(ToDoImpl.class.getName(), +// ToDoImpl.getServiceNames(), regKey); +// } } |