hidden aspect using cmis

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

hidden aspect using cmis

I'm trying to add a hidden secondary type to a document using CMIS but can't seem to get it to stay.  Here is an example using the groovy console from CMIS Workbench:

import org.apache.chemistry.opencmis.commons.*
import org.apache.chemistry.opencmis.commons.data.*
import org.apache.chemistry.opencmis.commons.enums.*
import org.apache.chemistry.opencmis.client.api.*
import org.apache.chemistry.opencmis.client.util.*

def cmiso = session.getObjectByPath("/User Homes/JoshWasHere.txt")
def secondaryTypes = cmiso.getPropertyValue("cmis:secondaryObjectTypeIds")
secondaryTypes.add("P:dp:restrictable")
secondaryTypes.add("P:sys:hidden")
def properties = new HashMap<String, Object>();
properties.put("cmis:secondaryObjectTypeIds", secondaryTypes)
cmiso.updateProperties(properties);
cmiso.getPropertyValue("cmis:secondaryObjectTypeIds")

The Result:

Result: [P:dp:restrictable, P:cm:titled, P:cm:generalclassifiable, P:sys:localized, P:cm:taggable, P:cm:author]

So one of the two secondary types I've added stays.  I don't see any errors in the web server logs. The closest thing I see that might be related is

PolicyTypeDefintionWrapper [http-nio-8080-exec-5]: Not a policy: {http://www.alfresco.org/model/cmis/1.0/cs01ext}aspects 

Are there limitation on what secondary types can be added to specific types?  Why can't I add the hidden secondary type to this document?

5 Replies
jpotts
Professional

Re: hidden aspect using cmis

Works for me on my machine as-written with no changes other than changing the path to the object and removing the P:db:restrictable addition:

Result: [P:cmSmiley Surprisedwnable, P:cm:titled, P:sys:cascadeUpdate, P:cm:taggable, P:sys:localized, P:cm:author, P:sys:hidden]

Do a cmiso.getAllowableActions() call and make sure CAN_UPDATE_PROPERTIES is in the list:

Result: Allowable Actions [allowable actions=[CAN_DELETE_OBJECT, CAN_UPDATE_PROPERTIES, CAN_GET_PROPERTIES, CAN_GET_OBJECT_RELATIONSHIPS, CAN_GET_OBJECT_PARENTS, CAN_MOVE_OBJECT, CAN_DELETE_CONTENT_STREAM, CAN_CHECK_OUT, CAN_SET_CONTENT_STREAM, CAN_GET_ALL_VERSIONS, CAN_ADD_OBJECT_TO_FOLDER, CAN_REMOVE_OBJECT_FROM_FOLDER, CAN_GET_CONTENT_STREAM, CAN_GET_APPLIED_POLICIES, CAN_CREATE_RELATIONSHIP, CAN_GET_RENDITIONS, CAN_GET_ACL, CAN_APPLY_ACL]][extensions=null]

This is Alfresco Community Edition 5.2 (201707-GA) and an ancient version of Workbench (0.11.0) hitting the browser binding.

jaxtell
Active Member

Re: hidden aspect using cmis

Thanks for the response.  That is interesting.  I'm running Alfresco

Community v6.0.7 (rb4fe76b5-b113) schema 10,201 

and Workbench

Version: 1.1.0 / Revision: 1789681 / Build: 2017-03-31T15:16:03+0200

I'll see if I can reproduce the issue in 5.2. 

EDIT: It works for me on my 5.2 installation.  Either it's an issue with 6.0, or I somehow managed to partially break my 6.0 installation.

EDIT: I just followed the instructions at https://community.alfresco.com/community/ecm/blog/2018/07/12/deploying-alfresco-content-services-com...  and deployed the latest using docker-compose.  Version 

Community Early Access v6.1.0 (r9b51cf44-b140) schema 10,301

I have the same issue on 6.1.0-EA that I have on my 6.0.7 installation.  

jpotts
Professional

Re: hidden aspect using cmis

I can confirm that the script I used that worked on 5.2 does not work when run against 6.0 (201806 GA) from Workbench 1.0.

You should look in Jira and see if there is an issue related to this and file one, if not.

jaxtell
Active Member

Re: hidden aspect using cmis

Thanks.  I opened [ALF-22019] Unable to set secondary type "P:sys:hidden" on document using CMIS client - Alfresco JIR...  and it was closed as expected behavior.  Apparently being able to add sys secodary types via cmis client in 5.2 is a bug.

jpotts
Professional

Re: hidden aspect using cmis

Just in case others don't follow the Jira link, Alfresco considers this not to be a bug but an intentional change in behavior. They no longer allow you to add aspects in the "sys" namespace to objects via CMIS. Those aspects are considered internal.