This is an extension to the information provided on How to setup a CMIS connection.
The Studio model mentioned in the information below is based on the example project that has been provided in the connection setup section. References to Alfresco DMS docker environment do refer to the default Community Edition settings as starting point.
Out of the box Alfresco uses a default model with types and properties when storing a file.
Some of these properties can be found in the Blueriq CmisExample Studio model in the entity called ‘Document_CMIS’ which stores information from the DMS in the profile (e.g. Version).
So properties need to be declared in both Blueriq and Alfresco.
If you need additional properties you can create your own, custom properties to be registered with the document and used within the Blueriq model. These need to be declared in both Blueriq and Alfresco.
The default Alfresco model, type or its properties cannot be modified. Therefor you need to create a new ‘Content model’ in Alfresco.
Information about how to do so can be found on https://docs.alfresco.com/
Background on Models: https://docs.alfresco.com/content-services/latest/config/models/
Tutorial with example: https://docs.alfresco.com/content-services/latest/tutorial/model/
The Alfresco documentation is elaborate and not all instructions are needed for the basic purpose, adding custom properties.
From the Content Model structure only the Content Model, Custom Types and Properties are required.
An example as quick reference when using the Alfresco Tutorial steps:
Create a new model
Create Model
Namespace: | model/blueriq/1.0 |
Prefix: | br |
Name: | Blueriq_model |
Create a new type
Open the created Model
- Select the option ‘Create Custom Type’
Create Custom Type
Name: | Blueriq_Custom_Type |
Parent Type: | smf:smartFolderTemplate |
Display Label: | Blueriq Custom Type |
Create new custom type properties
Open the created Custom Type
- Select the option ‘Create Property’
Create Property
Name: | custom_string |
Display Label: | Custom String |
Data Type: | d:text |
In this example you will end up with these new items:
Content Model: | Blueriq_model |
Custom Type: | br:Blueriq_Custom_Type |
Property: | br:custom_string |
(note the automatic addition of the configured prefix of the Model (in this case ‘br’) to the name of the Type and the Property)
The changes regarding Blueriq affect the Studio model and the Runtime properties.
The provided properties for the application-cmis-client.properties
need to be updated.
Specifically the blueriq.cmis.object-type-id
property.
When using the default (out of the box) properties to store a file in Alfresco and retrieving its data the object-type-id is cmis:document
.
But we want the use the new Custom Type which was created in the new Content Model in Alfresco.
So for the example we need to find the id for ‘br:Blueriq_Custom_Type’.
This involves using the Alfresco API and it is rather complicated.
It requires these steps:
blueriq.cmis.services-url,
in the application-cmis-client.properties,
+ ‘/typedesc’Replace the blueriq.cmis.object-type-id
cmis:document
with the id of the new Custom Type and save the properties file.
blueriq.cmis.object-type-id
=cmis:document
becomesblueriq.cmis.object-type-id
=D:br:Blueriq_Custom_Type
In the Studio model changes need to be made to receive and work with the custom property within the profile. Basically, consisting of:
- Add an attribute, for the property value.
- Specify the new attribute as TargetAttribute for the DMS property value in service call with service type AQ_CMIS_GetDocumentMetadata.
- Specify the new attribute as value for the DMS property field in service call with service type AQ_CMIS_Documentmanager (to set and update the value of the property)
- Additional changes to pages, AQ_InstanceList, flow, to see and update the value.
For the provided CmisExample model, examples of the changes to Entity and Service Calls are provided here:
- Document_CMIS (entity):
Add an attribute for the new property.
- CMIS_GetMetaData (service call)(service type AQ_CMIS_GetDocumentMetadata):
To get the value of the custom property into the profile.
In section CUSTOM PROPERTIES
Specify the custom property from the DMS to be mapped to the new attribute.
- DocumentManager_Update (service call)(service type AQ_CMIS_Documentmanager):
To set/update the value of the custom property.
In section CUSTOM METADATA
Specify the custom property from the DMS to be mapped to the new attribute.
This is what it could look like:
Page ‘Document overview’
Edit the document in Page ‘Document view’
Add a value for the Custom String
After 'Update'
Page ‘Document view’
Document properties in the Alfresco repository
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels. Note: the article itself also appears as related article, this is a known limitation.