[opencms-dev] Sorting of elements with cms:contentload
Frank Pertack
fpertack at vater-gruppe.de
Wed May 19 16:51:01 CEST 2010
Hello,
I have a slight problem with sorting a list of xml-documents.
I constructed a jsp, that shows all employees of our company-group in
alphabetical order of their lastnames.
Additionally to that, I like to have a sorting by company (=Gesellschaft)
and by location (=Standort),how do I realize this?
When I use the following maentry.xsd, how can I change this, to make the
contentload sort the xml-files according to a different field?
code
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<!--
XSD file for the MaEntry content type
-->
<!-- 1. Root Element -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<!-- 2. Define the location of the schema location -->
<xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>
<!--<xsd:include
schemaLocation="opencms://system/modules/org.vug.templates/schemas/maentry.xsd"/>-->
<!-- 3. Root element name and type of our XML type -->
<xsd:element name="MaEntrys" type="OpenCmsMaEntrys"/>
<!-- 4. Definition of the type described above -->
<xsd:complexType name="OpenCmsMaEntrys">
<xsd:sequence>
<xsd:element name="MaEntry" type="OpenCmsMaEntry"
minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- 5. Data field definitions -->
<xsd:complexType name="OpenCmsMaEntry">
<xsd:sequence>
<xsd:element name="Title" type="OpenCmsString"
minOccurs="1" maxOccurs="1" />
<!-- Personendaten:-->
<xsd:element name="LastName" type="OpenCmsString"
minOccurs="1" maxOccurs="1" />
<xsd:element name="FirstName" type="OpenCmsString"
minOccurs="1" maxOccurs="1" />
<!-- Kontaktdaten:-->
<xsd:element name="Phone" type="OpenCmsString"
minOccurs="1" maxOccurs="1" />
<xsd:element name="Fax" type="OpenCmsString"
minOccurs="0" maxOccurs="1" />
<xsd:element name="Mobile" type="OpenCmsString"
minOccurs="0" maxOccurs="1" />
<xsd:element name="Email" type="OpenCmsString"
minOccurs="1" maxOccurs="1" />
<xsd:element name="PrivatePhone" type="OpenCmsString"
minOccurs="0" maxOccurs="1" />
<!-- Category named "Company":-->
<xsd:element name="Company" type="OpenCmsString"
minOccurs="0" maxOccurs="20" />
<xsd:element name="Location" type="OpenCmsString"
minOccurs="0" maxOccurs="10" />
<xsd:element name="Function" type="OpenCmsString"
minOccurs="0" maxOccurs="1" />
<!-- Zusatzdaten:-->
<xsd:element name="Image" type="OpenCmsVfsFile"
minOccurs="0" maxOccurs="1" />
<xsd:element name="Alignment" type="OpenCmsString"
minOccurs="1" maxOccurs="1" />
<xsd:element name="Birthday" type="OpenCmsDateTime"
minOccurs="0" maxOccurs="1" />
<xsd:element name="Date" type="OpenCmsDateTime"
minOccurs="1" maxOccurs="1" />
<xsd:element name="Comments" type="OpenCmsString"
minOccurs="0" maxOccurs="1" />
</xsd:sequence>
<xsd:attribute name="language" type="OpenCmsLocale"
use="required"/>
</xsd:complexType>
<!-- 6. Annotations are used to define additional settings for our
content type -->
<xsd:annotation>
<xsd:appinfo>
<!-- 7. Mappings allow data fields to be mapped to
content properties -->
<mappings>
<mapping element="LastName" mapto="property:Title"
/>
<mapping element="FirstName" mapto="property:Text"
/>
<mapping element="Date"
mapto="attribute:datereleased" />
</mappings>
<!-- 8. Validation rules may be create for field entry
-->
<validationrules>
<!--
<rule element="BlogText" regex="!.*[Bl]og.*"
type="warning"
message="${key.editor.warning.BlogEntry.dontallowblog|${validation.path}}"/>
-->
</validationrules>
<!-- 9. Default values can be set for each field type -->
<defaults>
<default element="Date" value="${currenttime}"/>
<default element="Alignment" value="left"/>
</defaults>
<!-- 10. This section controls which widgets are used to
edit the data fields -->
<layouts>
<layout element="Title" widget="StringWidget"/>
<layout element="LastName" widget="StringWidget"/>
<layout element="FirstName" widget="StringWidget"/>
<layout element="Phone" widget="StringWidget"/>
<layout element="Fax" widget="StringWidget"/>
<layout element="Mobile" widget="StringWidget"/>
<layout element="Email" widget="StringWidget"/>
<layout element="PrivatePhone"
widget="StringWidget"/>
<layout element="Birthday"
widget="DateTimeWidget"/>
<layout element="Date" widget="DateTimeWidget"/>
<layout element="Image"
widget="ImageGalleryWidget"/>
<layout element="Alignment" widget="SelectorWidget"
configuration="left|right|center" />
<layout element="Company" widget="SelectorWidget"
configuration="Vater 4Office GmbH|Vater
Bankenberatung GmbH|Vater Bank IT|Vater BizCon GmbH|Vater ERPteam GmbH|
Vater ESN Business Academy GmbH|Vater Holding
GmbH|Vater KNS GmbH|Vater NetCom GmbH|Vater pcs GmbH|
Vater Solution GmbH|Vater SysCon GmbH" />
<layout element="Location" widget="SelectorWidget"
configuration="Bremen, Herrmann-Ritter-Straße
106-114|Hamburg, Schellingstraße 17|Kiel, Am Kiel-Kanal 1|Kiel, Boschstraße
5|
Kiel-Wellsee, Liebigstraße
26|Kiel-Schwentinental, Lise-Meitner-Straße 25-29|
Kiel-Schwentinental, Wasserwerksweg 18" />
<layout element="Function" widget="StringWidget"/>
<layout element="Comments"
widget="TextareaWidget"/>
</layouts>
<!-- 11. UI Localization -->
<resourcebundle name="org.vug.templates.workplace"/>
<!-- 12. this section controls relationship checking -->
<relations>
<relation element="Image" type="strong"
invalidate="node" />
</relations>
<!-- 13. Previewing URI -->
<preview uri="${previewtempfile}" />
<!-- 14. Model Folder -->
<modelfolder
uri="/system/modules/org.vug.templates/models/" />
</xsd:appinfo>
</xsd:annotation>
</xsd:schema>
end of
code--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Somehow I realized, it could be working by changing the mapping of the
title, but I don't know what to change here...:
Do you have any ideas?
Mit freundlichen Grüßen
Frank Pertack
Vater Solution GmbH
Liebigstraße 26
24145 Kiel
Telefon: +49 431 20084-210
Telefax: +49 431 20084-222
Mobil: +49 151 16353519
mailto: fpertack at vater-gruppe.de
http://www.vater-gruppe.de
Amtsgericht Kiel, HRB 6403
Geschäftsführer:
Klaus-Hinrich Vater
Michael Wiese
-----
Diese Email enthält ggfs. vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese Email
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Email. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Email sind nicht gestattet.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20100519/67d0728b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0D221242.gif
Type: image/gif
Size: 13624 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20100519/67d0728b/attachment.gif>
More information about the opencms-dev
mailing list