AnsweredAssumed Answered

Creating documents with custom properties via dotcmis

Question asked by katie on May 15, 2012
Latest reply on Feb 24, 2014 by julio.aescobar

After much flailing in the dark it is looking like I am either simply missing something important or simply not trying to do this in the right way at all.

What I need to be able to do is set custom properties associated with documents when they are uploaded to the DMS.  I need to be able to search for documents based on these custom properties, and see the values of these properties in the search results.  This is all being done in C# via the dotcmis library and hope (ultimately) to interface with a number of DMS - currently, I am developing against Alfresco because we use it internally, but ultimately this will almost certainly have to work with another CMIS-compliant DMS.

I can't get anything to do with custom properties working, without resorting to using Alfresco's web interface manually after I've used my program to upload the document, and even then, I still can't search using Query…

We have a model set up with a basic document type, that currently specifies a number of mandatory aspects (this is not important, I will not require the properties to be mandatory).  I can create a document using CreateDocument with the property cmis:objectTypeId set to my document type.  If I look at the properties in the Alfresco web interface I can then see our custom properties, so this much seems to be working as I would expect.

I cannot add any custom properties in CreateDocument, this gives me a "Not found" error.  If I try to add the aspects to the cmis:objectTypeId property, this also results in a "Not found" error (this is true even for the standard CMIS aspects, so I am unable even to set a description, for example.)  This, however, does not seem particularly necessary, because according to the web interface it's expecting the properties in any case, because it's how the document type is defined.

Finally, Query will not recognise any of the custom properties.  "select * from my:doctype" gives me results, but none of the custom properties are returned even though I've specified our custom document type.  If I try to add a where-clause based on a custom property, I get an "Internal Server Error."  Changing the property name to any standard cmis property works correctly (except with dates, but that is another issue entirely!)

Can anybody suggest anything?  I can't help thinking that I am missing something quite simple.  I have run out of things to try and am about to resort to a system of encoding the custom properties in the filename!