[opencms-dev] Can I modify An XmlSchema with API?

Alessio Brizi alessio.brizi at gmail.com
Fri Nov 21 18:25:32 CET 2008


I'm trying to setup a backoffice for my site in which I can add a field (of
simple type) to the schema defining my contents.

 

My code is:

CmsXmlContent content = CmsXmlContentFactory.unmarshal($cmsObject,
currentResource, request);

CmsXmlContentDefinition def = content.getContentDefinition();

CmsXmlStringValue newType = new CmsXmlStringValue(elementName, "0", "1");

def.addType(newType);

 

but unfortunately the addtype raise an UnsupportedOperationException with
the following stack trace (just the beginning, obvious):

java.lang.UnsupportedOperationException

        at java.util.Collections$UnmodifiableCollection.add(Unknown Source)

        at
org.opencms.xml.CmsXmlContentDefinition.addType(CmsXmlContentDefinition.java
:858)

 

Can anyone help me? Is it possible to do such operation? Where's the error?

Thanks in advance

 

Alessio Brizi

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20081121/531c7d69/attachment.htm>


More information about the opencms-dev mailing list