[opencms-dev] Nested Structured Content and Preview

Bob Silent silent.bob98 at gmail.com
Fri Jul 25 11:17:33 CEST 2008


Hi,

I have problems with my Nested Structured Content.

Creating a document with this Structured Content is ok and editing
too. Everything is ok but when i tried to preview my document, an
error occured:

org.opencms.main.CmsRuntimeException: It's not possible to get the
String value of a nested XML content definition.
	at org.opencms.xml.types.CmsXmlNestedContentDefinition.getStringValue(CmsXmlNestedContentDefinition.java:139)
	at org.opencms.xml.A_CmsXmlDocument.getStringValue(A_CmsXmlDocument.java:389)
	at org.opencms.loader.A_CmsXmlDocumentLoader.dumpAsString(A_CmsXmlDocumentLoader.java:149)
	at org.opencms.loader.CmsXmlContentLoader.dumpAsString(CmsXmlContentLoader.java:52)
	...

I don't know how to resolve it

Here my first xsd (vitrine.xsd):

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">

  <xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd" />
  <xsd:include schemaLocation="opencms://system/modules/org.company.templates/schemas/decor.xsd"
/>

  <xsd:element name="Vitrines" type="OpenCmsVitrines" />

  <xsd:complexType name="OpenCmsVitrines">
    <xsd:sequence>
      <xsd:element name="Vitrine" type="OpenCmsVitrine" minOccurs="0"
maxOccurs="unbounded" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="OpenCmsVitrine">
    <xsd:sequence>
      <xsd:element name="Titre" type="OpenCmsString" minOccurs="1"
maxOccurs="1" />
      <xsd:element name="Description" type="OpenCmsHtml" minOccurs="1"
maxOccurs="1" />
      <xsd:element name="Decor" type="OpenCmsDecor" minOccurs="1"
maxOccurs="unbounded" />
    </xsd:sequence>
    <xsd:attribute name="language" type="OpenCmsLocale" use="required" />
  </xsd:complexType>

  <xsd:annotation>
    <xsd:appinfo>
      <resourcebundle name="org.company.templates"/>
      <preview uri="${previewtempfile}" />
    </xsd:appinfo>
  </xsd:annotation>
</xsd:schema>

and then the nested xsd (decor.xsd)

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
  <xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd" />

  <xsd:element name="Decors" type="OpenCmsDecors" />

  <xsd:complexType name="OpenCmsDecors">
    <xsd:sequence>
      <xsd:element name="Decor" type="OpenCmsDecor" minOccurs="0"
maxOccurs="unbounded" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="OpenCmsDecor">
    <xsd:sequence>
      <xsd:element name="TitreDecor" type="OpenCmsString"
minOccurs="1" maxOccurs="1" />
      <xsd:element name="ImageDecor" type="OpenCmsVfsFile"
minOccurs="1" maxOccurs="unbounded" />
    </xsd:sequence>
    <xsd:attribute name="language" type="OpenCmsLocale" use="optional" />
  </xsd:complexType>

    <xsd:annotation>
    <xsd:appinfo>
      <resourcebundle name="org.company.templates"/>
      <preview uri="${previewtempfile}" />
    </xsd:appinfo>
  </xsd:annotation>
</xsd:schema>

Thanks



More information about the opencms-dev mailing list