AW: [opencms-dev] nested xml content

Ulrich Rueth lists at rueth.info
Sat Dec 25 00:07:00 CET 2004


Hi Andrey,

sorry, I cannot really help you on your problems, but I have a question
myself on the nested xml content. Did you succeed in nesting another complex
element inside the second global nested element? I did not, although I
thought this was possible with alpha 3. Maybe I misunderstood something?

Thanks in advance for your help.

Regards
Ulrich

Example of what I want but did not work (see the "Section" element):

<?xml version="1.0" encoding="UTF-8"?>

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

	<xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>
	<xsd:element name="InfoRuethArticles" type="OpenCmsInfoRuethArticles"/>

	<xsd:complexType name="OpenCmsInfoRuethArticles">
		<xsd:sequence>
			<xsd:element name="InfoRuethArticle" type="OpenCmsInfoRuethArticle"
minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="OpenCmsInfoRuethArticle">
		<xsd:sequence>
			<xsd:element name="Title" type="OpenCmsString" />
			<xsd:element name="Subtitle" type="OpenCmsString"/>
			<xsd:element name="Keywords" type="OpenCmsString"/>
			<xsd:element name="Teaser" type="OpenCmsString"/>
			<xsd:element name="Author" type="OpenCmsString"/>
			<xsd:element name="Date" type="OpenCmsDateTime"/>
			<xsd:element name="Publisher" type="OpenCmsString" use="optional"/>
			<xsd:element name="Copyright" type="OpenCmsString" use="optional"/>
			<xsd:element name="Section" maxOccurs="unbounded">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="Text" type="OpenCmsHtml"/>
						<xsd:element name="Info" type="OpenCmsString" minOccurs="0"
maxOccurs="unbounded"/>
					</xsd:sequence>
					<xsd:attribute name="sectiontitle" use="optional"/>
				</xsd:complexType>
			</xsd:element>
		</xsd:sequence>
		<xsd:attribute name="language" type="OpenCmsLocale" use="required"/>
	</xsd:complexType>
</xsd:schema>

-----Ursprungliche Nachricht-----
Von: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org]Im Auftrag von Андрей Дарбинян
Gesendet: Freitag, 24. Dezember 2004 16:18
An: opencms-dev at opencms.org
Betreff: [opencms-dev] nested xml content


Hello all!

I've recently tried openCMS 6 alpha 3 and really liked the new features.
One thing among them is a possibility to have nested XML content and thus to
have all my content of the same type in a single file, easily editable by
the built-in editor.

There was a few problems i could not solve though, maybe you can help me
with them:

1) I could not read named elements from nested xml files. As i would
normally do via
JspActionElement.getContent("somefile.xml","elementname",locale)

Is there a possibility to do so at all?

2) I failed to set default values to elements via <defaults> for the inner
nested xml elements
Tried to set them both in inner and outer xsd files.

Example:

----------------------------------------------------------------------------
------------
<?xml version="1.0" encoding="UTF-8"?>

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

	<xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>
	<xsd:element name="Areas" type="OpenCmsAreas"/>

	<xsd:complexType name="OpenCmsAreas">
		<xsd:sequence>
			<xsd:element name="Area" type="OpenCmsArea" minOccurs="0"
maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="OpenCmsArea">
		<xsd:sequence>
			<xsd:element name="shape" type="OpenCmsString" />
			<xsd:element name="coords"  type="OpenCmsString" />
                        <xsd:element name="info"  type="OpenCmsHtml" />
		</xsd:sequence>
                <xsd:attribute name="language" type="OpenCmsLocale"
use="optional"/>
	</xsd:complexType>

	<xsd:annotation>
		<xsd:appinfo>
			<defaults>
                                <default attribute="language"
value="${request:locale}" />
				<default element="shape" value="rect"/>
                        </defaults>
		</xsd:appinfo>

	</xsd:annotation>
</xsd:schema>
----------------------------------------------------------------------------
-------------

Am i missing something, or is it not possible?

3) I saw a nice snippet gallery widget. Is it possible to somehow reuse it
and make it so that you can load source code of snippet of your choice into
the wysiwyg edit field (for OpenCmsHtml type element).
I know nearly everything is possible in programmer's world :), but i'm
really looking for somewhat easy solution, without much hacking of the
openCMS code.

Big thanks for your comments in advance

Best regards,
Andrey





_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list