cancel
Showing results for 
Search instead for 
Did you mean: 

Repeating Attributes?

rberg
Champ in-the-making
Champ in-the-making
Hello,

Does alfresco provide the ability to have repeating attributes (Documentum lingo)?  Basically, can you have an attribute that contains multiple values? 

For example let's say you have an aspect called subscribeable. And you wanted an attribute subscribers that contained multiple e-mail addresses.

Currently the only way I can see to do this is to have a delimited string that is parsed manually.

Any thoughts or strategies?

-Ryan
2 REPLIES 2

andy
Champ on-the-rise
Champ on-the-rise
Hi

Yes, you can have multi-valued properties.

Start with:
http://www.alfresco.org/mediawiki/index.php/Security_and_Authentication
http://www.alfresco.org/mediawiki/index.php/Type_Mechanism

For example:


      <aspect name="cm:generalclassifiable">
         <title>General Classifiable</title>
         <parent>cm:classifiable</parent>
         <properties>
            <property name="cm:categories">
               <title>Categories</title>
               <type>d:category</type>
               <mandatory>false</mandatory>
               <multiple>true</multiple>
               <index enabled="true">
                  <atomic>true</atomic>
                  <stored>true</stored>
                  <tokenised>true</tokenised>
               </index>
            </property>        
         </properties>
      </aspect>

There are methods on DefaultTypeConverter.INSTANCE to support using multi-valued properties.

Regards

Andy

rbramley
Champ in-the-making
Champ in-the-making
Although if you go the multiple value route it gets stored as a Serialized set. The current hibernate configuration is limited to 16k for serialized values…


<property name="serializableValue" column="serializable_value" type="serializable" length="16384"/>

Instead - the cm:subscribable aspect uses node associations to cmSmiley Tongueerson:

<aspect name="cm:subscribable">
         <associations>
            <association name="cm:subscribedBy">
               <source>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </source>
               <target>
                  <class>cm:person</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
            </association>
         </associations>
      </aspect>

Hope this helps!