[opencms-dev] opencms-dev] Xml content definition problem with resource.type.id
Fievet Marc
Marc.Fievet at winterthur.be
Mon Feb 14 14:24:00 CET 2005
Hello Alex,
Hereby my followings steps:
1. I create a new xml schema located in the /sites/default/fr/news/
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema
<http://www.w3.org/2001/XMLSchema> " elementFormDefault="qualified">
<xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>
<xsd:element name="headnews" type="OpenCmsHeadnews"/>
<xsd:complexType name="OpenCmsHeadnews">
<xsd:sequence>
<xsd:element name="headnew" type="OpenCmsHeadnew" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OpenCmsHeadnew">
<xsd:sequence>
<xsd:element name="Title" type="OpenCmsString" />
</xsd:sequence>
<xsd:attribute name="language" type="OpenCmsLocale" use="required"/>
</xsd:complexType>
<xsd:annotation>
<xsd:appinfo>
<mappings>
<mapping element="Title" mapto="property:Title" />
</mappings>
</xsd:appinfo>
</xsd:annotation>
</xsd:schema>
2. When I try to create a new headnews display on the dropdown list with the
new number ID (in my case id =77) On the second, screen (for the name of the
resource) I have the following error message: " Maybe you don't have the
needed permissions or this resource already exists.
Please check the entered data or contact your system administrator. "
Details of the error screen:
org.opencms.xml.CmsXmlException: Unmarshalling xml document failed! [Code
400 - Error in xml processing]
Root cause was: org.dom4j.DocumentException: null Nested exception: null
....
>Root cause: >org.dom4j.DocumentException: null Nested exception: null
3. When I tried to create a new file by choosing the "generic XML Content".
this content:
<?xml version="1.0" encoding="UTF-8"?>
<Headnews xmlns:xsi=" <http://www.w3.org/2001/XMLSchema-instance>
http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="opencms://sites/default/fr/news/headnews.xsd"
>
<Headnew language="fr">
<Title><![CDATA[Enter the title of the article here...]]></Title>
</Headnew>
</Headnews>
I have this error :
<errors> <error column="142" line="4">cvc-elt.1: Cannot find the declaration
of element 'Headnews'.</error></errors>
In the opencms-vfs, I declare
<type class="org.opencms.file.types.CmsResourceTypeXmlContent">
<param name="resource.type.id">77</param>
<param name="resource.type.name">headnews</param>
<param name="schema">/sites/default/fr/news/headnews.xsd</param>
</type>
In the opencms-workplace.xml, those entries:
<explorertypes>
<explorertype name="headnews" key="fileicon.headnews" icon="headnews.gif"
reference="xmlcontent">
<newresource page="structurecontent"
uri="newresource_xmlcontent.jsp?newresourcetype=headnews" order="25"/>
</explorertype>
What's wrong?
Extended a existing schema works. I try with the article.xsd present in the
demo by adding some properties but create a new one from scratch is not the
same.
Thank you
Regards,
MARC
Can you post more details regarding this issue?
Best Regards,
Alex.
Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com <http://www.alkacon.com/>
_____
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Fievet Marc
Sent: Friday, February 11, 2005 6:01 PM
To: 'The OpenCms mailing list'
Subject: [opencms-dev] Xml content definition problem with resource.type.id
Hello,
I try to create my own schema according the doc transmitted by Alex
In the examples, you suggest to choose id 13
ID 13 is allocated to the Widget demo and when I declare this id in the
vfs.xml, it's the widgetdemo.xsd who parsed my content. Ok, that's correct
according the rules.
When I declare for my schema id 33 or 77, I have this return code " OpenCms
content definition XML schema structure: Invalid list name [Code 400 - Error
in xml processing]"...
example:
<type class="org.opencms.file.types.CmsResourceTypeXmlContent">
<param name="resource.type.id">77</param>
<param name="resource.type.name">headnews</param>
<param
name="schema">/sites/default/fr/news/headnews.xsd</param>
</type>
Is there another file where the id chosen must be declared?
Some restricted id we can't use? What id I can use to declare my schema?
Thanks
Regards,
MARC
____________________________________________________________________________
__
Disclaimer - Winterthur Europe Assurances - Avenue des Arts/Kunstlaan 56 -
1000 Brussels (BEL)
This message may contain confidential, proprietary or legally privileged
information and is intended only for the use of the addressee named above.
No confidentiality or privilege is waived or lost by any mistransmission. If
you are not the intended recipient of this message you are hereby notified
that you must not use, disseminate, copy it in any form or take any action
in reliance on it. If you have received this message in error please delete
it and any copies of it and notify Winterthur immediately. This e-mail
message and any attached files have been scanned for the presence of
computer viruses. However, you are advised that you open any attachments at
your own risk. The integrity and security of this message cannot be
guaranteed on the Internet.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20050214/c2fde005/attachment.htm>
More information about the opencms-dev
mailing list