Re: [dev] Example of use of the configuration
Joerg, Thanks a lot for your explanation. Not being a programmer but just an amateur who likes to write the odd macro, I doubt I will be able to do it, nevertheless I will try. Cheers, Michele On 13/10/05, Joerg Barfurth <[EMAIL PROTECTED]> wrote: > > Hi Michele, > > Michele Zarri wrote: > > Thanks Andrew, > > > > took a look at your examples, but I am not sure anymore if the > configuration > > service is really what I want... > > > > I guess that what I want is similar to creating a registry entry under > > windows XP. > > The configuration is the OOo equivalent of the Windows registry. Like > the registry it is a hierarchical database. It differs from the Windows > registry in that we require keeping track of what entries can go where > by means of a schema. You can't simply create a value of any type > anywhere within the hierarchy; instead you need to have a schema that > describes your value, its data type and possibly default value (or a > container where you can put arbitrary values). > > > When OOo is opened (ideally already with the quick start) a > > string (i.e. the path to the file I want to open) is made available to > the > > macros. (How/where the macros will read it will be the subject of a > > subsequent email :) ) > > > > Unless you can accomodate you data within an existing OOo configuration > schema, you need to install a configuration schema of your own with your > macro (you can deploy configuration schemas as part of UNO packages). > When the schema is installed, you can have your macro read or write the > data at any time. The data is loaded when it is first read and then kept > in memory (unless it isn't referenced in 15 minutes, in which case it > may get unloaded). > > HTH, Joerg > > -- > 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] > >
Re: [dev] Example of use of the configuration
Hi Michele, Michele Zarri wrote: Thanks Andrew, took a look at your examples, but I am not sure anymore if the configuration service is really what I want... I guess that what I want is similar to creating a registry entry under windows XP. The configuration is the OOo equivalent of the Windows registry. Like the registry it is a hierarchical database. It differs from the Windows registry in that we require keeping track of what entries can go where by means of a schema. You can't simply create a value of any type anywhere within the hierarchy; instead you need to have a schema that describes your value, its data type and possibly default value (or a container where you can put arbitrary values). When OOo is opened (ideally already with the quick start) a string (i.e. the path to the file I want to open) is made available to the macros. (How/where the macros will read it will be the subject of a subsequent email :) ) Unless you can accomodate you data within an existing OOo configuration schema, you need to install a configuration schema of your own with your macro (you can deploy configuration schemas as part of UNO packages). When the schema is installed, you can have your macro read or write the data at any time. The data is loaded when it is first read and then kept in memory (unless it isn't referenced in 15 minutes, in which case it may get unloaded). HTH, Joerg -- 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]
Re: [dev] Example of use of the configuration
Thanks Andrew, took a look at your examples, but I am not sure anymore if the configuration service is really what I want... I guess that what I want is similar to creating a registry entry under windows XP. When OOo is opened (ideally already with the quick start) a string (i.e. the path to the file I want to open) is made available to the macros. (How/where the macros will read it will be the subject of a subsequent email :) ) Cheers, Michele On 11/10/05, Andrew Douglas Pitonyak <[EMAIL PROTECTED]> wrote: > > Michele Zarri wrote: > > >Hi, > > > >I hope this is the right list, if not, apologies. > >I have written a macro that relies on a configuration file where I store > >some parameters. I would like to avoid to re-open the file every time the > >macro is executed so I would like writer to "remember" whether the file > has > >been opened or not for a given session. I cannot use global constants > >because from time to time I need to change the configuration parameters > (I > >have also created the macros to do it). > >Although the file is quite small and it takes no time to open it and > parse > >it, I would still like to use a more generic approac. > >Not knowing the Java language I gave up on the developer's guide > paragraph > >on configuration, so my questions are: > >1) is there a place where the developers guide examples are "translated" > in > >OOoBasic? > >2) is there somewhere an example of storing configuration parameters? > > > >Cheers, > > > >Michele > > > > > I have some old examples in section 5.5 and 5.7 of my free macro document. > > -- > Andrew Pitonyak > My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw > My Book: http://www.hentzenwerke.com/catalog/oome.htm > Info: http://www.pitonyak.org/oo.php > See Also: http://documentation.openoffice.org/HOW_TO/index.html > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: [dev] Example of use of the configuration
Michele Zarri wrote: Hi, I hope this is the right list, if not, apologies. I have written a macro that relies on a configuration file where I store some parameters. I would like to avoid to re-open the file every time the macro is executed so I would like writer to "remember" whether the file has been opened or not for a given session. I cannot use global constants because from time to time I need to change the configuration parameters (I have also created the macros to do it). Although the file is quite small and it takes no time to open it and parse it, I would still like to use a more generic approac. Not knowing the Java language I gave up on the developer's guide paragraph on configuration, so my questions are: 1) is there a place where the developers guide examples are "translated" in OOoBasic? 2) is there somewhere an example of storing configuration parameters? Cheers, Michele I have some old examples in section 5.5 and 5.7 of my free macro document. -- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw My Book: http://www.hentzenwerke.com/catalog/oome.htm Info: http://www.pitonyak.org/oo.php See Also: http://documentation.openoffice.org/HOW_TO/index.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] Example of use of the configuration
Hi, I hope this is the right list, if not, apologies. I have written a macro that relies on a configuration file where I store some parameters. I would like to avoid to re-open the file every time the macro is executed so I would like writer to "remember" whether the file has been opened or not for a given session. I cannot use global constants because from time to time I need to change the configuration parameters (I have also created the macros to do it). Although the file is quite small and it takes no time to open it and parse it, I would still like to use a more generic approac. Not knowing the Java language I gave up on the developer's guide paragraph on configuration, so my questions are: 1) is there a place where the developers guide examples are "translated" in OOoBasic? 2) is there somewhere an example of storing configuration parameters? Cheers, Michele