AnsweredAssumed Answered

problem in accessing cuctom content model in template

Question asked by lmanoh on Dec 3, 2008
Latest reply on Dec 17, 2008 by lmanoh
Hi
i Created custom content model. access the same in template, i added the customcontent.xml and template.ftl file below the same post. i got an error like this in console.
Caused by: freemarker.core.ParseException: Encountered "&" at line 1, column 533 in workspace://SpacesStore/b4f4ad64-ac57-425c-950f-823177b4e6fc.
Was expecting one of:
    <STRING_LITERAL> …
    <RAW_STRING> …
    "false" …
    "true" …
    <INTEGER> …
    <DECIMAL> …
    "." …
    "+" …
    "-" …
    "!" …
    "[" …
    "(" …
    "{" …
    <ID> …

        at freemarker.core.FMParser.generateParseException(FMParser.java:4697)
        at freemarker.core.FMParser.jj_consume_token(FMParser.java:4568)
        at freemarker.core.FMParser.UnaryExpression(FMParser.java:323)
        at freemarker.core.FMParser.MultiplicativeExpression(FMParser.java:435)
        at freemarker.core.FMParser.AdditiveExpression(FMParser.java:385)
        at freemarker.core.FMParser.RangeExpression(FMParser.java:556)
        at freemarker.core.FMParser.RelationalExpression(FMParser.java:511)
        at freemarker.core.FMParser.EqualityExpression(FMParser.java:476)

my custom content.xml file would be,
<model name="my:mynewmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>Example custom Model</description>
   <author></author>
   <version>1.0</version>

   <!– Imports are required to allow references to definitions in other models –>
   <imports>
          <!– Import Alfresco Dictionary Definitions –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>

   <!– Introduction of new namespaces defined by this model –>
   <!– NOTE: The following namespace my.new.model should be changed to reflect your own namespace –>
   <namespaces>
      <namespace uri="my.new.model" prefix="my"/>
   </namespaces>

   <types>

      <!– Definition of new Content Type: Standard Operating Procedure –>
      <type name="my:BookSKU">
         <title>BooK SKU</title>
         <parent>cm:content</parent>
         <properties>
            <property name="my:fifDate">
               <type>d:date</type>
            </property>

            <property name="my:publishedDate">
               <type>d:datetime</type>
            </property>
            <property name="my:authorisedBy">
               <type>d:text</type>
            </property>
         </properties>
         <associations>
          <association name="my:signOff">
               <source>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </source>
               <target>
                  <class>cm:content</class>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </target>
            </association>
            <child-association name="my:processSteps">
               <source>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </source>
               <target>
                  <class>cm:content</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
                        </child-association>
         </associations>
      </type>

    </types>

    <aspects>

      <!– Definition of new Content Aspect: Image Classification –>
      <aspect name="my:imageClassification">
         <title>Image Classfication</title>
         <properties>
            <property name="my:width">
               <type>d:int</type>
            </property>
            <property name="my:height">
               <type>d:int</type>
            </property>
            <property name="my:resolution">
               <type>d:int</type>
            </property>
         </properties>
      </aspect>

   </aspects>

</model>

accessing code in template file (.ftl)

<table width="100%"  border="0" cellpadding="1" cellspacing="1">

<#list space.children as child>
      <#if child.isDocument>
   
       <tr>
          <td><b>${child.name}</b></td>

          <td><b>${child.properties["my:fifDate"]?date}</b></td>

       </tr>
     </#if>

   </#list>

</table>

please help me in this regards.
-Lenin

Outcomes