[Opensource] ConfigManager custom properties
Mike Traum
mtraum at cirnetwork.org
Sun Feb 16 07:25:37 PST 2003
I assume you're aware of the 'Setup' DBObject? You can add values through
the expresso administration webpages. To retrieve them, use:
com.jcorporate.expresso.services.dbobj.Setup.getValueRequired(request.getDBN
ame(), "ConfigValueName")
The advantage of using this is that you can change the value easily. If you
use the xml and change the value, you'll have to restart the server.
mike
-----Original Message-----
From: Helga Wyns [mailto:helgawyns at hotmail.com]
Sent: Friday, February 14, 2003 8:45 AM
To: opensource at jcorporate.com
Subject: RE: [Opensource] ConfigManager custom properties
Thanks, Eddie and Mike. I had overlooked the customProperty tag in the DTD
:-(
This is a great feature!
>
>After adding the property to your xml config file get the property in
>your app via
>
> // example utility function to get a custom property
> public static String getCustomProp ()
> {
> String sCustomProp = null;
>
> try {
> sFontDir =
>ConfigManager.getContext("default").getCustomProperty("PropertyInConfig
>File"
>);
> } catch (Exception e) {
> // do something
> }
>
> return sCustomProp ;
> }
>
>-----Original Message-----
>From: Michael Rimov [mailto:rimovm at centercomp.com]
>Sent: Friday, 14 February 2003 7:36 AM
>To: opensource at jcorporate.com
>Subject: Re: [Opensource] ConfigManager custom properties
>
>
>At 02:44 PM 2/12/2003 +0100, you wrote:
> >Hi list,
> >according to the documentation it is possible to add some custom
> >properties to the expresso configuration xml files. But I don't
>understand
> >how. What should be the name of the tag?
>
>Helga,
>
>I looked at the Expresso DTD:
>
><!ELEMENT context (description?, hasSetupTables?, jdbc?, type-mapping*,
>images, startJobHandler?, showStackTrace?, mailDebug?, customProperty*,
>path-mappings*, expressoDir?, setupDefault*)>
>
><!ELEMENT customProperty (name, value)>
>
>
>So according to this you should put
><customProperty>
> <name>Test</name>
> <value>Abcdefg</value>
></customProperty>
>
>after mailDebug entries in your expresso-config contexts....
>
>Disclaimer: I personally haven't used it in my own apps, so mileage
>may vary. :(
>
> -Mike
>
>
>
>_______________________________________________
>Opensource mailing list
>Opensource at jcorporate.com
>http://mail.jcorporate.com/mailman/listinfo/opensource
>Archives: http://mail.jcorporate.com/pipermail/opensource/
_________________________________________________________________
MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.be
_______________________________________________
Opensource mailing list
Opensource at jcorporate.com
http://mail.jcorporate.com/mailman/listinfo/opensource
Archives: http://mail.jcorporate.com/pipermail/opensource/
More information about the Opensource
mailing list