OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Musings about the Configuration Manager

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Wed Nov 19, 2003 9:10 am    Post subject: Musings about the Configuration Manager Reply with quote

(Continued from.... FYI - X-Ray macro on OOoMacros
http://www.oooforum.org/forum/viewtopic.php?t=4002
thread)

I am very interested in the XCU files. They are not documented. You can deduce how to interpret the contents of any xcu file by studying the counterpart XCS file under OOo\shape\registry\schema.

I have working macro code (from last Thursday, haven't touched since) that creates an add-on menu, cleanly, via. the Configuration Manager API. Based on the schema

OOo\share\registry\schema\org\openoffice\Office\Addons.xcs

I believe I can also create new top level menus, or new toolbar icons, by putting the right stuff into either....

OOo\share\registry\data\org\openoffice\Office\Addons.xcu

or

OOo\user\registry\data\org\openoffice\Office\Addons.xcu

Or possibly into an XCU file embedded wtihin a document? Someone was recently talking about this, and I suspect it is related.

Another related tidbit of info is to look at the Addon's in the Python example at....
http://udk.openoffice.org/python/python-bridge.html
scroll down to the Addons.xcu that gets zipped into a package. Note the hierarchy similary to the schema for Addons.xcs that is in your OOo installation.

With the Configuration Manager, you open a node, such as....

org.openoffice.Office/Addons

and then get back an object that lets you manipulate configuration data. The data it manipulates is in the Addons.xcu file in the user directory.

Go look at my posting ENLARGE THE SIZE OF YOUR recent files list.
http://www.oooforum.org/forum/viewtopic.php?t=3559
See that macro. See how it works? See how it gets the nodepath....

/org.openoffice.Office.Common/History

This means, that as I manipulate the configuration via. the API, I am in fact altering the file....

OOo\user\registry\data\org\openoffice\Office\Common.xcu

and the <History> node within that file.

See how I create an instance of the service...

com.sun.star.configuration.ConfigurationUpdateAccess

If you use ConfigurationUpdateAccess, you can manipulate and change the data. If I had left out the word Update, and used only ConfigurationAccess instead, then I could read the configuration data, but not update it.

If you go to my Experiments page, and get the document named "Configuration", you can see my recent experiments with the Configuration Manager API. (Go to...
http://kosh.datateamsys.com/~danny/OOo/Experiments/
and download document whose name starts with Configuration.)

The oldest routine ExploreFilters() is where I used the configuration manager to inspect the filters within OOo.

The next oldest routine ExploreRecentFiles() is where I used the config mgr to inspect, and then later alter the recent files list.

The next oldest routine ExploreUnoConnections0 is where I learned how to configure OOo to listen (or not listen) for uno connections on a particular port -- hence my recent FYI posting about the UnoConnectionListener.
http://www.oooforum.org/forum/viewtopic.php?t=3754

If you skip forward in time to ExploreMenus2(), you'll see that the last experiment I did was to add a new menu to the AddOn's. In order to add the menu, you need to uncomment these lines...
Code:
'   oNew1 = oElement.createInstance()
'   oNew1.URL = "macro:///DannysLibrary.Conversion.SayHelloWorld()"
'   oNew1.Title = "Danny's Test"
'   oElement.insertByName( "nom.DannyBrewer.Test", oNew1 )

and this line
Code:
'   oConfigAccess.commitChanges()


You must quit from OOo to make changes take effect.

Later, to remove the menu, you need to uncomment this line...
Code:
'   oElement.removeByName( "nom.DannyBrewer.Test" )


So, like I said, I can add to the AddOn's menu, and remove from it all under macro control. I just need to package this up along with Andrew Brown's dynamic installer technique into a complete working example. This might become my preferred delivery mechanism for Danny's Writer Power Tools.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Guest






PostPosted: Wed Nov 19, 2003 12:53 pm    Post subject: Re: Musings about the Configuration Manager Reply with quote

DannyB wrote:
(Continued from.... FYI - X-Ray macro on OOoMacros
http://www.oooforum.org/forum/viewtopic.php?t=4002
thread)

I am very interested in the XCU files. They are not documented.


XCU file is documented in the Developers Guide 4.7.3. Just badly documented IMHO.
Have a look at the Addon tool when it appears at OOoMacro. I have added my own explanation in it. After hours of re-re-re-reading that 4.7.3 chapter. It should be more clear I hope.

Bernard
Back to top
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Wed Nov 19, 2003 1:48 pm    Post subject: Reply with quote

You're right!

I either missed it before, wasn't ready for it before, or it simply wasn't there in earlier versions of the developer's guide. I'm not sure which is the case.

I look at (older versions of) the developer's guide all the time, and so I don't consider this documentation to be bad at all. It fills in a number of important gaps in what I had figured out for myself.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Wed Nov 19, 2003 2:35 pm    Post subject: Reply with quote

I checked the past three SDK's I have been using.

1.0.2 beta
1.0.2
1.1 beta

In all three of them, the Developer's Guide did not have any information about the Add-On mechanism or XCU files. That is probably why I didn't know it was now documented.

I recently (maybe a two months ago) installed the 1.1rc4 SDK. Probably should get the 1.1.0 final SDK if it is available.

I suppose there is a lesson here.

Maybe I need to re-read all of the documentation?

Here in OOoForum, I tend to use (so I can link to) the online version of the Dev Guide. When doing development, I use the one in the SDK for speed.

This is probably also like my obsolete belief that OOo Basic does not support recursion. Well, it didn't when I tried it only months ago. Smile See my separate posting about this today.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
avantman42
Super User
Super User


Joined: 28 Jul 2003
Posts: 751
Location: Staffordshire, UK

PostPosted: Thu Nov 20, 2003 4:16 am    Post subject: Re: Musings about the Configuration Manager Reply with quote

Anonymous wrote:
DannyB wrote:
(Continued from.... FYI - X-Ray macro on OOoMacros
http://www.oooforum.org/forum/viewtopic.php?t=4002
thread)

I am very interested in the XCU files. They are not documented.


XCU file is documented in the Developers Guide 4.7.3. Just badly documented IMHO.
Have a look at the Addon tool when it appears at OOoMacro. I have added my own explanation in it. After hours of re-re-re-reading that 4.7.3 chapter. It should be more clear I hope.

Bernard


The Add-On tool is now available. See this post:
http://www.oooforum.org/forum/viewtopic.php?p=15207#15207

Russ
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group