Created
April 23, 2014 22:24
-
-
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
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 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