Skip to content

Instantly share code, notes, and snippets.

@jpotts
Created April 23, 2014 22:24
Show Gist options
  • Save jpotts/11234604 to your computer and use it in GitHub Desktop.
Save jpotts/11234604 to your computer and use it in GitHub Desktop.
Enable a rule and set it to run on sub-folders in Alfresco through CMIS by leveraging cmis:item support in CMIS 1.1
rs = session.query("select R.cmis:objectId from rule:rule as R join cm:titled as T on R.cmis:objectId = T.cmis:objectId where T.cm:title = 'add classifiable aspect'", false)
if (rs.getTotalNumItems() == 0) {
println("Couldn't find a rule that matched your query")
return
}
for (res in rs) {
ruleId = res.getPropertyValueById('cmis:objectId')
rule = session.getObject(ruleId)
props = new HashMap<String, Object>()
props['rule:applyToChildren'] = true
props['rule:disabled'] = false
rule.updateProperties(props)
}
println("Done")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment