cancel
Showing results for 
Search instead for 
Did you mean: 

extracting properties.

spazzm
Champ in-the-making
Champ in-the-making
I have a problem extracting document properties -
I've defined a new type in an xml file in the extensions directory:
—–snip—–
   <namespaces>
      <namespace uri="http://www.example.com/model/ypol/1.0" prefix="ypol"/>
   </namespaces>
   <types>
      <type name="ypol:specialOffer">
         <title>YPOL special offers custom model</title>
         <parent>cm:content</parent>
         <properties>
            <property name="ypol:iblId">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>


—snip—
I've created new content of the type, and sure enough - it has the specified property.

I then try to extract the iblId property using a template with the following line:
${document.properties.iblId}
The result is an error that says that iblId is undefined.

Strangely enough, when I iterate over the properties using the example code provided in the Wiki, the parameter shows up like this:
{http://www.example.com/model/ypol/1.0}iblId = 245234

I've tried any combination of paths and keys I can think of, but nothing seems to work - how do I reference iblId?
2 REPLIES 2

kevinr
Star Contributor
Star Contributor
The templating framework by default assumes you are using the Alfresco model. To access properties from your own model namespace try like this:

   ${document.properties["ypol:iblId"]}

Thanks,

Kevin

spazzm
Champ in-the-making
Champ in-the-making
Thanks, that helped.