<?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 get storeid in custom document action in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-storeid-in-custom-document-action/m-p/113563#M31580</link>
    <description>&lt;P&gt;ScriptNode is a Repository-tier API - the action is part of Share, so Repository-tier API is not available. You have to use some client-side JS api / model that Share provides. You should be able to use a placeholder like {node.nodeRef.storeId} in action URL templates&lt;/P&gt;
&lt;P&gt;webdavUrl just happens to be one of the properties that are available under a similar name as in the ScriptNode API.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jan 2020 16:53:38 GMT</pubDate>
    <dc:creator>afaust</dc:creator>
    <dc:date>2020-01-30T16:53:38Z</dc:date>
    <item>
      <title>how to get storeid in custom document action</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-storeid-in-custom-document-action/m-p/113562#M31579</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm currently trying to modify an existing custom document action in Share(share-documentlibrary-config.xml), the current action is like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="current webdavUrl.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/415iB2A9BECF90BF9358/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;In the document action, the {webdavUrl} will dynamically change to the correct string of wedavUrl, mentioned in ScriptNode:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.alfresco.com/6.1/references/API-JS-ScriptNode.html" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.alfresco.com/6.1/references/API-JS-ScriptNode.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I tried to modify {wedavUrl}&amp;nbsp; to {storeId}, restart the Alfresco, I expect to see the dynamic node ID in the link but it only shows "{storeId}":&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="storeId not changed.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/418iD11FE22D9F4CFC65/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought all ScriptNode object can be directly used here but looks like it's not. I tried {nodeRef}, it works. Can someone help me to figure out this? What did I miss?&lt;/P&gt;&lt;P&gt;Thank you, appreciate your help&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 16:25:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-storeid-in-custom-document-action/m-p/113562#M31579</guid>
      <dc:creator>jasonzhang</dc:creator>
      <dc:date>2020-01-30T16:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to get storeid in custom document action</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-storeid-in-custom-document-action/m-p/113563#M31580</link>
      <description>&lt;P&gt;ScriptNode is a Repository-tier API - the action is part of Share, so Repository-tier API is not available. You have to use some client-side JS api / model that Share provides. You should be able to use a placeholder like {node.nodeRef.storeId} in action URL templates&lt;/P&gt;
&lt;P&gt;webdavUrl just happens to be one of the properties that are available under a similar name as in the ScriptNode API.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 16:53:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-storeid-in-custom-document-action/m-p/113563#M31580</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2020-01-30T16:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to get storeid in custom document action</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-storeid-in-custom-document-action/m-p/113564#M31581</link>
      <description>&lt;P&gt;Hi afaust,&lt;/P&gt;&lt;P&gt;Thank you for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your comment "&lt;SPAN&gt;You have to use some client-side JS api / model that Share provides." Here in this case, {nodeRef},&amp;nbsp;{downloadUrl}, {viewUrl},&amp;nbsp;{managePermissionsUrl} and etc are available in&amp;nbsp;share-documentlibrary-config.xml because client-side JS api has already provided?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you let me know where I can access&amp;nbsp;client-side JS api?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there an example of how to impletment this?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If I want to use&amp;nbsp;&lt;SPAN&gt;a placeholder like {node.nodeRef.storeId} in action URL templates, can you let me know what are the steps I need to do to impletment this function?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you so much&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 17:11:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-storeid-in-custom-document-action/m-p/113564#M31581</guid>
      <dc:creator>jasonzhang</dc:creator>
      <dc:date>2020-01-30T17:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to get storeid in custom document action</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-storeid-in-custom-document-action/m-p/113565#M31582</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/77957"&gt;@jasonzhang&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;A guide to the API is available here&amp;nbsp;&lt;A href="https://docs.alfresco.com/6.1/concepts/dev-api-intro.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/6.1/concepts/dev-api-intro.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 13:28:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-storeid-in-custom-document-action/m-p/113565#M31582</guid>
      <dc:creator>EddieMay</dc:creator>
      <dc:date>2020-01-31T13:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to get storeid in custom document action</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-storeid-in-custom-document-action/m-p/113566#M31583</link>
      <description>&lt;P&gt;The available model elements come from many sources and are effectively merged before the URL template is processed to replace placeholders. E.g. you can find URL placeholders defined in &lt;A href="https://github.com/Alfresco/share/blob/master/share/src/main/webapp/components/documentlibrary/actions.js#L221" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/Alfresco/share/blob/master/share/src/main/webapp/components/documentlibrary/actions.js#L221&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The node placeholder element is based on this "class": from &lt;A href="https://github.com/Alfresco/share/blob/master/web-framework-commons/src/main/webapp/js/alfresco.js#L8849" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/Alfresco/share/blob/master/web-framework-commons/src/main/webapp/js/alfresco.js#L8849&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The nodeRef sub-element is based on this object initializer: &lt;A href="https://github.com/Alfresco/share/blob/master/web-framework-commons/src/main/webapp/js/alfresco.js#L8785" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/Alfresco/share/blob/master/web-framework-commons/src/main/webapp/js/alfresco.js#L8785&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You can see in the action rendering code in &lt;A href="https://github.com/Alfresco/share/blob/master/share/src/main/webapp/components/documentlibrary/actions.js#L142" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/Alfresco/share/blob/master/share/src/main/webapp/components/documentlibrary/actions.js#L142&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 16:36:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-storeid-in-custom-document-action/m-p/113566#M31583</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2020-01-31T16:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to get storeid in custom document action</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-storeid-in-custom-document-action/m-p/113567#M31584</link>
      <description>&lt;P&gt;Hi afaust,&lt;/P&gt;&lt;P&gt;Thank you for the links, they are very helpful, I managed&amp;nbsp; to modify the actions.js to impletement this by adding a new function to get the node id.&amp;nbsp;&lt;/P&gt;&lt;P&gt;One mre question, is there a way to get the user name from the current session/token through Share tier?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 14:44:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-storeid-in-custom-document-action/m-p/113567#M31584</guid>
      <dc:creator>jasonzhang</dc:creator>
      <dc:date>2020-02-03T14:44:37Z</dc:date>
    </item>
  </channel>
</rss>

