• Scipt to edit database values?

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #45823  by dferguson
 
I would like to bulk remove subscriptions to documents based on their parent folder.

I am using this to delete the subscription to an individual document based on the UUID.
Code: Select all
DELETE FROM OKM_NODE_SUBSCRIPTOR WHERE NSB_NODE = 'a621eb44-3136-467f-8848-de904147f709';
This works well, but I have an entire folder full of documents that needs to have there subscriptions removed. Can I write a script to poll the data base to get the UUIDs of all the files in a specific folder, then create a while loop to insert those UUIDs into the above code to loop through the removal process?
 #45824  by dferguson
 
I think I accomplished the same result by the following....
Code: Select all
SELECT NSB_NODE, NBS_NAME FROM OKM_NODE_SUBSCRIPTOR inner join OKM_NODE_BASE on OKM_NODE_SUBSCRIPTOR.NSB_NODE = OKM_NODE_BASE.NBS_UUID where NBS_PARENT = '46209ab6-4629-4d39-978d-935f993fa3f8';
to verify I had the correct list. Then the following to delete the entries...
Code: Select all
DELETE OKM_NODE_SUBSCRIPTOR FROM OKM_NODE_SUBSCRIPTOR inner join OKM_NODE_BASE on OKM_NODE_BASE.NBS_UUID = OKM_NODE_SUBSCRIPTOR.NSB_NODE =  where NBS_PARENT = '46209ab6-4629-4d39-978d-935f993fa3f8';
Then to remove the subscriptions sent messages, which we use to create reports for our quality assurance procedures.
Code: Select all
DELETE OKM_PROP_SUB_RECEIVED FROM OKM_PROP_SUB_RECEIVED inner join OKM_NODE_BASE on OKM_NODE_BASE.NBS_UUID = OKM_PROP_SUB_RECEIVED.PSR_NODE where PSR_FROM ='jmcnaughton' and NBS_PARENT = '46209ab6-4629-4d39-978d-935f993fa3f8';

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.