• Simple autotagging automation

  • 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.
 #41332  by openkm_user
 
Hi,

I am not a java developer, I am trying to use a script for automation purpose. I used the following example,
http://wiki.openkm.com/index.php/Simple_autotagging

My requirement is simple, if there is a document with name _default (for example, documentname_default) uploaded to DMS, I need the document tagged with download Keyword. I would be grateful if someone can help with a working script.

Thanks!
 #41337  by jllort
 
You only need two API calls, it's quite easy.
Code: Select all
String systemToken = DbSessionManager.getInstance().getSystemToken();
Document doc = OKMDocument.getIntance().getProperties(null, uuid);

if (doc.getName().contains("_default")) {
     	OKMProperty.getInstance().addKeyword(null, uuid, String keyword)
}
For future questions, take a look at API documentation ( java doc ):
http://docs.openkm.com/apidoc/ ( you must be interested on classes into com.openkm.api.* )
 #41342  by openkm_user
 
Hi,

Thank you once again, but I found an easier way, enabled automation,
http://wiki.openkm.com/index.php/Enable_automation

Then it's just simple validation and action,
Capture.JPG
Capture.JPG (38.19 KiB) Viewed 2111 times
No need script and it works.

Thanks for the great tool!

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.