How to extend an Alfresco repository to include work object IDs
Summary
To add support for work object attachments stored in a CMIS-compliant Enterprise Content Management (ECM) repository, you must extend the ECM data model to include the types pxAttachKey and pxRefObjectKey. Adding these types allows the attachment metadata to contain information about the work object to which the file was attached.
In the example below, the data model of an Alfresco 3.4a Community Edition repository is extended to include support for the .pxAttachKey and .pxRefObjectKey properties. For instructions on extending other ECM repositories, refer to your ECM vendor's documentation.
Suggested Approach
To extend the Alfresco data model:
- Define the custom content in an XML document
- Create an additional XML document to call the newly created content
- Place the files in the appropriate Alfresco directory
Define the custom content to be added
- Create an XML document which follows the schema described in modelSchema.xsd (located in the
<Alfresco_Home>\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\model
directory). In this example, the file is calledpega-model.xml
. - Add the following XML. This XML defines a workObjectAttachment type and contains the properties .pxAttachKey and .pxRefObjectKey.
<type name="pega:workObjectAttachment">
<title>work object attachment</title>
<parent>cm:content</parent>
<properties>
<property name="pega:pxAttachKey">
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="pega:pxRefObjectKey">
<type>d:text</type>
<mandatory>true</mandatory>
</property>
</properties>
</type>
Create a calling file
- Create an XML file with a name ending in
context
. For examplepega-model-context.xml
. - In this file, paste the following text:
<!-- Registration of new models -->
<bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap"
depends-on="dictionaryBootstrap"> <property name="models">
<list>
<value>alfresco/extension/pega-model.xml</value>
</list>
</property>
</bean>
Note: The value for the location of the pega-model.xml file must be copied exactly as given.
Place the files in the appropriate Alfresco directory
The two XML files must be placed in the <Alfresco_Home>\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension
directory. Restart Alfresco to apply the changes.