cancel
Showing results for 
Search instead for 
Did you mean: 

Can a property's type be a custom content type?

marcusthebrown
Champ in-the-making
Champ in-the-making
Can the property type of an aspect be a custom content type?  Something like this:


<types>
  <type name="abc:typePerson">
     <property name="abc:userID">
        <type>d:text</type>
    </property>
  </type>
</types>

<aspect name="abc:myAspect">
  <property name="abc:producer">
     <type>abc:typePerson</type>
  </property>
</aspect>

When I try and do this I get
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Property type 'abc:typePerson' of property 'abc:producer' is not found
I'm in the process of creating a custom content model and want to know if this is possible.  If so, how can I do it? 
 
Any help would be greatly appreciated!
1 REPLY 1

jayjayecl
Confirmed Champ
Confirmed Champ
Hi,

- A property of an object cannot be the "abstract object" of a content type (It's hard to explain, so I'm doing my best here). I mean, if you can refer a content type instance (an existing object) as a property, you cannot refer the content type itself as one.
- If you want to be able to set objects (like documents, spaces …) as a custom:myProperty of an aspect, you have to use property type "d:any".
If you want to restrict this "d:any" to the objects of your custom content type only, you will have to write a custom constraint.

Hope this helps