• Manually creating .okm files for import?

  • 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.
 #19370  by stiebs
 
If I've got a heap of newly scanned documents to import, I don't want to go through and manually upload, then assign keywords and categories to all documents. Gets very tedious and takes a long time. I can instead write a shell script to generate the *.okm files to be used for an import.

How do I go about doing this, and what information can I omit from the .okm file and still have the import work successfully? Obviously I would not be able to include the uuid. I will have the taxonomy path, the keywords and the category paths (but not the category uuids). I assume author, owner and roles are needed. How about the time stamps? For the omitted information, should I just leave it out, or does it need to be there, but blank?

Do I used {"uuid":[]} or {"uuid":""} or just omit the uuid component completely? Or something else?
Likewise for category. Do I use "categories":[{"uuid":[],"path":"/okm:categories/catname"}], or will "categories":["path":"/okm:categories/catname"}] suffice?

I'v tried creating an okm file and just removing the uuid entries. I put the okm file along with its pdf in a directory, and then tried doing a repository import, but got the error message "Error: Unable to perform operation. Node is protected.".

Is there something else I should be doing?

Thanks.
 #19372  by stiebs
 
After searching the forums a bit, I found that I was on 5.1.9, and previously someone else with problems importing fixed their problem by upgrading to 5.1.10.
So now that I've upgraded to 5.1.10, I have successfully imported a document from a hand written .okm file, by omitting the "uuid" components.

However there are two outstanding issues I'm still trying to resolve.

1. Even though I specified "path":"/okm:root/path/file.pdf", the document was created in the /okm:root location. If I leave "repository path" blank on the import, the import fails. I assume this means that to bulk import using this method, I should either import one taxonomy location at a time, or replicate the taxonomy structure in my source folders.

2. The keywords were added to the document on import, but the categories were not.
 #19384  by jllort
 
I suggest you upgrade to 5.1.11 ( is not oficialy released but can be found at nighly build integration.openkm.com )
To create .okm files we use GSON java library I suggest use it too.

In this class is done exportation http://doxygen.openkm.com/6.2.x/db/df6/ ... orter.html and probably you'll be interested in this too http://doxygen.openkm.com/6.2.x/d6/d40/ ... apter.html
Code: Select all
DocumentMetadata dmd = ma.getMetadata(docChild);
String json = gson.toJson(dmd);

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.