<?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 file moves subfolders too with original document in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/rule-file-moves-subfolders-too-with-original-document/m-p/132023#M35615</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/16045"&gt;@afaust&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks it was working fine but it is moving all the documents created. i want to move document for my custom type only. I am trying to get type through this:-&lt;/P&gt;&lt;P&gt;var nodeType = document.properties["cmis&lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;bjectTypeId"];&lt;/P&gt;&lt;P&gt;i think i am using wrong approach for getting type.&lt;/P&gt;&lt;P&gt;Please do help me out.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Piyush&lt;/P&gt;</description>
    <pubDate>Thu, 03 Jun 2021 11:55:28 GMT</pubDate>
    <dc:creator>piyush48</dc:creator>
    <dc:date>2021-06-03T11:55:28Z</dc:date>
    <item>
      <title>Rule file moves subfolders too with original document</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/rule-file-moves-subfolders-too-with-original-document/m-p/132021#M35613</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am writing rule for moving document created inside folder to a new folder hierarchy created dynamically through cm:created. Now i only want documents created inside folder to be only moved not subfolders which are already there.&lt;/P&gt;&lt;P&gt;Could anyone told what i am doing wrong with code:-&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var createdDate = document.properties["cm:created"];
var scanId = document.properties["live:uniqueDocument"];
var date = new Date(createdDate);
var year = ""+date.getFullYear();
var month = ""+(date.getMonth()+1);
var day = ""+date.getDate();
var hour = ""+date.getHours();
var min = ""+date.getMinutes();
var formattedDate = year+"-"+month+"-"+day;
var calender = [year,formattedDate,day,hour,min];
var parent = document.parent;
for(var i =0; i&amp;lt;calender.length;i++) {
var myfolder = parent.childByNamePath(calender[i]);
if (myfolder === null) {
    myfolder = parent.createFolder(calender[i]);
}
 parent = myfolder;
}
document.move(myfolder);&lt;/PRE&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Piyush&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 05:57:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/rule-file-moves-subfolders-too-with-original-document/m-p/132021#M35613</guid>
      <dc:creator>piyush48</dc:creator>
      <dc:date>2021-06-01T05:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rule file moves subfolders too with original document</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/rule-file-moves-subfolders-too-with-original-document/m-p/132022#M35614</link>
      <description>&lt;P&gt;Likely nothing wrong with your code but your rule configuration. Make sure to restrict your rule to only trigger on content nodes, not folder nodes. Alternatively, you could of course include a 'document.isSubType("cm:content")' check in your code and only act if that is the case.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 10:45:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/rule-file-moves-subfolders-too-with-original-document/m-p/132022#M35614</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2021-06-01T10:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rule file moves subfolders too with original document</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/rule-file-moves-subfolders-too-with-original-document/m-p/132023#M35615</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/16045"&gt;@afaust&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks it was working fine but it is moving all the documents created. i want to move document for my custom type only. I am trying to get type through this:-&lt;/P&gt;&lt;P&gt;var nodeType = document.properties["cmis&lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;bjectTypeId"];&lt;/P&gt;&lt;P&gt;i think i am using wrong approach for getting type.&lt;/P&gt;&lt;P&gt;Please do help me out.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Piyush&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jun 2021 11:55:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/rule-file-moves-subfolders-too-with-original-document/m-p/132023#M35615</guid>
      <dc:creator>piyush48</dc:creator>
      <dc:date>2021-06-03T11:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Rule file moves subfolders too with original document</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/rule-file-moves-subfolders-too-with-original-document/m-p/132024#M35616</link>
      <description>&lt;P&gt;Try &lt;A href="https://github.com/Alfresco/alfresco-repository/blob/master/src/main/java/org/alfresco/repo/jscript/ScriptNode.java#L379" target="_self" rel="nofollow noopener noreferrer"&gt;document.getType()&lt;/A&gt; method to get the type in combination to isSubType check as suggested already.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/content-services/6.2/develop/reference/repo-root-objects-ref/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/content-services/6.2/develop/reference/repo-root-objects-ref/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Get type method options:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/Alfresco/alfresco-repository/blob/master/src/main/java/org/alfresco/repo/jscript/ScriptNode.java#L379" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/Alfresco/alfresco-repository/blob/master/src/main/java/org/alfresco/repo/jscript/ScriptNode.java#L379&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/Alfresco/alfresco-repository/blob/master/src/main/java/org/alfresco/repo/jscript/ScriptNode.java#L387" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/Alfresco/alfresco-repository/blob/master/src/main/java/org/alfresco/repo/jscript/ScriptNode.java#L387&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jun 2021 14:44:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/rule-file-moves-subfolders-too-with-original-document/m-p/132024#M35616</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2021-06-03T14:44:08Z</dc:date>
    </item>
  </channel>
</rss>

