<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Ubuntu'; font-size:9pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Hi,</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">What you specified is supposed to take the contents of the "Date" field of the structured content and write it to a "datereleased" property on certain occasions (e.g. when you press "save" in the structured content editor). If you don't put anything in the "Date" field, nothing will happen at all.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">If you want a "release date" (whatever that could be), I'd recommend to use OpenCms API to to extract it from the CmsResource somehow (instead of explicitly storing it, if possible), or maybe there is some <cms:...> tag that can do that, too.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">If you think of "release date" as the date of the last publish of the file,  you can CmsObject.readAllAvailableVersions(),  execute getPublishTag() on the first I_CmsHistoryResource and use the result to CmsObject.readHistoryProject(), which has a getPublishingDate().</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">If you think of "release date" as the date of the first publish of the file... Maybe you should fill it automatically by listening to I_CmsListener.EVENT_BEFORE_PUBLISH_PROJECT. You'll need to implement and register an I_CmsModuleAction class for you module to achieve that.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Regards,</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Wolfgang</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Am Sonntag, 2. September 2012, 11:38:30 schrieb Fantasy:<br /></p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Hi, all,<br /><br />I defined a document schema file, and add the following mapping, but when i check in the file list, non of the documents contain the realeased date. Why?<br /><br /><span style=" font-weight:600;">the definitions:</span><br /><span style=" background-color:#ffffff;"><xsd:complexType name="OpenCmsVideoDocument"><br />    <xsd:sequence><br />        <!--  some other attributes --><br />        </span><span style=" font-weight:600; background-color:#ffffff;"><xsd:element name="</span><span style=" font-weight:600; color:#0000ff; background-color:#ffffff;">Date</span><span style=" font-weight:600; background-color:#ffffff;">" type="OpenCmsDateTime" minOccurs="1" maxOccurs="1"/></span><span style=" background-color:#ffffff;"><br />        <xsd:element name="URL" type="OpenCmsString" minOccurs="1" maxOccurs="1"/><br />        <!--  some other attributes --><br />    </xsd:sequence><br />    <xsd:attribute name="language" type="OpenCmsLocale" use="required"/><br /></xsd:complexType></span><br /><br /><span style=" font-weight:600;">the mappings:</span><br /><mappings><br />    <!-- some other mapping --><br />    <mapping element="Keywords" mapto="property:Keywords"/><br />    <span style=" font-weight:600;"><mapping element="</span><span style=" font-weight:600; color:#0000ff;">Date</span><span style=" font-weight:600;">" mapto="property:datereleased"/></span><br /></mappings><br /><br /><br />Thanks.<br /><br />Fantasy<br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br /></p></body></html>