Created
April 22, 2014 23:18
-
-
Save jpotts/11197704 to your computer and use it in GitHub Desktop.
Update a person object in Alfresco using CMIS 1.1 and cmis:item support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rs = session.query("select cmis:objectId FROM cm:person where cm:firstName like 'Te%' and cm:organization like 'Green%' and cm:location like 'Dallas%' and (cm:companypostcode <> '75070' or cm:companypostcode is null)", false) | |
if (rs.getTotalNumItems() == 0) { | |
println("Couldn't find person that matched query") | |
return | |
} | |
for (res in rs) { | |
personId = res.getPropertyValueById("cmis:objectId") | |
person = session.getObject(personId) | |
println("Updating " + person.getPropertyValue("cm:userName")) | |
postalCode = person.getPropertyValue("cm:companypostcode") | |
props = new HashMap<String, Object>() | |
props["cm:companypostcode"] = "75070" | |
person.updateProperties(props, false) | |
} | |
println("Done") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good morning @jpotts,
I using alfresco comunity 4.2.f. How can I enable cmis:item support on it?
Thanks,
Vladimir.
vurquia@gmail.com