09-21-2017 09:22 AM
Hi there,
Does anyone know of an easy way to bulk update a property on lots of documents?
The situation I have is that a new property has been added to our content model. We need to set the default value of all existing content that has been affected by this update.
Normally I would write a bit of JS to find all the documents, then iterate through each setting the property.
But here's the catch...the system has quite a lot of folder rules and behaviour policy extensions associated to my content types. If I just run my JS, it will trigger these rules and behaviour policies. I need a way of updating the property without any of this happening.
Any ideas?
Thanks
Paul
09-21-2017 06:32 PM
If you want to bulk update a property on a lot of documents you can either write a script to iterate over the docs or you can use CMIS, because CMIS 1.1 supports bulk operations against collections of objects.
You are also asking about making updates without triggering behaviors. If you want to do that, you can. I can't recall if the JavaScript API supports it, but the Java API does. Take a look at the JavaDoc for BehaviourFilter.
09-22-2017 03:28 AM
Thanks Jeff,
I'll take a look at the Java API docs.
Paul
Sent from my iPhone
09-25-2017 06:56 AM
Hi Jeff,
Just to clarify, if I write my "property update" program as a standalone CMIS application - I'm not going to be able to disable behaviours? To do that, i need to use the Java API which means implementing something like a java-backed web script that I deploy to alfresco and then call ? Or did I miss something here?
Thanks
Paul
09-28-2017 08:47 AM
It is possible to disable the folder rules and the behaviours using Javascript and the js-console addon.
You can find a sample code for behaviours at Disable alfresco policy in Javascript.js · GitHub
For the folder rules, you can use a similar approach, with something like this How to enable/disable Alfresco folder rules using JavaScript · GitHub
09-28-2017 02:29 PM
Thanks Douglas, that's really useful to know.
Paul
Explore our Alfresco products with the links below. Use labels to filter content by product module.