<?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: How to select parent of a given type somwhere in hierarchy? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-select-parent-of-a-given-type-somwhere-in-hierarchy/m-p/178168#M131298</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There is no CHILDREN index in Lucene, so you cannot query a parent for containing a child. You probably can using the XPath set (that is, without using Lucene at all), which you can read about at &lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/Search_Documentation#XPath_search_using_the_node_service" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Search_Documentation#XPath_search_using_the_node_service&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Mar 2009 10:22:27 GMT</pubDate>
    <dc:creator>rogier_oudshoor</dc:creator>
    <dc:date>2009-03-19T10:22:27Z</dc:date>
    <item>
      <title>How to select parent of a given type somwhere in hierarchy?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-select-parent-of-a-given-type-somwhere-in-hierarchy/m-p/178165#M131295</link>
      <description>Hello,My type ce:festival extends cm:folder. Inside of this festival there can be many folders with subfolders. Somewhere in hierachy there is a node for which I need to select ce:festival it is under. I do not know how deep it is - users can create as many folders as they want. For example, it coul</description>
      <pubDate>Tue, 17 Mar 2009 21:53:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-select-parent-of-a-given-type-somwhere-in-hierarchy/m-p/178165#M131295</guid>
      <dc:creator>mmalczewski</dc:creator>
      <dc:date>2009-03-17T21:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to select parent of a given type somwhere in hierarchy?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-select-parent-of-a-given-type-somwhere-in-hierarchy/m-p/178166#M131296</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'll assume you have Java skills for developing in Alfresco, that you have the NodeRef of your node my_node, and that you have a QName for your custom ce:festival type&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you just build a method like that (it is not working of course, but it may give you a few hints) :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;public NodeRef getAssociatedFestival (NodeRef nodeRef) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; // Test if this nodeRef is of type ce:festival&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if(nodeService.getType(NodeRef).equals(QName_festival))&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return nodeRef;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; } else {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; // get the parent node of nodeRef and run this very method on it&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ChildAssociationRef cAssocRef = nodeService.getPrimaryParent(nodeRef);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; NodeRef parentRef = cAssocRef.getParentRef();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; return getAssociatedFestival(parentRef);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 13:23:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-select-parent-of-a-given-type-somwhere-in-hierarchy/m-p/178166#M131296</guid>
      <dc:creator>jayjayecl</dc:creator>
      <dc:date>2009-03-18T13:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to select parent of a given type somwhere in hierarchy?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-select-parent-of-a-given-type-somwhere-in-hierarchy/m-p/178167#M131297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for reply. I did not make myself clear at the beginning - I have already had this working this way, but I don't like this solution. I'd rather invoke single lucene query, I think xpath based. Any ideas how to build such query?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mm&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 16:04:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-select-parent-of-a-given-type-somwhere-in-hierarchy/m-p/178167#M131297</guid>
      <dc:creator>mmalczewski</dc:creator>
      <dc:date>2009-03-18T16:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to select parent of a given type somwhere in hierarchy?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-select-parent-of-a-given-type-somwhere-in-hierarchy/m-p/178168#M131298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There is no CHILDREN index in Lucene, so you cannot query a parent for containing a child. You probably can using the XPath set (that is, without using Lucene at all), which you can read about at &lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/Search_Documentation#XPath_search_using_the_node_service" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Search_Documentation#XPath_search_using_the_node_service&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 10:22:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-select-parent-of-a-given-type-somwhere-in-hierarchy/m-p/178168#M131298</guid>
      <dc:creator>rogier_oudshoor</dc:creator>
      <dc:date>2009-03-19T10:22:27Z</dc:date>
    </item>
  </channel>
</rss>

