Page 1 of 1

Property groups / assigning of unique docket number

PostPosted:Wed Nov 05, 2014 4:18 pm
by janus
Hello!

Even though the property groups -feature is powerful for structuring the metadata of a document, I've run into a small problem. I couldn't find an answer in the wiki documentation or on the forums on how to configure the a property group in the repository in such a way, that it could automatically generate a unique docket number. Because of NGO-government body interactions and accountability requirements, my team would certainly need this kind of functionality.

Our old docket number format uses a four-digit integer for the domain of the document, a one letter code specifying type, followed by a six-digit integer, which is the unique "ordinal number" of the document and finally a four-digit integer for the registration year, all which are separated by a slash, "/". All the other parts are non-unique and can (and should) be entered manually, but generating the unique identifier is the problem, so a simple howto would be greatly appreciated.

It would also be appreciated, if someone could find a way to generate the whole docket number as one string from the data above, so that eg.

Domain: 2100
Type: S
Number: nnnnnn (this one unique and automatically assigned)
2014

...would become 2100/S/nnnnnn/2014

Thanks in advance.

Re: Property groups / assigning of unique docket number

PostPosted:Sat Nov 08, 2014 10:55 am
by jllort
In our utilities I think you can found something you can be interested on http://wiki.openkm.com/index.php/Utilities and I suggest take a look here http://wiki.openkm.com/index.php/Unique_name

I'm not sure if you want to set unique UUID on metadata or also you want to create subfolder structure on document creation. Both things can be done with basic scripting.

Re: Property groups / assigning of unique docket number

PostPosted:Wed Nov 12, 2014 5:18 am
by janus
Thanks a lot! I think this will get me started!

Re: Property groups / assigning of unique docket number

PostPosted:Fri Aug 07, 2015 1:28 pm
by janus
Hello again!

Might be a bit silly question, but I seem to have a problem generating the docket numbers in the format we usually use, where the different parts are separated by a slash "/". Is it possible to configure the automatic numbering to support the slash as separator?

My other question is, how to implement that directory structure. It would be the best solution, since a single docket number may have several documents under it.

Thx in advance.

Re: Property groups / assigning of unique docket number

PostPosted:Sat Aug 08, 2015 7:58 am
by jllort
Put here your code and we will take a look about the problem with "/". You're not using "/" on folder name no ? because this character is a reserved folder and can not be used as document name or folder name. You can use without problem into the metadata, but not in node names.

There a method to create missing folders:
OKMFolder.getInstance().createMissingFolders(null, "/okm:root/new folder/folder2/folder3");

It will check all the subpaths and if someone not exists will create for you.