AnsweredAssumed Answered

Getting all Properties from Content Type

Question asked by dannyl999 on Apr 28, 2010
Hi,

I am currently working on a web application that interfaces with an Alfresco server through Alfresco Webservices Remote API.  One of the pages I am creating is similiar to the Alfresco UI's Create Content page, the page where the user enters all the required fields (depending on the content type selected). 

Is there a way to get ALL of the properties of a content type, INCLUDING the properties of the mandatory aspects added to the content type?

For example, the content type would look something like this:

<types>
   <type name="aa:someDoc">
      <properties>
         <property name="aa:property1">
            <constraints>
               <constraint ref="aa:constraint1"/>
            </constraints>
         </property>
         <property name="aa:property2"/>
         <property name="aa:property3"/>
      </properties>         
      <mandatory-aspects>
         <aspect>aa:someAspect</aspect>
      </mandatory-aspects>
   </type>
</types>

<aspects>
   <aspect name="aa:parentAspect">
      <properties>
         <property name="aa:parentprop1">
         <property name="aa:parentprop2">
      </properties>
   </aspect>
   <aspect name="aa:someAspect">
      <parent>aa:parentAspect</parent>
      <properties>
         <property name="aa:aspectprop1">
         <property name="aa:aspectprop2">
      </properties>
   </aspect>
</aspects>

<constraints>
   <constraint name="aa:constraint1" type="LIST">
      <parameter name="allowedValues">
         <list>
            <value>option1</value>
            <value>option2</value>
            <value>option3</value>
         </list>
      </parameter>
   </constraint>
</constraints>

In this example, I would like to get aa:property1, aa:property2, aa:property3, aa:parentprop1, aa:parentprop2, aa:aspectprop1, and aa:aspectprop2.  I've tried using the DictionaryService but it only returns the properties in the type and supertypes, but not the mandatory aspects' properties.  If there was just a way to get the mandatory aspects of a type, then that would solve it, but I couldn't find any web service that could do that.

Also, is there a way to get the constraint values as well?  I would also like to use them as drop down boxes.

Thank you.

Outcomes