<?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 AlfrescoJsApi not working correctly in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2055#M191</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I recently started using ADF, I'm building an app using my instalation of Alfresco ECM 5.2, I have created a page within the app using the tutorials provided here.&lt;/P&gt;&lt;P&gt;My problem is that, i want to display information about a site which is on my ECM platform, i can login succesfully to platform but when it comes to getting the site info i have this error:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/14324_pastedImage_1.png" style="width: 620px; height: 235px;" /&gt;&lt;/P&gt;&lt;P&gt;and this is my component.ts:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/14325_pastedImage_2.png" style="width: 620px; height: 433px;" /&gt;&lt;/P&gt;&lt;P&gt;The weird part is that, i try the query on postman and it gives me the site i'm looking for:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/14326_pastedImage_3.png" style="width: 620px; height: 485px;" /&gt;&lt;/P&gt;&lt;P&gt;I will appreciate any kind of help in this matter,&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Jun 2017 16:22:33 GMT</pubDate>
    <dc:creator>os_cerna</dc:creator>
    <dc:date>2017-06-09T16:22:33Z</dc:date>
    <item>
      <title>AlfrescoJsApi not working correctly</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2055#M191</link>
      <description>Hello,I recently started using ADF, I'm building an app using my instalation of Alfresco ECM 5.2, I have created a page within the app using the tutorials provided here.My problem is that, i want to display information about a site which is on my ECM platform, i can login succesfully to platform but</description>
      <pubDate>Fri, 09 Jun 2017 16:22:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2055#M191</guid>
      <dc:creator>os_cerna</dc:creator>
      <dc:date>2017-06-09T16:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: AlfrescoJsApi not working correctly</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2056#M192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are losing the context of "this" when calling "promise.then(..)" with a "function" parameter. Try using the "fat arrow" syntax to allow TypeScript maintaining the context for you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;getSite(...).then(data =&amp;gt; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;if (data) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; this.nombreSitio = "your value";&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2017 17:11:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2056#M192</guid>
      <dc:creator>dvuika</dc:creator>
      <dc:date>2017-06-09T17:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: AlfrescoJsApi not working correctly</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2057#M193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but now i have this:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/14329_pastedImage_1.png" style="width: 620px; height: 301px;" /&gt;&lt;/P&gt;&lt;P&gt;as you see, it doesnt seem to catch the correct values.&lt;/P&gt;&lt;P&gt;Also i have these errors when i inspect the page, i dont know if they are related:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/14330_pastedImage_2.png" style="width: 620px; height: 195px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2017 17:53:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2057#M193</guid>
      <dc:creator>os_cerna</dc:creator>
      <dc:date>2017-06-09T17:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: AlfrescoJsApi not working correctly</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2058#M194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Based on your initial screenshot - your async code is executed in parallel. You try to log in and get data at the same time within different promises.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should be calling Alfresco JS Api&amp;nbsp;methods after login promise is resolved, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;api.login('admin', 'admin').then(ticket =&amp;gt; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;sites.getSite(...).then(data =&amp;gt; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;....&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;});&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2017 17:59:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2058#M194</guid>
      <dc:creator>dvuika</dc:creator>
      <dc:date>2017-06-09T17:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: AlfrescoJsApi not working correctly</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2059#M195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Based on your advice i modified my component.ts, now its like this:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/14331_pastedImage_1.png" style="width: 620px; height: 406px;" /&gt;&lt;/P&gt;&lt;P&gt;but it still not catching the correct values:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/14332_pastedImage_2.png" style="width: 620px; height: 303px;" /&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2017 18:37:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2059#M195</guid>
      <dc:creator>os_cerna</dc:creator>
      <dc:date>2017-06-09T18:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: AlfrescoJsApi not working correctly</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2060#M196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You already import '&lt;STRONG&gt;AlfrescoApiService&lt;/STRONG&gt;' that reduces the code, you may also want to use '&lt;STRONG&gt;AlfrescoAuthenticationService&lt;/STRONG&gt;' to perform the login.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the snippet code for the component that works for me and retrieves the site data, I've created a new public site 'demo1':&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://paper.dropbox.com/doc/Getting-Site-iaVrspkpTtCAeKFpoJlTW" title="https://paper.dropbox.com/doc/Getting-Site-iaVrspkpTtCAeKFpoJlTW" rel="nofollow noopener noreferrer"&gt;Dropbox Paper&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV style="color: #000000; background-color: #ffffff; font-size: 12px;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2017 19:03:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2060#M196</guid>
      <dc:creator>dvuika</dc:creator>
      <dc:date>2017-06-09T19:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: AlfrescoJsApi not working correctly</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2061#M197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please note that the JSON payload that comes with the JS API&amp;nbsp;call is wrapped into the "entry":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{"entry":{"role":"SiteManager","visibility":"PUBLIC","guid":"08918280-26ba-4e9a-a2a7-a31075184144","id":"demo1","title":"demo1"}}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you might need binding your properties to the "data.entry.id"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2017 19:06:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2061#M197</guid>
      <dc:creator>dvuika</dc:creator>
      <dc:date>2017-06-09T19:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: AlfrescoJsApi not working correctly</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2062#M198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It worked, thanks a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2017 19:19:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfrescojsapi-not-working-correctly/m-p/2062#M198</guid>
      <dc:creator>os_cerna</dc:creator>
      <dc:date>2017-06-09T19:19:02Z</dc:date>
    </item>
  </channel>
</rss>

