It getting more and more interesting. I post these messages to let
the people know, how difficult this stuff is ...

The automatically code generation had been enhanced. Of the CoreReflection
fails (and it fails on every service) I try to get similar information via
ComSunStarBeansIntrospection - which seems to work.

Here is the up-to-date Smalltalk program of the quick starter example:

| serviceManager desktop coreReflection aWriterDocument aText aTextCursor | "First we initialize the system"
   MSKDefaultOpenOfficeClass ClearAllDefaults.
   ComSunStarServiceManager ClearDefault.
(serviceManager := ComSunStarServiceManager Default) isNil
     ifTrue:[ ^AbtError errorText: 'Could not create service manager' ].
   (desktop := serviceManager createInstance: OOCSSFrameDesktop) isNil
     ifTrue:[ ^AbtError errorText: 'Could not create Deskto instance' ].
aWriterDocument :=
       desktop
loadComponentFromURL: 'private:factory/swriter' TargetFrameName: '_blank' SearchFlags: 0 Arguments: serviceManager dummyArgs. aText := aWriterDocument getText.
   aTextCursor := aText createTextCursor.
aText insertString: aTextCursor aString: 'Marten Feldtmann lives in Germany' bAbsorb: false
   ....

After all I had tremendous implementation problems with a very simple
call: "loadComponentFromURL...." .... amazing ! It seems so easy until
I wanted to do anything from that result !

Here more or less the discussions I started with myself.

Let us look at the specification: it's an XInterface. Ok, that's
worthless. According to the specification of the return parameter
it can only be instances which fullfills one of XWindow, XController
or XModel interfaces. Nice information, but not useful.

Ok, now the other way around. We look at the example and look at
the messages sent to that object. "getText" is a typical one and
after browing through my Smalltalk system I found the class
(service) OOCSSTextTextDocument (or com.star.sun.text.textdocument).

And here we have the next question one has to solve (actually a
very simple one):

If I have an object in UNO: how can I get the name of the service
the object represents ? CoreReflection does not work, Introspection
does not deliver the information and the TypeDescriptionManager
can not solve any names.

The more I work with the interface approach of OpenOffice and UNO
the more I understand, why it is so difficult to do programming
within OpenOffice for so many people.


Marten



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to