AnsweredAssumed Answered

support for adding List<Object> to cmis:Document

Question asked by mcs130 on Sep 5, 2012
Latest reply on Sep 12, 2012 by t_sato

After originally posting to the Apache Chemistry dev list, it was suggested that I post this question here since it is beginning to get Alfresco-specific.

We have a need to expand a content model so that the Document model can include a List<> where the List contains a custom type called UserNote…

Some of the original info as posed on the mailing list is as follows:


BTW - This is an all Java implementation from the client side.  Here is the scenario.

   We can currently add properties to cmis:Document …. let's say for simplicity, we add:

   categoryCode, type=String
   subCategoryCode, type=String
   displayName, type=String
   employeeID, type=String

   This works fine in both products - in one case, AF4, you extend the model with an XML configuration file whereas in Sharepoint, you can use the Library Admin page to add fields of various types to the current document model.  So far, so good.

   Now, we have a use case, where we need these same 4 properties, PLUS a List<UserNote> where:


   id, type=long
   date, type=Calendar
   noteText, type=String

   As I see it we have to 1) define the UserNote object in the ECM backend somehow and 2) add this List<UserNote> property to the cmis:Document.  What they are looking to do is to keep the history of these notes made by the user on this Document whenever they retrieve it to edit, etc.  Not trying to reproduce version control as much as attaching these ad-hoc notes managed on the Document.  Notes will NOT be editable.  Once entered on the UI, they are added to this List<> and simply ride around with the Document object like any other property.

   My 2 questions are:

   Can the CMIS APIs support this use case? (confirmed that this is supported by CMIS)
   If so, can anyone suggest an example or point to document showing something similar to this?

The current model we have been using successfully looks like this (where userNote is actually just a text (String) property type:

        <!– Enterprise-wide generic document type –>
        <type name="acme:doc">
            <title>ACME Document</title>
                <property name="acme:displayName">
                <property name="acme:documentType">
                <property name="acme:employeeID">
                <property name="acme:category">
                <property name="acme:subCategory">
                <property name="acme:expirationDate">
                <property name="acme:userNotes">
                <property name="acme:keyWords">

It is the following element definition above:

               <property name="acme:userNotes">

Where we want the actual <type> to be definable as a List<UserNote>

1) we have to be able to define UserNote (obviously we can model as simple Java bean)
2) we need to be able to have this acme:doc type defined such that it can include the List<> construct

Is this even feasible to do in Alfresco4?.  We currently are doing POC work with AF4 Community 4.0.e.

Thanks in advance for your time.