[opencms-dev] AW: Nested Structured Content and Locale

bessette Bessette at pokemon-seattle.com
Wed May 2 21:25:23 CEST 2007


Nick,

  Thanks for your help.  I may need it some more.  I'm getting the following
exception thrown.  I've included my main schema and the included one below.


Error:
org.opencms.xml.CmsXmlException: Invalid OpenCms content definition XML
schema structure:
Element "/xsd:schema/xsd:complexType[2]/xsd:sequence/xsd:element[1]" does
not have the required attribute "minOccurs".
	at
org.opencms.xml.CmsXmlContentDefinition.validateAttribute(CmsXmlContentDefinition.java:393)
	at
org.opencms.xml.CmsXmlContentDefinition.validateComplexTypeSequence(CmsXmlContentDefinition.java:559)
	at
org.opencms.xml.CmsXmlContentDefinition.unmarshalInternal(CmsXmlContentDefinition.java:682)
	at
org.opencms.xml.CmsXmlContentDefinition.unmarshal(CmsXmlContentDefinition.java:298)
	at
org.opencms.xml.CmsXmlContentDefinition.unmarshalInternal(CmsXmlContentDefinition.java:645)
	at
org.opencms.xml.CmsXmlContentDefinition.unmarshal(CmsXmlContentDefinition.java:252)
	at
org.opencms.file.types.CmsResourceTypeXmlContent.createResource(CmsResourceTypeXmlContent.java:111)
	at org.opencms.file.CmsObject.createResource(CmsObject.java:631)
	at
org.opencms.workplace.explorer.CmsNewResourceXmlContent.actionCreateResource(CmsNewResourceXmlContent.java:181)
	at
org.apache.jsp.WEB_002dINF.jsp.offline.system.workplace.commons.newresource_005fxmlcontent_jsp._jspService(org.apache.jsp.WEB_002dINF.jsp.offline.system.workplace.commons.newresource_005fxmlcontent_jsp:66)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
	at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
	at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
	at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
	at org.opencms.loader.CmsJspLoader.load(CmsJspLoader.java:369)
	at
org.opencms.loader.CmsResourceManager.loadResource(CmsResourceManager.java:730)
	at org.opencms.main.OpenCmsCore.showResource(OpenCmsCore.java:1469)
	at org.opencms.main.OpenCmsServlet.doGet(OpenCmsServlet.java:151)
	at org.opencms.main.OpenCmsServlet.doPost(OpenCmsServlet.java:163)
	...


Main:
<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/path.to.my.module/schemas/namedtext.xsd"
/>

	<xsd:element name="mains" type="OpenCmsMains" />

	<xsd:complexType name="OpenCmsMains">
		<xsd:sequence>
			<xsd:element name="main" type="OpenCmsMain"
				minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="OpenCmsMain">
		<xsd:sequence>
			<xsd:element name="Name" type="OpenCmsString" />
			<xsd:element name="Number" type="OpenCmsString" />
			<xsd:element name="Image" type="OpenCmsVfsFile"
				minOccurs="0" maxOccurs="1" />
			<xsd:element name="Namedtext" type="OpenCmsNamedtext"
				minOccurs="0" maxOccurs="5" />
		</xsd:sequence>
		<xsd:attribute name="language" type="OpenCmsLocale"
			use="required" />
	</xsd:complexType>

	<xsd:annotation>
		<xsd:appinfo>
			<mappings>
				<mapping element="name" mapto="property:Title" />
			</mappings>
			<layouts>
				<layout element="Image" widget="ImageGalleryWidget" />
			</layouts>
		</xsd:appinfo>
	</xsd:annotation>

</xsd:schema>


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

	<xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd" />

	<xsd:element name="namedtexts" type="OpenCmsNamedtexts" />

	<xsd:complexType name="OpenCmsNamedtexts">
		<xsd:sequence>
			<xsd:element name="namedtext" type="OpenCmsNamedtext"
				minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="OpenCmsNamedtext">
		<xsd:sequence>
			<xsd:element name="Name" type="OpenCmsString" />
			<xsd:element name="Text" type="OpenCmsHtml" />
		</xsd:sequence>
		<xsd:attribute name="language" type="OpenCmsLocale"
			use="optional" />
	</xsd:complexType>

	<xsd:annotation>
		<xsd:appinfo>
			<mappings />
			<layouts>
				<layout element="Text" widget="HtmlWidget"
				
configuration="source,link,anchor,formatselect,imagegallery,downloadgallery,linkgallery,htmlgallery,tablegallery,height:200px"
/>
			</layouts>
			<defaults />
		</xsd:appinfo>
	</xsd:annotation>

</xsd:schema>


Thanks,
Eric
-- 
View this message in context: http://www.nabble.com/Nested-Structured-Content-and-Locale-tf3644477.html#a10292900
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20070502/7ee115de/attachment.htm>


More information about the opencms-dev mailing list