Adding an association - Alfresco Content Services - 23.4 - 23.4 - Ready - Alfresco - external

Alfresco Content Services

Platform
Alfresco
Product
Alfresco Content Services
Release
23.4
License

In this tutorial you add an association to your model. An association is a logical link between content types, it is a way of connecting related content.

Complete the previous tutorials in this series before attempting this one.

  1. In your IDE, open the file aio/aio-platform-jar/src/main/resources/alfresco/module/aio-platform-jar/model/content-model.xml and load it into the editor.
  2. Change the MyCompany generic document type to the following code:
    <!-- Enterprise-wide generic document type -->
    <type name="my:doc">
        <title>MyCompany Generic Document</title>
        <parent>cm:content</parent>
        <associations>
            <association name="my:relatedDocuments">
                <title>Related Documents</title>
                <source>
                    <mandatory>false</mandatory>
                    <many>true</many>
                </source>
                <target>
                    <class>my:doc</class>
                    <mandatory>false</mandatory>
                    <many>true</many>
                </target>
            </association>
        </associations>
    </type>
    
  3. To build and restart the project see the Working with an All-In-One (AIO) Project section in the Alfresco In-Process SDK documentation.

The association has been created and deployed.