<?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: custom view for all spaces in sub tree in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/custom-view-for-all-spaces-in-sub-tree/m-p/118453#M83569</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you this thread was helpful for me in solving the same requirement.&amp;nbsp; However, one oddity (bug?) I ran across and was able to workaround with the javascript debugger, is that when a rule 's script is firing and being applied to sub-spaces, the space object is always set to the toplevel space. the document object is set to whatever the current space is. this is different than if you run the script by going into the sub-space and run action / execute a script. maybe that's a feature and it's probably documented somewhere, but it was a surprise to me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here is some code that I am using. hopefully it will help&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var tTemplatePath = "Data Dictionary/path/to…/custom-view.ftl";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var tTemplateNode = companyhome.childByNamePath( tTemplatePath );&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var tProps = new Array(1);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tProps["cm:template"] = tTemplateNode.nodeRef;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.addAspect("cm:templatable", tProps);&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Nov 2007 19:23:41 GMT</pubDate>
    <dc:creator>alrice</dc:creator>
    <dc:date>2007-11-27T19:23:41Z</dc:date>
    <item>
      <title>custom view for all spaces in sub tree</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/custom-view-for-all-spaces-in-sub-tree/m-p/118449#M83565</link>
      <description>Hi,I want to use the audit view as custom view for all my spaces in certain sub tree. Can I do it in one time or do I need to go space by space and add to every space custom view?Thx,&amp;nbsp; Itay</description>
      <pubDate>Wed, 07 Nov 2007 09:22:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/custom-view-for-all-spaces-in-sub-tree/m-p/118449#M83565</guid>
      <dc:creator>itayh</dc:creator>
      <dc:date>2007-11-07T09:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: custom view for all spaces in sub tree</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/custom-view-for-all-spaces-in-sub-tree/m-p/118450#M83566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is a perfect case for the JavaScript API. As the admin user, you can execute a script that walked all spaces (from a known start location or ALL spaces) and set the custom view to each space. A custom view is just an aspect (cm:templatable) and a d:noderef property on that aspect (cm:template) that points to the template to be displayed for the custom view. So if you get the noderef to your template (from it's details page) then you can write a script that does this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://wiki.alfresco.com/wiki/JavaScript_API" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/JavaScript_API&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 10:33:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/custom-view-for-all-spaces-in-sub-tree/m-p/118450#M83566</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2007-11-14T10:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: custom view for all spaces in sub tree</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/custom-view-for-all-spaces-in-sub-tree/m-p/118451#M83567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you kevin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One more question. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There all changes in the repository all the times. We are adding and deleting spaces all the time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So After&amp;nbsp; running the java script when I add new spaces I will need to run it again, correct?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Itay&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2007 08:07:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/custom-view-for-all-spaces-in-sub-tree/m-p/118451#M83567</guid>
      <dc:creator>itayh</dc:creator>
      <dc:date>2007-11-15T08:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: custom view for all spaces in sub tree</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/custom-view-for-all-spaces-in-sub-tree/m-p/118452#M83568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you set up a rule, you will not need to to run it again. Simply create a Rule on the root Company Home space (or User Homes or whatever) and make that Rule "inherit" (to apply to all subspaces) and make it fire when new cm:folder types are created. Then the script for the rule can add the custom view to just the new space as it is created.&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;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2007 11:17:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/custom-view-for-all-spaces-in-sub-tree/m-p/118452#M83568</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2007-11-23T11:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: custom view for all spaces in sub tree</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/custom-view-for-all-spaces-in-sub-tree/m-p/118453#M83569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you this thread was helpful for me in solving the same requirement.&amp;nbsp; However, one oddity (bug?) I ran across and was able to workaround with the javascript debugger, is that when a rule 's script is firing and being applied to sub-spaces, the space object is always set to the toplevel space. the document object is set to whatever the current space is. this is different than if you run the script by going into the sub-space and run action / execute a script. maybe that's a feature and it's probably documented somewhere, but it was a surprise to me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here is some code that I am using. hopefully it will help&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var tTemplatePath = "Data Dictionary/path/to…/custom-view.ftl";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var tTemplateNode = companyhome.childByNamePath( tTemplatePath );&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var tProps = new Array(1);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tProps["cm:template"] = tTemplateNode.nodeRef;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.addAspect("cm:templatable", tProps);&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2007 19:23:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/custom-view-for-all-spaces-in-sub-tree/m-p/118453#M83569</guid>
      <dc:creator>alrice</dc:creator>
      <dc:date>2007-11-27T19:23:41Z</dc:date>
    </item>
  </channel>
</rss>

