Re: [dev] how to create your own configuration reader in OpenOffice.org (configmgrrc)
see answers inline Joerg Barfurth wrote: Hi Christian, 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. My information about this is a little bit dated I think the last time we checked if we could use java was on the 1.1.x series of OOo, not 2.0.x series. I've searched the mailiong list but cannot find the mail regarding this, so I might be totally wrong. Anyway, if it now works in OOo 2.0.x that is a great benefit for me, since I don't have to learn c++ :-) 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. hopefully it does not need to, since the url from where it needs to download the files are specified in the configmgrrc file.. 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. That would be very much appreciated. and if you could telt us the url of this document when/if you find it and have it uploaded :-) 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. ok, this sounds doable, adn I'm looking forward to start testing it next week :-) 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. don't you mean $officeinstall/program/configmgr[rc|.ini] ?`because that is where I have changed CFG_Strata variable before? and looking in bootstrap now, it shows no such variable.. 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.) well, if this is as well-documented in the developersguide as the rest of the configuration system, I'll probably try to add it to the configmgr file :-) -- Christian Andersson - [EMAIL PROTECTED] Configuration and Collaboration for OpenOffice.org Open Framework Systems AS http://www.ofs.no - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] how to create your own configuration reader in OpenOffice.org (configmgrrc)
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]
[dev] how to create your own configuration reader in OpenOffice.org (configmgrrc)
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. 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.. 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? 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? /Christian Andersson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]