<?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: Get RESTApi response in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27012#M11638</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok I've seen with someone how to enable CORS in project. So I added these lines into my Alfresco repo (and put the lines in the web.xml such as said in the github link, and added the jar wherever I could or seemed right aha) :&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #808080;"&gt;&amp;lt;!-- Enabling CORS --&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN style="color: #3366ff;"&gt;&amp;lt;dependency&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: #3366ff;"&gt;&amp;lt;groupId&amp;gt;&lt;/SPAN&gt;org.alfresco&lt;SPAN style="color: #3366ff;"&gt;&amp;lt;/groupId&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: #3366ff;"&gt;&amp;lt;artifactId&amp;gt;&lt;/SPAN&gt;enablecors&lt;SPAN style="color: #3366ff;"&gt;&amp;lt;/artifactId&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: #3366ff;"&gt;&amp;lt;version&amp;gt;&lt;/SPAN&gt;1.0&lt;SPAN style="color: #3366ff;"&gt;&amp;lt;/version&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;lt;/dependency&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN style="color: #3366ff;"&gt;&amp;lt;dependency&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;groupId&amp;gt;&lt;/SPAN&gt;com.thetransactioncompany&lt;SPAN style="color: #3366ff;"&gt;&amp;lt;/groupId&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;artifactId&amp;gt;&lt;/SPAN&gt;cors-filter&lt;SPAN style="color: #3366ff;"&gt;&amp;lt;/artifactId&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;version&amp;gt;&lt;/SPAN&gt;2.5&amp;lt;&lt;SPAN style="color: #3366ff;"&gt;/version&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;lt;/dependency&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN style="color: #808080;"&gt;&amp;lt;!-- End enabling CORS --&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But I still get the same problems..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was also wondering since I'm creating a new page in Share do I have to add lines into the configurations xml files of this page to access the Alfresco database ? My xml files only contain :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;The first one:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro" style="color: #727174; border-width: 0px 0px 0px 2px; border-style: initial initial initial solid; border-color: initial initial initial #cccccc; margin: 10px 0px; padding: 10px 20px;"&gt;&lt;P style="border: 0px; font-weight: inherit;"&gt;&amp;lt;page&amp;gt;&lt;BR /&gt;&amp;lt;template-instance&amp;gt;new-page&amp;lt;/template-instance&amp;gt;&lt;BR /&gt;&amp;lt;authentication&amp;gt;none&amp;lt;/authentication&amp;gt; &amp;lt;!-- J'ai essayé avec une auth user aussi --&amp;gt;&lt;BR /&gt;&amp;lt;/page&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&lt;BR /&gt;The second one:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro" style="color: #727174; border-width: 0px 0px 0px 2px; border-style: initial initial initial solid; border-color: initial initial initial #cccccc; margin: 10px 0px; padding: 10px 20px;"&gt;&lt;P style="border: 0px; font-weight: inherit;"&gt;&amp;lt;template-instance&amp;gt;&lt;BR /&gt;&amp;lt;template-type&amp;gt;new-page/new-page&amp;lt;/template-type&amp;gt;&lt;BR /&gt;&amp;lt;/template-instance&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Jun 2017 07:37:12 GMT</pubDate>
    <dc:creator>jackarnd</dc:creator>
    <dc:date>2017-06-01T07:37:12Z</dc:date>
    <item>
      <title>Get RESTApi response</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27008#M11634</link>
      <description>Hello,I'd like to parse a string given by :&amp;nbsp;http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/people&amp;nbsp;but my code doesn't log in alfresco.Thus, I wrote this code in my custom share page:&amp;lt;p id="peoplelist"&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;script&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var people = new XMLHttpRequest();&amp;nbsp;&amp;nbsp;&amp;nbsp;peop</description>
      <pubDate>Tue, 30 May 2017 09:07:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27008#M11634</guid>
      <dc:creator>jackarnd</dc:creator>
      <dc:date>2017-05-30T09:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Get RESTApi response</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27009#M11635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jack,&lt;/P&gt;&lt;P&gt;I'm bit puzzled by the message about port 8081 but you could try to enable cors in the web.xm of alfresco like described in the configuration for the alfresco ng-components:&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Alfresco/alfresco-ng2-components/blob/master/ALFRESCOCORS.md" title="https://github.com/Alfresco/alfresco-ng2-components/blob/master/ALFRESCOCORS.md" rel="nofollow noopener noreferrer"&gt;alfresco-ng2-components/ALFRESCOCORS.md at master · Alfresco/alfresco-ng2-components · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe this helps...&lt;/P&gt;&lt;P&gt;cu Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 16:53:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27009#M11635</guid>
      <dc:creator>mehe</dc:creator>
      <dc:date>2017-05-30T16:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Get RESTApi response</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27010#M11636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi !&lt;BR /&gt;The port 8081 is because I used Maven to create my Alfresco repository and Share too. So Alfresco is running on 8080 and Share on 8081. So I've looked into enabling CORS in an Alfresco repo generated by Maven previously but it doesn't really work I think, the web.xml aren't the same, when I add the lines missing to enable CORS it bugs the compilation and so on...&lt;BR /&gt;But since Share works properly during the normal use I don't think that the CORS are the problem ? I don't know..&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2017 07:27:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27010#M11636</guid>
      <dc:creator>jackarnd</dc:creator>
      <dc:date>2017-05-31T07:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Get RESTApi response</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27011#M11637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;...but you are starting the XMLHttprequest from the html page - that means from your browser - if I understood the problem.&lt;/P&gt;&lt;P&gt;There is also the&amp;nbsp;&lt;A href="https://artifacts.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/enablecors/1.0/enablecors-1.0.jar" style="color: #0366d6; background-color: transparent; font-size: 16px;" rel="nofollow noopener noreferrer"&gt;enablecors&lt;/A&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff; font-size: 16px;"&gt; platform module JAR (see the above link) - maybe you can include this to your repo...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2017 19:16:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27011#M11637</guid>
      <dc:creator>mehe</dc:creator>
      <dc:date>2017-05-31T19:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get RESTApi response</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27012#M11638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok I've seen with someone how to enable CORS in project. So I added these lines into my Alfresco repo (and put the lines in the web.xml such as said in the github link, and added the jar wherever I could or seemed right aha) :&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #808080;"&gt;&amp;lt;!-- Enabling CORS --&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN style="color: #3366ff;"&gt;&amp;lt;dependency&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: #3366ff;"&gt;&amp;lt;groupId&amp;gt;&lt;/SPAN&gt;org.alfresco&lt;SPAN style="color: #3366ff;"&gt;&amp;lt;/groupId&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: #3366ff;"&gt;&amp;lt;artifactId&amp;gt;&lt;/SPAN&gt;enablecors&lt;SPAN style="color: #3366ff;"&gt;&amp;lt;/artifactId&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: #3366ff;"&gt;&amp;lt;version&amp;gt;&lt;/SPAN&gt;1.0&lt;SPAN style="color: #3366ff;"&gt;&amp;lt;/version&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;lt;/dependency&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN style="color: #3366ff;"&gt;&amp;lt;dependency&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;groupId&amp;gt;&lt;/SPAN&gt;com.thetransactioncompany&lt;SPAN style="color: #3366ff;"&gt;&amp;lt;/groupId&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;artifactId&amp;gt;&lt;/SPAN&gt;cors-filter&lt;SPAN style="color: #3366ff;"&gt;&amp;lt;/artifactId&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;version&amp;gt;&lt;/SPAN&gt;2.5&amp;lt;&lt;SPAN style="color: #3366ff;"&gt;/version&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;lt;/dependency&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN style="color: #808080;"&gt;&amp;lt;!-- End enabling CORS --&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But I still get the same problems..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was also wondering since I'm creating a new page in Share do I have to add lines into the configurations xml files of this page to access the Alfresco database ? My xml files only contain :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;The first one:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro" style="color: #727174; border-width: 0px 0px 0px 2px; border-style: initial initial initial solid; border-color: initial initial initial #cccccc; margin: 10px 0px; padding: 10px 20px;"&gt;&lt;P style="border: 0px; font-weight: inherit;"&gt;&amp;lt;page&amp;gt;&lt;BR /&gt;&amp;lt;template-instance&amp;gt;new-page&amp;lt;/template-instance&amp;gt;&lt;BR /&gt;&amp;lt;authentication&amp;gt;none&amp;lt;/authentication&amp;gt; &amp;lt;!-- J'ai essayé avec une auth user aussi --&amp;gt;&lt;BR /&gt;&amp;lt;/page&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&lt;BR /&gt;The second one:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro" style="color: #727174; border-width: 0px 0px 0px 2px; border-style: initial initial initial solid; border-color: initial initial initial #cccccc; margin: 10px 0px; padding: 10px 20px;"&gt;&lt;P style="border: 0px; font-weight: inherit;"&gt;&amp;lt;template-instance&amp;gt;&lt;BR /&gt;&amp;lt;template-type&amp;gt;new-page/new-page&amp;lt;/template-type&amp;gt;&lt;BR /&gt;&amp;lt;/template-instance&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jun 2017 07:37:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27012#M11638</guid>
      <dc:creator>jackarnd</dc:creator>
      <dc:date>2017-06-01T07:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Get RESTApi response</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27013#M11639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem isn't related to CORS. You say "custom share page" - which means you should be calling all Alfresco APIs through the Share proxy to piggy-back onto the existing authentication that Share is already using. You are trying to call Alfresco server directly, which is a bad idea from Share - as you have no idea what authentication chain is being used etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To call that API through Share and get the result is simply a matter of changing the GET URL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://localhost:8081/share/proxy/alfresco-api/-default-/public/alfresco/versions/1/people" title="http://localhost:8081/share/proxy/alfresco-api/-default-/public/alfresco/versions/1/people" rel="nofollow noopener noreferrer"&gt;http://localhost:8081/share/proxy/alfresco-api/-default-/public/alfresco/versions/1/people&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will return the result you want, it will also use the existing authentication for the logged in Share user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jun 2017 09:17:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27013#M11639</guid>
      <dc:creator>kevinr1</dc:creator>
      <dc:date>2017-06-01T09:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Get RESTApi response</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27014#M11640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok thank you a lot !! That works fine !&lt;BR /&gt;&lt;BR /&gt;With gratitude,&lt;BR /&gt;&lt;BR /&gt;Jack&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jun 2017 15:32:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27014#M11640</guid>
      <dc:creator>jackarnd</dc:creator>
      <dc:date>2017-06-01T15:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Get RESTApi response</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27015#M11641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was wondering, I have an Apache2 server running on a Raspberry Pi, so I wanted to know if the same page I'm working on could work. But there is no share proxy. so I&amp;nbsp;used the code I made at the beginning to access the api&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN&gt;people.open('GET', '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://192.168.1.103:8080/alfresco/api/-default-/public/alfresco/versions/1/people" rel="nofollow noopener noreferrer" target="_blank"&gt;http://192.168.1.103:8080/alfresco/api/-default-/public/alfresco/versions/1/people&lt;/A&gt;&lt;SPAN&gt;', true, 'admin', 'admin');&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But this doesn't work (as kinda expected).&lt;/P&gt;&lt;P&gt;So how am I supposed to access alfresco from another instance than Share ?&lt;BR /&gt;&lt;BR /&gt;Keeping up,&lt;BR /&gt;&lt;BR /&gt;Jack.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jun 2017 13:29:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/get-restapi-response/m-p/27015#M11641</guid>
      <dc:creator>jackarnd</dc:creator>
      <dc:date>2017-06-06T13:29:36Z</dc:date>
    </item>
  </channel>
</rss>

