AnsweredAssumed Answered

Open CMIS and Java Upload for Custom Types

Question asked by bendavies on Nov 17, 2018
Latest reply on Nov 19, 2018 by angelborroy

Just downloaded latest community edition. Installed fine, UI working, documents uploading etc.

 

Figured out how to use the Model Manager to create a ‘model’ called ‘Document’. Within this model I created a ‘custom type’ called ‘dc:PCN’ with a display name of ‘PCN’. Against the custom type I created 2 properties both with a datatype of ‘text’.

 

In the web UI, in the ‘Repository’ I can upload a file. I can then navigate to the new file, and change the type to the custom type I just created i.e. PCN. I can then see that the properties panel changes and I can populate these metadata fields as needed.

 

My question relates to how I do this via CMIS. In Java I have been able to code a connector to IBM FileNet and upload a file. For this I use this property something like :-

 

props.put(PropertyIds.OBJECT_TYPE_ID, “cmis:PCN”)

 

This works fine. However for Alfresco it doesn’t. If I set it to use the returned queryName for the custom type returned in a list from session.getTypeChildren("cmis:document”, true) i.e. dc:PCN

 

props.put(PropertyIds.OBJECT_TYPE_ID, “dc:PCN”)

 

If fails saying CmisObjectNotFoundException Type ‘dc:PCN’ is unknown!

 

However I can get the file to upload successfully if I use the base:-

 

props.put(PropertyIds.OBJECT_TYPE_ID, “cmis:document”)

 

Issue is there is no metadata fields associated as this is the base class.

 

So my question, what props do I need to set for me to be able to set the custom type of my file to PCN and map the metadata properties to it.

Outcomes