[opencms-dev] change opencms-system.xml with java code/site node

Sebastian Himberger sebastian.himberger at gmx.de
Mon Sep 18 17:36:43 CEST 2006


Hi Andy,

we used dom4j to alter the site configuration. But don't forget you have
to restart OpenCms atfer a change to the site configuration.

best regards
Sebastian

Andy Bicksbo schrieb:
> HI
> i do not need to this during runtime....but it would be the best
> solution for my tasks(build an admin module, whith witch the admin can
> do multisite configuratation.)
> I thought thebest way to edit the opencms-system.xml is to use some of
> the provided opencms java classes, rather than writing my own package,
> to edit this for example with dom4j or jdom (when rading this file
> there are some additional problems to make the parser find the .dtd)
> Andy
>
>  
> 2006/9/16, Jonathan Woods <jonathan.woods at scintillance.com
> <mailto:jonathan.woods at scintillance.com>>:
>
>     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> [mailto:
>     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
>
>
>     _______________________________________________
>     This mail is sent to you from the opencms-dev mailing list
>     To change your list options, or to unsubscribe from the list,
>     please visit
>     http://lists.opencms.org/mailman/listinfo/opencms-dev
>
>
> ------------------------------------------------------------------------
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list