diff options
author | Juergen Schmidt <jsc@openoffice.org> | 2003-02-28 16:41:28 +0000 |
---|---|---|
committer | Juergen Schmidt <jsc@openoffice.org> | 2003-02-28 16:41:28 +0000 |
commit | d720cc6c45c5f00c111671a7697435399721c155 (patch) | |
tree | f4c4fdc23570ac3e14a9f949404144ed8e5d943f | |
parent | 54d89d1efb2163390a23de87f8f1971aa8773b5e (diff) |
#107931# synch with OOO_STABLE_1
-rw-r--r-- | odk/examples/java/Inspector/Makefile | 6 | ||||
-rw-r--r-- | odk/examples/java/MinimalComponent/Makefile | 4 | ||||
-rw-r--r-- | odk/examples/java/MinimalComponent/MinimalComponent.java | 48 | ||||
-rw-r--r-- | odk/examples/java/NotesAccess/Makefile | 6 | ||||
-rw-r--r-- | odk/examples/java/NotesAccess/NotesAccess.java | 26 | ||||
-rw-r--r-- | odk/examples/java/PropertySet/Makefile | 4 | ||||
-rw-r--r-- | odk/examples/java/ToDo/Makefile | 4 | ||||
-rw-r--r-- | odk/examples/java/ToDo/ToDo.java | 27 |
8 files changed, 25 insertions, 100 deletions
diff --git a/odk/examples/java/Inspector/Makefile b/odk/examples/java/Inspector/Makefile index 37e356012f2b..ebd146234c9d 100644 --- a/odk/examples/java/Inspector/Makefile +++ b/odk/examples/java/Inspector/Makefile @@ -37,7 +37,11 @@ CLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/%.class,$(JAVAFILES)) CLASSFILES += $(subst $(OUT_COMP_GEN),$(OUT_COMP_CLASS),$(GENJAVAFILES:.java=.class)) $(COMPONENT1_NAME)_CLASSFILES = $(COMPONENT1_NAME).class \ - $(COMPONENT1_NAME)$$_$(COMPONENT1_NAME).class + $(COMPONENT1_NAME)$(QUOTE)$$_$(COMPONENT1_NAME).class \ + $(COMPONENT1_NAME)$(QUOTE)$$1.class \ + $(COMPONENT1_NAME)$(QUOTE)$$2.class \ + $(COMPONENT1_NAME)$(QUOTE)$$3.class \ + $(COMPONENT1_NAME)$(QUOTE)$$4.class $(COMPONENT1_NAME)_CLASSFILES += $(subst $(OUT_COMP_GEN)/,,$(GENJAVAFILES:.java=.class)) diff --git a/odk/examples/java/MinimalComponent/Makefile b/odk/examples/java/MinimalComponent/Makefile index fc67eb45a862..c02d96da588a 100644 --- a/odk/examples/java/MinimalComponent/Makefile +++ b/odk/examples/java/MinimalComponent/Makefile @@ -37,7 +37,7 @@ CLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/%.class,$(JAVAFILES)) #CLASSFILES += $(subst $(OUT_COMP_GEN),$(OUT_COMP_CLASS),$(GENJAVAFILES:.java=.class)) $(COMPONENT1_NAME)_CLASSFILES = $(COMPONENT1_NAME).class \ - $(COMPONENT1_NAME)$$$(COMPONENT1_NAME)Implementation.class + $(COMPONENT1_NAME)$(QUOTE)$$$(COMPONENT1_NAME)Implementation.class #$(COMPONENT1_NAME)_CLASSFILES += $(subst $(OUT_COMP_GEN)/,,$(GENJAVAFILES:.java=.class)) @@ -98,7 +98,7 @@ endif JavaMinimalComponentExample : $(REGISTERFLAG) @echo -------------------------------------------------------------------------------- - @echo Please use one of the following commands to execute the examples! + @echo Please use the following command to execute the example! @echo - @echo make TestMinimalComponent.run @echo ------ diff --git a/odk/examples/java/MinimalComponent/MinimalComponent.java b/odk/examples/java/MinimalComponent/MinimalComponent.java index 4d19813fc1b4..4f6637b77196 100644 --- a/odk/examples/java/MinimalComponent/MinimalComponent.java +++ b/odk/examples/java/MinimalComponent/MinimalComponent.java @@ -2,9 +2,9 @@ * * $RCSfile: MinimalComponent.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: bnolte $ $Date: 2002-01-11 10:31:50 $ + * last change: $Author: jsc $ $Date: 2003-02-28 17:39:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,6 +62,7 @@ import com.sun.star.comp.loader.FactoryHelper; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XSingleServiceFactory; +import com.sun.star.lib.uno.helper.WeakBase; import com.sun.star.uno.UnoRuntime; import com.sun.star.registry.XRegistryKey; import com.sun.star.lang.XInitialization; @@ -73,15 +74,15 @@ import com.sun.star.uno.Type; * factory for creating the service (<CODE>__getServiceFactory</CODE>) and a * method, that writes the information into the given registry key * (<CODE>__writeRegistryServiceInfo</CODE>). - * @version $Date: 2002-01-11 10:31:50 $ + * @version $Date: 2003-02-28 17:39:28 $ * @author Bertram Nolte */ public class MinimalComponent { /** This class implements the component. At least the interfaces XServiceInfo, * XTypeProvider, and XInitialization should be provided by the service. */ - public static class MinimalComponentImplementation implements XInitialization, - XTypeProvider, XServiceInfo { + public static class MinimalComponentImplementation extends WeakBase implements XInitialization, + XServiceInfo { /** The service name, that must be used to get an instance of this service. */ static private final String __serviceName = @@ -113,27 +114,6 @@ public class MinimalComponent { XMultiServiceFactory.class, object[ 0 ] ); } - /** Provides a sequence of all types (usually interface types) - * provided by the object. - * @return Sequence of all types (usually interface types) provided by the - * service. - */ - public Type[] getTypes() { - Type[] typeReturn = {}; - - try { - typeReturn = new Type[] { - new Type( XTypeProvider.class ), - new Type( XServiceInfo.class ), - new Type( XInitialization.class ) - }; - } catch( Exception exception ) { - System.err.println( exception ); - } - - return( typeReturn ); - } - /** This method returns an array of all supported service names. * @return Array of supported service names. */ @@ -167,22 +147,6 @@ public class MinimalComponent { return( MinimalComponentImplementation.class.getName() ); } - /** This method returns an array of bytes, that can be used to - * unambiguously distinguish between two sets of types, e.g. - * to realise hashing functionality when the object is introspected. - * Two objects that return the same ID also have to return - * the same set of types in getTypes(). If an unique - * implementation Id cannot be provided this method has to - * return an empty sequence. Important: If the object - * aggregates other objects the ID has to be unique for the - * whole combination of objects. - * @return Array of bytes, in order to distinguish between two sets. - */ - public byte[] getImplementationId() { - byte[] byteReturn = {}; - - return( byteReturn ); - } } diff --git a/odk/examples/java/NotesAccess/Makefile b/odk/examples/java/NotesAccess/Makefile index 13c9e45c088b..0eea41d1cc47 100644 --- a/odk/examples/java/NotesAccess/Makefile +++ b/odk/examples/java/NotesAccess/Makefile @@ -37,18 +37,18 @@ $(OUT_COMP_CLASS) : $(OUT) $(OFFICE_CLASSES_DIR)/Notes.jar : @echo -------------------------------------------------------------------------------- - @echo You need the Notes.jar from Notes/Domino for this example. + @echo You need the "$(QM)'Notes.jar$(QM)" from Notes/Domino for this example. @echo You can download it from http://www.servlets.com/cos/index.html @echo and then please copy it into your $(OFFICE_CLASSES_DIR) directory. @echo -------------------------------------------------------------------------------- -$(CLASSFILES) : $(OUT_COMP_CLASS) $(JAVAFILES) $(OFFICE_CLASSES_DIR)/Notes.jar +$(CLASSFILES) : $(OFFICE_CLASSES_DIR)/Notes.jar $(OUT_COMP_CLASS) $(JAVAFILES) javac -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMP_CLASS) $(JAVAFILES) JavaNotesAccessExample : $(CLASSFILES) @echo -------------------------------------------------------------------------------- - @echo Please use one of the following commands to execute the examples! + @echo Please use the following command to execute the example! @echo - @echo make NotesAccess.run @echo -------------------------------------------------------------------------------- diff --git a/odk/examples/java/NotesAccess/NotesAccess.java b/odk/examples/java/NotesAccess/NotesAccess.java index 4c162212a274..9c59d6301a97 100644 --- a/odk/examples/java/NotesAccess/NotesAccess.java +++ b/odk/examples/java/NotesAccess/NotesAccess.java @@ -73,7 +73,7 @@ public class NotesAccess implements Runnable { // It is possible to use a different connection string, passed as argument if ( args.length == 2 ) { - sConnectionString = args[1]; + sOfficeConnection = args[1]; } if ( !args[ 1 ].trim().equals( "" ) ) { @@ -126,27 +126,6 @@ public class NotesAccess implements Runnable { XMultiComponentFactory xmulticomponentfactory = xcomponentcontext.getServiceManager(); - // NOTE: This is special code, that is only necessary, when connecting to - // a Sun ONE Webtop ! - // Connection: "portal,host=<portalhost>,port=<port>,service=soffice,user=<username>,password=<passwd>" - if ( stringOfficeConnection.regionMatches( 4, "portal", 0, 6 ) ) { - com.sun.star.loader.XImplementationLoader ximplementationloader = - ( com.sun.star.loader.XImplementationLoader ) UnoRuntime.queryInterface( - com.sun.star.loader.XImplementationLoader.class, - xmulticomponentfactory.createInstanceWithContext( - "com.sun.star.loader.Java", xcomponentcontext ) ); - com.sun.star.container.XSet xset = (com.sun.star.container.XSet) - UnoRuntime.queryInterface( com.sun.star.container.XSet.class, - xmulticomponentfactory ); - - com.sun.star.lang.XSingleServiceFactory xsingleservicefactory = - ( com.sun.star.lang.XSingleServiceFactory ) UnoRuntime.queryInterface( - com.sun.star.lang.XSingleServiceFactory.class, - ximplementationloader.activate( - "com.sun.star.comp.portal_connect.Connector", null, null, null ) ); - xset.insert( xsingleservicefactory ); - } - /* Creates an instance of the component UnoUrlResolver which supports the services specified by the factory. */ Object objectUrlResolver = @@ -205,7 +184,8 @@ public class NotesAccess implements Runnable { XIndexAccess.class, xspreadsheets ); // Getting the first spreadsheet. - XSpreadsheet xspreadsheet = ( XSpreadsheet ) xindexaccess.getByIndex( 0 ); + XSpreadsheet xspreadsheet = ( XSpreadsheet ) UnoRuntime.queryInterface( + XSpreadsheet.class, xindexaccess.getByIndex( 0 )); Session session; if ( !stringHost.equals( "" ) ) { diff --git a/odk/examples/java/PropertySet/Makefile b/odk/examples/java/PropertySet/Makefile index 3918d44e4e25..303d890af6cd 100644 --- a/odk/examples/java/PropertySet/Makefile +++ b/odk/examples/java/PropertySet/Makefile @@ -71,8 +71,8 @@ endif JavaPropertySetExample : $(REGISTERFLAG) @echo -------------------------------------------------------------------------------- @echo The PropTest was installed if SDK_AUTO_DEPLOYMENT = YES. - @echo Load the PropertySet.sxw document to see how this component works. You can use - @echo this component inside your office installation, see the example description. + @echo Load the "$(QM)PropertySet.sxw$(QM)" document to see how this component works. You + @echo can use this component inside your office installation, see the example description. @echo -------------------------------------------------------------------------------- .PHONY: clean diff --git a/odk/examples/java/ToDo/Makefile b/odk/examples/java/ToDo/Makefile index 5aba65240cd3..a90a131b7e3a 100644 --- a/odk/examples/java/ToDo/Makefile +++ b/odk/examples/java/ToDo/Makefile @@ -36,7 +36,7 @@ CLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/%.class,$(JAVAFILES)) CLASSFILES += $(subst $(OUT_COMP_GEN),$(OUT_COMP_CLASS),$(GENJAVAFILES:.java=.class)) $(COMPONENT1_NAME)_CLASSFILES = $(COMPONENT1_NAME).class \ - $(COMPONENT1_NAME)$$$(COMPONENT1_NAME)Implementation.class + $(COMPONENT1_NAME)$(QUOTE)$$$(COMPONENT1_NAME)Implementation.class $(COMPONENT1_NAME)_CLASSFILES += $(subst $(OUT_COMP_GEN)/,,$(GENJAVAFILES:.java=.class)) @@ -98,7 +98,7 @@ endif JavaToDoExample : $(REGISTERFLAG) @echo -------------------------------------------------------------------------------- @echo The ToDo Java component was installed if SDK_AUTO_DEPLOYMENT = YES. - @echo Please load the ToDo.sxc document to see how this component works, see + @echo Please load the "$(QM)ToDo.sxc$(QM)" document to see how this component works, see @echo the example description. @echo -------------------------------------------------------------------------------- diff --git a/odk/examples/java/ToDo/ToDo.java b/odk/examples/java/ToDo/ToDo.java index c82470afac4a..e70d80bf088a 100644 --- a/odk/examples/java/ToDo/ToDo.java +++ b/odk/examples/java/ToDo/ToDo.java @@ -160,29 +160,6 @@ public class ToDo { return( ToDoImplementation.class.getName() ); } - /** Provides a sequence of all types (usually interface types) - * provided by the object. - * @return Sequence of all types (usually interface types) provided by the - * service. - */ - public Type[] getTypes() { - Type[] typeReturn = {}; - - try { - typeReturn = new Type[] { - new Type( XToDo.class), - new Type( XTypeProvider.class ), - new Type( XServiceInfo.class ), - new Type( XWeak.class ), - new Type( XInterface.class ) - }; - } catch( Exception exception ) { - System.err.println( exception ); - } - - return( typeReturn ); - } - /** For every bug/feature listed in a spreadsheet document this method calculates * the start date, day of week of the start date, the end date and the day of week * of the end date. All calculations are dependent on the values of "Needed Days", @@ -210,8 +187,8 @@ public class ToDo { xspreadsheetdocument.getSheets() ); // Getting the first XSpreadsheet - XSpreadsheet xspreadsheet = (XSpreadsheet) - xindexaccess.getByIndex( 0 ); + XSpreadsheet xspreadsheet = (XSpreadsheet)UnoRuntime.queryInterface( + XSpreadsheet.class, xindexaccess.getByIndex( 0 )); // Querying for the interface XCellRange on the XSpeadsheet XCellRange xcellrange = ( XCellRange ) |