• Automatic tagging based on folder

  • 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.
 #27605  by Ben.Hahlen
 
I have been using OpenKM for a while now and I am really enjoying it.
However, I am trying to improve my usage by adding tags to my documents.
Preferably, this would happen automatically when adding documents to OpenKM, either by upload or by copying it into a WebDAV-mount.
My folder structure is set up as such:
<NAME>
|-<COMPANY>
||-<YEAR>
|||-<FILENAME>

Preferably, the tags on the file would consist of <COMPANY> and <YEAR>.
Is it possible to automate this in some way?
Which path should I take? Scripting? Macro? Workflow?

Thanks in advance :)
 #27615  by jllort
 
Before give you some ideas ( clues ) we need to know the logic behing to identify document type and decide what tags should be added. Before knowing anything I suggest scripting or a combination of metadata and crontab ( metadata to set property group to indicate pending status after document creation or change, and crontab to analytize and autotag the pending documents and change status ).

If you decide to doing it, we'll be pleased to sharing your code example in our wiki documentation at http://wiki.openkm.com/index.php/Utilities . I think your work can be interesting for other users.
 #27626  by Ben.Hahlen
 
Of course I'll share the end-result, I am just looking for some pointers, as I am a bit overwhelmed with all the options available :-)

Let's take this folder structure as an example:
okm:root/Ben/Bank/2013/Correspondence
The file is:
2013-01-02 - Statement.pdf

The tags (/keywords) that I would like to be added are: Bank, 2013, Correspondence
If possible, if it could add "statement" as a keyword as well, that would be awesome, but it might be a bit too complex.

So, basically what you are suggesting so far:
On import of document, metadata should be added, providing a "untagged" status, it will then parse through the directories, adding the keywords, after which it will receive a "tagged" status.
And then a cron-job that triggers this?

Breaking this down (and from what I can find in my Administration Dashboard):
- CronJob
|- AnalyzeTag.bsh
|- AutoTag.bsh
- Metadata
|- Property Groups
||- Tagged/Untagged
- Automation
|- Tagging stuff

Is this the right track?
 #27645  by jllort
 
if tags are based on folder path, simply can execute script after document creation , splith path / and then add keywords
 #45602  by neil_h
 
Hi

Sorry to bump an old thread, but this is exactly what i want to do, and i cant see the end result on the Utilities page as listed further up this thread. can any one help?

Thanks

Neil
 #45609  by neil_h
 
Hi

So in essence, i want to achieve the same as the original poster, sorting documents into a folder structure, this is for home use, to electronically store info on mortgage, insurances etc. the folder structure would consist of a descriptive root folder, Year, such as

okm:root, Insurance, 2018, House
or
okm:root, Insurance, 2018, Car

then each folder would have as assigned keyword of the same name "Insurance, 2018, House" as appropriate. I will be imaging documents on my phone and uploading by Webdav to the correct folder structure. I want a Create Document action to add the folders structures tags to the new document to aid searching later on.

Although i have done coding in the past (15 + years ago) it was in Pascal, not in Java or C which appear to be the languages involved (could be wrong). Ive started looking at the automation options and and see i can add a action to a create document event.

I have been reading https://docs.openkm.com/kcenter/view/ok ... ction.html and whilst this has a AddKeyword Class on the page, i dont know where to start..

I have also traced the UUID's through the DB and know it will need a recursive call to process the folder structure for its tags. but again im not sure where to start and nothing ive seen shows where the DB SQL lookups correlate to the automation code.

Does this give enough info

Thanks

Neil

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.