cancel
Showing results for 
Search instead for 
Did you mean: 

List of properties from custom defined type

msvoren
Champ in-the-making
Champ in-the-making
Hi,
Is there a way to access alfresco-data model from javascript?
E.g. is there a way to list all properties from xml-defined-type..

   <type name="custom:documentX">
      <title>X</title>
      <parent>cm:content</parent>
      <properties>
         <property name="custom:Pink">
            <title>prop1</title>
            <type>d:text</type>
         </property>
         <property name="custom:Floyd">
            <title>prop2</title>
            <type>d:text</type>
         </property>
      </properties>
   </type>

How can I get a list of properties from custom:documentX, like:
>
Pink
Floyd
2 REPLIES 2

rogier_oudshoor
Champ in-the-making
Champ in-the-making
Through pure javascript, no. You can however access these through the DictionaryService ( http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/service/cmr/dictionary/Dictionary... ) in Java. The easiest way is implementing your own own serviceclass (defined in spring as BaseScopableExtension) to wrap around the dictionaryService, and having your javascript call this class.

msvoren
Champ in-the-making
Champ in-the-making
Thank you for your answer!