<?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: Rule to dynamically create month- and day-folders in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/rule-to-dynamically-create-month-and-day-folders/m-p/245128#M198258</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks for reply. Unfortunately i'm not familiar with javascript. Can you send me your script as an example?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thomas&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Dec 2009 08:25:08 GMT</pubDate>
    <dc:creator>thk</dc:creator>
    <dc:date>2009-12-03T08:25:08Z</dc:date>
    <item>
      <title>Rule to dynamically create month- and day-folders</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/rule-to-dynamically-create-month-and-day-folders/m-p/245126#M198256</link>
      <description>Hello,im using Alfresco 2.1 and I want to create a rule which whenever a file arrives first creates a folder with the creation-day in the name and then moves the file in this folder. When the folder for this day already exists the rule should only move all files with this creationday in it. If a new</description>
      <pubDate>Wed, 02 Dec 2009 15:06:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/rule-to-dynamically-create-month-and-day-folders/m-p/245126#M198256</guid>
      <dc:creator>thk</dc:creator>
      <dc:date>2009-12-02T15:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Rule to dynamically create month- and day-folders</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/rule-to-dynamically-create-month-and-day-folders/m-p/245127#M198257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Thk,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At a client i had a similar requirement. I was able to implement it via a content rule and a small, simple javascript.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Koen&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2009 16:42:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/rule-to-dynamically-create-month-and-day-folders/m-p/245127#M198257</guid>
      <dc:creator>kbonnet</dc:creator>
      <dc:date>2009-12-02T16:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rule to dynamically create month- and day-folders</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/rule-to-dynamically-create-month-and-day-folders/m-p/245128#M198258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks for reply. Unfortunately i'm not familiar with javascript. Can you send me your script as an example?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thomas&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2009 08:25:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/rule-to-dynamically-create-month-and-day-folders/m-p/245128#M198258</guid>
      <dc:creator>thk</dc:creator>
      <dc:date>2009-12-03T08:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rule to dynamically create month- and day-folders</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/rule-to-dynamically-create-month-and-day-folders/m-p/245129#M198259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, here is a sample script doing just this :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;// Move document to YYYY/MM/DD structure&lt;BR /&gt;// First, find or create target folder&lt;BR /&gt;var current = document.properties["cm:created"];&lt;BR /&gt;var year = current.getFullYear();&lt;BR /&gt;var month = current.getMonth() + 1;&lt;BR /&gt;var day = current.getDate();&lt;BR /&gt;&lt;BR /&gt;var yearSpace = space.childByNamePath(year);&lt;BR /&gt;if (yearSpace == null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;yearSpace = space.createFolder(year);&lt;BR /&gt;}&lt;BR /&gt;var monthSpace = yearSpace.childByNamePath(month);&lt;BR /&gt;if (monthSpace == null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; monthSpace = yearSpace.createFolder(month);&lt;BR /&gt;}&lt;BR /&gt;var daySpace = monthSpace.childByNamePath(day);&lt;BR /&gt;if (daySpace == null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;daySpace = monthSpace.createFolder(day);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;// Then move document&lt;BR /&gt;document.move(daySpace);&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;Trigger this script with an inbound rule on a given space, and it will automatically create a year/month/date structure in this space.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Denis&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2009 08:55:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/rule-to-dynamically-create-month-and-day-folders/m-p/245129#M198259</guid>
      <dc:creator>dgenard</dc:creator>
      <dc:date>2009-12-03T08:55:07Z</dc:date>
    </item>
  </channel>
</rss>

