cancel
Showing results for 
Search instead for 
Did you mean: 

Java Api CMIS - change attribuite 'cm:creator' = 'cmis:createdBy'

dmralfing
Champ in-the-making
Champ in-the-making
I´m implementing a migration with the CMIS Java Api for Alfresco 4.1. The problem is that I have to migrate also the values that indicates the owner of the files, so I have to put values in the attributes cm:creator and cm:modifier - that matches with cmis:createdBy and cmis:lastModifiedBy - .
Does it exist any way to put this values in code?.
Thank you so much
13 REPLIES 13

jpotts
World-Class Innovator
World-Class Innovator
No, those are read-only.

Jeff

dmralfing
Champ in-the-making
Champ in-the-making
Yes, it´s that I though. But it's a migration from another CMS to Alfresco, and I have to carry this
information also to the Alfresco CMS to identify at least the owner of the elements.
Maybe any job or behaviour that makes any changeOwner function done since the Alfresco system?. I don´t
mind how, but I must do it. Somebody knows how I can?

kaynezhang
World-Class Innovator
World-Class Innovator
You can customize a webscript to  modify node permission(owner) .In you webscript call
setOwner(String userId) /code> method of 
ScriptNode API</code>
or
void setOwner(NodeRef nodeRef, String userName) mehod of <code> public servcie api

dmralfing
Champ in-the-making
Champ in-the-making
Thank you so much!. I guess this function changes the attribute cm:creator, but…Is it possible to do something to change the attributes "cm:modifier", "cm:created" and "cm:modified"?. I need it because I want to have the same information in this attributes that I have in the source Content Server.
Thank you so much again!

kaynezhang
World-Class Innovator
World-Class Innovator
No,it will change cmSmiley Surprisedwner property of ownable aspect, if this node dosen't have this aspect ,the aspect will be added first.
cm:modified,cm:modifier are read only ,why do you want to modify them?

dmralfing
Champ in-the-making
Champ in-the-making
I want it because it is a migration from another content server that it already has its attributes that indicates this things - last user that modified, creation date… - . So then, if I want to migrate this information, I should need to create new customized attributes replicating all of this instead of use them. That would not be efficient, neither ellegant..

mrogers
Star Contributor
Star Contributor
The cmis specification says these properties are read only.   Sorry.
   
http://docs.oasis-open.org/cmis/CMIS/v1.1/cs01/CMIS-v1.1-cs01.html

You could upload via another protocol, or perhaps run something on the server to fix the dates after upload via cmis.

kaynezhang
World-Class Innovator
World-Class Innovator
You can change these properties using javascript api 、webscript api、or java public api.

dmralfing
Champ in-the-making
Champ in-the-making
Ok, fine, but can you tell me how?, I don´t mind web script, Java API, whatever you'd rather, but please give me any way to do it, I don´t mind how, it isn´t necessary doing it with CMIS.
Thanks!
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.