Page 1 of 1

Convert all uppercase keywords to lowercase automatically?

PostPosted:Thu Feb 13, 2014 10:09 am
by bartekhejnowicz
Because of lack of communication between our deparments, for now we have multiple variants of the same keywords. So... I turned on force converting to lowercase and things are getting straight.
But what to do with existing keywords? Is there any possible way to convert all uppercase keywords to lowercase?
Doing it manually could take some time, as we got almost 2000 documens already keyworded...

Appreciate any help! :)

Re: Convert all uppercase keywords to lowercase automaticall

PostPosted:Fri Feb 14, 2014 3:36 pm
by jllort
First of all, for futere take in mind use http://wiki.openkm.com/index.php/Applic ... conversion

It's more easy than you thing, but need some time. The idea will be:
- Set force keywords to lower case
- Iterate across all respository documents and if there's some keywords asociated then set it again

For it you must do with scripting feature:
- This script will help you on iterate along all repository:
http://wiki.openkm.com/index.php/Script ... _traversal

- Then you need to know something about openkm api -> here's the actual 6.2.x api http://doxygen.openkm.com/
Document object allow you to get keywords getKeywords () -> http://doxygen.openkm.com/openkm/de/d62 ... ument.html
And OKMProperty allows you to remove and get keywords again ( idea will be remove and set again ) http://doxygen.openkm.com/openkm/da/d9f ... perty.html
Should be something like OKMProperty.getInstance().removeKeyword(null, doc.getPath, keyword); and other to set

I suggest test first in a non production environement or at least, as you see in script to iterate in all repository start on a testing node /okm:root/testing not on /okm:root

Hope this could help you. Is more easy than seems.