Page 1 of 1
Clear Keywords
PostPosted:Sat Jan 26, 2013 1:54 am
by chackem
Is there a way in Beanshell to clear ALL the keywords for a given node at one time? I've figured out how to add and remove a keyword one at a time, but I assume there is a way to do this in one method call? I'd like to do the same for categories, but I assume the one will show me how to do the other.
Thanks.
Re: Clear Keywords
PostPosted:Sat Jan 26, 2013 8:01 pm
by jllort
To add keyword should be used: OKMProperty.getInstance().addKeyword(null, path, keyword);
To add category should be used: OKMProperty.getInstance().addCategory(null, path, category);
Take a look here for involved class
http://doxygen.openkm.com/6.2.x/da/d9f/ ... perty.html
Take a look here for more information :
http://doxygen.openkm.com/6.2.x/
If you make some script and you want to share with comunity users tell us and we'll publicate in wiki Utilities section.
Re: Clear Keywords
PostPosted:Sat Jan 26, 2013 8:50 pm
by chackem
I'm planning on making my project available once it's complete.
I've figured out how to do those one at a time. I was wondering if there was a way to remove ALL of the keywords at one time, without having to call the function x number of times. If not, it's no big deal. Just looking for the most efficient way possible.
Thanks.
Re: Clear Keywords
PostPosted:Mon Jan 28, 2013 10:34 pm
by jllort
If you make a query you can see where keywords are stored:
Actually api not support any method to clean all keywords at one call, the low level implementation is available at DbPropertyModule.java, obviously can be implemented but I think is not a normal use from UI clean all keywords of a word. The same can be applied with categories. Try to justify the need of it, and then if there's some scenario that really needs it we can implement it.