Select Page

Diagramming Content Models in Alfresco

by Eric Harper

Content models in Alfresco are implemented as an XML file that is commonly deployed through the Data Dictionary or embedded in an Alfresco .amp (or .jar) customization. While programmers are used to XML and can deal with it directly, for business users and others this can be a big barrier for understanding how their content management system works.

Alfresco does have a graphical content modeling tool, Model Manager (https://docs.alfresco.com/5.2/concepts/admintools-cmm-intro.html), but it doesn’t work with the many built-in content models—or any custom model deployed through the Data Dictionary or a customization module. Model Manager also does not support model associations and has limitations on how aspects, types, and constraints can be implemented.

A business user needing to understand a content model such as this can be faced with a steep learning curve:

<?xml version="1.0" encoding="UTF-8"?>
<!-- custom model for illustrative purposes -->
<model name="my:custommodel" xmlns="https://www.alfresco.org/model/dictionary/1.0">

   <!-- Optional meta-data about the model -->   
   <description>Example Custom Model</description>
   <author>Alfresco Documentation Team</author>
   <version>1.0</version>

   <!-- Imports are required to allow references to definitions in other models -->   
   <imports>
   	  <!-- Import Alfresco Dictionary and Content Domain Model Definitions -->
      <import uri="https://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <import uri="https://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>

   <!-- Introduction of new namespaces defined by this model -->
   <namespaces>
      <namespace uri="https://www.mycompany.com/model/content/1.0" prefix="my"/>
   </namespaces>

   <types>
   	<!--  Generic document type -->
   	<type name="my:doc">
            <title>MyCompany Generic Document</title>
            <parent>cm:content</parent>    
   	</type>    
   	<type name="my:marketingDoc">
   	    <title>MyCompany Marketing Document</title>
   	    <parent>my:doc</parent>    
	    <properties>
		<property name="my:product">
		    <type>d:text</type>
		</property>
	    </properties>
	    <mandatory-aspects>
		<aspect>my:processed</aspect>
	    </mandatory-aspects>
   	</type>    
   	<type name="my:whitepaper">
            <title>MyCompany Whitepaper</title>
   	    <parent>my:marketingDoc</parent>    
        </type>    		
   </types>
   <aspects>
        <aspect name="my:processed">
            <title>Processed</title>
            <properties>
                <property name="cm:processedStatusFlag">
                    <title>Process Status</title>
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                </property>
            </properties>
    	</aspect>
    </aspects>
</model>

To meet this need, Zia has developed a module to visualize content models. The above XML is represented by this diagram:

 

The module is implemented as a repository webscript and allows the user to specify which content models to diagram. There is another webscript which provides a list of all the content models deployed in the system. For an out-of-the-box Alfresco installation, these are the deployed content models:

act:actionmodel
app:applicationmodel
trx:applicationmodel
blg:blogintegration
bpm:businessprocessmodel
ia:CalendarEventModel
cmis:cmismodel
cm:contentmodel
custom:customModel
cmm:customModelManagementModel
dl:datalistmodel
d:dictionary
dp:distributionPoliciesModel
download:downloadModel
emailserver:emailserverModel

fm:forummodel
hwf:hybridWorkflowModel
imap:imapmodel
imwf:invitation-moderated-workflow-model
inwf:invite-workflow-model
lnk:linksmodel
cmiscustom:model
facebook:publishingmodel
flickr:publishingmodel
linkedin:publishingmodel
pub:publishingmodel
slideshare:publishingmodel
twitter:publishingmodel
youtube:publishingmodel
qshare:qsharemodel
rc:RemoteCredentialsModel
rule:rulemodel
st:siteModel
smf:smartFolder
srft:solrfacetmodel
sync:syncmodel
sys:systemmodel
surf:uimodel
usr:usermodel
ver2:versionmodel
ver:versionmodel
pubwf:workflowModel
wf:workflowmodel

The Zia content model diagram module produces the content model diagram as an SVG file so the user can zoom in without loss of resolution. That’s important because even a single content model typically contains dozens of types and aspects and hundreds of metadata properties.

Contact Zia for more details on diagraming content models in Alfresco and to get the model diagram module.

Pin It on Pinterest

Sharing is caring

Share this post with your friends!