Created
June 18, 2015 17:31
-
-
Save douglascrp/39cf1657002c324b32f3 to your computer and use it in GitHub Desktop.
Snippet of Alfresco JavaScript API to manipulate person objects
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
//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