Reputation: 65
I'm currently working on a content model for my Alfresco instance. In this content model, I have a base document type, and multiple specific document types (e.g. report, test procedure, statement of work etc.) which are children of the base document type.
I am in the process of configuring the forms for the "edit properties" section in share, for these document types, and I am looking for a way to inherit the form configuration from my base document type, so that I only need to define it once in my share-config-custom.xml (as opposed to copying the same xml code over and over again). Is there a simple way to do this?
Thanks
Marcus
Upvotes: 2
Views: 174
Reputation: 65
Found a workaround, which is to use aspects instead. Define aspects containing your document metadata in your content model, and apply them to your document types. Then you can define forms for these aspects by using evaluator="aspect" in share-config-custom.xml
Content Model with a "metadata" aspect:
<aspects>
<aspect name="vor:docMetaData">
<title>Vorticity Document Metadata</title>
<properties>
<property name="vor:docType">
<type>d:text</type>
<multiple>false</multiple>
<constraints>
<constraint ref="vor:docTypeList" />
</constraints>
</property>
<property name="vor:docTitle">
<type>d:text</type>
</property>
<property name="vor:docNumber">
<type>d:text</type>
</property>
<property name="vor:customerNumber">
<type>d:text</type>
</property>
<property name="vor:project">
<type>d:text</type>
<multiple>false</multiple>
<constraints>
<constraint ref="vor:projectList" />
</constraints>
</property>
<property name="vor:issueStatus">
<type>d:text</type>
<multiple>false</multiple>
<constraints>
<constraint ref="vor:issueOptions" />
</constraints>
</property>
<property name="vor:issueNumber">
<type>d:int</type>
</property>
</properties>
</aspect>
</aspects>
Aspect applied to type:
<types>
<!--Parent vor:doc type-->
<type name="vor:doc">
<title>Vorticity Document</title>
<parent>cm:content</parent>
<mandatory-aspects>
<aspect>vor:docMetaData</aspect>
</mandatory-aspects>
</type>
</types>
Configuration in share-config-custom.xml
<config evaluator="aspect" condition="vor:docMetaData">
<forms>
<form>
<field-visibility>
<show id="vor:docTitle" />
<show id="vor:docType" />
<show id="vor:docNumber" />
<show id="vor:customerNumber" />
<show id="vor:project" />
<show id="vor:issueStatus" />
<show id="vor:issueDate" />
</field-visibility>
<appearance>
<set id="docinfo" appearance="" />
<set id="issued" appearance="" template="/org/alfresco/components/form/2-column-set.ftl"/>
<field id="vor:docTitle" label="Document Title" set="docinfo" />
<field id="vor:docType" label="Document Type" set="docinfo" />
<field id="vor:docNumber" label="Document Number" set="docinfo" />
<field id="vor:customerNumber" label="Customer Number" set="docinfo" />
<field id="vor:project" label="Project" set="docinfo" />
<field id="vor:issueStatus" label="Issue Status" set="issued" />
<field id="vor:issueDate" label="Issue Date" set="issued" />
</appearance>
</form>
</forms>
</config>
Upvotes: 1