<?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: not able to fetch the parent of a node in share side js in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/not-able-to-fetch-the-parent-of-a-node-in-share-side-js/m-p/79823#M24783</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need the node Object to use X.parent, but you only have the nodeRef&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var node=search.findNode(str); &amp;nbsp; //now you have the node object&lt;/P&gt;&lt;P&gt;var parentNode=node.parent;&lt;/P&gt;&lt;P&gt;var parentNodeRef=parentNode.nodeRef;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could do this in a "one-liner" if you like...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Feb 2018 10:56:22 GMT</pubDate>
    <dc:creator>mehe</dc:creator>
    <dc:date>2018-02-21T10:56:22Z</dc:date>
    <item>
      <title>not able to fetch the parent of a node in share side js</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/not-able-to-fetch-the-parent-of-a-node-in-share-side-js/m-p/79822#M24782</link>
      <description>I am trying to find the parent of a node in node-header.get.js by doing the following;&amp;nbsp;&amp;nbsp;&amp;nbsp;var str = model.nodeRef;&amp;nbsp;&amp;nbsp; logger.log("childnoderef"+str);&amp;nbsp;&amp;nbsp; var parentNodeRef = str.parent;&amp;nbsp;&amp;nbsp; logger.log("parentNodeRef"+parentNodeRef);&amp;nbsp;but parentNodeRef is coming undefinedOn some googling,I have found out th</description>
      <pubDate>Wed, 21 Feb 2018 09:24:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/not-able-to-fetch-the-parent-of-a-node-in-share-side-js/m-p/79822#M24782</guid>
      <dc:creator>ayushi_agrahari</dc:creator>
      <dc:date>2018-02-21T09:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: not able to fetch the parent of a node in share side js</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/not-able-to-fetch-the-parent-of-a-node-in-share-side-js/m-p/79823#M24783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need the node Object to use X.parent, but you only have the nodeRef&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var node=search.findNode(str); &amp;nbsp; //now you have the node object&lt;/P&gt;&lt;P&gt;var parentNode=node.parent;&lt;/P&gt;&lt;P&gt;var parentNodeRef=parentNode.nodeRef;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could do this in a "one-liner" if you like...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Feb 2018 10:56:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/not-able-to-fetch-the-parent-of-a-node-in-share-side-js/m-p/79823#M24783</guid>
      <dc:creator>mehe</dc:creator>
      <dc:date>2018-02-21T10:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: not able to fetch the parent of a node in share side js</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/not-able-to-fetch-the-parent-of-a-node-in-share-side-js/m-p/79824#M24784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is always been confusion in this I guess.The script which you are trying to override is inside the share server side script.Its some thing like , you are trying to use repository javascript api inside the share javascript file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this you need to call repository webscript and use it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Feb 2018 10:57:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/not-able-to-fetch-the-parent-of-a-node-in-share-side-js/m-p/79824#M24784</guid>
      <dc:creator>krutik_jayswal</dc:creator>
      <dc:date>2018-02-21T10:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: not able to fetch the parent of a node in share side js</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/not-able-to-fetch-the-parent-of-a-node-in-share-side-js/m-p/79825#M24785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks krutik,now I understand why it is giving undefined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now can you tell me if there is any out of the webscript that gives the parent of a node so that I can call that webscript or should I need to make a custom webscript.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Feb 2018 11:51:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/not-able-to-fetch-the-parent-of-a-node-in-share-side-js/m-p/79825#M24785</guid>
      <dc:creator>ayushi_agrahari</dc:creator>
      <dc:date>2018-02-21T11:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: not able to fetch the parent of a node in share side js</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/not-able-to-fetch-the-parent-of-a-node-in-share-side-js/m-p/79826#M24786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It’s undefiniert because a String (noderef) has no „parent“ attribute. See Code above...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Feb 2018 18:23:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/not-able-to-fetch-the-parent-of-a-node-in-share-side-js/m-p/79826#M24786</guid>
      <dc:creator>mehe</dc:creator>
      <dc:date>2018-02-21T18:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: not able to fetch the parent of a node in share side js</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/not-able-to-fetch-the-parent-of-a-node-in-share-side-js/m-p/79827#M24787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Elaborating more on this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;node-header.get.js file is created inside the alfresco share.So using repository api's will not be possible over there.search object is available on repository side and not on alfresco share&amp;nbsp; so that will also not work in this file.Below link contains the root objects which are available in alfresco share.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.alfresco.com/5.2/references/APISurf-rootscoped.html" title="https://docs.alfresco.com/5.2/references/APISurf-rootscoped.html" rel="nofollow noopener noreferrer"&gt;Surf root objects | Alfresco Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no existing webscript using which you can get the parent of a node, you need to make your own.Below is the code for repository controller script.for getting the parent of a node.Make sure you create this on repository side and not in alfresco share.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE style="color: #515d6b; font-size: 12px;"&gt;function main() { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var nodeRefArg= args["nodeRef"]; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var node = search.findNode(nodeRefArg); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (node.exists()) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; model.nodeRefModel = node.getParent().getNodeRef().toString(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;model.nodeRefModel = "N/A"; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} }&amp;nbsp; main();&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2018 04:44:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/not-able-to-fetch-the-parent-of-a-node-in-share-side-js/m-p/79827#M24787</guid>
      <dc:creator>krutik_jayswal</dc:creator>
      <dc:date>2018-02-22T04:44:11Z</dc:date>
    </item>
  </channel>
</rss>

