<div>HI</div>
<div>I searched very hard through the opencms code but i didn't find a solution to add a CmsSite to the opencms-system.xml during runtime, so i worked out some jdom methods for time saving on this prop(i know that the opencms team is using dom4j, but i have just a little expirience with it) so it now works well,
<br>BUT if somebody know a way for this proplem please let me know<br>thx</div>
<div>andy<br><br> </div>
<div><span class="gmail_quote">2006/9/18, Sebastian Himberger <<a href="mailto:sebastian.himberger@gmx.de">sebastian.himberger@gmx.de</a>>:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Andy,<br><br>we used dom4j to alter the site configuration. But don't forget you have<br>to restart OpenCms atfer a change to the site configuration.
<br><br>best regards<br>Sebastian<br><br>Andy Bicksbo schrieb:<br>> HI<br>> i do not need to this during runtime....but it would be the best<br>> solution for my tasks(build an admin module, whith witch the admin can
<br>> do multisite configuratation.)<br>> I thought thebest way to edit the opencms-system.xml is to use some of<br>> the provided opencms java classes, rather than writing my own package,<br>> to edit this for example with dom4j or jdom (when rading this file
<br>> there are some additional problems to make the parser find the .dtd)<br>> Andy<br>><br>><br>> 2006/9/16, Jonathan Woods <<a href="mailto:jonathan.woods@scintillance.com">jonathan.woods@scintillance.com
</a><br>> <mailto:<a href="mailto:jonathan.woods@scintillance.com">jonathan.woods@scintillance.com</a>>>:<br>><br>> Do you really need to do this during runtime? As I said the other<br>> day, the normal way to add a site is to edit
opencms-system.xml<br>> (using your favourite text editor) to include the new site(s).<br>> The changes will then be picked up when OpenCms is next started.<br>><br>> Jon<br>><br>> ------------------------------------------------------------------------
<br>> *From:* <a href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a><br>> <mailto:<a href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a>> [mailto:
<br>> <a href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a><br>> <mailto:<a href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a>>] *On Behalf Of *Christian
<br>> Steinert<br>> *Sent:* 16 September 2006 12:16<br>> *To:* The OpenCms mailing list<br>> *Subject:* Re: [opencms-dev] change opencms-system.xml with java<br>> code/site node<br>><br>
><br>> Andy Bicksbo schrieb:<br>>> Hi all!<br>>> I asked the same question afew days ago, but I didn't get s<br>>> satisfying answer since that nor i found a solution by myself.<br>
>> So desparating pulling hair since that on my proplem:<br>>> I am trying to add some custom site definitions to the<br>>> opencms-system.xml through a java class with the method:<br>>> addSite() from the Class
org.opencms.site.CmsSiteManager<br>>><br>>> i get the following error message:<br>>><br>>> org.opencms.main.CmsRuntimeException: Site configuration has<br>>> been frozen and can not longer be changed.
<br>>> at org.opencms.site.CmsSiteManager.addSite(CmsSiteManager.java:289)<br>>><br>>> In javadoc its written: "Adds a new CmsSite to the list of<br>>> configured sites, this is only allowed during configuration"
<br>>> Does anybody know how to get "during configuration"?<br>>> -or know a different solution<br>>> Best regards<br>>> Andy<br>> This is just an assumption, but this method might just be there to
<br>> inject the config information into the Site Manager, when opencms<br>> is booted.<br>> If that is the case, then this method just initializes the state<br>> of the Site Manager and is not meant for adding sites.
<br>><br>> But this is just a guess. The only way to find out is by checking<br>> how the Site Manager gets frozen. But with other classes I have<br>> seen, that they are usually created, initialized with runtime data
<br>> and then frozen. If that's the case here, then you only way of<br>> changing the configuration might be by injecting sth into the XML<br>> config and somehow triggering a restart of your web app. The
<br>> latter is probably not possible with any of the opencms apis<br>><br>> christian<br>><br>><br>> _______________________________________________<br>> This mail is sent to you from the opencms-dev mailing list
<br>> To change your list options, or to unsubscribe from the list,<br>> please visit<br>> <a href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev
</a><br>><br>><br>> ------------------------------------------------------------------------<br>><br>><br>> _______________________________________________<br>> This mail is sent to you from the opencms-dev mailing list
<br>> To change your list options, or to unsubscribe from the list, please visit<br>> <a href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a><br><br>
<br>_______________________________________________<br>This mail is sent to you from the opencms-dev mailing list<br>To change your list options, or to unsubscribe from the list, please visit<br><a href="http://lists.opencms.org/mailman/listinfo/opencms-dev">
http://lists.opencms.org/mailman/listinfo/opencms-dev</a><br></blockquote></div><br>