Skip to content

Instantly share code, notes, and snippets.

@douglascrp
Created June 18, 2015 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglascrp/39cf1657002c324b32f3 to your computer and use it in GitHub Desktop.
Save douglascrp/39cf1657002c324b32f3 to your computer and use it in GitHub Desktop.
Snippet of Alfresco JavaScript API to manipulate person objects
//var nodes = search.luceneSearch('+TYPE:"cm:person" AND +@cm\\:lastName:\"lastName\"');
//var nodes = search.luceneSearch('+TYPE:"cm:person" AND -@cm\\:lastName:\"lastName\"');
var nodes = search.luceneSearch('+TYPE:"cm:person"');
logger.log(nodes.length);
for each(var node in nodes) {
var userid = node.properties.userName;
var useremail = node.properties.email;
logger.warn(userid + " " + useremail);
node.properties.email = "user1@localhost";
node.save();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment