From 5d868ad4ccb6dd9f2c77a8738eaa52fb16fd65b5 Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Wed, 29 Sep 2010 14:16:04 +0200 Subject: jsc340: i113043: check the ure-link to support linux distors that move the different office peices somewhere else --- odk/configure.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'odk') diff --git a/odk/configure.pl b/odk/configure.pl index 789cfac7cd76..ea5b58452b1c 100755 --- a/odk/configure.pl +++ b/odk/configure.pl @@ -35,7 +35,7 @@ if ( $main::operatingSystem =~ m/darwin/ ) { # $main::OO_SDK_URE_HOME = `cd $main::sdkpath/../ure-link && pwd`; } else { - $main::OO_SDK_URE_HOME = `cd $main::sdkpath/../../ure && pwd`; + $main::OO_SDK_URE_HOME = `cd $main::sdkpath/../ure-link && pwd`; } chomp($main::OO_SDK_URE_HOME); -- cgit From dade5b09e567e144d6274160aa8da2d66164075b Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Fri, 1 Oct 2010 14:16:28 +0200 Subject: jsc340: i114789: remove space --- odk/settings/settings.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'odk') diff --git a/odk/settings/settings.mk b/odk/settings/settings.mk index 188ff880255e..b21efe720aba 100644 --- a/odk/settings/settings.mk +++ b/odk/settings/settings.mk @@ -210,7 +210,7 @@ SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/inclu CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=sunpro5 CC_OUTPUT_SWITCH=-o -LIBRARY_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp '-R $$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm +LIBRARY_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp '-R$$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm # means if used CC is lower then version 5.5 use option -instance=static ifeq ($(OO_SDK_CC_55_OR_HIGHER),) LIBRARY_LINK_FLAGS+=-instances=static -- cgit From 21f4435c7287ad6b32b2c4d225c1077719055ba1 Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Thu, 28 Oct 2010 14:17:41 +0200 Subject: jsc340: i115252: check arch for older Mac version --- odk/settings/settings.mk | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'odk') diff --git a/odk/settings/settings.mk b/odk/settings/settings.mk index b21efe720aba..ca35652d1cd3 100644 --- a/odk/settings/settings.mk +++ b/odk/settings/settings.mk @@ -392,10 +392,16 @@ PACKAGE_LIB_DIR=macosx_x86.plt UNOPKG_PLATFORM=MacOSX_x86 JAVA_PROC_TYPE=x86 else +ifeq "$(PROCTYPE)" "i386" +PACKAGE_LIB_DIR=macosx_x86.plt +UNOPKG_PLATFORM=MacOSX_x86 +JAVA_PROC_TYPE=x86 +else PACKAGE_LIB_DIR=macosx_ppc.plt UNOPKG_PLATFORM=MacOSX_PowerPC JAVA_PROC_TYPE=ppc endif +endif JAVABIN=Commands GCC_VERSION =$(shell gcc -dumpversion| cut -d"." -f1,2) -- cgit From 34ed8946e9fac7b881122b8566b1fd865bc1232d Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Thu, 28 Oct 2010 14:19:03 +0200 Subject: jsc340: i114887: remove idls for old draft types --- odk/pack/copying/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'odk') diff --git a/odk/pack/copying/makefile.mk b/odk/pack/copying/makefile.mk index 52efe87ff797..02471bd53638 100644 --- a/odk/pack/copying/makefile.mk +++ b/odk/pack/copying/makefile.mk @@ -34,7 +34,7 @@ TARGET=copying .INCLUDE: $(PRJ)/util/makefile.pmk #---------------------------------------------------------------- -IDLLIST:={$(subst,/,/ $(shell @$(FIND) $(IDLOUT) -type f | sed -e '/star.portal/d' -e'/star.webservices/d'))} +IDLLIST:={$(subst,/,/ $(shell @$(FIND) $(IDLOUT)/com -type f))} DESTIDLLIST={$(subst,$(IDLOUT),$(DESTDIRIDL) $(IDLLIST))} DESTINCLUDELIST={$(subst,$(SOLARINCDIR),$(DESTDIRINC) $(INCLUDELIST))} -- cgit From fa59c73830964b2add1443f5b081982342802eca Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Thu, 28 Oct 2010 14:20:34 +0200 Subject: jsc340: fix problem in resolveLink --- odk/configure.pl | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'odk') diff --git a/odk/configure.pl b/odk/configure.pl index ea5b58452b1c..e1a1cfb99924 100755 --- a/odk/configure.pl +++ b/odk/configure.pl @@ -5,6 +5,7 @@ # use IO::File; +use File::Basename; $main::hostname= $ARGV[0]; $main::sdkpath= $ARGV[1]; @@ -554,15 +555,26 @@ sub resolveLink { my $base= shift; my $link= shift; - my $linktarget = readlink "$base/$link"; + + my $resolvedpath = "$base/$link"; + my $linktarget = readlink "$resolvedpath"; my $resolvedlink = ""; while ( $linktarget ne "") { - $link = $linktarget; - $linktarget = readlink "$base/$link"; + + if ( $linktarget =~ m/^\/.*/ ) + { + $resolvedpath = "$linktarget"; + } else { + $resolvedpath = `cd $base/$linktarget; pwd`; + chop $resolvedpath; } + $base = dirname("$resolvedpath"); - $resolvedlink = `cd $base/$link; pwd`; + $linktarget = readlink "$resolvedpath"; + } + + $resolvedlink = `cd $resolvedpath; pwd`; chop $resolvedlink; return $resolvedlink; } @@ -578,6 +590,7 @@ sub searchprog { if ( $main::operatingSystem =~ m/darwin/ ) { $progDir = resolveLink("/System/Library/Frameworks/JavaVM.Framework/Versions", "CurrentJDK"); + if ( -e "$progDir/$main::OO_SDK_JAVA_BIN_DIR/javac" ) { return "$progDir/$main::OO_SDK_JAVA_BIN_DIR"; -- cgit From 7b79ab8131a422e582953518d2c85c7c540de563 Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Thu, 28 Oct 2010 16:35:23 +0200 Subject: jsc340: i115253: insert message windows only --- odk/examples/CLI/CSharp/Spreadsheet/Makefile | 15 +++++++++------ odk/examples/CLI/VB.NET/WriterDemo/Makefile | 7 +++++++ 2 files changed, 16 insertions(+), 6 deletions(-) (limited to 'odk') diff --git a/odk/examples/CLI/CSharp/Spreadsheet/Makefile b/odk/examples/CLI/CSharp/Spreadsheet/Makefile index cbe43167905d..bae593f34069 100644 --- a/odk/examples/CLI/CSharp/Spreadsheet/Makefile +++ b/odk/examples/CLI/CSharp/Spreadsheet/Makefile @@ -25,10 +25,7 @@ CLI_LIB_LOCATION = $(PRJ)\cli # Targets .PHONY : ALL -ALL : SpreadsheetSample \ - GeneralTableSample \ - ViewSample \ - Info +ALL : Info include $(SETTINGS)/stdtarget.mk @@ -56,7 +53,8 @@ GeneralTableSample : $(SPREADSHEET_OUT)/GeneralTableSample.exe ViewSample : $(SPREADSHEET_OUT)/ViewSample.exe .PHONY : Info -Info : +ifeq "$(OS)" "WIN" +Info : SpreadsheetSample GenerateTableSample ViewSample @echo ------------------------------------------------------------------------------- @echo Please use one of the following commands to execute the examples! @echo - @@ -64,7 +62,12 @@ Info : @echo $(MAKE) SpreadsheetSample.run @echo $(MAKE) ViewSample.run @echo ------------------------------------------------------------------------------- - +else +Info : + @echo -------------------------------------------------------------------------------- + @echo This example works only under Windows! + @echo -------------------------------------------------------------------------------- +endif %.run : $(SPREADSHEET_OUT)/%.exe @echo ------------------------------------------------------------------------------- diff --git a/odk/examples/CLI/VB.NET/WriterDemo/Makefile b/odk/examples/CLI/VB.NET/WriterDemo/Makefile index ac60d7ef4536..2fd3f993ce2c 100644 --- a/odk/examples/CLI/VB.NET/WriterDemo/Makefile +++ b/odk/examples/CLI/VB.NET/WriterDemo/Makefile @@ -42,12 +42,19 @@ $(WRITERDEMO_OUT)/%.exe: %.vb -reference:System.Windows.Forms.dll \ $^ +ifeq "$(OS)" "WIN" WriterDemo : $(WRITERDEMO_OUT)/WriterDemo.exe @echo ------------------------------------------------------------------------------- @echo Please use the following command to execute the example! @echo - @echo $(MAKE) WriterDemo.run @echo ------------------------------------------------------------------------------- +else +WriterDemo : + @echo -------------------------------------------------------------------------------- + @echo This example works only under Windows! + @echo -------------------------------------------------------------------------------- +endif %.run : $(WRITERDEMO_OUT)/%.exe @echo ------------------------------------------------------------------------------- -- cgit From 1446346432d489763ff85734b20ae066cd65f2ce Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Thu, 27 Jan 2011 13:33:00 +0100 Subject: jsc340: extend proctype check for MacOS --- odk/settings/settings.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'odk') diff --git a/odk/settings/settings.mk b/odk/settings/settings.mk index ca35652d1cd3..af9b1536df9b 100644 --- a/odk/settings/settings.mk +++ b/odk/settings/settings.mk @@ -387,12 +387,12 @@ PROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1) # Default is MacOSX on a Intel machine PLATFORM=macosx -ifeq "$(PROCTYPE)" "i686" +ifeq "$(PROCTYPE)" "i386" PACKAGE_LIB_DIR=macosx_x86.plt UNOPKG_PLATFORM=MacOSX_x86 JAVA_PROC_TYPE=x86 else -ifeq "$(PROCTYPE)" "i386" +ifeq "$(PROCTYPE)" "x86_64" PACKAGE_LIB_DIR=macosx_x86.plt UNOPKG_PLATFORM=MacOSX_x86 JAVA_PROC_TYPE=x86 -- cgit From 134b85e8f8c6bb38c7ce9b4f7f159b8738b0f347 Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Tue, 1 Feb 2011 18:08:59 +0100 Subject: jsc340: i114609: support passive component registration --- .../JavaComponent/JavaComponent.components | 11 ++++ .../Components/JavaComponent/Makefile | 57 ++++++++++--------- .../JavaComponent/TestServiceProvider.java | 22 +++++--- .../SimpleLicense/LicenseTest.components | 8 +++ .../Components/SimpleLicense/LicenseTest.java | 14 +++-- .../Components/SimpleLicense/Makefile | 10 ++-- .../dialogcomponent/DialogComponent.components | 8 +++ .../dialogcomponent/DialogComponent.java | 14 +++-- .../Components/dialogcomponent/Makefile | 10 ++-- .../Database/DriverSkeleton/Makefile | 47 ++++++++++------ .../Database/DriverSkeleton/SServices.cxx | 58 ++++++++++--------- .../AsciiFilter/AsciiReplaceFilter.java | 17 +++--- .../FilterDevelopment/AsciiFilter/Makefile | 8 ++- .../AsciiFilter/SampleFilter.components | 10 ++++ .../FlatXmlFilterDetection/Makefile | 38 +++++++++---- .../FlatXmlFilterDetection/fdcomp.cxx | 53 +++++++++--------- .../FlatXmlFilter_cpp/FlatXml.cxx | 58 ++++++++++--------- .../FilterDevelopment/FlatXmlFilter_cpp/Makefile | 46 +++++++++------ .../FlatXmlFilter_java/FlatXml.java | 13 +++-- .../FlatXmlFilter_java.components | 8 +++ .../FilterDevelopment/FlatXmlFilter_java/Makefile | 44 ++++++++------- odk/examples/cpp/complextoolbarcontrols/Makefile | 55 ++++++++++++------ .../cpp/complextoolbarcontrols/exports.cxx | 65 +++++++++++----------- .../java/EmbedDocument/EmbeddedObject/Makefile | 12 ++-- .../EmbeddedObject/OwnEmbeddedObject.components | 8 +++ .../EmbeddedObject/OwnEmbeddedObjectFactory.java | 13 +++-- odk/examples/java/MinimalComponent/Makefile | 18 +++--- .../MinimalComponent/MinimalComponent.components | 8 +++ .../java/MinimalComponent/MinimalComponent.java | 13 +++-- odk/examples/java/PropertySet/Makefile | 10 ++-- odk/examples/java/PropertySet/PropTest.components | 8 +++ odk/examples/java/PropertySet/PropTest.java | 13 +++-- .../java/Spreadsheet/CalcAddins.components | 9 +++ odk/examples/java/Spreadsheet/CalcAddins.java | 15 +++-- odk/examples/java/Spreadsheet/Makefile | 58 +++++++++---------- odk/examples/java/ToDo/Makefile | 10 ++-- odk/examples/java/ToDo/ToDo.components | 8 +++ odk/examples/java/ToDo/ToDo.java | 11 ++-- odk/setsdkenv_unix | 0 odk/settings/settings.mk | 37 +++++++----- odk/util/makefile.pmk | 2 +- 41 files changed, 575 insertions(+), 352 deletions(-) create mode 100644 odk/examples/DevelopersGuide/Components/JavaComponent/JavaComponent.components create mode 100644 odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.components create mode 100644 odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.components create mode 100644 odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/SampleFilter.components create mode 100644 odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXmlFilter_java.components create mode 100644 odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.components create mode 100644 odk/examples/java/MinimalComponent/MinimalComponent.components create mode 100644 odk/examples/java/PropertySet/PropTest.components create mode 100644 odk/examples/java/Spreadsheet/CalcAddins.components create mode 100644 odk/examples/java/ToDo/ToDo.components mode change 100644 => 100755 odk/setsdkenv_unix (limited to 'odk') diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/JavaComponent.components b/odk/examples/DevelopersGuide/Components/JavaComponent/JavaComponent.components new file mode 100644 index 000000000000..67ac8696dbe2 --- /dev/null +++ b/odk/examples/DevelopersGuide/Components/JavaComponent/JavaComponent.components @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/Makefile b/odk/examples/DevelopersGuide/Components/JavaComponent/Makefile index 55f8cbc12425..327d4f2d3f36 100644 --- a/odk/examples/DevelopersGuide/Components/JavaComponent/Makefile +++ b/odk/examples/DevelopersGuide/Components/JavaComponent/Makefile @@ -43,21 +43,23 @@ include $(SETTINGS)/dk.mk # Define non-platform/compiler specific settings -COMPONENT_NAME=JavaComponent -OUT_COMP_CLASS = $(OUT_CLASS)/$(COMPONENT_NAME) -OUT_COMP_GEN = $(OUT_MISC)/$(COMPONENT_NAME) -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 +COMP_NAME=JavaComponent +OUT_COMP_CLASS = $(OUT_CLASS)/$(COMP_NAME) +OUT_COMP_GEN = $(OUT_MISC)/$(COMP_NAME) +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_COMPONENTS=$(COMP_NAME).components + APP1_NAME=TestJavaComponent APP1_JAR=$(OUT_COMP_CLASS)/$(APP1_NAME).jar -REGISTERFLAG = $(OUT_MISC)$(PS)devguide_$(COMPONENT_NAME)_register_component.flag +REGISTERFLAG = $(OUT_MISC)$(PS)devguide_$(COMP_NAME)_register_component.flag IDLFILES = XSomethingA.idl \ XSomethingB.idl \ @@ -80,9 +82,9 @@ GENURDFILES = $(patsubst %.idl,$(OUT_COMP_GEN)/%.urd,$(IDLFILES)) COMPCLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/%.class,$(COMPJAVAFILES)) -$(COMPONENT_NAME)_CLASSFILES = $(patsubst %.java,%.class,$(COMPJAVAFILES)) +$(COMP_NAME)_CLASSFILES = $(patsubst %.java,%.class,$(COMPJAVAFILES)) -$(COMPONENT_NAME)_CLASSFILES += $(subst $(OUT_COMP_CLASS)/,,$(GENCLASSFILES)) +$(COMP_NAME)_CLASSFILES += $(subst $(OUT_COMP_CLASS)/,,$(GENCLASSFILES)) SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\ $(PATH_SEPARATOR)$(OUT_COMP_CLASS)) @@ -109,9 +111,9 @@ $(OUT_COMP_GEN)/%.rdb : $(GENURDFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) $(REGMERGE) $@ /UCR $(GENURDFILES) -$(OUT_COMP_CLASS)/$(PACKAGE)/%.class : $(COMPONENT_RDB) +$(OUT_COMP_CLASS)/$(PACKAGE)/%.class : $(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 $(GENCLASSFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) @@ -134,11 +136,11 @@ $(OUT_COMP_CLASS)/%.mf : $(APP1_JAR) : $(OUT_COMP_CLASS)/$(APP1_NAME).mf $(OUT_COMP_CLASS)/$(APP1_NAME).class $(COMPCLASSFILES) $(GENCLASSFILES) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) - +cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(basename $(@F)).mf $(basename $(@F)).class $($(COMPONENT_NAME)_CLASSFILES) + +cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(basename $(@F)).mf $(basename $(@F)).class $($(COMP_NAME)_CLASSFILES) +$(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) $(> $@ @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_COMPONENTS)$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ # rule for component pacakge file -$(COMPONENT_PACKAGE) : $(COMPONENT_RDB) $(COMPONENT_JAR) $(COMPONENT_UNOPKG_MANIFEST) +$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) - $(COPY) $(subst /,$(PS),$(COMPONENT_RDB)) $(subst /,$(PS),$(OUT_COMP_CLASS)) - cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) ../../bin/$(@F) $(COMPONENT_RDB_NAME) $(COMPONENT_JAR_NAME) + $(COPY) $(subst /,$(PS),$(COMP_RDB)) $(subst /,$(PS),$(OUT_COMP_CLASS)) + $(SDK_ZIP) $@ $(COMP_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)/$(COMPONENT_RDB_NAME))) + $(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_COMP_CLASS)/$(COMP_RDB_NAME))) -$(REGISTERFLAG) : $(COMPONENT_PACKAGE) +$(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 -------------------------------------------------------------------------------- @@ -200,5 +203,5 @@ JavaComponentExample : $(REGISTERFLAG) $(APP1_JAR) clean : -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS)) -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN)) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_PACKAGE_URL))) + -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL))) -$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG))) diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java b/odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java index dee8899510e4..05662e9d884a 100644 --- a/odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java +++ b/odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java @@ -57,15 +57,19 @@ public class TestServiceProvider return xSingleServiceFactory; } - public static boolean __writeRegistryServiceInfo(XRegistryKey regKey){ - boolean bregA= FactoryHelper.writeRegistryServiceInfo( - TestComponentA.class.getName(), - TestComponentA.__serviceName, regKey); - boolean bregB= FactoryHelper.writeRegistryServiceInfo( - TestComponentB.class.getName(), - TestComponentB.__serviceName, regKey); - return bregA && bregB; - } + // This method not longer necessary since OOo 3.4 where the component registration was + // 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){ +// boolean bregA= FactoryHelper.writeRegistryServiceInfo( +// TestComponentA.class.getName(), +// TestComponentA.__serviceName, regKey); +// boolean bregB= FactoryHelper.writeRegistryServiceInfo( +// TestComponentB.class.getName(), +// TestComponentB.__serviceName, regKey); +// return bregA && bregB; +// } } diff --git a/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.components b/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.components new file mode 100644 index 000000000000..94a4848c0ee1 --- /dev/null +++ b/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.components @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java b/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java index 211638c46c58..f76f6e2ec56a 100644 --- a/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java +++ b/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java @@ -148,11 +148,15 @@ public class LicenseTest { * @param regKey the registryKey * @see com.sun.star.comp.loader.JavaLoader */ - public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { - return Factory.writeRegistryServiceInfo(_LicenseTest.class.getName(), - _LicenseTest.getServiceNames(), - regKey); - } + // This method not longer necessary since OOo 3.4 where the component registration was + // 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(_LicenseTest.class.getName(), +// _LicenseTest.getServiceNames(), +// regKey); +// } /** This method is a member of the interface for initializing an object * directly after its creation. * @param object This array of arbitrary objects will be passed to the diff --git a/odk/examples/DevelopersGuide/Components/SimpleLicense/Makefile b/odk/examples/DevelopersGuide/Components/SimpleLicense/Makefile index 976de2d07b40..c82f0ba7e014 100644 --- a/odk/examples/DevelopersGuide/Components/SimpleLicense/Makefile +++ b/odk/examples/DevelopersGuide/Components/SimpleLicense/Makefile @@ -62,6 +62,7 @@ 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_LOCAL_FILES = description.xml registration/license_de.txt registration/license_en_US.txt +COMP_COMPONENTS=$(COMP_NAME).components IDLFILES = LicenseTest.idl @@ -130,15 +131,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 $(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 $(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_COMPONENTS)$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ # rule for component package file -$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_LOCAL_FILES) +$(COMP_PACKAGE) : $(COMP_RDB) $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_LOCAL_FILES) $(COMP_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_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 $(SDK_ZIP) -u $@ $(COMP_LOCAL_FILES) diff --git a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.components b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.components new file mode 100644 index 000000000000..56d7c8eb8f45 --- /dev/null +++ b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.components @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java index f7ad9ad4b7c8..f10256939a4f 100644 --- a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java +++ b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java @@ -316,9 +316,13 @@ public class DialogComponent { * @param regKey the registryKey * @see com.sun.star.comp.loader.JavaLoader */ - public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { - return Factory.writeRegistryServiceInfo(_DialogComponent.class.getName(), - _DialogComponent.getServiceNames(), - regKey); - } + // This method not longer necessary since OOo 3.4 where the component registration was + // 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(_DialogComponent.class.getName(), +// _DialogComponent.getServiceNames(), +// regKey); +// } } diff --git a/odk/examples/DevelopersGuide/Components/dialogcomponent/Makefile b/odk/examples/DevelopersGuide/Components/dialogcomponent/Makefile index 8726029ec222..7afc11f0834c 100644 --- a/odk/examples/DevelopersGuide/Components/dialogcomponent/Makefile +++ b/odk/examples/DevelopersGuide/Components/dialogcomponent/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 IDLFILES = XTestDialogHandler.idl \ TestDialogHandler.idl @@ -131,15 +132,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 $(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 $(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_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_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_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/DevelopersGuide/Database/DriverSkeleton/Makefile b/odk/examples/DevelopersGuide/Database/DriverSkeleton/Makefile index cbd28b982eac..f1451d3d1a67 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/Makefile +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/Makefile @@ -43,7 +43,7 @@ include $(SETTINGS)/dk.mk # Define non-platform/compiler specific settings COMP_NAME=DatabaseSDBCDriverSkeleton -COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT) +COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT) COMP_LIBRARY=$(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) OUT_COMP_INC=$(OUT_INC)/$(COMP_NAME) OUT_COMP_MISC=$(OUT_MISC)/$(COMP_NAME) @@ -51,9 +51,10 @@ OUT_COMP_SLO=$(OUT_SLO)/$(COMP_NAME) COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT) COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)") COMP_UNOPKG_MANIFEST = $(OUT_COMP_MISC)/$(COMP_NAME)/META-INF/manifest.xml -COMP_MAPFILE = $(OUT_COMP_MISC)/$(COMP_NAME).uno.map +#COMP_MAPFILE = $(OUT_COMP_MISC)/$(COMP_NAME).uno.map +COMP_COMPONENTS = $(OUT_COMP_MISC)/$(COMP_NAME).components -REGISTERFLAG = $(OUT_COMP_MISC)/devguide_$(COMP_NAME)_register_component.flag +COMP_REGISTERFLAG = $(OUT_COMP_MISC)/devguide_$(COMP_NAME)_register_component.flag CXXFILES = SConnection.cxx \ SDatabaseMetaData.cxx \ @@ -78,12 +79,12 @@ $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG) -$(MKDIR) $(subst /,$(PS),$(@D)) $(CC) $(CC_FLAGS) $(CC_INCLUDES) $(STL_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $< -$(COMP_MAPFILE) : $(SLOFILES) - -$(MKDIR) $(subst /,$(PS),$(@D)) - cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE) -ifeq "$(OS)" "MACOSX" - nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE) -endif +#$(COMP_MAPFILE) : $(SLOFILES) +# -$(MKDIR) $(subst /,$(PS),$(@D)) +# cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE) +#ifeq "$(OS)" "MACOSX" +# nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE) +#endif ifeq "$(OS)" "WIN" $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) @@ -94,7 +95,7 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib $(LINK_MANIFEST) else -$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) +$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) $(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \ $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB) @@ -109,18 +110,30 @@ $(OUT_COMP_MISC)/%/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=native;platform=$(UNOPKG_PLATFORM)$(QM)" >> $@ - @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_MISC)/,,$(UNOPKG_PLATFORM)/$(@D))).uno.$(SHAREDLIB_EXT)$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components;platform=$(UNOPKG_PLATFORM)$(QM)">> $@ + @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ -$(COMP_PACKAGE) : $(COMP_LIBRARY) $(COMP_UNOPKG_MANIFEST) +$(COMP_COMPONENTS) : + -$(MKDIR) $(subst /,$(PS),$(@D)) + @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@ + @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(UNOPKG_PLATFORM)/$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)com.sun.star.comp.sdbc.SkeletonDriver$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)com.sun.star.sdbc.Driver$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@ + @echo $(OSEP)/components$(CSEP) >> $@ + +$(COMP_PACKAGE) : $(COMP_LIBRARY) $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS) -$(MKDIR) $(subst /,$(PS),$(@D)) && $(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_MISC)/$(UNOPKG_PLATFORM)) $(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_COMP_MISC)/$(UNOPKG_PLATFORM)) - cd $(subst /,$(PS),$(OUT_COMP_MISC)) && $(SDK_ZIP) ../../bin/$(@F) $(UNOPKG_PLATFORM)/$( #include "SDriver.hxx" #include #include @@ -55,8 +56,8 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) //*************************************************************************************** // -// Die vorgeschriebene C-Api muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. +// The required C-Api must be provided! +// It contains of 3 special functions that have to be exported. // //--------------------------------------------------------------------------------------- @@ -118,7 +119,7 @@ struct ProviderRequest //--------------------------------------------------------------------------------------- -extern "C" void SAL_CALL component_getImplementationEnvironment( +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char **ppEnvTypeName, uno_Environment **ppEnv ) @@ -126,33 +127,36 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } +// This method not longer necessary since OOo 3.4 where the component registration was +// was changed to passive component registration. For more details see +// http://wiki.services.openoffice.org/wiki/Passive_Component_Registration //--------------------------------------------------------------------------------------- -extern "C" sal_Bool SAL_CALL component_writeInfo( - void* pServiceManager, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - REGISTER_PROVIDER( - SkeletonDriver::getImplementationName_Static(), - SkeletonDriver::getSupportedServiceNames_Static(), xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "SKELETON::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} +// extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( +// void* pServiceManager, +// void* pRegistryKey +// ) +// { +// if (pRegistryKey) +// try +// { +// Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); + +// REGISTER_PROVIDER( +// SkeletonDriver::getImplementationName_Static(), +// SkeletonDriver::getSupportedServiceNames_Static(), xKey); + +// return sal_True; +// } +// catch (::com::sun::star::registry::InvalidRegistryException& ) +// { +// OSL_ENSURE(sal_False, "SKELETON::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); +// } + +// return sal_False; +// } //--------------------------------------------------------------------------------------- -extern "C" void* SAL_CALL component_getFactory( +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey) diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java index 24eb92a3109c..8ef02f641b7a 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java +++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java @@ -723,11 +723,14 @@ public class AsciiReplaceFilter * * @see com.sun.star.comp.loader.JavaLoader */ - public static boolean __writeRegistryServiceInfo( com.sun.star.registry.XRegistryKey xRegistryKey ) - { - return Factory.writeRegistryServiceInfo( - _AsciiReplaceFilter.class.getName(), - _AsciiReplaceFilter.m_serviceNames, - xRegistryKey ); - } + // This method not longer necessary since OOo 3.4 where the component registration was + // was changed to passive component registration. For more details see + // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration +// public static boolean __writeRegistryServiceInfo( com.sun.star.registry.XRegistryKey xRegistryKey ) +// { +// return Factory.writeRegistryServiceInfo( +// _AsciiReplaceFilter.class.getName(), +// _AsciiReplaceFilter.m_serviceNames, +// xRegistryKey ); +// } } diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/Makefile b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/Makefile index e84e53ed3fc0..d0ce80991c11 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/Makefile +++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/Makefile @@ -55,6 +55,7 @@ COMP_JAR = $(SAMPLE_CLASS_OUT)/$(COMP_JAR_NAME) COMP_MANIFESTFILE = $(SAMPLE_GEN_OUT)/$(COMP_NAME).uno.Manifest COMP_UNOPKG_MANIFEST = $(SAMPLE_GEN_OUT)/$(COMP_NAME)/META-INF/manifest.xml COMP_REGISTERFLAG = $(SAMPLE_GEN_OUT)/devguide_$(COMP_NAME)_component.flag +COMP_COMPONENTS=$(COMP_NAME).components # often the java files are structured in a hierarchy similar to the package, # for the example we know the package @@ -98,15 +99,16 @@ $(SAMPLE_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.configuration-data$(QM)" >> $@ @echo $(SQM) $(SQM)manifest:full-path="$(QM)TypeDetection.xcu$(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 $(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_COMPONENTS)$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ # rule for component package file -$(COMP_PACKAGE) : $(COMP_JAR) TypeDetection.xcu $(COMP_UNOPKG_MANIFEST) +$(COMP_PACKAGE) : $(COMP_JAR) TypeDetection.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) $(SDK_ZIP) $@ TypeDetection.xcu + $(SDK_ZIP) -u $@ $(COMP_COMPONENTS) cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_ZIP) -u ../../bin/$(@F) $( + + + + + + + + + diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/Makefile b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/Makefile index 11a200398426..8a458d9d8570 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/Makefile +++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/Makefile @@ -43,7 +43,7 @@ include $(SETTINGS)/dk.mk # Define non-platform/compiler specific settings COMP_NAME=FlatXmlTypeDetection -COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT) +COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT) OUT_COMP_INC = $(OUT_INC)/$(COMP_NAME) OUT_COMP_GEN = $(OUT_MISC)/$(COMP_NAME) OUT_COMP_SLO=$(OUT_SLO)/$(COMP_NAME) @@ -52,7 +52,8 @@ 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_UNOPKG_MANIFEST = $(OUT_COMP_GEN)/$(COMP_NAME)/META-INF/manifest.xml -COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map +COMP_COMPONENTS = $(OUT_COMP_GEN)/$(COMP_NAME).components +#COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map REGISTERFLAG = $(OUT_MISC)/devguide_$(COMP_NAME)_register_component.flag @@ -72,12 +73,12 @@ $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG) -$(MKDIR) $(subst /,$(PS),$(@D)) $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $< -$(COMP_MAPFILE) : $(SLOFILES) - -$(MKDIR) $(subst /,$(PS),$(@D)) - cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE) -ifeq "$(OS)" "MACOSX" - nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE) -endif +#$(COMP_MAPFILE) : $(SLOFILES) +# -$(MKDIR) $(subst /,$(PS),$(@D)) +# cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE) +#ifeq "$(OS)" "MACOSX" +# nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE) +#endif ifeq "$(OS)" "WIN" $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) @@ -88,7 +89,7 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib $(LINK_MANIFEST) else -$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) +$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) $(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \ $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB) @@ -105,17 +106,29 @@ $(OUT_COMP_GEN)/%/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.configuration-data$(QM)" >> $@ @echo $(SQM) $(SQM)manifest:full-path="$(QM)FlatXmlTypeDetection.xcu$(QM)"/$(CSEP) >> $@ - @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=native;platform=$(UNOPKG_PLATFORM)$(QM)" >> $@ - @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_GEN)/,,$(UNOPKG_PLATFORM)/$(@D))).uno.$(SHAREDLIB_EXT)$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components;platform=$(UNOPKG_PLATFORM)$(QM)">> $@ + @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ +$(COMP_COMPONENTS) : + -$(MKDIR) $(subst /,$(PS),$(@D)) + @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@ + @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(UNOPKG_PLATFORM)/$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)devguide.officedev.samples.filter.FlatXmlDetect$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)com.sun.star.document.ExtendedTypeDetection$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@ + @echo $(OSEP)/components$(CSEP) >> $@ + # rule for component package file -$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) FlatXmlTypeDetection.xcu $(COMP_UNOPKG_MANIFEST) +$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) FlatXmlTypeDetection.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM)) $(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM)) $(SDK_ZIP) $@ FlatXmlTypeDetection.xcu + cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_NAME).components cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) -u ../../bin/$(@F) $(UNOPKG_PLATFORM)/$( xNewKey( - reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( FilterDetect_getImplementationName() ) ); - xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); +// SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( +// void * pServiceManager, void * pRegistryKey ) +// { +// if (pRegistryKey) +// { +// try +// { +// Reference< XRegistryKey > xNewKey( +// reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( FilterDetect_getImplementationName() ) ); +// xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); - const Sequence< OUString > & rSNL = FilterDetect_getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - xNewKey->createKey( pArray[nPos] ); +// const Sequence< OUString > & rSNL = FilterDetect_getSupportedServiceNames(); +// const OUString * pArray = rSNL.getConstArray(); +// for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) +// xNewKey->createKey( pArray[nPos] ); - return sal_True; - } - catch (InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; -} +// return sal_True; +// } +// catch (InvalidRegistryException &) +// { +// OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); +// } +// } +// return sal_False; +// } //================================================================================================== -void * SAL_CALL component_getFactory( +SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) { void * pRet = 0; diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx index b1cf3afbf536..7ebb628b29a9 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx +++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx @@ -318,38 +318,42 @@ using namespace XFlatXml; extern "C" { -void SAL_CALL component_getImplementationEnvironment( +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * pRegistryKey ) -{ - if (pRegistryKey) - { - try - { - Reference< XRegistryKey > xNewKey( - reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( - OUString::createFromAscii( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) ); - - const Sequence< OUString > & rSNL = getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - xNewKey->createKey( pArray[nPos] ); - - return sal_True; - } - catch (InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; -} - -void * SAL_CALL component_getFactory( +// This method not longer necessary since OOo 3.4 where the component registration was +// was changed to passive component registration. For more details see +// http://wiki.services.openoffice.org/wiki/Passive_Component_Registration +// +// SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * pRegistryKey ) +// { +// if (pRegistryKey) +// { +// try +// { +// Reference< XRegistryKey > xNewKey( +// reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( +// OUString::createFromAscii( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) ); + +// const Sequence< OUString > & rSNL = getSupportedServiceNames(); +// const OUString * pArray = rSNL.getConstArray(); +// for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) +// xNewKey->createKey( pArray[nPos] ); + +// return sal_True; +// } +// catch (InvalidRegistryException &) +// { +// OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); +// } +// } +// return sal_False; +// } + +SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) { void * pRet = 0; diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/Makefile b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/Makefile index 09a4cfafa4dd..a9e987777cf7 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/Makefile +++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/Makefile @@ -43,16 +43,17 @@ include $(SETTINGS)/dk.mk # Define non-platform/compiler specific settings COMP_NAME=FlatXmlFilter_cpp -COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT) +COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT) OUT_COMP_INC = $(OUT_INC)/$(COMP_NAME) OUT_COMP_GEN = $(OUT_MISC)/$(COMP_NAME) OUT_COMP_SLO=$(OUT_SLO)/$(COMP_NAME) COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT) COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)") COMP_UNOPKG_MANIFEST = $(OUT_COMP_GEN)/$(COMP_NAME)/META-INF/manifest.xml -COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map +#COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map +COMP_COMPONENTS = $(OUT_COMP_GEN)/$(COMP_NAME).components -REGISTERFLAG = $(OUT_MISC)/devguide_$(COMP_NAME)_register_component.flag +COMP_REGISTERFLAG = $(OUT_MISC)/devguide_$(COMP_NAME)_register_component.flag CXXFILES = FlatXml.cxx @@ -69,12 +70,12 @@ $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG) -$(MKDIR) $(subst /,$(PS),$(@D)) $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $< -$(COMP_MAPFILE) : $(SLOFILES) - -$(MKDIR) $(subst /,$(PS),$(@D)) - cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE) -ifeq "$(OS)" "MACOSX" - nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE) -endif +#$(COMP_MAPFILE) : $(SLOFILES) +# -$(MKDIR) $(subst /,$(PS),$(@D)) +# cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE) +#ifeq "$(OS)" "MACOSX" +# nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE) +#endif ifeq "$(OS)" "WIN" $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) @@ -85,7 +86,7 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib $(LINK_MANIFEST) else -$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) +$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) $(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \ $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB) @@ -102,21 +103,33 @@ $(OUT_COMP_GEN)/%/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.configuration-data$(QM)" >> $@ @echo $(SQM) $(SQM)manifest:full-path="$(QM)FlatXmlFilter_cpp.xcu$(QM)"/$(CSEP) >> $@ - @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=native;platform=$(UNOPKG_PLATFORM)$(QM)" >> $@ - @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_GEN)/,,$(UNOPKG_PLATFORM)/$(@D))).uno.$(SHAREDLIB_EXT)$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components;platform=$(UNOPKG_PLATFORM)$(QM)">> $@ + @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ +$(COMP_COMPONENTS) : + -$(MKDIR) $(subst /,$(PS),$(@D)) + @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@ + @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(UNOPKG_PLATFORM)/$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)devguide.officedev.samples.filter.FlatXmlCpp$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)devguide.officedev.samples.filter.FlatXmlCpp$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@ + @echo $(OSEP)/components$(CSEP) >> $@ + # rule for component package file -$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) FlatXmlFilter_cpp.xcu $(COMP_UNOPKG_MANIFEST) +$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) FlatXmlFilter_cpp.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM)) $(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM)) $(SDK_ZIP) $@ FlatXmlFilter_cpp.xcu + cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) -u ../../bin/$(@F) $(COMP_NAME).components cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) -u ../../bin/$(@F) $(UNOPKG_PLATFORM)/$( + + + + + + + diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/Makefile b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/Makefile index afd060aee7be..a619e9d9c9d0 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/Makefile +++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/Makefile @@ -42,15 +42,16 @@ include $(SETTINGS)/std.mk include $(SETTINGS)/dk.mk # Define non-platform/compiler specific settings -COMPONENT_NAME=FlatXmlFilter_java -OUT_COMP_CLASS = $(OUT_CLASS)/$(COMPONENT_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)devguide_$(COMPONENT_NAME)_register_component.flag +COMP_NAME=FlatXmlFilter_java +OUT_COMP_CLASS = $(OUT_CLASS)/$(COMP_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)devguide_$(COMP_NAME)_register_component.flag +COMP_COMPONENTS=$(COMP_NAME).components JAVAFILES = \ FlatXml.java \ @@ -58,9 +59,9 @@ JAVAFILES = \ CLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/%.class,$(JAVAFILES)) -#$(COMPONENT_NAME)_CLASSFILES = FlatXml.class FlatXml$(dlr)_FlatXml.class +#$(COMP_NAME)_CLASSFILES = FlatXml.class FlatXml$(dlr)_FlatXml.class -$(COMPONENT_NAME)_CLASSFILES = *.class +$(COMP_NAME)_CLASSFILES = *.class SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\ $(PATH_SEPARATOR)$(OUT_COMP_CLASS)) @@ -82,7 +83,7 @@ $(CLASSFILES) : $(JAVAFILES) $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMP_CLASS) $(JAVAFILES) # rule for component jar file -$(COMPONENT_JAR) : $(COMPONENT_MANIFESTFILE) $(CLASSFILES) +$(COMP_JAR) : $(COMP_MANIFESTFILE) $(CLASSFILES) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(> $@ @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)FlatXmlFilter_java.xcu$(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_COMPONENTS)$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ # rule for component package file -$(COMPONENT_PACKAGE) : $(COMPONENT_JAR) FlatXmlFilter_java.xcu $(COMPONENT_UNOPKG_MANIFEST) +$(COMP_PACKAGE) : $(COMP_JAR) FlatXmlFilter_java.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) $(SDK_ZIP) $@ FlatXmlFilter_java.xcu - cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) ../../bin/$(@F) $( $(subst /,$(PS),$@) else @echo -------------------------------------------------------------------------------- @@ -121,7 +123,7 @@ else @echo -------------------------------------------------------------------------------- endif -FlatXmlFilterJavaExample : $(REGISTERFLAG) +FlatXmlFilterJavaExample : $(COMP_REGISTERFLAG) @echo -------------------------------------------------------------------------------- @echo The Java FlatXmlFilter component is installed if SDK_AUTO_DEPLOYMENT = YES. @echo You can use the filters "$(QM)DevGuide FlatXML ...$(QM)" inside your office installation @@ -137,5 +139,5 @@ FlatXmlFilterJavaExample : $(REGISTERFLAG) .PHONY: clean clean : -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS)) - -$(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/cpp/complextoolbarcontrols/Makefile b/odk/examples/cpp/complextoolbarcontrols/Makefile index a21590d03d67..8e6223305346 100644 --- a/odk/examples/cpp/complextoolbarcontrols/Makefile +++ b/odk/examples/cpp/complextoolbarcontrols/Makefile @@ -51,8 +51,8 @@ COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT) COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)") COMP_UNOPKG_MANIFEST = $(OUT_COMP_GEN)/$(COMP_NAME)/META-INF/manifest.xml COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map - -REGISTERFLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_register_component.flag +COMP_COMPONENTS = $(OUT_COMP_GEN)/$(COMP_NAME).components +COMP_REGISTERFLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_register_component.flag COMP_TYPEFLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_types.flag CXXFILES = \ @@ -79,12 +79,12 @@ $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG) $(CC) $(CC_FLAGS) $(STL_INCLUDES) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $< -$(COMP_MAPFILE) : $(SLOFILES) - -$(MKDIR) $(subst /,$(PS),$(@D)) - cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE) -ifeq "$(OS)" "MACOSX" - nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE) -endif +#$(COMP_MAPFILE) : $(SLOFILES) +# -$(MKDIR) $(subst /,$(PS),$(@D)) +# cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE) +#ifeq "$(OS)" "MACOSX" +# nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE) +#endif ifeq "$(OS)" "WIN" $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) @@ -95,7 +95,8 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib $(LINK_MANIFEST) else -$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) +#$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) +$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) $(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \ $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB) @@ -114,24 +115,42 @@ $(OUT_COMP_GEN)/%/manifest.xml : @echo $(SQM) $(SQM)manifest:full-path="$(QM)Addons.xcu$(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)WriterWindowState.xcu$(QM)"/$(CSEP) >> $@ - @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@ + @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:meda-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@ @echo $(SQM) $(SQM)manifest:full-path="$(QM)CalcWindowState.xcu$(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)ProtocolHandler.xcu$(QM)"/$(CSEP) >> $@ - @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=native;platform=$(UNOPKG_PLATFORM)$(QM)" >> $@ - @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_GEN)/,,$(UNOPKG_PLATFORM)/$(@D))).uno.$(SHAREDLIB_EXT)$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components;platform=$(UNOPKG_PLATFORM)$(QM)">> $@ + @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@ + +# @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=native;platform=$(UNOPKG_PLATFORM)$(QM)" >> $@ +# @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_GEN)/,,$(UNOPKG_PLATFORM)/$(@D))).uno.$(SHAREDLIB_EXT)$(QM)"/$(CSEP) >> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ +$(COMP_COMPONENTS) : + -$(MKDIR) $(subst /,$(PS),$(@D)) + @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@ + @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(UNOPKG_PLATFORM)/$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)vnd.My.impl.NewDocListener$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)vnd.My.NewDocListener$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)vnd.demo.Impl.ProtocolHandler$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)vnd.demo.ProtocolHandler$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@ + @echo $(OSEP)/components$(CSEP) >> $@ + # rule for component package file -$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) Addons.xcu ProtocolHandler.xcu WriterWindowState.xcu CalcWindowState.xcu $(COMP_UNOPKG_MANIFEST) +$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) Addons.xcu ProtocolHandler.xcu WriterWindowState.xcu CalcWindowState.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS) -$(MKDIR) $(subst /,$(PS),$(@D)) && $(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM)) $(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM)) - cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) ../../bin/$(@F) $(UNOPKG_PLATFORM)/$(& xRegistryKey , - const char* pImplementationName, - const char* pServiceName ) -{ - ::rtl::OUStringBuffer sKey(256); - sKey.append (::rtl::OUString::createFromAscii(pImplementationName)); - sKey.appendAscii("/UNO/SERVICES/"); - sKey.append (::rtl::OUString::createFromAscii(pServiceName)); - - xRegistryKey->createKey(sKey.makeStringAndClear()); -} +// static void writeInfo(const css::uno::Reference< css::registry::XRegistryKey >& xRegistryKey , +// const char* pImplementationName, +// const char* pServiceName ) +// { +// ::rtl::OUStringBuffer sKey(256); +// sKey.append (::rtl::OUString::createFromAscii(pImplementationName)); +// sKey.appendAscii("/UNO/SERVICES/"); +// sKey.append (::rtl::OUString::createFromAscii(pServiceName)); + +// xRegistryKey->createKey(sKey.makeStringAndClear()); +// } extern "C" { @@ -62,27 +62,30 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } +// This method not longer necessary since OOo 3.4 where the component registration was +// was changed to passive component registration. For more details see +// http://wiki.services.openoffice.org/wiki/Passive_Component_Registration //================================================================================================== -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void* pServiceManager, - void* pRegistryKey ) -{ - if (!pRegistryKey) - return sal_False; - - try - { - css::uno::Reference< css::registry::XRegistryKey > xKey(reinterpret_cast< css::registry::XRegistryKey* >(pRegistryKey), css::uno::UNO_QUERY); - - writeInfo( xKey, MYLISTENER_IMPLEMENTATIONNAME , MYLISTENER_SERVICENAME ); - writeInfo( xKey, MYPROTOCOLHANDLER_IMPLEMENTATIONNAME, MYPROTOCOLHANDLER_SERVICENAME ); - - return sal_True; - } - catch(const css::registry::InvalidRegistryException&) - { OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); } - - return sal_False; -} +// SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void* pServiceManager, +// void* pRegistryKey ) +// { +// if (!pRegistryKey) +// return sal_False; + +// try +// { +// css::uno::Reference< css::registry::XRegistryKey > xKey(reinterpret_cast< css::registry::XRegistryKey* >(pRegistryKey), css::uno::UNO_QUERY); + +// writeInfo( xKey, MYLISTENER_IMPLEMENTATIONNAME , MYLISTENER_SERVICENAME ); +// writeInfo( xKey, MYPROTOCOLHANDLER_IMPLEMENTATIONNAME, MYPROTOCOLHANDLER_SERVICENAME ); + +// return sal_True; +// } +// catch(const css::registry::InvalidRegistryException&) +// { OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); } + +// return sal_False; +// } //================================================================================================== SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* pImplName , diff --git a/odk/examples/java/EmbedDocument/EmbeddedObject/Makefile b/odk/examples/java/EmbedDocument/EmbeddedObject/Makefile index 6b75f4ed72ac..62fb17e5e0ac 100644 --- 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 000000000000..421706f7418f --- /dev/null +++ b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.components @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java index fd8f2793c9c5..f081aaf668f9 100755 --- a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java +++ b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java @@ -37,11 +37,14 @@ 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 + // 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 8fd4ade8fb9d..23530a89358d 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 000000000000..9e413f2b64a2 --- /dev/null +++ b/odk/examples/java/MinimalComponent/MinimalComponent.components @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/odk/examples/java/MinimalComponent/MinimalComponent.java b/odk/examples/java/MinimalComponent/MinimalComponent.java index 47129efc00d2..bce1f1882e29 100644 --- a/odk/examples/java/MinimalComponent/MinimalComponent.java +++ b/odk/examples/java/MinimalComponent/MinimalComponent.java @@ -163,9 +163,12 @@ 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 + // 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 0a382d15042e..7a79f340d79c 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) $( + + + + + + + diff --git a/odk/examples/java/PropertySet/PropTest.java b/odk/examples/java/PropertySet/PropTest.java index e8652c7689bb..3e1014e9a9f2 100644 --- a/odk/examples/java/PropertySet/PropTest.java +++ b/odk/examples/java/PropertySet/PropTest.java @@ -257,9 +257,12 @@ 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 + // 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 000000000000..c16c4a3a99e7 --- /dev/null +++ b/odk/examples/java/Spreadsheet/CalcAddins.components @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/odk/examples/java/Spreadsheet/CalcAddins.java b/odk/examples/java/Spreadsheet/CalcAddins.java index 6a052a7e2eea..7b5e1d94f698 100644 --- a/odk/examples/java/Spreadsheet/CalcAddins.java +++ b/odk/examples/java/Spreadsheet/CalcAddins.java @@ -295,10 +295,13 @@ 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 + // 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 4a251ae2062b..52d73a4406ca 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) $(> $@ @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)/$( $(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 476ff6620dbc..d597e969aa24 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 000000000000..0b667b96a87e --- /dev/null +++ b/odk/examples/java/ToDo/ToDo.components @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/odk/examples/java/ToDo/ToDo.java b/odk/examples/java/ToDo/ToDo.java index 87257c406903..722ee8a46d37 100644 --- a/odk/examples/java/ToDo/ToDo.java +++ b/odk/examples/java/ToDo/ToDo.java @@ -957,9 +957,12 @@ 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 + // 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); +// } } diff --git a/odk/setsdkenv_unix b/odk/setsdkenv_unix old mode 100644 new mode 100755 diff --git a/odk/settings/settings.mk b/odk/settings/settings.mk index af9b1536df9b..0857882183f3 100644 --- a/odk/settings/settings.mk +++ b/odk/settings/settings.mk @@ -196,7 +196,7 @@ endif EMPTYSTRING= PATH_SEPARATOR=: -CC_FLAGS=-c -KPIC +CC_FLAGS=-c -KPIC -xldscope=hidden ifeq "$(DEBUG)" "yes" CC_FLAGS+=-g endif @@ -207,7 +207,7 @@ SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/inclu # define for used compiler necessary for UNO # -DCPPU_ENV=sunpro5 -- sunpro cc 5.x solaris sparc/intel -CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=sunpro5 +CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=sunpro5 -DHAVE_GCC_VISIBILITY_FEATURE CC_OUTPUT_SWITCH=-o LIBRARY_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp '-R$$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm @@ -215,7 +215,8 @@ LIBRARY_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp '-R$$ORIGIN' -z text -nor ifeq ($(OO_SDK_CC_55_OR_HIGHER),) LIBRARY_LINK_FLAGS+=-instances=static endif -COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -M $(PRJ)/settings/component.uno.map +#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -M $(PRJ)/settings/component.uno.map +COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) EXE_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -Bdirect -z defs LINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_URE_LIB_DIR)" @@ -334,11 +335,12 @@ endif EMPTYSTRING= PATH_SEPARATOR=: +CC_FLAGS=-c -fpic -fvisibility=hidden # -O is necessary for inlining (see gcc documentation) ifeq "$(DEBUG)" "yes" -CC_FLAGS=-c -g -fpic +CC_FLAGS+=-g else -CC_FLAGS=-c -O -fpic +CC_FLAGS+=-O endif ifeq "$(PROCTYPE)" "ppc" @@ -348,7 +350,7 @@ endif SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/linux" CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl" -CC_DEFINES=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) +CC_DEFINES=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) -DHAVE_GCC_VISIBILITY_FEATURE # define for used compiler necessary for UNO #-DCPPU_ENV=gcc2 -- gcc 2.91/2.95 @@ -361,7 +363,8 @@ LIBRARY_LINK_FLAGS=-shared '-Wl,-rpath,$$ORIGIN' ifeq "$(PROCTYPE)" "ppc" LIBRARY_LINK_FLAGS+=-fPIC endif -COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,--version-script,$(PRJ)/settings/component.uno.map +#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,--version-script,$(PRJ)/settings/component.uno.map +COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) #EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined -Wl,-export-dynamic -Wl,-z,defs -Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined -Wl,-export-dynamic -Wl,-z,defs -Wl,--no-whole-archive @@ -463,17 +466,18 @@ INSTALL_NAME_URELIBS_BIN=install_name_tool -change @____________________________ EMPTYSTRING= PATH_SEPARATOR=: +CC_FLAGS=-malign-natural -c -fPIC -fno-common $(GCC_ARCH_OPTION) -fvisibility=hidden # -O is necessary for inlining (see gcc documentation) ifeq "$(DEBUG)" "yes" -CC_FLAGS=-malign-natural -c -g -fPIC -fno-common $(GCC_ARCH_OPTION) +CC_FLAGS+=-g else -CC_FLAGS=-malign-natural -c -O -fPIC -fno-common $(GCC_ARCH_OPTION) +CC_FLAGS+=-O endif SDK_JAVA_INCLUDES = -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl" -CC_DEFINES=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) +CC_DEFINES=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) -DHAVE_GCC_VISIBILITY_FEATURE CC_OUTPUT_SWITCH=-o @@ -481,7 +485,8 @@ LIBRARY_LINK_FLAGS=-dynamiclib -single_module -Wl,-multiply_defined,suppress $(G #-fPIC -fno-common # install_name '@executable_path$/(@:f)' -COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,-exported_symbols_list $(COMP_MAPFILE) +#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,-exported_symbols_list $(COMP_MAPFILE) +COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) EXE_LINK_FLAGS=$(GCC_ARCH_OPTION) -Wl,-multiply_defined,suppress LINK_LIBS=-L$(OUT)/lib -L$(OO_SDK_OUT)/$(PLATFORM)/lib -L"$(OO_SDK_URE_LIB_DIR)" @@ -584,22 +589,24 @@ endif EMPTYSTRING= PATH_SEPARATOR=: +CC_FLAGS=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS) -fvisibility=hidden # -O is necessary for inlining (see gcc documentation) ifeq "$(DEBUG)" "yes" -CC_FLAGS=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS) +CC_FLAGS+=-g else -CC_FLAGS=-c -O -fPIC -DPIC $(PTHREAD_CFLAGS) +CC_FLAGS+=-O endif SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/freebsd" CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl" -CC_DEFINES=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) +CC_DEFINES=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) -DHAVE_GCC_VISIBILITY_FEATURE CC_OUTPUT_SWITCH=-o LIBRARY_LINK_FLAGS=-shared '-Wl,-rpath,$$ORIGIN' -COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,--version-script,$(PRJ)/settings/component.uno.map +#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,--version-script,$(PRJ)/settings/component.uno.map +COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined #EXE_LINK_FLAGS+=-Wl,-export-dynamic -Wl,-z,defs diff --git a/odk/util/makefile.pmk b/odk/util/makefile.pmk index aa0f10ed035e..5e9662242957 100644 --- a/odk/util/makefile.pmk +++ b/odk/util/makefile.pmk @@ -26,7 +26,7 @@ #************************************************************************* # used for sdk common files -PRODUCT_RELEASE=3.3 +PRODUCT_RELEASE=3.4 OFFICENAME=OpenOffice.org SDKDIRNAME=openoffice.org$(PRODUCT_RELEASE)_sdk OFFICEPRODUCTNAME=$(OFFICENAME) $(PRODUCT_RELEASE) -- cgit From 928af9414dac5ff185e2a8716a585efc33be2001 Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Tue, 22 Feb 2011 16:13:49 +0100 Subject: jsc340: i114609: support passive component registration --- .../Charts/JavaSampleChartAddIn.java | 32 +++--- odk/examples/DevelopersGuide/Charts/Makefile | 36 ++++--- .../Components/Addons/JobsAddon/AsyncJob.java | 19 ++-- .../Components/Addons/JobsAddon/Makefile | 39 +++---- .../Addons/ProtocolHandlerAddon_cpp/Makefile | 41 +++++--- .../Addons/ProtocolHandlerAddon_cpp/component.cxx | 56 +++++----- .../Addons/ProtocolHandlerAddon_java/Makefile | 41 ++++---- .../ProtocolHandlerAddon.java | 18 ++-- .../Components/CppComponent/Makefile | 44 +++++--- .../Components/CppComponent/service1_impl.cxx | 67 ++++++------ .../Components/CppComponent/service2_impl.cxx | 21 ++-- .../JavaComponent/TestServiceProvider.java | 2 +- .../Components/SimpleLicense/LicenseTest.java | 2 +- .../dialogcomponent/DialogComponent.java | 2 +- .../AsciiFilter/AsciiReplaceFilter.java | 3 +- .../FlatXmlFilter_java/FlatXml.java | 3 +- .../DevelopersGuide/OfficeDev/Linguistic/Makefile | 115 ++++++++++----------- .../OfficeDev/Linguistic/SampleHyphenator.java | 32 +++--- .../OfficeDev/Linguistic/SampleSpellChecker.java | 32 +++--- .../OfficeDev/Linguistic/SampleThesaurus.java | 32 +++--- .../DevelopersGuide/Spreadsheet/ExampleAddIn.java | 24 +++-- .../Spreadsheet/ExampleDataPilotSource.java | 63 ++++++----- odk/examples/DevelopersGuide/Spreadsheet/Makefile | 20 ++-- .../EmbeddedObject/OwnEmbeddedObjectFactory.java | 3 +- .../java/MinimalComponent/MinimalComponent.java | 3 +- odk/examples/java/PropertySet/PropTest.java | 3 +- odk/examples/java/Spreadsheet/CalcAddins.java | 3 +- odk/examples/java/ToDo/ToDo.java | 3 +- 28 files changed, 427 insertions(+), 332 deletions(-) (limited to 'odk') diff --git a/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java b/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java index 10a137a316d5..06239b6c9851 100644 --- a/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java +++ b/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java @@ -459,18 +459,22 @@ public class JavaSampleChartAddIn extends WeakBase implements * @param regKey the registryKey * @see com.sun.star.comp.loader.JavaLoader */ - public static boolean __writeRegistryServiceInfo( com.sun.star.registry.XRegistryKey regKey ) - { - boolean bResult = true; - - String[] aServices = getSupportedServiceNames_Static(); - int i, nLength = aServices.length; - - for( i = 0; i < nLength; ++i ) - { - bResult = bResult && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo( - JavaSampleChartAddIn.class.getName(), aServices[ i ], regKey ); - } - return bResult; - } + // 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( com.sun.star.registry.XRegistryKey regKey ) +// { +// boolean bResult = true; + +// String[] aServices = getSupportedServiceNames_Static(); +// int i, nLength = aServices.length; + +// for( i = 0; i < nLength; ++i ) +// { +// bResult = bResult && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo( +// JavaSampleChartAddIn.class.getName(), aServices[ i ], regKey ); +// } +// return bResult; +// } } diff --git a/odk/examples/DevelopersGuide/Charts/Makefile b/odk/examples/DevelopersGuide/Charts/Makefile index f35f8fcbb9f7..d6727662bfbb 100644 --- a/odk/examples/DevelopersGuide/Charts/Makefile +++ b/odk/examples/DevelopersGuide/Charts/Makefile @@ -57,14 +57,15 @@ APP4_JAR=$(SAMPLE_CLASS_OUT)/$(APP4_NAME).jar APP5_NAME=SelectionChangeListener APP5_JAR=$(SAMPLE_CLASS_OUT)/$(APP5_NAME).jar -COMPONENT_NAME=JavaSampleChartAddIn -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 = $(SAMPLE_CLASS_OUT)/$(COMPONENT_JAR_NAME) -COMPONENT_MANIFESTFILE = $(SAMPLE_CLASS_OUT)/$(COMPONENT_NAME).uno.Manifest -COMPONENT_UNOPKG_MANIFEST = $(SAMPLE_CLASS_OUT)/$(COMPONENT_NAME)/META-INF/manifest.xml -COMP_REGISTERFLAG = $(SAMPLE_GEN_OUT)/devguide_$(COMPONENT_NAME)_register_component.flag +COMP_NAME=JavaSampleChartAddIn +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 = $(SAMPLE_CLASS_OUT)/$(COMP_JAR_NAME) +COMP_MANIFESTFILE = $(SAMPLE_CLASS_OUT)/$(COMP_NAME).uno.Manifest +COMP_UNOPKG_MANIFEST = $(SAMPLE_CLASS_OUT)/$(COMP_NAME)/META-INF/manifest.xml +COMP_REGISTERFLAG = $(SAMPLE_GEN_OUT)/devguide_$(COMP_NAME)_register_component.flag +COMP_COMPONENTS=$(COMP_NAME).components COMPJAVAFILES = \ JavaSampleChartAddIn.java @@ -79,7 +80,7 @@ COMPCLASSFILES= $(patsubst %.java,$(SAMPLE_CLASS_OUT)/%.class,$(COMPJAVAFILES)) APP_CLASSFILES= $(patsubst %.java,$(SAMPLE_CLASS_OUT)/%.class,$(APP_JAVAFILES)) APP_CLASSNAMES= $(patsubst %.java,%.class,$(APP_JAVAFILES)) -$(COMPONENT_NAME)_CLASSFILES = $(COMPONENT_NAME).class +$(COMP_NAME)_CLASSFILES = $(COMP_NAME).class SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\ $(PATH_SEPARATOR)$(SAMPLE_CLASS_OUT)) @@ -122,7 +123,7 @@ $(SAMPLE_CLASS_OUT)/%.jar : $(SAMPLE_CLASS_OUT)/%.mf $(SAMPLE_CLASS_OUT)/%.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),$(SAMPLE_CLASS_OUT)) && $(SDK_JAR) cvfm $(@F) $( $@ @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 $(SAMPLE_CLASS_OUT)/,,$(@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_COMPONENTS)$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ # rule for component pacakge file -$(COMPONENT_PACKAGE) : $(COMPONENT_JAR) $(COMPONENT_UNOPKG_MANIFEST) +$(COMP_PACKAGE) : $(COMP_JAR) $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) - cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_ZIP) ../../bin/$(@F) $( $(subst /,$(PS),$@) else @echo -------------------------------------------------------------------------------- @@ -195,4 +197,4 @@ AddInChart.ods.load : $(REGISTERFLAG) clean : -$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) -$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_GEN_OUT)) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_PACKAGE_URL))) + -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL))) diff --git a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java index 14c2659e48a7..4a4733c674ed 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java +++ b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java @@ -415,12 +415,15 @@ public class AsyncJob extends WeakBase implements XServiceInfo, XAsyncJob } //___________________________________________ - - public synchronized static boolean __writeRegistryServiceInfo(com.sun.star.registry.XRegistryKey xRegKey) - { - return Factory.writeRegistryServiceInfo( - AsyncJob.IMPLEMENTATIONNAME, - AsyncJob.SERVICENAMES, - xRegKey); - } + // 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 synchronized static boolean __writeRegistryServiceInfo(com.sun.star.registry.XRegistryKey xRegKey) +// { +// return Factory.writeRegistryServiceInfo( +// AsyncJob.IMPLEMENTATIONNAME, +// AsyncJob.SERVICENAMES, +// xRegKey); +// } } diff --git a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Makefile b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Makefile index 8b40d9ec87ff..052cea359530 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Makefile +++ b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Makefile @@ -42,16 +42,17 @@ include $(SETTINGS)/std.mk include $(SETTINGS)/dk.mk # Define non-platform/compiler specific settings -COMPONENT_NAME=AsyncJob -OUT_COMP_CLASS=$(OUT_CLASS)/$(COMPONENT_NAME) -OUT_COMP_MISC=$(OUT_MISC)/$(COMPONENT_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_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_COMP_MISC)$(PS)java_$(COMPONENT_NAME)_register_component.flag +COMP_NAME=AsyncJob +OUT_COMP_CLASS=$(OUT_CLASS)/$(COMP_NAME) +OUT_COMP_MISC=$(OUT_MISC)/$(COMP_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_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 +REGISTERFLAG=$(OUT_COMP_MISC)$(PS)java_$(COMP_NAME)_register_component.flag +COMP_COMPONENTS=$(COMP_NAME).components JAVAFILES = AsyncJob.java @@ -76,7 +77,7 @@ $(CLASSFILES) : $(JAVAFILES) $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMP_CLASS) $(JAVAFILES) # rule for component jar file -$(COMPONENT_JAR) : $(COMPONENT_MANIFESTFILE) $(CLASSFILES) +$(COMP_JAR) : $(COMP_MANIFESTFILE) $(CLASSFILES) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) $(SDK_JAR) cvfm $@ $< -C $(OUT_COMP_CLASS) . @@ -91,24 +92,24 @@ $(OUT_COMP_CLASS)/%/manifest.xml : @echo $(SQM) $(SQM)manifest:full-path="$(QM)Addons.xcu$(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)Jobs.xcu$(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_COMPONENTS)$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ # rule for component package file -$(COMPONENT_PACKAGE) : $(COMPONENT_JAR) Addons.xcu Jobs.xcu $(COMPONENT_UNOPKG_MANIFEST) +$(COMP_PACKAGE) : $(COMP_JAR) Addons.xcu Jobs.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) cd $(subst /,$(PS),$(OUT_CLASS)) && $(SDK_ZIP) ../bin/$(@F) $( $(subst /,$(PS),$@) else @echo -------------------------------------------------------------------------------- @@ -132,5 +133,5 @@ DevGuideJobsAddon : $(REGISTERFLAG) clean : -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS)) -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_MISC)) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_PACKAGE_URL))) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_JAR))) + -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL))) + -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_JAR))) diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/Makefile b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/Makefile index c5429565e406..98bbab16ba2c 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/Makefile +++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/Makefile @@ -43,14 +43,15 @@ include $(SETTINGS)/dk.mk # Define non-platform/compiler specific settings COMP_NAME=ProtocolHandlerAddon_cpp -COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT) +COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT) OUT_COMP_INC=$(OUT_INC)/$(COMP_NAME) OUT_COMP_GEN=$(OUT_MISC)/$(COMP_NAME) OUT_COMP_SLO=$(OUT_SLO)/$(COMP_NAME) COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT) COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)") COMP_UNOPKG_MANIFEST = $(OUT_COMP_GEN)/$(COMP_NAME)/META-INF/manifest.xml -COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map +#COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map +COMP_COMPONENTS = $(OUT_COMP_GEN)/$(COMP_NAME).components REGISTERFLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_register_component.flag @@ -70,12 +71,12 @@ $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG) -$(MKDIR) $(subst /,$(PS),$(@D)) $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $< -$(COMP_MAPFILE) : $(SLOFILES) - -$(MKDIR) $(subst /,$(PS),$(@D)) - cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE) -ifeq "$(OS)" "MACOSX" - nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE) -endif +#$(COMP_MAPFILE) : $(SLOFILES) +# -$(MKDIR) $(subst /,$(PS),$(@D)) +# cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE) +#ifeq "$(OS)" "MACOSX" +# nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE) +#endif ifeq "$(OS)" "WIN" $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) @@ -86,7 +87,8 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib $(LINK_MANIFEST) else -$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) +#$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) +$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) $(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \ $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB) @@ -105,16 +107,28 @@ $(OUT_COMP_GEN)/%/manifest.xml : @echo $(SQM) $(SQM)manifest:full-path="$(QM)Addons.xcu$(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)ProtocolHandler.xcu$(QM)"/$(CSEP) >> $@ - @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=native;platform=$(UNOPKG_PLATFORM)$(QM)" >> $@ - @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(OUT_COMP_GEN)/,,$(UNOPKG_PLATFORM)/$(@D))).uno.$(SHAREDLIB_EXT)$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components;platform=$(UNOPKG_PLATFORM)$(QM)">> $@ + @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ +$(COMP_COMPONENTS) : + -$(MKDIR) $(subst /,$(PS),$(@D)) + @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@ + @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(UNOPKG_PLATFORM)/$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)org.openoffice.Office.addon.example$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)com.sun.star.frame.ProtocolHandler$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@ + @echo $(OSEP)/components$(CSEP) >> $@ + # rule for component package file -$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) Addons.xcu ProtocolHandler.xcu $(COMP_UNOPKG_MANIFEST) +$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) Addons.xcu ProtocolHandler.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS) -$(MKDIR) $(subst /,$(PS),$(@D)) && $(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM)) $(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM)) - cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) ../../bin/$(@F) $(UNOPKG_PLATFORM)/$( xNewKey( - reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( - OUString( RTL_CONSTASCII_USTRINGPARAM("/" IMPLEMENTATION_NAME "/UNO/SERVICES") ) ) ); +// if (pRegistryKey) +// { +// try +// { +// Reference< XRegistryKey > xNewKey( +// reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( +// OUString( RTL_CONSTASCII_USTRINGPARAM("/" IMPLEMENTATION_NAME "/UNO/SERVICES") ) ) ); - const Sequence< OUString > & rSNL = - Addon_getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - xNewKey->createKey( pArray[nPos] ); +// const Sequence< OUString > & rSNL = +// Addon_getSupportedServiceNames(); +// const OUString * pArray = rSNL.getConstArray(); +// for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) +// xNewKey->createKey( pArray[nPos] ); - return sal_True; - } - catch (InvalidRegistryException &) - { - // we should not ignore exceptions - } - } - return result; -} +// return sal_True; +// } +// catch (InvalidRegistryException &) +// { +// // we should not ignore exceptions +// } +// } +// return result; +// } /** * This function is called to get service factories for an implementation. @@ -108,7 +112,7 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * * @param pRegistryKey the registry key for this component, need for persistent data * @return a component factory */ -extern "C" void * SAL_CALL component_getFactory(const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey) +extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey) { void * pRet = 0; diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/Makefile b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/Makefile index ac6a0670a05a..82a87aea4ecf 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/Makefile +++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/Makefile @@ -42,17 +42,18 @@ include $(SETTINGS)/std.mk include $(SETTINGS)/dk.mk # Define non-platform/compiler specific settings -COMPONENT_NAME=ProtocolHandlerAddon_java -OUT_COMP_CLASS=$(OUT_CLASS)/$(COMPONENT_NAME) -OUT_COMP_MISC=$(OUT_MISC)/$(COMPONENT_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_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_COMP_MISC)$(PS)java_$(COMPONENT_NAME)_register_component.flag +COMP_NAME=ProtocolHandlerAddon_java +OUT_COMP_CLASS=$(OUT_CLASS)/$(COMP_NAME) +OUT_COMP_MISC=$(OUT_MISC)/$(COMP_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_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_COMPONENTS=$(COMP_NAME).components + +REGISTERFLAG=$(OUT_COMP_MISC)$(PS)java_$(COMP_NAME)_register_component.flag JAVAFILES = ProtocolHandlerAddon.java @@ -77,7 +78,7 @@ $(CLASSFILES) : $(JAVAFILES) $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMP_CLASS) $(JAVAFILES) # rule for component jar file -$(COMPONENT_JAR) : $(COMPONENT_MANIFESTFILE) $(CLASSFILES) +$(COMP_JAR) : $(COMP_MANIFESTFILE) $(CLASSFILES) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) $(SDK_JAR) cvfm $@ $< -C $(OUT_COMP_CLASS) . @@ -92,25 +93,25 @@ $(OUT_COMP_CLASS)/%/manifest.xml : @echo $(SQM) $(SQM)manifest:full-path="$(QM)Addons.xcu$(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)ProtocolHandler.xcu$(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_COMPONENTS)$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ # rule for component package file -$(COMPONENT_PACKAGE) : $(COMPONENT_JAR) Addons.xcu ProtocolHandler.xcu $(COMPONENT_UNOPKG_MANIFEST) +$(COMP_PACKAGE) : $(COMP_JAR) Addons.xcu ProtocolHandler.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_MISC)) $(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_COMP_MISC)) cd $(subst /,$(PS),$(OUT_COMP_MISC)) && $(SDK_ZIP) ../../bin/$(@F) $( $(subst /,$(PS),$@) else @echo -------------------------------------------------------------------------------- @@ -134,5 +135,5 @@ DevGuideProtocolHandlerAddon : $(REGISTERFLAG) clean : -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS)) -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_MISC)) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_PACKAGE_URL))) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_JAR))) + -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL))) + -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_JAR))) diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java index ad3b0efe8747..debc2ce8d8af 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java +++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java @@ -273,11 +273,15 @@ public class ProtocolHandlerAddon { * structures) of a single * registry key accessible. */ - public static boolean __writeRegistryServiceInfo( - XRegistryKey xRegistryKey ) { - return Factory.writeRegistryServiceInfo( - ProtocolHandlerAddonImpl.class.getName(), - ProtocolHandlerAddonImpl.getServiceNames(), - 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( +// ProtocolHandlerAddonImpl.class.getName(), +// ProtocolHandlerAddonImpl.getServiceNames(), +// xRegistryKey ); +// } } diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/Makefile b/odk/examples/DevelopersGuide/Components/CppComponent/Makefile index 0a4e7eee4cae..b89d58bd6211 100644 --- a/odk/examples/DevelopersGuide/Components/CppComponent/Makefile +++ b/odk/examples/DevelopersGuide/Components/CppComponent/Makefile @@ -49,7 +49,7 @@ SAMPLE_SLO_OUT=$(OUT_SLO)/$(SAMPLE_NAME) SAMPLE_OBJ_OUT=$(OUT_OBJ)/$(SAMPLE_NAME) COMP_NAME=CppComponent -COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT) +COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT) APP1_NAME= TestCppComponent APP1_BINARY= $(OUT_BIN)/$(APP1_NAME)$(EXE_EXT) @@ -59,7 +59,8 @@ COMP_RDB = $(SAMPLE_GEN_OUT)/$(COMP_RDB_NAME) COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT) COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)") COMP_UNOPKG_MANIFEST = $(SAMPLE_GEN_OUT)/$(COMP_NAME)/META-INF/manifest.xml -COMP_MAPFILE = $(SAMPLE_GEN_OUT)/$(COMP_NAME).uno.map +#COMP_MAPFILE = $(SAMPLE_GEN_OUT)/$(COMP_NAME).uno.map +COMP_COMPONENTS = $(SAMPLE_GEN_OUT)/$(COMP_NAME).components COMP_REGISTERFLAG = $(SAMPLE_GEN_OUT)/devguide_$(COMP_NAME)_register_component.flag COMP_TYPEFLAG = $(SAMPLE_GEN_OUT)/devguide_$(COMP_NAME)_types.flag @@ -103,12 +104,12 @@ $(SAMPLE_SLO_OUT)/%.$(OBJ_EXT) : %.cxx $(COMP_TYPEFLAG) -$(MKDIR) $(subst /,$(PS),$(@D)) $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(SAMPLE_INC_OUT) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $< -$(COMP_MAPFILE) : $(SLOFILES) - -$(MKDIR) $(subst /,$(PS),$(@D)) - cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE) -ifeq "$(OS)" "MACOSX" - nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE) -endif +#$(COMP_MAPFILE) : $(SLOFILES) +# -$(MKDIR) $(subst /,$(PS),$(@D)) +# cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE) +#ifeq "$(OS)" "MACOSX" +# nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE) +#endif ifeq "$(OS)" "WIN" $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) @@ -119,7 +120,8 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib $(LINK_MANIFEST) else -$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) +#$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) +$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) && $(DEL) $(subst \\,\,$(subst /,$(PS),$@)) $(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \ $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB) @@ -136,16 +138,31 @@ $(SAMPLE_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 $(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=native;platform=$(UNOPKG_PLATFORM)$(QM)" >> $@ - @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(subst /META-INF,,$(subst $(SAMPLE_GEN_OUT)/,,$(UNOPKG_PLATFORM)/$(@D))).uno.$(SHAREDLIB_EXT)$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components;platform=$(UNOPKG_PLATFORM)$(QM)">> $@ + @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ -$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) $(COMP_RDB) $(COMP_UNOPKG_MANIFEST) +$(COMP_COMPONENTS) : + -$(MKDIR) $(subst /,$(PS),$(@D)) + @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@ + @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(UNOPKG_PLATFORM)/$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)my_module.my_sc_implementation.MyService1$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)my_module.MyService1$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)my_module.my_sc_implementation.MyService2$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)my_module.MyService2$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@ + @echo $(OSEP)/components$(CSEP) >> $@ + +$(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) $(COMP_RDB) $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) -$(MKDIR) $(subst /,$(PS),$(SAMPLE_GEN_OUT)/$(UNOPKG_PLATFORM)) $(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(SAMPLE_GEN_OUT)/$(UNOPKG_PLATFORM)) - cd $(subst /,$(PS),$(SAMPLE_GEN_OUT)) && $(SDK_ZIP) ../../bin/$(@F) $(COMP_RDB_NAME) $(UNOPKG_PLATFORM)/$( SAL_CALL create_MyService2Impl( } /* -extern "C" void SAL_CALL component_getImplementationEnvironment( +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( sal_Char const ** ppEnvTypeName, uno_Environment ** ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -extern "C" sal_Bool SAL_CALL component_writeInfo( - lang::XMultiServiceFactory * xMgr, registry::XRegistryKey * xRegistry ) -{ - if (xRegistry) - { - try - { - // implementation of MyService1A - Reference< registry::XRegistryKey > xKey( - xRegistry->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( - "my_module.my_sc_implementation.MyService1/UNO/SERVICES") ) ) ); - // subkeys denote implemented services of implementation - xKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( - "my_module.MyService1") ) ); - // implementation of MyService1B - xKey = xRegistry->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( - "my_module.my_sc_implementation.MyService2/UNO/SERVICES") ) ); - // subkeys denote implemented services of implementation - xKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( - "my_module.MyService2") ) ); - return sal_True; // success - } - catch (registry::InvalidRegistryException &) - { - // function fails if exception caught - } - } - return sal_False; -} -extern "C" void * SAL_CALL component_getFactory( +// This method not longer necessary since OOo 3.4 where the component registration was +// was changed to passive component registration. For more details see +// http://wiki.services.openoffice.org/wiki/Passive_Component_Registration +// +// extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( +// lang::XMultiServiceFactory * xMgr, registry::XRegistryKey * xRegistry ) +// { +// if (xRegistry) +// { +// try +// { +// // implementation of MyService1A +// Reference< registry::XRegistryKey > xKey( +// xRegistry->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( +// "my_module.my_sc_implementation.MyService1/UNO/SERVICES") ) ) ); +// // subkeys denote implemented services of implementation +// xKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( +// "my_module.MyService1") ) ); +// // implementation of MyService1B +// xKey = xRegistry->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( +// "my_module.my_sc_implementation.MyService2/UNO/SERVICES") ) ); +// // subkeys denote implemented services of implementation +// xKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( +// "my_module.MyService2") ) ); +// return sal_True; // success +// } +// catch (registry::InvalidRegistryException &) +// { +// // function fails if exception caught +// } +// } +// return sal_False; +// } + +extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( sal_Char const * implName, lang::XMultiServiceFactory * xMgr, void * ) { Reference< lang::XSingleComponentFactory > xFactory; diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx b/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx index 8589f8e88ab7..8876c2381870 100644 --- a/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx +++ b/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx @@ -199,20 +199,25 @@ static struct ::cppu::ImplementationEntry s_component_entries [] = extern "C" { -void SAL_CALL component_getImplementationEnvironment( +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( sal_Char const ** ppEnvTypeName, uno_Environment ** ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -sal_Bool SAL_CALL component_writeInfo( - lang::XMultiServiceFactory * xMgr, registry::XRegistryKey * xRegistry ) -{ - return ::cppu::component_writeInfoHelper( - xMgr, xRegistry, ::my_sc_impl::s_component_entries ); -} +// This method not longer necessary since OOo 3.4 where the component registration was +// was changed to passive component registration. For more details see +// http://wiki.services.openoffice.org/wiki/Passive_Component_Registration +// +// sal_Bool SAL_CALL component_writeInfo( +// lang::XMultiServiceFactory * xMgr, registry::XRegistryKey * xRegistry ) +// { +// return ::cppu::component_writeInfoHelper( +// xMgr, xRegistry, ::my_sc_impl::s_component_entries ); +// } + -void * SAL_CALL component_getFactory( +SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( sal_Char const * implName, lang::XMultiServiceFactory * xMgr, registry::XRegistryKey * xRegistry ) { diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java b/odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java index 05662e9d884a..15980bb04a64 100644 --- a/odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java +++ b/odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java @@ -57,7 +57,7 @@ public class TestServiceProvider return xSingleServiceFactory; } - // This method not longer necessary since OOo 3.4 where the component registration was + // 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 diff --git a/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java b/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java index f76f6e2ec56a..d7b6716dcdcc 100644 --- a/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java +++ b/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java @@ -148,7 +148,7 @@ public class LicenseTest { * @param regKey the registryKey * @see com.sun.star.comp.loader.JavaLoader */ - // This method not longer necessary since OOo 3.4 where the component registration was + // 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 diff --git a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java index f10256939a4f..9d6409e26674 100644 --- a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java +++ b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java @@ -316,7 +316,7 @@ public class DialogComponent { * @param regKey the registryKey * @see com.sun.star.comp.loader.JavaLoader */ - // This method not longer necessary since OOo 3.4 where the component registration was + // 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 diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java index 8ef02f641b7a..475fb4963dbc 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java +++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java @@ -723,9 +723,10 @@ public class AsciiReplaceFilter * * @see com.sun.star.comp.loader.JavaLoader */ - // This method not longer necessary since OOo 3.4 where the component registration was + // 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( com.sun.star.registry.XRegistryKey xRegistryKey ) // { // return Factory.writeRegistryServiceInfo( diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java index 307196289f6f..689d9b84fac6 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java +++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java @@ -264,9 +264,10 @@ public class FlatXml implements XImportFilter, XExportFilter, XServiceName, return xSingleServiceFactory; } - // This method not longer necessary since OOo 3.4 where the component registration was + // 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(__implName, diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/Makefile b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/Makefile index c2ac5900e862..83491a844dfb 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/Makefile +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/Makefile @@ -45,29 +45,32 @@ include $(SETTINGS)/dk.mk EXAMPLE_NAME=OfficeDevLinguisticExample OUT_COMP_CLASS = $(OUT_CLASS)/$(EXAMPLE_NAME) -COMPONENT1_NAME=SampleHyphenator -COMPONENT1_PACKAGE = $(OUT_BIN)/$(COMPONENT1_NAME).$(UNOOXT_EXT) -COMPONENT1_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMPONENT1_NAME).$(UNOOXT_EXT)") -COMPONENT1_JAR_NAME = $(COMPONENT1_NAME).uno.jar -COMPONENT1_JAR = $(OUT_COMP_CLASS)/$(COMPONENT1_JAR_NAME) -COMPONENT1_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMPONENT1_NAME).uno.Manifest -COMPONENT1_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMPONENT1_NAME)/META-INF/manifest.xml - -COMPONENT2_NAME=SampleSpellChecker -COMPONENT2_PACKAGE = $(OUT_BIN)/$(COMPONENT2_NAME).$(UNOOXT_EXT) -COMPONENT2_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMPONENT2_NAME).$(UNOOXT_EXT)") -COMPONENT2_JAR_NAME = $(COMPONENT2_NAME).uno.jar -COMPONENT2_JAR = $(OUT_COMP_CLASS)/$(COMPONENT2_JAR_NAME) -COMPONENT2_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMPONENT2_NAME).uno.Manifest -COMPONENT2_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMPONENT2_NAME)/META-INF/manifest.xml - -COMPONENT3_NAME=SampleThesaurus -COMPONENT3_PACKAGE = $(OUT_BIN)/$(COMPONENT3_NAME).$(UNOOXT_EXT) -COMPONENT3_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMPONENT3_NAME).$(UNOOXT_EXT)") -COMPONENT3_JAR_NAME = $(COMPONENT3_NAME).uno.jar -COMPONENT3_JAR = $(OUT_COMP_CLASS)/$(COMPONENT3_JAR_NAME) -COMPONENT3_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMPONENT3_NAME).uno.Manifest -COMPONENT3_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMPONENT3_NAME)/META-INF/manifest.xml +COMP1_NAME=SampleHyphenator +COMP1_PACKAGE = $(OUT_BIN)/$(COMP1_NAME).$(UNOOXT_EXT) +COMP1_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP1_NAME).$(UNOOXT_EXT)") +COMP1_JAR_NAME = $(COMP1_NAME).uno.jar +COMP1_JAR = $(OUT_COMP_CLASS)/$(COMP1_JAR_NAME) +COMP1_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMP1_NAME).uno.Manifest +COMP1_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP1_NAME)/META-INF/manifest.xml +COMP1_COMPONENTS=$(COMP1_NAME).components + +COMP2_NAME=SampleSpellChecker +COMP2_PACKAGE = $(OUT_BIN)/$(COMP2_NAME).$(UNOOXT_EXT) +COMP2_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP2_NAME).$(UNOOXT_EXT)") +COMP2_JAR_NAME = $(COMP2_NAME).uno.jar +COMP2_JAR = $(OUT_COMP_CLASS)/$(COMP2_JAR_NAME) +COMP2_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMP2_NAME).uno.Manifest +COMP2_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP2_NAME)/META-INF/manifest.xml +COMP2_COMPONENTS=$(COMP2_NAME).components + +COMP3_NAME=SampleThesaurus +COMP3_PACKAGE = $(OUT_BIN)/$(COMP3_NAME).$(UNOOXT_EXT) +COMP3_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP3_NAME).$(UNOOXT_EXT)") +COMP3_JAR_NAME = $(COMP3_NAME).uno.jar +COMP3_JAR = $(OUT_COMP_CLASS)/$(COMP3_JAR_NAME) +COMP3_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMP3_NAME).uno.Manifest +COMP3_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP3_NAME)/META-INF/manifest.xml +COMP3_COMPONENTS=$(COMP2_NAME).components APP1_NAME=LinguisticExamples APP1_JAR=$(OUT_COMP_CLASS)/$(APP1_NAME).jar @@ -89,22 +92,22 @@ JAVAFILES = \ CLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/%.class,$(JAVAFILES)) -$(COMPONENT1_NAME)_CLASSFILES = XHyphenatedWord_impl.class \ +$(COMP1_NAME)_CLASSFILES = XHyphenatedWord_impl.class \ XPossibleHyphens_impl.class \ PropChgHelper.class \ PropChgHelper_Hyph.class \ OneInstanceFactory.class \ - $(COMPONENT1_NAME).class + $(COMP1_NAME).class -$(COMPONENT2_NAME)_CLASSFILES = XSpellAlternatives_impl.class \ +$(COMP2_NAME)_CLASSFILES = XSpellAlternatives_impl.class \ PropChgHelper_Spell.class \ PropChgHelper.class \ OneInstanceFactory.class \ - $(COMPONENT2_NAME).class + $(COMP2_NAME).class -$(COMPONENT3_NAME)_CLASSFILES = XMeaning_impl.class \ +$(COMP3_NAME)_CLASSFILES = XMeaning_impl.class \ OneInstanceFactory.class \ - $(COMPONENT3_NAME).class + $(COMP3_NAME).class SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\ $(PATH_SEPARATOR)$(OUT_COMP_CLASS)) @@ -126,67 +129,59 @@ $(CLASSFILES) : $(JAVAFILES) # rules for the component jars and the packages doesn't work proper and we # defined explicit rules -#$(OUT_COMP_CLASS)/%.jar : $(OUT_COMP_CLASS)/%.Manifest $(CLASSFILES) -# -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -# -$(MKDIR) $(subst /,$(PS),$(@D)) -# cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $( $@ @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_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)$(subst /META-INF,,$(subst $(OUT_COMP_CLASS)/,,$(@D))).components$(QM)"/$(CSEP) >> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ -#$(OUT_BIN)/%.uno.pkg : $(OUT_COMP_CLASS)/%.uno.jar $(OUT_COMP_CLASS)/%/META-INF/manifest.xml -# -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -# -$(MKDIR) $(subst /,$(PS),$(@D)) -# cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) ../../bin/$(@F) $( $(subst /,$(PS),$@) else @echo -------------------------------------------------------------------------------- @@ -220,8 +215,8 @@ $(EXAMPLE_NAME) : $(REGISTERFLAG) $(APP1_JAR) @echo - @echo $(MAKE) $(APP1_NAME).run @echo -------- - @echo Before you can run the examples the components "$(QM)$(COMPONENT1_NAME)$(QM)", - @echo "$(QM)$(COMPONENT2_NAME)$(QM)" and "$(QM)$(COMPONENT3_NAME)$(QM)" must be deployed. + @echo Before you can run the examples the components "$(QM)$(COMP1_NAME)$(QM)", + @echo "$(QM)$(COMP2_NAME)$(QM)" and "$(QM)$(COMP3_NAME)$(QM)" must be deployed. @echo The components will be automatically deployed if SDK_AUTO_DEPLOYMENT = YES. @echo -------------------------------------------------------------------------------- @@ -231,7 +226,7 @@ $(EXAMPLE_NAME) : $(REGISTERFLAG) $(APP1_JAR) .PHONY: clean clean : -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS)) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT1_PACKAGE_URL))) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT2_PACKAGE_URL))) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT3_PACKAGE_URL))) + -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP1_PACKAGE_URL))) + -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP2_PACKAGE_URL))) + -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP3_PACKAGE_URL))) -$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG))) diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java index adad109f9a87..8008fcd5affd 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java @@ -488,7 +488,7 @@ public class SampleHyphenator extends ComponentBase implements // __________ static things __________ - public static String _aSvcImplName = "com.sun.star.linguistic2.JavaSamples.SampleHyphenator"; + public static String _aSvcImplName = SampleHyphenator.class.getName(); public static String[] getSupportedServiceNames_Static() { @@ -531,18 +531,22 @@ public class SampleHyphenator extends ComponentBase implements * @param xRegKey the registryKey * @see com.sun.star.comp.loader.JavaLoader */ - public static boolean __writeRegistryServiceInfo( - com.sun.star.registry.XRegistryKey xRegKey ) - { - boolean bResult = true; - String[] aServices = getSupportedServiceNames_Static(); - int i, nLength = aServices.length; - for( i = 0; i < nLength; ++i ) - { - bResult = bResult && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo( - _aSvcImplName, aServices[i], xRegKey ); - } - return bResult; - } + // 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( +// com.sun.star.registry.XRegistryKey xRegKey ) +// { +// boolean bResult = true; +// String[] aServices = getSupportedServiceNames_Static(); +// int i, nLength = aServices.length; +// for( i = 0; i < nLength; ++i ) +// { +// bResult = bResult && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo( +// _aSvcImplName, aServices[i], xRegKey ); +// } +// return bResult; +// } } diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java index 9e2cd5a81853..6d28867a3e1d 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java @@ -431,7 +431,7 @@ public class SampleSpellChecker extends ComponentBase implements // __________ static things __________ - public static String _aSvcImplName = "com.sun.star.linguistic2.JavaSamples.SampleSpellChecker"; + public static String _aSvcImplName = SampleSpellChecker.class.getName(); public static String[] getSupportedServiceNames_Static() { @@ -474,18 +474,22 @@ public class SampleSpellChecker extends ComponentBase implements * @param xRegKey the registryKey * @see com.sun.star.comp.loader.JavaLoader */ - public static boolean __writeRegistryServiceInfo( - com.sun.star.registry.XRegistryKey xRegKey ) - { - boolean bResult = true; - String[] aServices = getSupportedServiceNames_Static(); - int i, nLength = aServices.length; - for( i = 0; i < nLength; ++i ) - { - bResult = bResult && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo( - _aSvcImplName, aServices[i], xRegKey ); - } - return bResult; - } + // 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( +// com.sun.star.registry.XRegistryKey xRegKey ) +// { +// boolean bResult = true; +// String[] aServices = getSupportedServiceNames_Static(); +// int i, nLength = aServices.length; +// for( i = 0; i < nLength; ++i ) +// { +// bResult = bResult && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo( +// _aSvcImplName, aServices[i], xRegKey ); +// } +// return bResult; +// } } diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java index 7e5bbb1bf442..fd56a5683882 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java @@ -268,7 +268,7 @@ public class SampleThesaurus extends ComponentBase implements // __________ static things __________ - public static String _aSvcImplName = "com.sun.star.linguistic2.JavaSamples.SampleThesaurus"; + public static String _aSvcImplName = SampleThesaurus.class.getName(); public static String[] getSupportedServiceNames_Static() { @@ -311,18 +311,22 @@ public class SampleThesaurus extends ComponentBase implements * @param xRegKey the registryKey * @see com.sun.star.comp.loader.JavaLoader */ - public static boolean __writeRegistryServiceInfo( - com.sun.star.registry.XRegistryKey xRegKey ) - { - boolean bResult = true; - String[] aServices = getSupportedServiceNames_Static(); - int i, nLength = aServices.length; - for( i = 0; i < nLength; ++i ) - { - bResult = bResult && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo( - _aSvcImplName, aServices[i], xRegKey ); - } - return bResult; - } + // 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( +// com.sun.star.registry.XRegistryKey xRegKey ) +// { +// boolean bResult = true; +// String[] aServices = getSupportedServiceNames_Static(); +// int i, nLength = aServices.length; +// for( i = 0; i < nLength; ++i ) +// { +// bResult = bResult && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo( +// _aSvcImplName, aServices[i], xRegKey ); +// } +// return bResult; +// } } diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java index 44f17a50c83d..d44de20e345e 100644 --- a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java +++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java @@ -116,7 +116,7 @@ public class ExampleAddIn { static private final String aExampleService = "org.openoffice.sheet.addin.ExampleAddIn"; static private final String aAddInService = "com.sun.star.sheet.AddIn"; - static private final String aImplName = "ExampleAddIn"; + static private final String aImplName = _ExampleAddIn.class.getName(); private static final short FUNCTION_INVALID = -1; private static final short FUNCTION_INCREMENT = 0; @@ -301,14 +301,18 @@ public class ExampleAddIn return xSingleServiceFactory; } - public static boolean __writeRegistryServiceInfo( - com.sun.star.registry.XRegistryKey regKey) - { - // register for both the base AddIn and the own service - return com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo( - _ExampleAddIn.aImplName, _ExampleAddIn.aExampleService, regKey) - && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo( - _ExampleAddIn.aImplName, _ExampleAddIn.aAddInService, 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( +// com.sun.star.registry.XRegistryKey regKey) +// { +// // register for both the base AddIn and the own service +// return com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo( +// _ExampleAddIn.aImplName, _ExampleAddIn.aExampleService, regKey) +// && com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo( +// _ExampleAddIn.aImplName, _ExampleAddIn.aAddInService, regKey); +// } } diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java b/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java index 80f5ff15a4d2..8c827d0cc2f8 100644 --- a/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java +++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java @@ -765,7 +765,7 @@ public class ExampleDataPilotSource com.sun.star.lang.XServiceInfo { static private final String aServiceName = "com.sun.star.sheet.DataPilotSource"; - static private final String aImplName = "ExampleDataPilotSource"; + static private final String aImplName = _ExampleDataPilotSource.class.getName(); private ExampleSettings aSettings = new ExampleSettings(); private ExampleDimensions aDimensions; @@ -780,27 +780,34 @@ public class ExampleDataPilotSource { // If the first argument (Source) is a number between 2 and 10, // use it as member count, otherwise keep the default value. - if ( aArguments.length >= 1 ) + try { - String aSource = (String) aArguments[0]; - if ( aSource != null ) - { - try - { - int nValue = Integer.parseInt( aSource ); - if ( nValue >= 2 && nValue <= 10 ) - aSettings.nMemberCount = nValue; - } - catch ( NumberFormatException e ) - { - System.out.println( "Error: caught exception in " + - "ExampleDataPilotSource.initialize!\nException Message = " - + e.getMessage()); - e.printStackTrace(); - } - } + if ( aArguments.length >= 1 ) + { + String aSource = com.sun.star.uno.AnyConverter.toString(aArguments[0]); + if ( aSource != null && aSource.length() > 0) + { + int nValue = Integer.parseInt( aSource ); + if ( nValue >= 2 && nValue <= 10 ) + aSettings.nMemberCount = nValue; } } + } + catch ( NumberFormatException e ) + { + System.out.println( "Error: caught exception in " + + "ExampleDataPilotSource.initialize!\nException Message = " + + e.getMessage()); + e.printStackTrace(); + } + catch ( com.sun.star.lang.IllegalArgumentException e ) + { + System.out.println( "Error: caught exception in " + + "ExampleDataPilotSource.initialize!\nException Message = " + + e.getMessage()); + e.printStackTrace(); + } + } // XDataPilotResults @@ -970,12 +977,16 @@ public class ExampleDataPilotSource return xSingleServiceFactory; } - public static boolean __writeRegistryServiceInfo( - com.sun.star.registry.XRegistryKey regKey) - { - return com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo( - _ExampleDataPilotSource.aImplName, - _ExampleDataPilotSource.aServiceName, 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( +// com.sun.star.registry.XRegistryKey regKey) +// { +// return com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo( +// _ExampleDataPilotSource.aImplName, +// _ExampleDataPilotSource.aServiceName, regKey); +// } } diff --git a/odk/examples/DevelopersGuide/Spreadsheet/Makefile b/odk/examples/DevelopersGuide/Spreadsheet/Makefile index 3c1748327bac..84fdd9432dd8 100644 --- a/odk/examples/DevelopersGuide/Spreadsheet/Makefile +++ b/odk/examples/DevelopersGuide/Spreadsheet/Makefile @@ -59,6 +59,7 @@ COMP1_JAR=$(SAMPLE_CLASS_OUT)/$(COMP1_JAR_NAME) COMP1_MANIFESTFILE=$(COMP1_GEN_OUT)/$(COMP1_NAME).uno.Manifest COMP1_UNOPKG_MANIFEST=$(COMP1_GEN_OUT)/$(COMP1_NAME)/META-INF/manifest.xml COMP1_REGISTERFLAG=$(SAMPLE_GEN_OUT)/devguide_$(COMP1_NAME)_register_component.flag +COMP1_COMPONENTS=$(COMP1_NAME).components # Example DataPilot component COMP2_NAME=ExampleDataPilotSource @@ -71,6 +72,7 @@ COMP2_JAR=$(SAMPLE_CLASS_OUT)/$(COMP2_JAR_NAME) COMP2_MANIFESTFILE=$(COMP2_GEN_OUT)/$(COMP2_NAME).uno.Manifest COMP2_UNOPKG_MANIFEST=$(COMP2_GEN_OUT)/$(COMP2_NAME)/META-INF/manifest.xml COMP2_REGISTERFLAG=$(SAMPLE_GEN_OUT)/devguide_$(COMP2_NAME)_register_component.flag +COMP2_COMPONENTS=$(COMP2_NAME).components #REGISTERFLAG = $(OUT_MISC)$(PS)devguide_$(SAMPLE_NAME)_register_component.flag @@ -176,8 +178,8 @@ $(COMP1_UNOPKG_MANIFEST) : @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 $(COMP1_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 $(COMP1_GEN_OUT)/,,$(@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)$(COMP1_COMPONENTS)$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ $(COMP2_UNOPKG_MANIFEST) : @@ -185,22 +187,24 @@ $(COMP2_UNOPKG_MANIFEST) : @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 $(COMP2_GEN_OUT)/,,$(@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)$(COMP2_COMPONENTS)$(QM)"/$(CSEP)>> $@ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@ -$(COMP1_PACKAGE) : $(COMP1_RDB) $(COMP1_JAR) $(COMP1_UNOPKG_MANIFEST) +$(COMP1_PACKAGE) : $(COMP1_RDB) $(COMP1_JAR) $(COMP1_UNOPKG_MANIFEST) $(COMP1_COMPONENTS) echo "####" $(@) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) - cd $(subst /,$(PS),$(COMP1_GEN_OUT)) && $(SDK_ZIP) ../../../bin/$(@F) $( Date: Tue, 22 Feb 2011 16:34:11 +0100 Subject: jsc340: i114609: support passive component registration --- .../DevelopersGuide/Charts/JavaSampleChartAddIn.components | 10 ++++++++++ .../Components/Addons/JobsAddon/AsyncJob.components | 8 ++++++++ .../ProtocolHandlerAddon_java.components | 8 ++++++++ .../OfficeDev/Linguistic/SampleHyphenator.components | 8 ++++++++ .../OfficeDev/Linguistic/SampleSpellChecker.components | 8 ++++++++ .../OfficeDev/Linguistic/SampleThesaurus.components | 8 ++++++++ .../DevelopersGuide/Spreadsheet/ExampleAddIn.components | 9 +++++++++ .../Spreadsheet/ExampleDataPilotSource.components | 8 ++++++++ 8 files changed, 67 insertions(+) create mode 100644 odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.components create mode 100644 odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.components create mode 100644 odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon_java.components create mode 100644 odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.components create mode 100644 odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.components create mode 100644 odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.components create mode 100644 odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.components create mode 100644 odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.components (limited to 'odk') diff --git a/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.components b/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.components new file mode 100644 index 000000000000..e9a7baa48056 --- /dev/null +++ b/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.components @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.components b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.components new file mode 100644 index 000000000000..c47f26b0187d --- /dev/null +++ b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.components @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon_java.components b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon_java.components new file mode 100644 index 000000000000..13665ebbc3c5 --- /dev/null +++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon_java.components @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.components b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.components new file mode 100644 index 000000000000..bf083b386a31 --- /dev/null +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.components @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.components b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.components new file mode 100644 index 000000000000..bb489918b843 --- /dev/null +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.components @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.components b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.components new file mode 100644 index 000000000000..025f42451f26 --- /dev/null +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.components @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.components b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.components new file mode 100644 index 000000000000..6212c72d4215 --- /dev/null +++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.components @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.components b/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.components new file mode 100644 index 000000000000..f0881c1f5570 --- /dev/null +++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.components @@ -0,0 +1,8 @@ + + + + + + + + -- cgit From 4ef76a17eed2c60b361961c9c31326ccb164512e Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Wed, 23 Feb 2011 13:37:36 +0100 Subject: jsc340: i114609: support passive component registration --- .../DevelopersGuide/Components/Thumbs/Makefile | 2 +- .../openoffice/comp/test/ImageShrink.components | 8 ++++++++ .../org/openoffice/comp/test/ImageShrink.java | 17 ++++++++++------ .../Thumbs/org/openoffice/comp/test/Makefile | 23 +++++++++++----------- .../Components/Thumbs/org/openoffice/test/Makefile | 4 ++-- .../DevelopersGuide/Components/Thumbs/thumbs.mk | 21 ++++++++++---------- 6 files changed, 45 insertions(+), 30 deletions(-) create mode 100644 odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.components (limited to 'odk') diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/Makefile b/odk/examples/DevelopersGuide/Components/Thumbs/Makefile index 6dffc4cbad7a..7070493a8cf1 100644 --- a/odk/examples/DevelopersGuide/Components/Thumbs/Makefile +++ b/odk/examples/DevelopersGuide/Components/Thumbs/Makefile @@ -59,7 +59,7 @@ $(SUBDIRS) : org/openoffice/comp/test : org/openoffice/test -ComponentsThumbsExample : $(COMPONENT_PACKAGE) +ComponentsThumbsExample : $(COMP_PACKAGE) @echo -------------------------------------------------------------------------------- @echo Please use one of the following command to execute the example! @echo - diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.components b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.components new file mode 100644 index 000000000000..11d958fe82a0 --- /dev/null +++ b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.components @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java index 7fe4307d8a80..5565d7d20780 100644 --- a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java +++ b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java @@ -93,12 +93,17 @@ public class ImageShrink extends WeakBase return xSingleServiceFactory; } - public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { - //System.out.println(ImageShrink.class.getName()); - return FactoryHelper.writeRegistryServiceInfo( ImageShrink.class.getName(), - __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) { +// //System.out.println(ImageShrink.class.getName()); +// return FactoryHelper.writeRegistryServiceInfo( ImageShrink.class.getName(), +// __serviceName, +// regKey); +// } // XFilter implementation (a sub-interface of XImageShrinkFilter) public void cancel() { diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/Makefile b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/Makefile index 2b990e22ae2e..6894e1d9bb49 100644 --- a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/Makefile +++ b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/Makefile @@ -74,7 +74,7 @@ $(OUT_COMP_CLASS)/%.mf : @echo Application-Class: $(subst /,.,$(PACKAGE)).$*>> $@ # rule for component jar file -$(COMPONENT_JAR) : $(COMPONENT_MANIFESTFILE) $(OUT_COMP_CLASS)/$(PACKAGE)/$(COMPONENT_NAME).class +$(COMP_JAR) : $(COMP_MANIFESTFILE) $(OUT_COMP_CLASS)/$(PACKAGE)/$(COMP_NAME).class -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) $(SDK_JAR) cvfm $@ $< -C $(OUT_COMP_CLASS) $(PACKAGE)/$(basename $(basename $(@F))).class $(patsubst %.class,-C $(OUT_COMP_CLASS) %.class,$(GENCLASSNAMES)) @@ -87,18 +87,19 @@ $(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_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_COMPONENTS) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) -$(MKDIR) $(subst /,$(PS),$(@D)) - $(COPY) $(subst /,$(PS),$(COMPONENT_RDB)) $(subst /,$(PS),$(OUT_COMP_CLASS)) - cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) ../../bin/$(@F) $(COMPONENT_RDB_NAME) $(COMPONENT_JAR_NAME) + $(COPY) $(subst /,$(PS),$(COMP_RDB)) $(subst /,$(PS),$(OUT_COMP_CLASS)) + $(SDK_ZIP) $@ $(COMP_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_CLASS)/$(COMPONENT_RDB_NAME))) + $(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_CLASS)/$(COMP_RDB_NAME))) $(APP1_JAR) : $(OUT_COMP_CLASS)/$(APP1_NAME).mf $(OUT_COMP_CLASS)/$(PACKAGE)/$(APP1_NAME).class -$(MKDIR) $(subst /,$(PS),$(@D)) && $(DEL) $(subst \\,\,$(subst /,$(PS),$@)) @@ -106,11 +107,11 @@ $(APP1_JAR) : $(OUT_COMP_CLASS)/$(APP1_NAME).mf $(OUT_COMP_CLASS)/$(PACKAGE)/$(A +$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES) -$(REGISTERFLAG) : $(COMPONENT_PACKAGE) +$(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 -------------------------------------------------------------------------------- @@ -122,7 +123,7 @@ endif .PHONY: clean clean : - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_PACKAGE_URL))) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_JAR))) + -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL))) + -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_JAR))) -$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG))) -$(DEL) $(subst \\,\,$(subst /,$(PS),$(APP1_JAR))) diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/Makefile b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/Makefile index 698670084a23..fc453a11f948 100644 --- a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/Makefile +++ b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/Makefile @@ -64,9 +64,9 @@ $(OUT_COMP_GEN)/%.rdb : $(GENURDFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) $(REGMERGE) $@ /UCR $(GENURDFILES) -$(OUT_COMP_CLASS)/%.class : $(COMPONENT_RDB) +$(OUT_COMP_CLASS)/%.class : $(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) .PHONY: clean clean : diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/thumbs.mk b/odk/examples/DevelopersGuide/Components/Thumbs/thumbs.mk index ae6a5c94f0fa..cec8a3f4c655 100644 --- a/odk/examples/DevelopersGuide/Components/Thumbs/thumbs.mk +++ b/odk/examples/DevelopersGuide/Components/Thumbs/thumbs.mk @@ -1,16 +1,17 @@ OUT_COMP_CLASS = $(OUT_CLASS)/ComponentThumbsExample OUT_COMP_GEN = $(OUT_MISC)/ComponentThumbsExample -COMPONENT_NAME=ImageShrink -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)devguide_$(COMPONENT_NAME)_register_component.flag +COMP_NAME=ImageShrink +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 +REGISTERFLAG = $(OUT_MISC)$(PS)devguide_$(COMP_NAME)_register_component.flag +COMP_COMPONENTS=$(COMP_NAME).components IDL_PACKAGE=org/openoffice/test -- cgit From 6a500920e5e34fc2ed5cd94e7d0b725f0d58b27b Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Wed, 23 Feb 2011 14:27:55 +0100 Subject: jsc340: fix problem with showing Java awt UI from the AppKit thread --- .../Components/Addons/JobsAddon/AsyncJob.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'odk') diff --git a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java index 4a4733c674ed..790a52d46fb1 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java +++ b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java @@ -312,7 +312,22 @@ public class AsyncJob extends WeakBase implements XServiceInfo, XAsyncJob // Because we need a parent anytime. // And showing e.g. a java dialog can make some trouble // inside office ... but we have no chance here. - javax.swing.JOptionPane.showMessageDialog(null, sMessage, sTitle, javax.swing.JOptionPane.INFORMATION_MESSAGE); + final java.lang.String sFinalTitle = sTitle; + final java.lang.String sFinalMessage = sMessage; + + // On Mac OS X, AWT/Swing must not be accessed from the AppKit thread, so call + // SwingUtilities.invokeLater always on a fresh thread to avoid that problem + // (also, the current thread must not wait for that fresh thread to terminate, + // as that would cause a deadlock if this thread is the AppKit thread): + final Runnable doRun = new Runnable() { + public void run() { + javax.swing.JOptionPane.showMessageDialog(null, sFinalMessage, sFinalTitle, javax.swing.JOptionPane.INFORMATION_MESSAGE); + } + }; + + new Thread( doRun ) { + public void run() { javax.swing.SwingUtilities.invokeLater(doRun); } + }.start(); } //___________________________________________ -- cgit From 01f92dfffd32f2c9311b385aaa290d44ed40fa6e Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Mon, 28 Feb 2011 14:10:02 +0100 Subject: jsc340: i114609: adapt examples to work with the URE and use the passive registration --- .../DevelopersGuide/ProfUNO/CppBinding/Makefile | 34 ++--------- odk/examples/cpp/DocumentLoader/DocumentLoader.cxx | 39 +++++-------- odk/examples/cpp/DocumentLoader/Makefile | 37 +++--------- odk/examples/cpp/counter/Makefile | 37 +++++++++--- odk/examples/cpp/counter/counter.cxx | 58 +++++++++--------- odk/examples/cpp/counter/countermain.cxx | 68 ++++++++-------------- odk/examples/cpp/remoteclient/Makefile | 59 ++++++++++--------- odk/examples/cpp/remoteclient/remoteclient.cxx | 54 ++++++++--------- 8 files changed, 171 insertions(+), 215 deletions(-) (limited to 'odk') diff --git a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile index 05880e3acf72..fb235c76dbf7 100644 --- a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile +++ b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile @@ -49,17 +49,11 @@ SAMPLE_OBJ_OUT=$(OUT_OBJ)/$(SAMPLE_NAME) APP1_NAME=office_connect APP1_BINARY=$(OUT_BIN)/$(APP1_NAME)$(EXE_EXT) -APP1_RDB=$(OUT_BIN)/office_connect.rdb -APP1_ENV_FLAG = $(SAMPLE_GEN_OUT)/cpp_$(SAMPLE_NAME)_prepare_env.flag APP2_NAME=string_samples APP2_BINARY=$(OUT_BIN)/$(APP2_NAME)$(EXE_EXT) -ifeq "$(OS)" "WIN" -INI_EXTENSION=.ini -else -INI_EXTENSION=rc -endif +ENV_OFFICE_TYPES=-env:URE_MORE_TYPES=file://$(OFFICE_TYPES) CXXFILES = \ office_connect.cxx \ @@ -72,14 +66,6 @@ ALL : \ include $(SETTINGS)/stdtarget.mk -$(OUT_BIN)/%$(INI_EXTENSION) : %$(INI_EXTENSION) - -$(MKDIR) $(subst /,$(PS),$(@D)) - $(COPY) $< $(subst /,$(PS),$@) - -$(OUT_BIN)/%.rdb : - -$(MKDIR) $(subst /,$(PS),$(@D)) - $(REGMERGE) $@ / $(URE_TYPES) $(OFFICE_TYPES) - $(SAMPLE_OBJ_OUT)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG) -$(MKDIR) $(subst /,$(PS),$(@D)) $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(SAMPLE_INC_OUT) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $< @@ -98,23 +84,10 @@ ifeq "$(OS)" "MACOSX" endif endif -$(OUT_BIN)/office_connect$(EXE_EXT) : $(APP1_ENV_FLAG) $(OUT_BIN)/office_connect$(INI_EXTENSION) $(SAMPLE_OBJ_OUT)/office_connect.$(OBJ_EXT) +$(OUT_BIN)/office_connect$(EXE_EXT) : $(SAMPLE_OBJ_OUT)/office_connect.$(OBJ_EXT) $(OUT_BIN)/string_samples$(EXE_EXT) : $(SAMPLE_OBJ_OUT)/string_samples.$(OBJ_EXT) -$(APP1_ENV_FLAG) : $(APP1_RDB) - -$(MKDIR) $(subst /,$(PS),$(@D)) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) - @echo -------------------------------------------------------------------------------- - @echo Register necessary runtime components in $(APP1_RDB) - @echo -------------------------------------------------------------------------------- - $(REGCOMP) -register -r $(APP1_RDB) -c connector.uno.$(SHAREDLIB_EXT) - $(REGCOMP) -register -r $(APP1_RDB) -c remotebridge.uno.$(SHAREDLIB_EXT) - $(REGCOMP) -register -r $(APP1_RDB) -c bridgefac.uno.$(SHAREDLIB_EXT) - $(REGCOMP) -register -r $(APP1_RDB) -c uuresolver.uno.$(SHAREDLIB_EXT) - @echo bla > $@ - - ProUNOCppBindingExample : $(APP1_BINARY) $(APP2_BINARY) @echo -------------------------------------------------------------------------------- @echo Note: For the "$(QM)$(APP1_NAME)$(QM)" example you need a running office listening @@ -131,6 +104,9 @@ ProUNOCppBindingExample : $(APP1_BINARY) $(APP2_BINARY) %.run: $(OUT_BIN)/%$(EXE_EXT) cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@) +$(API1_NAME).run: $(API1_BINARY) + cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@) $(ENV_OFFICE_TYPES) + .PHONY: clean clean : -$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_INC_OUT)) diff --git a/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx b/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx index a2ea5b4f9107..02eabbc5c3c5 100644 --- a/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx +++ b/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx @@ -48,6 +48,7 @@ #include #include +#include #include #include @@ -71,35 +72,21 @@ using namespace com::sun::star::registry; SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { OUString sConnectionString(RTL_CONSTASCII_USTRINGPARAM("uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager")); - if (argc < 2) + + sal_Int32 nCount = (sal_Int32)rtl_getAppCommandArgCount(); + + if (nCount < 1) { - printf("using: DocumentLoader []\n\n" - "example: DocumentLoader \"file:///e:/temp/test.odt\" \"uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager\"\n"); + printf("using: DocumentLoader -env:URE_MORE_TYPES= []\n\n" + "example: DocumentLoader -env:URE_MORE_TYPES=\"file:///.../basis-link/program/offapi.rdb\" \"file:///e:/temp/test.odt\" \"uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager\"\n"); exit(1); } - if (argc == 3) + if (nCount == 2) { - sConnectionString = OUString::createFromAscii(argv[2]); + rtl_getAppCommandArg(1, &sConnectionString.pData); } - // Creates a simple registry service instance. - Reference< XSimpleRegistry > xSimpleRegistry( - ::cppu::createSimpleRegistry() ); - - // Connects the registry to a persistent data source represented by an URL. - xSimpleRegistry->open( OUString( RTL_CONSTASCII_USTRINGPARAM( - "DocumentLoader.rdb") ), sal_True, sal_False ); - - /* Bootstraps an initial component context with service manager upon a given - registry. This includes insertion of initial services: - - (registry) service manager, shared lib loader, - - simple registry, nested registry, - - implementation registration - - registry typedescription provider, typedescription manager (also - installs it into cppu core) - */ - Reference< XComponentContext > xComponentContext( - ::cppu::bootstrap_InitialComponentContext( xSimpleRegistry ) ); + Reference< XComponentContext > xComponentContext(::cppu::defaultBootstrap_InitialComponentContext()); /* Gets the service manager instance to be used (or null). This method has been added for convenience, because the service manager is a often used @@ -151,9 +138,11 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) /* Loads a component specified by an URL into the specified new or existing frame. */ - OUString sAbsoluteDocUrl, sWorkingDir, sDocPathUrl; + OUString sAbsoluteDocUrl, sWorkingDir, sDocPathUrl, sArgDocUrl; + rtl_getAppCommandArg(0, &sArgDocUrl.pData); + osl_getProcessWorkingDir(&sWorkingDir.pData); - osl::FileBase::getFileURLFromSystemPath( OUString::createFromAscii(argv[1]), sDocPathUrl); + osl::FileBase::getFileURLFromSystemPath( sArgDocUrl, sDocPathUrl); osl::FileBase::getAbsoluteFileURL( sWorkingDir, sDocPathUrl, sAbsoluteDocUrl); Reference< XComponent > xComponent = xComponentLoader->loadComponentFromURL( diff --git a/odk/examples/cpp/DocumentLoader/Makefile b/odk/examples/cpp/DocumentLoader/Makefile index 91e6f49ce41e..3e7b904daf2c 100644 --- a/odk/examples/cpp/DocumentLoader/Makefile +++ b/odk/examples/cpp/DocumentLoader/Makefile @@ -43,19 +43,17 @@ include $(SETTINGS)/dk.mk # Define non-platform/compiler specific settings COMPONENT_NAME=DocumentLoader -COMPONENT_RDB_NAME = $(COMPONENT_NAME).rdb -COMPONENT_RDB = $(OUT_BIN)/$(COMPONENT_RDB_NAME) OUT_COMP_INC = $(OUT_INC)/$(COMPONENT_NAME) OUT_COMP_GEN = $(OUT_MISC)/$(COMPONENT_NAME) OUT_COMP_OBJ=$(OUT_OBJ)/$(COMPONENT_NAME) -COMPOENNT_ENV_FLAG = $(OUT_MISC)/cpp_$(COMPONENT_NAME)_prepare_env.flag - CXXFILES = DocumentLoader.cxx OBJFILES = $(patsubst %.cxx,$(OUT_SLO_COMP)/%.$(OBJ_EXT),$(CXXFILES)) +ENV_OFFICE_TYPES=-env:URE_MORE_TYPES=file://$(OFFICE_TYPES) + # Targets .PHONY: ALL ALL : \ @@ -63,12 +61,6 @@ ALL : \ include $(SETTINGS)/stdtarget.mk -# This example type library will be extended by the URE and office types -$(OUT_BIN)/%.rdb : - -$(MKDIR) $(subst /,$(PS),$(@D)) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) - $(REGMERGE) $@ / $(URE_TYPES) $(OFFICE_TYPES) - $(OUT_COMP_OBJ)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG) -$(MKDIR) $(subst /,$(PS),$(@D)) $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $< @@ -87,41 +79,30 @@ ifeq "$(OS)" "MACOSX" endif endif -$(COMPOENNT_ENV_FLAG) : $(COMPONENT_RDB) - -$(MKDIR) $(subst /,$(PS),$(@D)) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) - @echo -------------------------------------------------------------------------------- - @echo Register necessary runtime components in the DocumentLoader.rdb - @echo -------------------------------------------------------------------------------- - $(REGCOMP) -register -r $(COMPONENT_RDB) -c connector.uno.$(SHAREDLIB_EXT) - $(REGCOMP) -register -r $(COMPONENT_RDB) -c remotebridge.uno.$(SHAREDLIB_EXT) - $(REGCOMP) -register -r $(COMPONENT_RDB) -c bridgefac.uno.$(SHAREDLIB_EXT) - $(REGCOMP) -register -r $(COMPONENT_RDB) -c uuresolver.uno.$(SHAREDLIB_EXT) - @echo bla > $@ - -CppDocumentLoaderExample : $(OUT_BIN)/DocumentLoader$(EXE_EXT) $(COMPOENNT_ENV_FLAG) +CppDocumentLoaderExample : $(OUT_BIN)/DocumentLoader$(EXE_EXT) @echo -------------------------------------------------------------------------------- @echo The example loads the "$(QM)test.odt$(QM)" document in the DocumentLoader example directory. - @echo I you want to load your own document, please use: DocumentLoader "$(QM)filename$(QM)" [connection_url] + @echo If you want to load your own document, please use: + @echo $(SQM) $(SQM)DocumentLoader -env:URE_MORE_TYPES="$(QM)$(QM)" "$(QM)filename$(QM)" [connection_url] @echo - @echo Use the following command to execute the example! @echo - @echo $(MAKE) DocumentLoader.run @echo - @echo NOTE: This example does not use the new UNO bootstrap mechanism, it uses still a socket - @echo $(SQM) $(SQM)connection. Before you can run this example you have to start your office in listening mode. + @echo $(SQM) $(SQM)connection. The example use the defaultBootstrap_InitialComponentContext method and provides + @echo $(SQM) $(SQM)the additional office types via the UNO environment variable -env:URE_MORE_TYPES=... + @echo $(SQM) $(SQM)Before you can run this example you have to start your office in listening mode. @echo - @echo $(SQM) $(SQM)soffice "$(QM)-accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager$(QM)" @echo -------------------------------------------------------------------------------- %.run: $(OUT_BIN)/DocumentLoader$(EXE_EXT) - cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@) $(subst \\,/,$(subst /,$(PS),"$(OO_SDK_HOME)/examples/cpp/DocumentLoader/test.odt")) + cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@) $(ENV_OFFICE_TYPES) $(subst \\,/,$(subst /,$(PS),"$(OO_SDK_HOME)/examples/cpp/DocumentLoader/test.odt")) .PHONY: clean clean : -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_INC)) -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN)) -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_OBJ)) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPOENNT_ENV_FLAG))) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMPONENT_RDB))) -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/DocumentLoader*)) diff --git a/odk/examples/cpp/counter/Makefile b/odk/examples/cpp/counter/Makefile index 5e7f620a645c..84062dc2dd0d 100644 --- a/odk/examples/cpp/counter/Makefile +++ b/odk/examples/cpp/counter/Makefile @@ -43,7 +43,7 @@ include $(SETTINGS)/dk.mk # Define non-platform/compiler specific settings COMP_NAME=counter -COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT) +COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT) COMP_IMPL=$(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) COMP_RDB_NAME = $(COMP_NAME).uno.rdb COMP_RDB = $(OUT_BIN)/$(COMP_RDB_NAME) @@ -52,6 +52,10 @@ OUT_COMP_INC = $(OUT_INC)/$(COMP_NAME) OUT_COMP_GEN = $(OUT_MISC)/$(COMP_NAME) OUT_COMP_OBJ = $(OUT_OBJ)/$(COMP_NAME) OUT_COMP_SLO = $(OUT_SLO)/$(COMP_NAME) +COMP_SERVICES=$(OUT_BIN)/counterservices.rdb + +ENV_EXAMPLE_TYPES=-env:URE_MORE_TYPES=file://$(COMP_RDB) +ENV_COMP_SERVICES=-env:URE_MORE_SERVICES=file://$(COMP_SERVICES) COMP_TYPEFLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_types.flag @@ -84,12 +88,12 @@ $(OUT_BIN)/%.rdb : $(GENURDFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) $(REGMERGE) $@ /UCR $(GENURDFILES) - $(REGMERGE) $@ / $(URE_TYPES) +# $(REGMERGE) $@ / $(URE_TYPES) $(COMP_TYPEFLAG) : $(COMP_RDB) $(SDKTYPEFLAG) -$(MKDIR) $(subst /,$(PS),$(@D)) -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_TYPEFLAG))) - $(CPPUMAKER) -Gc -BUCR -O$(OUT_COMP_INC) $(TYPESLIST) $(COMP_RDB) + $(CPPUMAKER) -Gc -BUCR -O$(OUT_COMP_INC) $(TYPESLIST) $(COMP_RDB) -X $(URE_TYPES) echo flagged > $@ $(OUT_COMP_OBJ)/%.$(OBJ_EXT) : %.cxx $(COMP_TYPEFLAG) @@ -110,7 +114,7 @@ ifeq "$(OS)" "MACOSX" endif ifeq "$(OS)" "WIN" -$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) +$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) -$(MKDIR) $(subst /,$(PS),$(@D)) -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN)) $(LINK) $(COMP_LINK_FLAGS) /OUT:$@ \ @@ -118,7 +122,8 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib $(LINK_MANIFEST) else -$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) +#$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) +$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) $(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \ $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB) @@ -138,16 +143,33 @@ else $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB) $(STLPORTLIB) $(STDC++LIB) endif +$(COMP_SERVICES) : + -$(MKDIR) $(subst /,$(PS),$(@D)) + @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@ + @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)com.sun.star.comp.example.cpp.Counter$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)foo.Counter$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@ + @echo $(OSEP)/components$(CSEP) >> $@ + -CppCounterExample : $(OUT_BIN)/countermain$(EXE_EXT) $(COMP_IMPL) +CppCounterExample : $(OUT_BIN)/countermain$(EXE_EXT) $(COMP_IMPL) $(COMP_SERVICES) @echo -------------------------------------------------------------------------------- @echo Please use the following command to execute the example! @echo - @echo $(MAKE) countermain.run + @echo - + @echo NOTE: The example makes use of the URE and use the defaultBootstrap_InitialComponentContext method. + @echo $(SQM) $(SQM)The additional example IDL types are provided via the UNO environment variable -env:URE_MORE_TYPES=... + @echo $(SQM) $(SQM)and the example component is made available via -env:URE_MORE_SERVICES=... + @echo $(SQM) $(SQM)Please check the generated $(QM)$(COMP_SERVICES)$(QM) to see how you can specify your own components in such an environment + @echo $(SQM) $(SQM)and how to use the passive UNO registration. @echo -------------------------------------------------------------------------------- %.run: $(OUT_BIN)/countermain$(EXE_EXT) $(COMP_IMPL) - cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@) + cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@) $(ENV_EXAMPLE_TYPES) $(ENV_COMP_SERVICES) .PHONY: clean clean : @@ -159,3 +181,4 @@ clean : -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_RDB))) -$(DEL) $(subst \\,\,$(subst /,$(PS),$(SHAREDLIB_OUT)/$(COMP_NAME).*)) -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/countermain*)) + -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_SERVICES))) diff --git a/odk/examples/cpp/counter/counter.cxx b/odk/examples/cpp/counter/counter.cxx index 0e6dbd0c5eb2..1029fab1f964 100644 --- a/odk/examples/cpp/counter/counter.cxx +++ b/odk/examples/cpp/counter/counter.cxx @@ -167,7 +167,7 @@ Reference< XInterface > SAL_CALL MyCounterImpl_create( /** * Gives the environment this component belongs to. */ -extern "C" void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv) +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } @@ -179,33 +179,33 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(const sal_Char * * @param pServiceManager the service manager * @param pRegistryKey the registry key */ -extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * pRegistryKey) -{ - sal_Bool result = sal_False; - - if (pRegistryKey) - { - try - { - Reference< XRegistryKey > xNewKey( - reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( - OUString( RTL_CONSTASCII_USTRINGPARAM("/" IMPLNAME "/UNO/SERVICES") ) ) ); - - const Sequence< OUString > & rSNL = - MyCounterImpl::getSupportedServiceNames_Static(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - xNewKey->createKey( pArray[nPos] ); - - return sal_True; - } - catch (InvalidRegistryException &) - { - // we should not ignore exceptions - } - } - return result; -} +// extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * pRegistryKey) +// { +// sal_Bool result = sal_False; + +// if (pRegistryKey) +// { +// try +// { +// Reference< XRegistryKey > xNewKey( +// reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( +// OUString( RTL_CONSTASCII_USTRINGPARAM("/" IMPLNAME "/UNO/SERVICES") ) ) ); + +// const Sequence< OUString > & rSNL = +// MyCounterImpl::getSupportedServiceNames_Static(); +// const OUString * pArray = rSNL.getConstArray(); +// for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) +// xNewKey->createKey( pArray[nPos] ); + +// return sal_True; +// } +// catch (InvalidRegistryException &) +// { +// // we should not ignore exceptions +// } +// } +// return result; +// } /** * This function is called to get service factories for an implementation. @@ -215,7 +215,7 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * * @param pRegistryKey the registry key for this component, need for persistent data * @return a component factory */ -extern "C" void * SAL_CALL component_getFactory(const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey) +extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey) { void * pRet = 0; diff --git a/odk/examples/cpp/counter/countermain.cxx b/odk/examples/cpp/counter/countermain.cxx index 0fb4bb1f0ddb..aaaa5f1af7ba 100644 --- a/odk/examples/cpp/counter/countermain.cxx +++ b/odk/examples/cpp/counter/countermain.cxx @@ -68,55 +68,37 @@ using namespace ::rtl; //======================================================================= SAL_IMPLEMENT_MAIN() { - Reference< XSimpleRegistry > xReg = createSimpleRegistry(); - OSL_ENSURE( xReg.is(), "### cannot get service instance of \"com.sun.star.regiystry.SimpleRegistry\"!" ); - - xReg->open(OUString::createFromAscii("counter.uno.rdb"), sal_False, sal_False); - OSL_ENSURE( xReg->isValid(), "### cannot open test registry \"counter.uno.rdb\"!" ); - - Reference< XComponentContext > xContext = bootstrap_InitialComponentContext(xReg); - OSL_ENSURE( xContext.is(), "### cannot creage intial component context!" ); - - Reference< XMultiComponentFactory > xMgr = xContext->getServiceManager(); - OSL_ENSURE( xMgr.is(), "### cannot get initial service manager!" ); - - // register my counter component - Reference< XImplementationRegistration > xImplReg( - xMgr->createInstanceWithContext(OUString::createFromAscii("com.sun.star.registry.ImplementationRegistration"), xContext), UNO_QUERY); - OSL_ENSURE( xImplReg.is(), "### cannot get service instance of \"com.sun.star.registry.ImplementationRegistration\"!" ); - - if (xImplReg.is()) - { - xImplReg->registerImplementation( - OUString::createFromAscii("com.sun.star.loader.SharedLibrary"), // loader for component -#ifdef UNX -#ifdef MACOSX - OUString::createFromAscii("counter.uno.dylib"), // component location -#else - OUString::createFromAscii("counter.uno.so"), // component location -#endif -#else - OUString::createFromAscii("counter.uno.dll"), // component location -#endif - Reference< XSimpleRegistry >() // registry omitted, - // defaulting to service manager registry used - ); - - // get a counter instance - Reference< XInterface > xx ; - xx = xMgr->createInstanceWithContext(OUString::createFromAscii("foo.Counter"), xContext); + try { + + Reference< XComponentContext > xContext(::cppu::defaultBootstrap_InitialComponentContext()); + OSL_ENSURE( xContext.is(), "### bootstrap failed!\n" ); + + Reference< XMultiComponentFactory > xMgr = xContext->getServiceManager(); + OSL_ENSURE( xMgr.is(), "### cannot get initial service manager!" ); + + Reference< XInterface > xx = xMgr->createInstanceWithContext( + OUString::createFromAscii("foo.Counter"), xContext); + + OSL_ENSURE( xx.is(), "### cannot get service instance of \"foo.Counter\"!" ); + Reference< XCountable > xCount( xx, UNO_QUERY ); - OSL_ENSURE( xCount.is(), "### cannot get service instance of \"foo.Counter\"!" ); + OSL_ENSURE( xCount.is(), "### cannot query XCountable interface of service instance \"foo.Counter\"!" ); if (xCount.is()) { - xCount->setCount( 42 ); - fprintf( stdout , "%d," , xCount->getCount() ); - fprintf( stdout , "%d," , xCount->increment() ); - fprintf( stdout , "%d\n" , xCount->decrement() ); + xCount->setCount( 42 ); + fprintf( stdout , "%d," , (int)xCount->getCount() ); + fprintf( stdout , "%d," , (int)xCount->increment() ); + fprintf( stdout , "%d\n" , (int)xCount->decrement() ); } + + Reference< XComponent >::query( xContext )->dispose(); + + } catch( Exception& e) { + printf("Error: caught exception:\n %s\n", + OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US).getStr()); + exit(1); } - Reference< XComponent >::query( xContext )->dispose(); return 0; } diff --git a/odk/examples/cpp/remoteclient/Makefile b/odk/examples/cpp/remoteclient/Makefile index 40d51deb7cf1..50e3545a4c15 100644 --- a/odk/examples/cpp/remoteclient/Makefile +++ b/odk/examples/cpp/remoteclient/Makefile @@ -43,17 +43,19 @@ include $(SETTINGS)/dk.mk # Define non-platform/compiler specific settings COMP_NAME=remoteclientsample -COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT) +COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT) COMP_IMPL=$(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) COMP_RDB_NAME = $(COMP_NAME).uno.rdb COMP_RDB = $(OUT_BIN)/$(COMP_RDB_NAME) COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map +COMP_SERVICES=$(SHAREDLIB_OUT)/remoteclientsample.rdb + +ENV_COMP_SERVICES=-env:URE_MORE_SERVICES=file://$(COMP_SERVICES) OUT_COMP_INC=$(OUT_INC)/$(COMP_NAME) OUT_COMP_GEN=$(OUT_MISC)/$(COMP_NAME) OUT_COMP_SLO=$(OUT_SLO)/$(COMP_NAME) -COMP_ENV_FLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_prepare_env.flag COMP_TYPEFLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_types.flag CXXFILES = remoteclient.cxx @@ -85,7 +87,7 @@ ifeq "$(OS)" "MACOSX" endif ifeq "$(OS)" "WIN" -$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) +$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) -$(MKDIR) $(subst /,$(PS),$(@D)) -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN)) $(LINK) $(COMP_LINK_FLAGS) /OUT:$@ \ @@ -93,7 +95,7 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib $(LINK_MANIFEST) else -$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) +$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) $(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \ $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB) @@ -102,40 +104,41 @@ ifeq "$(OS)" "MACOSX" endif endif -$(COMP_ENV_FLAG) : $(COMP_RDB) $(OUT_BIN)/remoteserver.rdb +$(COMP_SERVICES) : -$(MKDIR) $(subst /,$(PS),$(@D)) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$@)) - @echo -------------------------------------------------------------------------------- - @echo Register necessary runtime components in remoteserver/remoteclientsample rdb - @echo -------------------------------------------------------------------------------- - $(REGCOMP) -register -r $(OUT_BIN)/remoteserver.rdb -c connector.uno.$(SHAREDLIB_EXT) - $(REGCOMP) -register -r $(OUT_BIN)/remoteserver.rdb -c remotebridge.uno.$(SHAREDLIB_EXT) - $(REGCOMP) -register -r $(OUT_BIN)/remoteserver.rdb -c bridgefac.uno.$(SHAREDLIB_EXT) - $(REGCOMP) -register -r $(OUT_BIN)/remoteserver.rdb -c uuresolver.uno.$(SHAREDLIB_EXT) - $(REGCOMP) -register -r $(OUT_BIN)/remoteserver.rdb -c streams.uno.$(SHAREDLIB_EXT) - $(REGCOMP) -register -r $(COMP_RDB) -c connector.uno.$(SHAREDLIB_EXT) - $(REGCOMP) -register -r $(COMP_RDB) -c remotebridge.uno.$(SHAREDLIB_EXT) - $(REGCOMP) -register -r $(COMP_RDB) -c bridgefac.uno.$(SHAREDLIB_EXT) - $(REGCOMP) -register -r $(COMP_RDB) -c uuresolver.uno.$(SHAREDLIB_EXT) - @echo bla > $@ - -CppClientExample : $(COMP_IMPL) $(COMP_ENV_FLAG) + @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@ + @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)com.sun.star.comp.product.example.RemoteClientSample$(QM)"$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)com.sun.star.bridge.example.RemoteClientSample$(QM)"/$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@ + @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@ + @echo $(OSEP)/components$(CSEP) >> $@ + + +#CppClientExample : $(COMP_IMPL) $(COMP_ENV_FLAG) +CppClientExample : $(COMP_IMPL) $(COMP_SERVICES) @echo -------------------------------------------------------------------------------- @echo The remoteclient C++ component can be used by using the uno binary. Use the @echo the follwong command to start the example. The run target starts a remote @echo server and connect with the client to this server. @echo - @echo $(MAKE) remoteclient.run + @echo - + @echo NOTE: The example uses the $(QM)uno$(QM) tool to prepare a working UNO environment. + @echo $(SQM) $(SQM)The example component is made available via -env:URE_MORE_SERVICES=... + @echo $(SQM) $(SQM)Please check the generated $(QM)$(COMP_SERVICES)$(QM) to see how you can specify your own components in such an environment + @echo $(SQM) $(SQM)and how to use the passive UNO registration. @echo -------------------------------------------------------------------------------- -%.run: $(COMP_IMPL) $(COMP_ENV_FLAG) +%.run: $(COMP_IMPL) @echo Start the remote server process ... @echo - ifeq "$(OS)" "WIN" - start uno -rw $(OUT_BIN)/remoteserver.rdb --singleaccept -s com.sun.star.io.Pipe \ + start uno $(ENV_COMP_SERVICES) --singleaccept -s com.sun.star.io.Pipe \ -u "uno:socket,host=localhost,port=2083;urp;MyPipe" else - uno -rw $(OUT_BIN)/remoteserver.rdb --singleaccept -s com.sun.star.io.Pipe \ + uno $(ENV_COMP_SERVICES) --singleaccept -s com.sun.star.io.Pipe \ -u "uno:socket,host=localhost,port=2083;urp;MyPipe" & @echo waiting on the server process ... sleep 5 @@ -145,8 +148,8 @@ endif @echo - @echo Start remote client process ... @echo - - uno -l $(COMP_IMPL) -c com.sun.star.comp.product.example.RemoteClientSample \ - -rw $(COMP_RDB) -- "uno:socket,host=localhost,port=2083;urp;MyPipe" + uno $(ENV_COMP_SERVICES) -s com.sun.star.bridge.example.RemoteClientSample \ + -- "uno:socket,host=localhost,port=2083;urp;MyPipe" @echo - .PHONY: clean @@ -154,7 +157,7 @@ clean : -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_INC)) -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN)) -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_SLO)) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_ENV_FLAG))) -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_TYPEFLAG))) + -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_SERVICES))) -$(DEL) $(subst \\,\,$(subst /,$(PS),$(SHAREDLIB_OUT)/$(COMP_NAME).*)) - -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/remoteserver.rdb)) +# -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/remoteserver.rdb)) diff --git a/odk/examples/cpp/remoteclient/remoteclient.cxx b/odk/examples/cpp/remoteclient/remoteclient.cxx index cbec4d4bf84c..324f27d0bcec 100644 --- a/odk/examples/cpp/remoteclient/remoteclient.cxx +++ b/odk/examples/cpp/remoteclient/remoteclient.cxx @@ -227,39 +227,41 @@ using namespace remotebridges_officeclient; extern "C" { //================================================================================================== -void SAL_CALL component_getImplementationEnvironment( +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//================================================================================================== -sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey ) -{ - if (pRegistryKey) - { - try - { - Reference< XRegistryKey > xNewKey( - reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( - OUString::createFromAscii( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) ); - const Sequence< OUString > & rSNL = getSupportedServiceNames(); - const OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - xNewKey->createKey( pArray[nPos] ); +//================================================================================================== +// SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( +// void * pServiceManager, void * pRegistryKey ) +// { +// if (pRegistryKey) +// { +// try +// { +// Reference< XRegistryKey > xNewKey( +// reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( +// OUString::createFromAscii( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) ); + +// const Sequence< OUString > & rSNL = getSupportedServiceNames(); +// const OUString * pArray = rSNL.getConstArray(); +// for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) +// xNewKey->createKey( pArray[nPos] ); + +// return sal_True; +// } +// catch (InvalidRegistryException &) +// { +// OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); +// } +// } +// return sal_False; +// } - return sal_True; - } - catch (InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; -} //================================================================================================== -void * SAL_CALL component_getFactory( +SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) { void * pRet = 0; -- cgit From 471c9c37fe8a1eb49c3cf9177149020dc7850211 Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Tue, 1 Mar 2011 07:41:02 +0100 Subject: jsc340: i114609: adapt examples to work with the URE and use the passive registration --- odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile | 4 +++- odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connect.ini | 2 -- odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connectrc | 2 -- odk/util/check.pl | 2 ++ 4 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connect.ini delete mode 100644 odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connectrc (limited to 'odk') diff --git a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile index fb235c76dbf7..1ab9cfb31b49 100644 --- a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile +++ b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile @@ -91,7 +91,9 @@ $(OUT_BIN)/string_samples$(EXE_EXT) : $(SAMPLE_OBJ_OUT)/string_samples.$(OBJ_EXT ProUNOCppBindingExample : $(APP1_BINARY) $(APP2_BINARY) @echo -------------------------------------------------------------------------------- @echo Note: For the "$(QM)$(APP1_NAME)$(QM)" example you need a running office listening - @echo $(SQM) $(SQM)on port 2083. Before you run the example you have to start your office with + @echo $(SQM) $(SQM)on port 2083. The example use the defaultBootstrap_InitialComponentContext method and provides + @echo $(SQM) $(SQM)the additional office types via the UNO environment variable -env:URE_MORE_TYPES=... + @echo $(SQM) $(SQM)Before you can run this example you have to start your office in listening mode. @echo - @echo $(SQM) $(SQM)soffice "$(QM)-accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager$(QM)" @echo ----- diff --git a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connect.ini b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connect.ini deleted file mode 100644 index c10b97b57bd3..000000000000 --- a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connect.ini +++ /dev/null @@ -1,2 +0,0 @@ -UNO_TYPES=$SYSBINDIR/office_connect.rdb -UNO_SERVICES=$SYSBINDIR/office_connect.rdb \ No newline at end of file diff --git a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connectrc b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connectrc deleted file mode 100644 index ab2c6f10b7e5..000000000000 --- a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connectrc +++ /dev/null @@ -1,2 +0,0 @@ -UNO_TYPES=$SYSBINDIR/office_connect.rdb -UNO_SERVICES=$SYSBINDIR/office_connect.rdb diff --git a/odk/util/check.pl b/odk/util/check.pl index 6bf3fdd62b2f..490210c382b8 100644 --- a/odk/util/check.pl +++ b/odk/util/check.pl @@ -347,7 +347,9 @@ if (-d "$StartDir") { "animations", "auth", "awt", + "awt/tab", "awt/tree", + "awt/grid", "beans", "bridge", "bridge/oleautomation", -- cgit From 8e8fc2abfa0e8ffe4dc9b7cd4b59593b2d674351 Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Tue, 1 Mar 2011 09:48:57 +0100 Subject: jsc340: i114609: adapt examples to work with the URE and use the passive registration --- odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile | 2 +- odk/examples/cpp/DocumentLoader/Makefile | 2 +- odk/examples/cpp/counter/Makefile | 15 +++------------ odk/examples/cpp/remoteclient/Makefile | 12 ++---------- odk/settings/component.uno.def | 1 - 5 files changed, 7 insertions(+), 25 deletions(-) (limited to 'odk') diff --git a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile index 1ab9cfb31b49..09d8246b14e0 100644 --- a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile +++ b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/Makefile @@ -53,7 +53,7 @@ APP1_BINARY=$(OUT_BIN)/$(APP1_NAME)$(EXE_EXT) APP2_NAME=string_samples APP2_BINARY=$(OUT_BIN)/$(APP2_NAME)$(EXE_EXT) -ENV_OFFICE_TYPES=-env:URE_MORE_TYPES=file://$(OFFICE_TYPES) +ENV_OFFICE_TYPES=-env:URE_MORE_TYPES=$(URLPREFIX)$(OFFICE_TYPES) CXXFILES = \ office_connect.cxx \ diff --git a/odk/examples/cpp/DocumentLoader/Makefile b/odk/examples/cpp/DocumentLoader/Makefile index 3e7b904daf2c..6cbd8bdd8e92 100644 --- a/odk/examples/cpp/DocumentLoader/Makefile +++ b/odk/examples/cpp/DocumentLoader/Makefile @@ -52,7 +52,7 @@ CXXFILES = DocumentLoader.cxx OBJFILES = $(patsubst %.cxx,$(OUT_SLO_COMP)/%.$(OBJ_EXT),$(CXXFILES)) -ENV_OFFICE_TYPES=-env:URE_MORE_TYPES=file://$(OFFICE_TYPES) +ENV_OFFICE_TYPES=-env:URE_MORE_TYPES=$(URLPREFIX)$(OFFICE_TYPES) # Targets .PHONY: ALL diff --git a/odk/examples/cpp/counter/Makefile b/odk/examples/cpp/counter/Makefile index 84062dc2dd0d..e809c24cf163 100644 --- a/odk/examples/cpp/counter/Makefile +++ b/odk/examples/cpp/counter/Makefile @@ -47,15 +47,14 @@ COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT) COMP_IMPL=$(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) COMP_RDB_NAME = $(COMP_NAME).uno.rdb COMP_RDB = $(OUT_BIN)/$(COMP_RDB_NAME) -COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map OUT_COMP_INC = $(OUT_INC)/$(COMP_NAME) OUT_COMP_GEN = $(OUT_MISC)/$(COMP_NAME) OUT_COMP_OBJ = $(OUT_OBJ)/$(COMP_NAME) OUT_COMP_SLO = $(OUT_SLO)/$(COMP_NAME) COMP_SERVICES=$(OUT_BIN)/counterservices.rdb -ENV_EXAMPLE_TYPES=-env:URE_MORE_TYPES=file://$(COMP_RDB) -ENV_COMP_SERVICES=-env:URE_MORE_SERVICES=file://$(COMP_SERVICES) +ENV_EXAMPLE_TYPES=-env:URE_MORE_TYPES=$(URLPREFIX)$(COMP_RDB) +ENV_COMP_SERVICES=-env:URE_MORE_SERVICES=$(URLPREFIX)$(COMP_SERVICES) COMP_TYPEFLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_types.flag @@ -106,15 +105,8 @@ $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(COMP_TYPEFLAG) -$(MKDIR) $(subst /,$(PS),$(@D)) $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $< -$(COMP_MAPFILE) : $(SLOFILES) - -$(MKDIR) $(subst /,$(PS),$(@D)) - cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE) -ifeq "$(OS)" "MACOSX" - nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE) -endif - ifeq "$(OS)" "WIN" -$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) +$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN)) $(LINK) $(COMP_LINK_FLAGS) /OUT:$@ \ @@ -122,7 +114,6 @@ $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) msvcrt.lib kernel32.lib $(LINK_MANIFEST) else -#$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) $(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \ diff --git a/odk/examples/cpp/remoteclient/Makefile b/odk/examples/cpp/remoteclient/Makefile index 50e3545a4c15..96b2ef9b12cd 100644 --- a/odk/examples/cpp/remoteclient/Makefile +++ b/odk/examples/cpp/remoteclient/Makefile @@ -47,10 +47,9 @@ COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT) COMP_IMPL=$(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) COMP_RDB_NAME = $(COMP_NAME).uno.rdb COMP_RDB = $(OUT_BIN)/$(COMP_RDB_NAME) -COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map COMP_SERVICES=$(SHAREDLIB_OUT)/remoteclientsample.rdb -ENV_COMP_SERVICES=-env:URE_MORE_SERVICES=file://$(COMP_SERVICES) +ENV_COMP_SERVICES=-env:URE_MORE_SERVICES=$(URLPREFIX)$(COMP_SERVICES) OUT_COMP_INC=$(OUT_INC)/$(COMP_NAME) OUT_COMP_GEN=$(OUT_MISC)/$(COMP_NAME) @@ -79,15 +78,8 @@ $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG) -$(MKDIR) $(subst /,$(PS),$(@D)) $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $< -$(COMP_MAPFILE) : $(SLOFILES) - -$(MKDIR) $(subst /,$(PS),$(@D)) - cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE) -ifeq "$(OS)" "MACOSX" - nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE) -endif - ifeq "$(OS)" "WIN" -$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) $(COMP_MAPFILE) +$(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN)) $(LINK) $(COMP_LINK_FLAGS) /OUT:$@ \ diff --git a/odk/settings/component.uno.def b/odk/settings/component.uno.def index 72a4eb2fa96d..d0c2def3434e 100644 --- a/odk/settings/component.uno.def +++ b/odk/settings/component.uno.def @@ -1,4 +1,3 @@ EXPORTS component_getImplementationEnvironment -component_writeInfo component_getFactory -- cgit From 7551b6e26d5049a8f1725c61a46717a9bb877b84 Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Tue, 1 Mar 2011 14:45:39 +0100 Subject: jsc340: i114609: move generated component services rdb --- odk/examples/cpp/counter/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'odk') diff --git a/odk/examples/cpp/counter/Makefile b/odk/examples/cpp/counter/Makefile index e809c24cf163..161145f7dea6 100644 --- a/odk/examples/cpp/counter/Makefile +++ b/odk/examples/cpp/counter/Makefile @@ -51,7 +51,7 @@ OUT_COMP_INC = $(OUT_INC)/$(COMP_NAME) OUT_COMP_GEN = $(OUT_MISC)/$(COMP_NAME) OUT_COMP_OBJ = $(OUT_OBJ)/$(COMP_NAME) OUT_COMP_SLO = $(OUT_SLO)/$(COMP_NAME) -COMP_SERVICES=$(OUT_BIN)/counterservices.rdb +COMP_SERVICES=$(SHAREDLIB_OUT)/counterservices.rdb ENV_EXAMPLE_TYPES=-env:URE_MORE_TYPES=$(URLPREFIX)$(COMP_RDB) ENV_COMP_SERVICES=-env:URE_MORE_SERVICES=$(URLPREFIX)$(COMP_SERVICES) -- cgit From 7de486ee0f338fd2a0a2defd8edd22f5516b5408 Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Thu, 3 Mar 2011 14:28:00 +0100 Subject: jsc340: i114609: no visibility compiler flag for jni lib --- .../DesktopEnvironment/nativelib/unix/Makefile | 2 +- .../DesktopEnvironment/nativelib/windows/Makefile | 2 +- odk/settings/settings.mk | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) (limited to 'odk') diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/Makefile b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/Makefile index d6778b59be70..4eb8d30bec4b 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/Makefile +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/Makefile @@ -60,7 +60,7 @@ include $(SETTINGS)/stdtarget.mk $(OUT_SHL_SLO)/%.$(OBJ_EXT) : %.c -$(MKDIR) $(subst /,$(PS),$(@D)) - $(CC) $(CC_FLAGS) $(CC_INCLUDES) $(SDK_JAVA_INCLUDES) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $< + $(CC) $(CC_FLAGS_JNI) $(CC_INCLUDES) $(SDK_JAVA_INCLUDES) $(CC_DEFINES_JNI) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $< $(SHAREDLIB_OUT)/$(SHAREDLIB_PRE)$(SHL_NAME).$(SHAREDLIB_EXT) : $(SLOFILES) -$(MKDIR) $(subst /,$(PS),$(@D)) diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/Makefile b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/Makefile index 71c50df5ea2e..7052c2f968cc 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/Makefile +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/Makefile @@ -61,7 +61,7 @@ include $(SETTINGS)/stdtarget.mk $(OUT_SHL_SLO)/%.$(OBJ_EXT) : %.c -$(MKDIR) $(subst /,$(PS),$(@D)) - $(CC) $(CC_FLAGS) $(CC_INCLUDES) $(SDK_JAVA_INCLUDES) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $< + $(CC) $(CC_FLAGS_JNI) $(CC_INCLUDES) $(SDK_JAVA_INCLUDES) $(CC_DEFINES_JNI) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $< $(SHAREDLIB_OUT)/$(SHAREDLIB_PRE)$(SHL_NAME).$(SHAREDLIB_EXT) : $(SLOFILES) $(SHL_NAME).def -$(MKDIR) $(subst /,$(PS),$(@D)) diff --git a/odk/settings/settings.mk b/odk/settings/settings.mk index 0857882183f3..748800b265c1 100644 --- a/odk/settings/settings.mk +++ b/odk/settings/settings.mk @@ -79,6 +79,7 @@ EMPTYSTRING= PATH_SEPARATOR=; # use this for release version +CC_FLAGS_JNI=-c -MT -Zm500 -Zc:forScope,wchar_t- -wd4251 -wd4275 -wd4290 -wd4675 -wd4786 -wd4800 -Zc:forScope -GR -EHa CC_FLAGS=-c -MT -Zm500 -Zc:forScope,wchar_t- -wd4251 -wd4275 -wd4290 -wd4675 -wd4786 -wd4800 -Zc:forScope -GR -EHa ifeq "$(CPP_MANIFEST)" "true" #CC_FLAGS+=-EHa -Zc:wchar_t- @@ -88,6 +89,7 @@ else LINK_MANIFEST= endif ifeq "$(DEBUG)" "yes" +CC_FLAGS_JNI+=-Zi CC_FLAGS+=-Zi endif @@ -98,6 +100,7 @@ SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/inclu # define for used compiler necessary for UNO # -DCPPU_ENV=msci -- windows msvc 4.x - 7.x +CC_DEFINES_JNI=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=msci CC_DEFINES=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=msci CC_OUTPUT_SWITCH=-Fo @@ -196,8 +199,10 @@ endif EMPTYSTRING= PATH_SEPARATOR=: +CC_FLAGS_JNI=-c -KPIC CC_FLAGS=-c -KPIC -xldscope=hidden ifeq "$(DEBUG)" "yes" +CC_FLAGS_JNI+=-g CC_FLAGS+=-g endif CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include @@ -207,6 +212,7 @@ SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/inclu # define for used compiler necessary for UNO # -DCPPU_ENV=sunpro5 -- sunpro cc 5.x solaris sparc/intel +CC_DEFINES_JNI=-DUNX -DSOLARIS -DCPPU_ENV=sunpro5 CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=sunpro5 -DHAVE_GCC_VISIBILITY_FEATURE CC_OUTPUT_SWITCH=-o @@ -335,11 +341,14 @@ endif EMPTYSTRING= PATH_SEPARATOR=: +CC_FLAGS_JNI=-c -fpic CC_FLAGS=-c -fpic -fvisibility=hidden # -O is necessary for inlining (see gcc documentation) ifeq "$(DEBUG)" "yes" +CC_FLAGS_JNI+=-g CC_FLAGS+=-g else +CC_FLAGS_JNI+=-O CC_FLAGS+=-O endif @@ -350,6 +359,7 @@ endif SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/linux" CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl" +CC_DEFINES_JNI=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) CC_DEFINES=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) -DHAVE_GCC_VISIBILITY_FEATURE # define for used compiler necessary for UNO @@ -466,17 +476,21 @@ INSTALL_NAME_URELIBS_BIN=install_name_tool -change @____________________________ EMPTYSTRING= PATH_SEPARATOR=: +CC_FLAGS_JNI=-malign-natural -c -fPIC -fno-common $(GCC_ARCH_OPTION) CC_FLAGS=-malign-natural -c -fPIC -fno-common $(GCC_ARCH_OPTION) -fvisibility=hidden # -O is necessary for inlining (see gcc documentation) ifeq "$(DEBUG)" "yes" +CC_FLAGS_JNI+=-g CC_FLAGS+=-g else +CC_FLAGS_JNI+=-O CC_FLAGS+=-O endif SDK_JAVA_INCLUDES = -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl" +CC_DEFINES_JNI=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) CC_DEFINES=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) -DHAVE_GCC_VISIBILITY_FEATURE CC_OUTPUT_SWITCH=-o @@ -589,17 +603,21 @@ endif EMPTYSTRING= PATH_SEPARATOR=: +CC_FLAGS_JNI=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS) CC_FLAGS=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS) -fvisibility=hidden # -O is necessary for inlining (see gcc documentation) ifeq "$(DEBUG)" "yes" +CC_FLAGS_JNI+=-g CC_FLAGS+=-g else +CC_FLAGS_JNI+=-O CC_FLAGS+=-O endif SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/freebsd" CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl" +CC_DEFINES_JNI=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) CC_DEFINES=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) -DHAVE_GCC_VISIBILITY_FEATURE CC_OUTPUT_SWITCH=-o -- cgit