cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to find association definition for association

timv
Champ in-the-making
Champ in-the-making
Hi,

I added an association to my custom content type and I added the show-association in the web client config file.

But I don't see anything of the association in the web client. And when I click to save the new content, I get:     * A system error happened during the operation: Transaction didn't commit: ContentData string does not have a content URL: sdfsdfs

In tomcat logs:
10:25:24,534 WARN  [component.property.UIAssociation] Failed to find association definition for association 'cm:contains'
10:25:31,078 ERROR [util.transaction.SpringAwareUserTransaction] Transaction didn't commit
org.alfresco.error.AlfrescoRuntimeException: ContentData string does not have a content URL: sdfsdfs


I don't know how an actual association is created in the web client.

I must be missing something in the docs.
Can someone point me to the solution?


Best regards,
timv
4 REPLIES 4

gavinc
Champ in-the-making
Champ in-the-making
It sounds like you may have some errors in your configuration, could you post the model XML and property sheet configuration you have used?

timv
Champ in-the-making
Champ in-the-making
Indeed, there must be something wrong in my configuration.

I made a small testcase. Here's how it looks:
In contentmodel.xml:
      <type name="cm:event">
         <title>Event</title>
         <parent>cm:content</parent>
         <properties>
            <property name="tv:title">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="tv:description">
               <type>d:content</type>
               <mandatory>true</mandatory>
            </property>
            <property name="tv:date">
               <type>d:date</type>
               <mandatory>true</mandatory>
            </property>
            <property name="tv:showme">
               <type>d:boolean</type>
               <mandatory>true</mandatory>
            </property>
         </properties>
     <associations>
            <child-association name="tv:asslogo">
               <source>
                  <mandatory>true</mandatory>
                  <many>false</many>
               </source>
               <target>
                  <class>sys:base</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
               <duplicate>false</duplicate>
            </child-association>
         </associations>
      </type>

In web client config:

   <config evaluator="node-type" condition="cm:event">
      <property-sheet>
         <show-property name="title" show-in-edit-mode="false" />
         <show-property name="description" show-in-edit-mode="false" />
         <show-property name="tv:title" />
         <show-property name="tv:description" />
         <show-property name="tv:date" />
         <show-property name="tv:showme" />
         <show-association name="tv:asslogo"/>
      </property-sheet>
   </config>

I also added 'cm:event' to the content wizards.
The error I get in tomcat logging now is similar: 14:18:16,489 WARN  [component.property.UIAssociation] The association named 'tv:asslogo' is not an association.
14:23:24,855 ERROR [util.transaction.SpringAwareUserTransaction] Transaction didn't commit
org.alfresco.error.AlfrescoRuntimeException: ContentData string does not have a content URL: this is my value in tv:description

When I click to save the properties of the newly created instance I get:
Error  Please correct the errors below then click OK.
    * A system error happened during the operation: Transaction didn't commit: ContentData string does not have a content URL: this is my value in tv:description

Do you see anything wrong in the association definition?

Thanks.
timv

gavinc
Champ in-the-making
Champ in-the-making
Yes, there are a couple of issues here.

The first one is that you have created a child association in your model and then configured in an association, not a child association, therefore swap


<show-association name="tv:asslogo"/>

with


<show-child-association name="tv:asslogo"/>

The error you get when trying to save the properties is due to the use of d:content for the tv:description property. This property type is not handled correctly in the property sheet. d:content typed properties are not free form text they expect a ContentData object.

You have 3 choices, you can either change the description field to be of type d:text, you could create an association if you need to point to another node in the repository or you can add 'special' handling for the d:content type.

There is a JIRA bug raised for the lack of handling of d:content in the property sheet here http://www.alfresco.org/jira/browse/AWC-816

timv
Champ in-the-making
Champ in-the-making
Thanks, I've followed your instructions and it works now.
Greets,
Tim