AnsweredAssumed Answered

association lost after copy/paste

Question asked by joe.l3 on Apr 6, 2010
Hi all,
I have upgraded Alfresco Community Edition from 3.0 to 3.2r2.
In new version 3.2r2 I have this problem: I lose the association of a custom content type after a copy/paste.

————————————-
System Configuration
————————————-
- Alfresco Comunity Ed. 3.2r2
- Mysql 5.0.77
- Java 1.6.0_16
- Apache Tomcat Server 6.0.18

————————————-
Issue
————————————-
- custom association of a content type lost after copy/paste

———————————–
Steps to reproduce
———————————–

1. Copy in $alfresco_extension_home directory my-model.xml :
<?xml version="1.0" encoding="UTF-8"?>
<!– Custom Model –>
<model name="kfo:myModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <description>My description</description>
   <author>Someone</author>
   <version>1.0</version>
    <imports>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>

   <namespaces>
      <namespace uri="http://www.mymodel.com/model/content/1.0" prefix="kfo"/>
   </namespaces>

<types>
   <type name="kfo:contentTest">
         <title>MY_CONTENT_Test</title>
         <parent>cm:content</parent>
         <associations>
          <association  name="kfo:assocTest">
         <title>AssociationTest</title>
              <source>
                <mandatory>false</mandatory>
                <many>true</many>
              </source>
              <target>
                <class>cm:content</class>
                <mandatory>false</mandatory>
                <many>false</many>
              </target>
          </association>
         </associations>
   </type>
</types>   
</model>

2. Copy in $alfresco_extension_home directory my-web-client-config-custom.xml
<alfresco-config>
   <config evaluator="node-type" condition="kfo:contentTest">
      <property-sheet>
         <show-association name="kfo:assocTest" />
       </property-sheet>
   </config>

   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
    <type name="kfo:contentTest" />
       </content-types>
   </config>
</alfresco-config>

3. Copy in $alfresco_extension_home my-web-client-config-custom.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
      <bean id="my_configBootstrap" class="org.alfresco.web.config.WebClientConfigBootstrap" init-method="init">
      <property name="configs">
        <list>
           <value>classpath:alfresco/extension/my-web-client-config-custom.xml</value>
        </list>
      </property>
   </bean>
    <!– Registration of new models –>
    <bean id="my.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/my-model.xml</value>
            </list>
        </property>
    </bean>
</beans>

4. Start Alfresco
5. On web client, upload a content (for example an image "test.png").
6. In any space, select "Create content".
7. Type in any name for the content. Select the type as "MY_CONTENT_Test". Select HTML "Content type". Clic next.
8. Type in anything into the content editor. Clic next. Click finish.
9. In "Modify Content Properties" form, select custom association "AssociationTest". Search for "test.png" and select it. Clic OK. Clic OK.
10. View Details of content and check the value for the "AssociationTest" property. In my case it says : /company_home/test.png
11. Now back in the space of the created content and select the "Copy" action on the piece of content.
12. Then choose the "Paste all" action within the space.
12. View Details of the pasted content  and check the value for the "AssociationTest" property. In my case it is null!!!
13. As you can see, the copying process has lost the content's "AssociationTest" ("/company_home/test.png" on the original, null on the copy).

:?: Any ideas? Thanks in advanced.
joe.l3

Outcomes