• Manually Set Version Number/Letter

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
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.
 #40869  by alexwgordon
 
Hi All!

I've started setting up my production instance of OpenKM and have a ton of existing files. I'm using a versioning system that goes from A-Z and then to AA-AZ, etc (instead of 1, 2, 3...). I currently have many of my files that are not on their first revision and are just now going into a true revision control, i.e. most are on rev C, D, etc. Is there an easier way of altering the version (A, B, etc) to what the current one is without changing the versioning java code? I feel like that could save me a ton of time. Any help on the situation would be amazing! Thanks everyone!
 #40871  by alexwgordon
 
So in the mean time, I've decided to just create multiple instances of the LetterVersionAdapter.class file, each having different start values. Then I just switch which vernum I'm using, restart OpenKM and upload all the files of the same revision.

So now I have:
LetterVersionAdapter.class
LetterVersionAdapterB.class
LetterVersionAdapterC.class
etc

Still wondering if there is another solution though!
 #40885  by jllort
 
Could you provide here a clear example with one problematic file version and which should be the good ?
 #40888  by alexwgordon
 
So I have a file that is not currently in OpenKM and it's revision is set to C:
file revC.pdf

I want to add this into OpenKM, but if I use the standard LetterVersionAdapter.class when it is added, it will add it as revision A:
file revC.pdf – OpenKM revision shows A

How can I change the file to actually be revision C without having to change my LetterVersionAdapter.class code?

Hopefully that makes more sense.
 #40889  by alexwgordon
 
Building off of my current issue, is it possible to have a certain folder within OpenKM implement a different version.numeration.adapter?

Basically I have a prototype folder that will use the same revision scheme (A-ZZ), but will start at a different letter. Instead of starting at A it will start at ZZ (the last revision in the LetterVersionAdapter.class array of revisions). I want to do this so that once the revision goes up, it will start over at A. Is this possible??
 #40894  by jllort
 
I think two ways for doing it:
- Importing ( with .okm file -> then you can set there the version you wish )
- Import to especific folder document named -> document_version_A.doc -> process the name and then change version executing SQL.
 #40896  by alexwgordon
 
Is there any documentation on creating a .okm file? or what's the easiest way to generating one I can use as a template?

What do you mean "change version executing SQL"? Can you explain further please?

Thanks jllort!
 #40903  by alexwgordon
 
Ah okay, the .okm file example could just be exporting a single file/folder from Adminstration > Export. I'm thinking this way may just end up being the easiest, but seems like a lot of typing.

Also, I attempted to do the import using an .okm file and if I change the version, it still places it as "A" instead of what I set it to (B in this case)

This is from the log after attempting to import
Code: Select all
3964	2015-11-20 13:28:37,207 [http-apr-0.0.0.0-8080-exec-3] INFO com.openkm.util.impexp.RepositoryImporter- File: C:\Test\Vacation Policy-RevA.pdf
3965	2015-11-20 13:28:37,207 [http-apr-0.0.0.0-8080-exec-3] INFO com.openkm.util.impexp.RepositoryImporter- Document: C:\Test\Vacation Policy-RevA.pdf
3966	2015-11-20 13:28:37,207 [http-apr-0.0.0.0-8080-exec-3] INFO com.openkm.util.impexp.RepositoryImporter- Document Metadata File: C:\Test\Vacation Policy-RevA.pdf.okm
3967	2015-11-20 13:28:37,207 [http-apr-0.0.0.0-8080-exec-3] INFO com.openkm.util.impexp.RepositoryImporter- Document Metadata: {uuid=null, author=agordon, name=Vacation Policy-RevA.pdf, path=/okm:root/Vacation Policy-RevA.pdf, created=null, lastModified=null, language=, title=null, description=null, keywords=[], categories=[], subscriptors=[], scripting=null, notes=[], propertyGroups=[], version={author=agordon, name=B, created=null, size=0, mimeType=null, comment=null}, grantedUsers={okmAdmin=15, agordon=15}, grantedRoles={ROLE_USER=3}}
3968	2015-11-20 13:28:37,285 [http-apr-0.0.0.0-8080-exec-3] INFO com.openkm.util.impexp.RepositoryImporter- Created document '/okm:root/Vacation Policy-RevA.pdf'
 #40910  by jllort
 
.okm file is a json object. Take a look at RepositoryExporter.java and the method exportDocument.
http://sourceforge.net/p/openkm/code/HE ... orter.java

If you import a single version of the document, then should take a look at this two lines:
Code: Select all
DocumentMetadata dmd = ma.getMetadata(docChild);
String json = gson.toJson(dmd);
 #41047  by alexwgordon
 
The way I actually ended up accomplishing this is by modifying my vernum adapter to parse the file name for something like, "file rev D.txt" and determine what the initial rev should be from that. Then I had the the " rev D" portion removed from the filename and uploaded.
 #41056  by jllort
 
Also could be done some script or crontab task for it. If you have some pattern in filename like [vernum=AAA], you could do some query in repository for name="[vernum=]" and then apply some database table update directly ( an rename the file at the end ). With LegacyDAO.java class you can execute your own SQL directly ( and update openkm table values, must be used with care ! ).

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.