[CiDIT] Here's how simple it could be
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Directory Project > [CiDIT] Here's how simple it could be




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    [CiDIT] Here's how simple it could be  
Ole Ersoy


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-30-07 12:11 AM

Hey Guys,

Here's a tiny segment of code that shows how simple it could be to store the
 xml configuration file in the DIT using the DAS.  This comes from the DAS w
hich stores some of it's own configuration in the DIT.

LdapDASHelper.readDasMeta(
dasMetaDataGraph,
context,
metaDataObjectToRelativeDNCache );

This method first tries to read the configuration DataGraph (server.xml in D
IT).  If it does not exist (First time server is started), it creates an ins
tance of the model and writes it to the DIT.  The model of server.xml contai
ns all the server.xml defau
lts, so now all the defaults are stored in the DIT.  Later, when needing to 
change configuration values, the root object bean is gotten from the dasMeta
DataGraph like this:

Configuration configuration = dasMetaDataGraph.getRootDataObject();

The configuration object represent the root element of the configuration fil
e, and is generated from the XML Schema that contains the structure of the s
erver.xml file.

When changing the configuration, just turn on change logging on the DataGrap
h and when done, turn it off.  Then use the DAS to write the changes.  And t
hat's it.  So it would be something like this:

dasMetaDataGraph.turnOnChangeLogging();

Make changes to Configuration and objects contained by configuration.

Then turn off change logging:
dasMetaDataGraph.turnOffChangeLogging();

And update the DIT:

LdapDASHelper.update(
dasMetaDataGraph,
context);

And finito.

Cheers,
- Ole







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 05:41 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register