[opencms-dev] change opencms-system.xml with java code/site node
Jonathan Woods
jonathan.woods at scintillance.com
Sat Sep 16 15:00:58 CEST 2006
Do you really need to do this during runtime? As I said the other day, the
normal way to add a site is to edit opencms-system.xml (using your favourite
text editor) to include the new site(s). The changes will then be picked up
when OpenCms is next started.
Jon
_____
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Christian Steinert
Sent: 16 September 2006 12:16
To: The OpenCms mailing list
Subject: Re: [opencms-dev] change opencms-system.xml with java code/site
node
Andy Bicksbo schrieb:
Hi all!
I asked the same question afew days ago, but I didn't get s satisfying
answer since that nor i found a solution by myself.
So desparating pulling hair since that on my proplem:
I am trying to add some custom site definitions to the opencms-system.xml
through a java class with the method:
addSite() from the Class org.opencms.site.CmsSiteManager
i get the following error message:
org.opencms.main.CmsRuntimeException: Site configuration has been frozen
and can not longer be changed.
at org.opencms.site.CmsSiteManager.addSite(CmsSiteManager.java:289)
In javadoc its written: "Adds a new CmsSite to the list of configured sites,
this is only allowed during configuration"
Does anybody know how to get "during configuration"?
-or know a different solution
Best regards
Andy
This is just an assumption, but this method might just be there to inject
the config information into the Site Manager, when opencms is booted.
If that is the case, then this method just initializes the state of the Site
Manager and is not meant for adding sites.
But this is just a guess. The only way to find out is by checking how the
Site Manager gets frozen. But with other classes I have seen, that they are
usually created, initialized with runtime data and then frozen. If that's
the case here, then you only way of changing the configuration might be by
injecting sth into the XML config and somehow triggering a restart of your
web app. The latter is probably not possible with any of the opencms apis
christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060916/56b030d4/attachment.htm>
More information about the opencms-dev
mailing list