<?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 change type of all documents in a space in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/change-type-of-all-documents-in-a-space/m-p/254868#M207998</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What is the easiest way to change the type of all documents in a space to a custom type say "kb:whitepaper". I realize I can write a script and execute the script, but I am stuck after that. Any suggestions on how do I started on the javascript? Does the api allow to get all the nodes and iterate through them adding the type to each node?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help will be greatly appreciated; so will be any code samples&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks a lot&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Apr 2012 20:29:36 GMT</pubDate>
    <dc:creator>jackjm</dc:creator>
    <dc:date>2012-04-05T20:29:36Z</dc:date>
    <item>
      <title>change type of all documents in a space</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/change-type-of-all-documents-in-a-space/m-p/254868#M207998</link>
      <description>What is the easiest way to change the type of all documents in a space to a custom type say "kb:whitepaper". I realize I can write a script and execute the script, but I am stuck after that. Any suggestions on how do I started on the javascript? Does the api allow to get all the nodes and iterate th</description>
      <pubDate>Thu, 05 Apr 2012 20:29:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/change-type-of-all-documents-in-a-space/m-p/254868#M207998</guid>
      <dc:creator>jackjm</dc:creator>
      <dc:date>2012-04-05T20:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: change type of all documents in a space</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/change-type-of-all-documents-in-a-space/m-p/254869#M207999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is an example that adds the taggable and classifiable aspects to every object in a given folder:&lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;for each (var doc in space.children) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; doc.addAspect("cm:taggable");&lt;BR /&gt;&amp;nbsp;&amp;nbsp; doc.addAspect("cm:generalclassifiable");&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;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;And here is an example that specializes the type of every object in a given folder:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;for each (var doc in space.children) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; doc.specializeType("kb:whitepaper");&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;SPAN&gt;And here is a link to the &lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/4.0_JavaScript_API" rel="nofollow noopener noreferrer"&gt;JavaScript API&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For doing stuff like this, I prefer to use Florian Maul's &lt;/SPAN&gt;&lt;A href="http://code.google.com/p/share-extras/wiki/JavascriptConsole" rel="nofollow noopener noreferrer"&gt;JavaScript Console&lt;/A&gt;&lt;SPAN&gt; which is part of &lt;/SPAN&gt;&lt;A href="http://code.google.com/p/share-extras" rel="nofollow noopener noreferrer"&gt;Share Extras&lt;/A&gt;&lt;SPAN&gt;. It gives you an interactive JavaScript console directly in the Share UI.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Otherwise, create the code in a JS file, put it in Data Dictionary/Scripts, then go to the folder in question and do Run Action, Execute Script, and select the script. The "space" variable will automatically have the folder you are running the script against.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2012 21:49:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/change-type-of-all-documents-in-a-space/m-p/254869#M207999</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2012-04-05T21:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: change type of all documents in a space</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/change-type-of-all-documents-in-a-space/m-p/254870#M208000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you very much Jeff for the detailed answer and also for the pointer to Florian's plugin; it is incredibly useful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;best regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 14:31:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/change-type-of-all-documents-in-a-space/m-p/254870#M208000</guid>
      <dc:creator>jackjm</dc:creator>
      <dc:date>2012-04-10T14:31:22Z</dc:date>
    </item>
  </channel>
</rss>

