AnsweredAssumed Answered

opencmis - addaspect - Alfresco 4.2

Question asked by luigi on Dec 19, 2013
Latest reply on Jan 20, 2014 by luigi
Hello,

I trying write an application using the alfresco opencmis plugin in Alfresco 4.2 Community Ed (Bitnami VM).
I just created a custom model with custom aspect.
those are my steps:
- Rename /…/shared/classes/extension/custom-model-context.xml.sample to custom-model-context.xml and customModel.xml.sample to customModel.xml
This is my custom aspect in customModel.xml:


<aspects>
<aspect name="custom:ModuloDetails">
<title>Document Dettaglio Moduloies>
<property name="custom:CodProtocollo">
<title>Codice Modulo</title>
<type>d:text</type>
<protected>false</protected>
<mandatory>true</mandatory>
<multiple>false</multiple>
</property>
<property name="custom:CodModulo">
<title>Codice Modulo</title>
<type>d:text</type>
</property>
</properties>
</aspect>
</aspects>



- Rename  web-client-config-custom.xml.sample web-client-config-custom.xml
this is my code added


<config evaluator="string-compare" condition="Action Wizards">
<aspects>
<aspect name="custom:ModuloDetails"/>
</aspects>
</config>

<config evaluator="aspect-name" condition="custom:ModuloDetails">
<property-sheet>
<show-property name="custom:CodProtocollo"/>
<show-property name="custom:CodModulo"/>
</property-sheet>
</config>



Problems:
1. no additional properties visible in Alfresco
2. if I add aspect programmatically


AlfrescoDocument alfDoc = (AlfrescoDocument) doc;
alfDoc.addAspect("P:custom:ModuloDetails");


I have got this error
org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Bad Request

Any help appreciated.

Thanks

Outcomes