<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get date information in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-get-date-information/m-p/315852#M2853</link>
    <description>&lt;P&gt;No, I don't think, so. There is no specific function that does that.&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Nuxeo provides Nuxeo IDE integrated with Nuxeo Studio. Here is steps to follow:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://doc.nuxeo.com/x/aoKE"&gt;Install Nuxeo IDE and create an empty project&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Create a new empty Operation. You just have to click on the yellow "NX" button &amp;gt; Automation &amp;gt; Operation&lt;/LI&gt;
&lt;LI&gt;Select your project, give a package (for instance "com.yourcompany.yourproject.automation"), the name of your operation, id of your operation (Fill.ID for instance), Category CAT_DOCUMENT, let uncheck "Require Seam Context", let Document selected for Input and Output. And let "Iterable Operation" checked.&lt;/LI&gt;
&lt;LI&gt;In the run method you can implement your logic to create the ID and fill the document.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;You must something like that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;@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
}    
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;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).&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jan 2012 10:38:49 GMT</pubDate>
    <dc:creator>Benjamin_Jalon1</dc:creator>
    <dc:date>2012-01-19T10:38:49Z</dc:date>
    <item>
      <title>How to get date information</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-get-date-information/m-p/315851#M2852</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;first of all congratulations for this forum where answers are usually quick and precise. It is really a helpful forum.&lt;/P&gt;
&lt;P&gt;Back to work...&lt;/P&gt;
&lt;P&gt;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).&lt;/P&gt;
&lt;P&gt;Is there any function available to return this like in some other language (php for instance).&lt;/P&gt;
&lt;P&gt;Thank you for your help&lt;/P&gt;
&lt;P&gt;Snarf&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2012 22:04:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-get-date-information/m-p/315851#M2852</guid>
      <dc:creator>snarf77_</dc:creator>
      <dc:date>2012-01-18T22:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get date information</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-get-date-information/m-p/315852#M2853</link>
      <description>&lt;P&gt;No, I don't think, so. There is no specific function that does that.&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Nuxeo provides Nuxeo IDE integrated with Nuxeo Studio. Here is steps to follow:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://doc.nuxeo.com/x/aoKE"&gt;Install Nuxeo IDE and create an empty project&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Create a new empty Operation. You just have to click on the yellow "NX" button &amp;gt; Automation &amp;gt; Operation&lt;/LI&gt;
&lt;LI&gt;Select your project, give a package (for instance "com.yourcompany.yourproject.automation"), the name of your operation, id of your operation (Fill.ID for instance), Category CAT_DOCUMENT, let uncheck "Require Seam Context", let Document selected for Input and Output. And let "Iterable Operation" checked.&lt;/LI&gt;
&lt;LI&gt;In the run method you can implement your logic to create the ID and fill the document.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;You must something like that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;@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
}    
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;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).&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2012 10:38:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-get-date-information/m-p/315852#M2853</guid>
      <dc:creator>Benjamin_Jalon1</dc:creator>
      <dc:date>2012-01-19T10:38:49Z</dc:date>
    </item>
  </channel>
</rss>

