01-18-2012 05:04 PM
Hi all,
first of all congratulations for this forum where answers are usually quick and precise. It is really a helpful forum.
Back to work...
I have followed the tuto in Nuxeo Studio documentation to create some document number id automatically based on prefix and GetNextId function and I was wondering if there is any function to get some date format extraction in order to customize my document id. Let's say I want my document id to contain two digit corresponding to week number (1-52) and two digit corresponding to the 2 last digits of the year (ex 12 for this year 2012).
Is there any function available to return this like in some other language (php for instance).
Thank you for your help
Snarf
01-19-2012 05:38 AM
No, I don't think, so. There is no specific function that does that.
My piece of advice would be to create your own operation. If you have just a little notion of development you can do it really really easily.
Nuxeo provides Nuxeo IDE integrated with Nuxeo Studio. Here is steps to follow:
You must something like that:
@OperationMethod(collector=DocumentModelCollector.class)
public DocumentModel run(DocumentModel input) {
... do the code that create the id with the date on 2 digits and put the value into the id parameter ...
input.setPropertyValue("prefix:field", id);
// where prefix is the prefix of your schema and field the name of the field where you want to store the id generated
}
In this operation we don't save the document so think to add in your chain a SAVE operation after (without that the value will be not saved).
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.