Skip to content

Instantly share code, notes, and snippets.

@jpotts
Created April 22, 2014 23:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpotts/11197704 to your computer and use it in GitHub Desktop.
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
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")
@vurquia
Copy link

vurquia commented Sep 15, 2014

Good morning @jpotts,
I using alfresco comunity 4.2.f. How can I enable cmis:item support on it?
Thanks,
Vladimir.
vurquia@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment