cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, i want to know how to add custom types dynamically to my custom model via a web script or repository service

yaqine
Champ on-the-rise
Champ on-the-rise

We have an application in production that manage documents and their properties, and we want to migrate to alfresco,

so we have a database table that contains all documents types, i have a big number of types so i can't add them to a custom model by the classic approach (in mymodel.xml create all types as a subtypes of cm:content, and for every type add properties), but i want to create a java application that create my types and properties via a rest call.

So how to do that and if there is an other way to do it please tell me

thanks in advance

4 REPLIES 4

douglascrp
World-Class Innovator
World-Class Innovator

AFAIK, there is no way to do so.

One option would be o create custom Aspects, as this offers you some freedom to play with different sets of properties per document.

But even with that option, you would still need to deploy a custom model every time you need a new Aspect.

cesarista
World-Class Innovator
World-Class Innovator

Hi:

As a very very basic aprox, you can always upload your XML model (with your aspects) via REST or CMIS in /Data Dictionary/Models directory and then to enable it via Active flag of the content model, in a dynamic way.

On the other side, as far I read (I did not test it) in CMIS 1.1 you have type mutability, so you can do something in that direction.

CMIS 1.1 is now an approved spec; Here's a recap of what's new | ECM Architect 

Regards.

--C.

douglascrp
World-Class Innovator
World-Class Innovator

Cesar Capillas‌ Judging by Axel's answer in the link below, I believe that is not possible with the Alfresco's CMIS implementation.

https://community.alfresco.com/message/823656-re-how-to-create-custom-object-type-using-java-opencmi... 

cesarista
World-Class Innovator
World-Class Innovator

Thanks for the link Douglas, in principle not all features of the CMIS 1.1 standard may be implemented, for any CMIS repository (including Alfresco). After your comment, I just checked CMIS repository information in CMIS workbench for example, but I did not see clearly something related (although I can see some features are not implemented in Alfresco repository: ex, Unfiling supported). Anyway I always saw a create type option in CMIS workbench types, that I thought it was related with this feature.

Regards.

--C.