AnsweredAssumed Answered

Aspects and Constraints

Question asked by tim@lcs on Feb 15, 2012
Latest reply on Feb 13, 2013 by mjf
Hello,

I have been working on a content model for our organization and have a few questions regarding what may be best-practices. These concepts could possibly be best practices in the realm of OOP but not in content modeling in Alfresco.

This first set of questions will help guide me in the next round of questions. So, thanks for the help in advance.

I have created an example model with constraints and aspects (only).

1.    Can an Aspect's property have a constraint like the model below?
2.   Can the same aspect be applied to an entity multiple times? For example, a document is relevant to several people in the organization. Using the model above, is it possible (or recommended, or discouraged…) to apply the aspect multiple times, each with a different ‘Person Type’ property?

Here is the example:
<!– PersonType Constraint–>
<constraints>
   <constraint name="my:person_personTypeConstraint" type="LIST">
      <parameter name="allowedValues">
         <list>
            <value>Employee</value>
            <value>Consultant</value>
            <value>Vendor</value>
            <value>Other</value>
         </list>
      </parameter>
      <parameter name="caseSensitive">
         <value>true</value>
      </parameter>
   </constraint>
</constraints>


<!– Person Aspect –>
<aspects>
   <aspect name="my:Person">
      <title>Person</title>
      <properties>
         <property name="my:personId">
            <title>Person ID</title>
            <type>d:long</type>
         </property>
         <property name="my:personName">
            <title>Name</title>
            <type>d:text</type>
         </property>
         <property name="my:personType">
            <title>Person Type</title>
            <type>d:text</type>
            <constraints>
               <constraint ref="person_personTypeConstraint" type="LIST"/>
            </constraints>
         </property>
      </properties>
   </aspect>
</aspects>
Thanks!
-Tim

Outcomes