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

cancel
Showing results for 
Search instead for 
Did you mean: 
yaqine
Active Member

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

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
douglascrp
Advanced II

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

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
Customer

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

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
Advanced II

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

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
Customer

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

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.