<?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: Is there a way to delete Content Rules using Javascript API ? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298190#M251320</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't see how to do this unfortunately. If anyone whish to help, it would be a pleasure to try !&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Oct 2013 12:02:15 GMT</pubDate>
    <dc:creator>msevestre</dc:creator>
    <dc:date>2013-10-18T12:02:15Z</dc:date>
    <item>
      <title>Is there a way to delete Content Rules using Javascript API ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298186#M251316</link>
      <description>HelloI will migrate my data to the latest version of Alfresco and at the same time, I want to delete all the Content Rules that exists in my current data tree as they will become useless.I am able to change rights using javascripts without problems (via calls to SetPermission(), etc..), but I have n</description>
      <pubDate>Thu, 17 Oct 2013 12:22:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298186#M251316</guid>
      <dc:creator>msevestre</dc:creator>
      <dc:date>2013-10-17T12:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to delete Content Rules using Javascript API ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298187#M251317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;AFAIK there is not such direct API available which will help you in this case.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want you can create your custom javascript API's to achieve this. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 14:09:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298187#M251317</guid>
      <dc:creator>mitpatoliya</dc:creator>
      <dc:date>2013-10-17T14:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to delete Content Rules using Javascript API ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298188#M251318</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;I don't think I have the capabilities to build such an API… so I'll keep my useless rules contents or take time to delete them one by one. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 07:07:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298188#M251318</guid>
      <dc:creator>msevestre</dc:creator>
      <dc:date>2013-10-18T07:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to delete Content Rules using Javascript API ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298189#M251319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think this is what you can check once. Each rule alfresco store under one space which has type rule on which it is created. you will not able able to see it on UI but internally from node-browser you will be able to see it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So, what I think is that if you some how manage to delete them though script rule should also be deleted. Just give it a try and let us know if it works.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 09:42:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298189#M251319</guid>
      <dc:creator>mitpatoliya</dc:creator>
      <dc:date>2013-10-18T09:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to delete Content Rules using Javascript API ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298190#M251320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't see how to do this unfortunately. If anyone whish to help, it would be a pleasure to try !&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 12:02:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298190#M251320</guid>
      <dc:creator>msevestre</dc:creator>
      <dc:date>2013-10-18T12:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to delete Content Rules using Javascript API ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298191#M251321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;why don't you consider to use&amp;nbsp;&amp;nbsp; webscript as instead.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;webscript api&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;DELETE /alfresco/service/api/node/{store_type}/{store_id}/{id}/ruleset/rules/{rule_id}&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Oct 2013 06:58:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298191#M251321</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2013-10-19T06:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to delete Content Rules using Javascript API ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298192#M251322</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;that's not a problem using webscript… but as I'm not very "fluent" in Alfresco background, I don't know how to define the values between the "{..}"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 07:19:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298192#M251322</guid>
      <dc:creator>msevestre</dc:creator>
      <dc:date>2013-10-21T07:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to delete Content Rules using Javascript API ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298193#M251323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;{store_type} - that is, the type of store&lt;BR /&gt;{store_id} - the id of the store&lt;BR /&gt;{id} - the id of the node whose rules you want to delete&lt;BR /&gt;{rule_id} - the id of the rule you want to delete&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;alfreco default&amp;nbsp; store is&amp;nbsp; workspace://SpacesStore ,so your url may be like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;/alfresco/service/api/node/workspace/SpacesStore/3446584b-6605-4871-8fbc-0131c6f44584/ruleset/rules/b680b35f-303b-4189-822e-4fb99b4024cc&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 07:40:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298193#M251323</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2013-10-21T07:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to delete Content Rules using Javascript API ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298194#M251324</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;OK thanks. I was successfull to list the rules first… unfortunately, this API is aimed to work on a specific node.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I want to do is to act, starting for a node, recursively in all children nodes (deleting by hand through the web interface will not be longer than using the API)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe there's a trick to display recursively all the rules ? If yes, then you mya have find the full solution &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 08:16:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298194#M251324</guid>
      <dc:creator>msevestre</dc:creator>
      <dc:date>2013-10-21T08:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to delete Content Rules using Javascript API ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298195#M251325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;workspace://SpacesStore/e7d585dd-16f1-4b31-9cd5-a9f8e2869a17&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use search &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;GET /alfresco/service/slingshot/search&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; to search all node you want to delete&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;then iterate each node and get all rules applied to it by &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt; /api/node/{store_type}/{store_id}/{id}/ruleset/rules?ruleType={rule_type?}&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;then delete each rule by &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;/alfresco/service/api/node/{store_type}/{store_id}/{id}/ruleset/rules/{rule_id}&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 09:25:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298195#M251325</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2013-10-21T09:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to delete Content Rules using Javascript API ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298196#M251326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;no success until now… I give up and will keep my useless content rules for now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help and to have taken time trying to help me !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 08:57:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298196#M251326</guid>
      <dc:creator>msevestre</dc:creator>
      <dc:date>2013-10-22T08:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to delete Content Rules using Javascript API ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298197#M251327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In fact you can still use javascript api to delete rules ,in alfresco rules are saved as nodes .rules applied to a node A is saved under A with child associations named {&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/rule/1.0}ruleFolder" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/rule/1.0}ruleFolder&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So you can delete rules applied to a node by using ScriptNode api to delete sub nodes,this is not a direct way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;following is a profile of an example&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if you want to delete all rules,follow step 1.2.16.17&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if you want to remove some rules,follow all steps except 16.17&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;1.var ruleFolder = mynode.childAssocs["{&lt;A href="http://www.alfresco.org/model/rule/1.0}ruleFolder" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/rule/1.0}ruleFolder&lt;/A&gt;"][0];//mynode is the node whose rules&amp;nbsp; you want to delete&lt;BR /&gt;2.mynode.removeNode(ruleFolder);&lt;BR /&gt;3.rules = ruleFolder.childAssocs["{&lt;A href="http://www.alfresco.org/model/rule/1.0}ruleFolder" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/rule/1.0}ruleFolder&lt;/A&gt;"];&lt;BR /&gt;4.for(i=0;i&amp;lt;rules.length;i++)&lt;BR /&gt;5.{&lt;BR /&gt;6.&amp;nbsp;&amp;nbsp;&amp;nbsp;var obj = rules&lt;EM&gt;;&lt;BR /&gt;7.&amp;nbsp;&amp;nbsp;&amp;nbsp;var reg = new&amp;nbsp; RegExp("^rules.*");&lt;BR /&gt;8.&amp;nbsp;&amp;nbsp;&amp;nbsp;if(reg.exec(obj.properties.name)){//node name matches ^rules.*&amp;nbsp; regular expression is rule node&lt;BR /&gt;9.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// add your code here to idenfify rule you want to delete&lt;BR /&gt;10.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(***){&lt;BR /&gt;11.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rules.removeNode(obj);&lt;BR /&gt;12.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;13.&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;14.}&lt;BR /&gt;15.rules.save();&lt;BR /&gt;16.mynode.removeAspect("{&lt;A href="http://www.alfresco.org/model/rule/1.0}rules" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/rule/1.0}rules&lt;/A&gt;");//remove mynode's rules aspect;&lt;BR /&gt;17.mynode.save();&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;/EM&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;You 'd better run a test before you use these code to make sure they do the right thing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 06:38:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/is-there-a-way-to-delete-content-rules-using-javascript-api/m-p/298197#M251327</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2013-10-24T06:38:00Z</dc:date>
    </item>
  </channel>
</rss>

