Book Image

Alfresco Developer Guide

Book Image

Alfresco Developer Guide

Overview of this book

Table of Contents (17 chapters)
Alfresco Developer Guide
Credits
About the Author
About the Reviewers
Preface
Index

Step-by-Step: Relating Types with Associations


SomeCo has a generic need to be able to identify documents that relate to each other for any reason. A Whitepaper might be tied to a solution offering data sheet, for example. Or maybe a project proposal the Legal department has should be related to the project plan the Operations team is managing. These relationships are called associations.

Let's update the model file to include a related-documents association in the sc:doc type so that any SomeCo document can be related to any other.

To add assocations to the model, follow these steps:

  1. Edit the scModel.xml file.

  2. Add the following associations element to the sc:doc type. Notice that the target of the association must be an sc:doc or one of its child types. The association is not mandatory, and there may be more than one related document:

        <type name="sc:doc">
          <title>Someco Document</title>
          <parent>cm:content</parent>
          <associations>
         ...