cancel
Showing results for 
Search instead for 
Did you mean: 

Can Alfresco associations carry additional data?

hbf
Champ on-the-rise
Champ on-the-rise
Hi,

Can an association have additional data associated with it? For instance, in a relationship of a department to its employees, can each association carry a "role" text-string ("Mr. Bean" is an employee of department "Blabla" and his role is "part-time employee"). Is there a general mechanism to attach such additional, per-association data?

In particular, such a mechanism could be used to order children (although there seems to be a way to achieve this, see "OrderedChildren" in the Data Dictionary Guide – but I do not know how this works).

Thanks,
Kaspar
7 REPLIES 7

itayh
Champ in-the-making
Champ in-the-making
Hi,

I am having the same problem. Can I define additional values for association?
I have an association that need to have additional values.
I have MMSMessage content type that I add images to it using association. For every Image I need to save additional values (time , index…)

One solution is to keep those additional properties in the target of the association (meaning on the image) but this is pretty ugly workaround (cause those properties are relevant for the association).

Second solution is to define relationship between properties/associations of the source node. Is it possible?

Anyone??

tfornoville
Champ in-the-making
Champ in-the-making
Hi all,

We're facing more or less the same challenge.
Currently we're investigating whether Alfresco is suitable to serve as the basis for a catalogue system. For this to work we need associations between different parts (= custom type) that carry an additional property, namely quantity.

An example:
  3 parts: car, wheel, engine.
  2 associations: "car has 4 wheels" and "car has 1 engine".

The first workaround mentioned in the previous post would't suffice because if you keep the "quantity" property on the target object it could only be associated to 1 source (another car might for example have 6 wheels).

I'm not entirely following your second option but I think it suffers from the same drawback as the first.

All advice and ideas greatly appreciated.

Cheers,
Tom

amarendra_thaku
Champ in-the-making
Champ in-the-making
I also have the same problem.If anyone has been able to solve this problem.Please reply as it is urgent to me

i did some thing like this

  
<types>
     <type name="km:forumMemberAssocs">
        <title>Forum Member Association</title>
        <parent>cm:content</parent>
         <properties>
            <property name="km:memberStatus">
               <title>Member Status</title>
               <type>d:text</type>
            </property>
         </properties>
      <associations>
         <association name="km:spaceMembersAssoc">
            <title>Space Member Assocs</title>
            <source>
               <mandatory>false</mandatory>
               <many>true</many>
            </source>
            <target>
               <class>cm:person</class>
               <mandatory>false</mandatory>
               <many>true</many>
            </target>
         </association>
      </associations>
      </type>
   </types>

and then i extended my orginial association with the type defined above.like this

      <aspect name="km:spaceMembersInfo">
         <title>userMembershipInfo</title>
         <associations>
            <association name="km:spaceMembers">
               <title>Member List</title>
               <source>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </source>
               <target>
                  <class>km:forumMemberAssocs</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
            </association>
         </associations>
      </aspect>


is this right way to do??

Can any one tell me how to do it

Thanks & Regards
Amarendra

jaaav
Champ in-the-making
Champ in-the-making
Hello,

have any of you found a solution on this matter? I haven't found a way other than adding this kind of information using database tables.

Regards.

mrogers
Star Contributor
Star Contributor
As you can see from amarendra.thakur's post above an association can be named and it be restricted to the types it comes from and goes to and the multiplicity.

So to use the example from the start of the thread you could have the following associations

carA  - carAwheel1 - wheel1
carA - carAwheel2 - wheel2
carA - carAwheel3 - wheel3
carA - carAwheel4 - wheel4

However AFAIK you can't have the abstract relationship "car has N wheels".  

You could however model a type 4WheeledCar that has 4 associations, one for each wheel. 
Or you could have a MultiWheeledCar.

Does that help or am I misunderstanding the problem?

jaaav
Champ in-the-making
Champ in-the-making
Thank you ofr your interes, I will try to explain with another example.

I have a document, let's say a text related news.

I want to attach 2 image files and a video to this text.

With an association this is possible and easy to be done.

But then I want to go a step further, I want to add some additional details, for example, I want to know who stablished the relation between the document and each file and when it was done:

text 1 - image 1 - by andrew on tuesday
text 1 - image 2 - by rose on friday
text 2 - image 1 - by peter on saturday

The additional data name and date, are specific on the association, not the document or file itself.

It is like adding an intermediate table in a database with the primary keys of both main tables (text, images) but also with additional information not belonging to any of the two main tables.

Regards and thank you again for the fast reply.

mrogers
Star Contributor
Star Contributor
The "name" is the only property allowed for a child association.  

So one option would be to have a fairly long name. :roll:

I can't see this on the enhancement list so I suggest you raise an enhancement request and vote for it.   Or better yet speak to the Alfresco project managers at an alfresco meetup or some other event.

Or contribute an enhancement.