Hi Christian,

Christian Andersson schrieb:
Hi there, I have some questions regarding the configuration system
within openoffice. (as you will se from below I'm not that good with how
OOo works internally, nor c++)


I think I partly understand that basics about what it does (reading
configuration files from different places, etc) and what can be done
using this, but I have come to a situation where I need to read the
configuration from a server using http/soap/etc instead of local files.

today I have it working so that it can read these files using
com.sun.star.comp.configuration.backend.LocalStratum  but that can only
read from file:// and not from http://

from what I understand this stuff can only be done in c++ right now, not
java.


Not so. The backends are accessed as UNO services and can be written in any language suitable for writing UNO components. This includes Java and even Python.

The only premise is that the UNO language binding does not access the configuration database for its own startup configuration. IIRC that used to be a problem with Java in OOo 1.1.x, but shouldn't be the case any more in OOo 2.

so my questions will be..

how can I create my own "version"
com.sun.star.comp.configuration.backend.LocalStratum that instead of
reading from the harddrive it reads over http..


We did create a modified version of the Configuration chapter in the developer's guide that explains the services and interfaces involved in this. Unfortunately it seems to have not made it into the OOo 2.0 version of the guide. I'll check if I can find it somewhere and get it up onto the website.

The short summary is: You need to create a UNO service that implements one of the abstract services com.sun.star.configuration.backend.SingleLayerStratum [1] or com.sun.star.configuration.backend.MultiLayerStratum [2].

This essentially amounts to implementing the methods of the XSingleLayerStratum or XMultiLayerStratum interface to return a Layer object whose XLayer::readData method reads and parses from your data store.

If you store your data in the 'xcu' XML format, you can use the existing com.sun.star.configuration.backend.xml.LayerParser service to implement the Layer object. All you need to do is provide an XInputStream to read the data.

If I manage to write my own configurationreader can this then be
installed using unopkg? or do I have to compile it within my own version
of OpenOffice.org?


You can install such a backend using unopkg add --shared. That will not automatically enable its use for the standard configuration stack though. To activate it for that purpose, you need to add it to the CFG_Strata entry in $officeinstall/program/bootstrap.

Alternatively you can have your SingleLayerStratum register itself as an instance of service com.sun.star.configuration.backend.PlatformBackend. In that case it will be used automatically through the special 'SystemIntegration' backend service. Warning: this service is still declared 'unpublished' and thus is subject to change in a future version. (I do think that is unlikely, though and changes will be announced using the interface-announce mailing list.)

I have read the Developers manual, but I still have a hard time figuring
out how to do this, is there any other documentation for this then the
developerguide?


As I mentioned this should be in the dev guide, but isn't :-(

HTH

- Jörg

References:

[1] Reference documentation for SingleLayerStratum service
http://api.openoffice.org/docs/common/ref/com/sun/star/configuration/backend/SingleLayerStratum.html

[2] Reference documentation for MultiLayerStratum service
http://api.openoffice.org/docs/common/ref/com/sun/star/configuration/backend/MultiLayerStratum.html

--
Joerg Barfurth              Sun Microsystems - Desktop - Hamburg
>>>>>>>>>>>>>>>>>> using std::disclaimer <<<<<<<<<<<<<<<<<<<<<<<
Software Engineer                         [EMAIL PROTECTED]
OpenOffice.org Configuration          http://util.openoffice.org

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

Reply via email to