cancel
Showing results for 
Search instead for 
Did you mean: 

Child Association on cm:content

naramski
Champ in-the-making
Champ in-the-making
I want to create a gallery in Alfresco.

On each document image/jpeg, I would associate another cm:content that contains the thumbnail of the picture.

I have created a new aspect that has a child association to the thumbnail. I create the thumbnail on the event "onAddAspect".

The IntegrityChecker print an ERROR indicating :

The association source type is incorrect:
Required Source Type : {http://www.alfresco.org/model/system/1.0}container
Actual Source Type : {http://www.alfresco.org/model/content/1.0}content

The custom model I made is :

<aspect name="pictSmiley Tongueicture">
  <associations>
    <child-association name="pict:thumbnail">
      <target>
        <class>cm:content</class>
        <mantatory>false</mandatory>
        <many>false</many>
      </target>
    </child-association>
  </associations>
</aspect>

I can't figure out how to add a thumbnail as a child of my pictures. Can you help me ?
2 REPLIES 2

naramski
Champ in-the-making
Champ in-the-making
Actually, I found my mistake.

I was using the nodeService.createNode for creating a new child on onAddAspect.

I was using a ContentModel.ASSOC_CHILDREN on the second argument.

I should use QName.createQName("extension.picture", "thumbnail").

friedman30
Champ in-the-making
Champ in-the-making
Hi,

I've read your post, and it seems that you've solved the exact problem i am now facing.

I am trying to create a thumbnail view - (i want every picture in the gallery to  have an "thumbnail" aspect, that will point to a thumbnail that i created; i want the icon that is generated by alfresco to be replaced with my thumbnail).

can you please share the steps you've taken to achieve this goal?    :?:

thanks,

Dror