<?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 access repo service in Share WebScript in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-access-repo-service-in-share-webscript/m-p/47662#M18705</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alfresco share is a seperate Web-App so I think &lt;B&gt;Mike Hatfield&lt;/B&gt;‌s answer to&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/thread/160605"&gt;Cannot access Root Scope Objects in Share dashlet Web Script&lt;/A&gt;&amp;nbsp; also applies to your question&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 07 Oct 2018 13:06:38 GMT</pubDate>
    <dc:creator>mehe</dc:creator>
    <dc:date>2018-10-07T13:06:38Z</dc:date>
    <item>
      <title>How to access repo service in Share WebScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-access-repo-service-in-share-webscript/m-p/47661#M18704</link>
      <description>When I am using people object in Share Webscript received below error.ReferenceError: people is not defined alfrescoMy requirement is to display few navigation links if user is part of a group. Below is the code snippet.var node = people.getGroup("&amp;lt;some_group&amp;gt;");if(node){ var members = people.</description>
      <pubDate>Fri, 05 Oct 2018 20:24:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-access-repo-service-in-share-webscript/m-p/47661#M18704</guid>
      <dc:creator>mehar460</dc:creator>
      <dc:date>2018-10-05T20:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to access repo service in Share WebScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-access-repo-service-in-share-webscript/m-p/47662#M18705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alfresco share is a seperate Web-App so I think &lt;B&gt;Mike Hatfield&lt;/B&gt;‌s answer to&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/thread/160605"&gt;Cannot access Root Scope Objects in Share dashlet Web Script&lt;/A&gt;&amp;nbsp; also applies to your question&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Oct 2018 13:06:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-access-repo-service-in-share-webscript/m-p/47662#M18705</guid>
      <dc:creator>mehe</dc:creator>
      <dc:date>2018-10-07T13:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to access repo service in Share WebScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-access-repo-service-in-share-webscript/m-p/47663#M18706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The web script framework has a built-in mechanism for calling other rest APIs. The root object is called "remote". The framework can connect to any system, even non-Alfresco systems, but, by default, it connects to the Alfresco repo tier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, you can do something like:&lt;/P&gt;&lt;P&gt;response = remote.call("/some/webscript");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And that will invoke a web script on the repo tier that has a URL of "/alfresco/service/some/webscript".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can check response.status for the response code and you can parse the response into a JavaScript object as needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a list of the Alfresco repository tier web scripts, take a look at &lt;A href="http://localhost:8080/alfresco/service/index" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/service/index&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2018 20:12:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-access-repo-service-in-share-webscript/m-p/47663#M18706</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2018-10-10T20:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to access repo service in Share WebScript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-access-repo-service-in-share-webscript/m-p/47664#M18707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Glad you replied.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have figured out, below is the code snippet used and is working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var name = encodeURIComponent(user.name);&lt;/P&gt;&lt;P&gt;var connector = remote.connect("alfresco-api");&lt;/P&gt;&lt;P&gt;var data =&lt;/P&gt;&lt;P&gt;connector.get("/-default-/public/alfresco/versions/1/people/"&lt;EM&gt;name&lt;/EM&gt;"/groups");&lt;/P&gt;&lt;P&gt;var isGateKeeper = false;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(data.status == 200){&lt;/P&gt;&lt;P&gt;var result = eval('(' + data + ')');&lt;/P&gt;&lt;P&gt;var count = result.list.pagination.count;&lt;/P&gt;&lt;P&gt;for(i=0; i &amp;lt; count; i++)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;if(result.list.entries[0].entry.id == "GROUP_gate-keeper")&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;isGateKeeper = true;&lt;/P&gt;&lt;P&gt;break;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;if(isGateKeeper &amp;amp;&amp;amp; !user.isAdmin){&lt;/P&gt;&lt;P&gt;var headerMenu = widgetUtils.findObject(model.jsonModel, "id",&lt;/P&gt;&lt;P&gt;"HEADER_APP_MENU_BAR");&lt;/P&gt;&lt;P&gt;if (headerMenu != null) {&lt;/P&gt;&lt;P&gt;headerMenu.config.widgets.push({&lt;/P&gt;&lt;P&gt;id: "HEADER_USER_TRASH_CAN",&lt;/P&gt;&lt;P&gt;name: "alfresco/menus/AlfMenuBarItem",&lt;/P&gt;&lt;P&gt;config: {&lt;/P&gt;&lt;P&gt;label: "My Trash Can",&lt;/P&gt;&lt;P&gt;targetUrl: "user/" + name + "/user-trashcan"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2018 20:38:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-access-repo-service-in-share-webscript/m-p/47664#M18707</guid>
      <dc:creator>mehar460</dc:creator>
      <dc:date>2018-10-10T20:38:40Z</dc:date>
    </item>
  </channel>
</rss>

