<?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 Reference to exports. and helpers. in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Reference-to-exports-and-helpers/m-p/1100679#M68555</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Can someone please tell me where 'exports.' and 'helpers.' used in the sample code in the article "&lt;A href="https://software.intel.com/en-us/xdk/docs/oauth2authentication?wapkw=dropbox%20login#serverside"&gt;Using OAuth2 Authentication&lt;/A&gt;" are defined?&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Sat, 23 Jan 2016 22:34:13 GMT</pubDate>
    <dc:creator>Andrew_S_1</dc:creator>
    <dc:date>2016-01-23T22:34:13Z</dc:date>
    <item>
      <title>Reference to exports. and helpers.</title>
      <link>https://community.intel.com/t5/Software-Archive/Reference-to-exports-and-helpers/m-p/1100679#M68555</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Can someone please tell me where 'exports.' and 'helpers.' used in the sample code in the article "&lt;A href="https://software.intel.com/en-us/xdk/docs/oauth2authentication?wapkw=dropbox%20login#serverside"&gt;Using OAuth2 Authentication&lt;/A&gt;" are defined?&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2016 22:34:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Reference-to-exports-and-helpers/m-p/1100679#M68555</guid>
      <dc:creator>Andrew_S_1</dc:creator>
      <dc:date>2016-01-23T22:34:13Z</dc:date>
    </item>
    <item>
      <title>Once you create a data</title>
      <link>https://community.intel.com/t5/Software-Archive/Reference-to-exports-and-helpers/m-p/1100680#M68556</link>
      <description>&lt;P&gt;Once you create a data binding in the xdk UI, there will be code scripts added to the project, you can find these definitions in this path in your project:&lt;/P&gt;

&lt;P&gt;.../www/xdk/service/service-method.js&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2016 20:17:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Reference-to-exports-and-helpers/m-p/1100680#M68556</guid>
      <dc:creator>Rakshith_K_Intel</dc:creator>
      <dc:date>2016-01-25T20:17:43Z</dc:date>
    </item>
    <item>
      <title>Thank you Rakshith, however I</title>
      <link>https://community.intel.com/t5/Software-Archive/Reference-to-exports-and-helpers/m-p/1100681#M68557</link>
      <description>&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Thank you Rakshith, however I am not quite able to complete the binding.&amp;nbsp; I am running XDK#2893 on a MacBook Pro from early 2015 using OS X Yosemite 10.10.5.&amp;nbsp; I am trying to setup a connection with my app’s setup on Dropbox, using the &lt;STRONG&gt;&lt;EM&gt;authorize&lt;/EM&gt;&lt;/STRONG&gt; method on the XDK’s list of services.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Using the localhost as the&lt;STRONG&gt; redirect_uri&lt;/STRONG&gt;, and &lt;STRONG&gt;response_type&lt;/STRONG&gt; set to "code" I get a Dropbox screen asking for access permission, and after confirming on that, the XDK receives what looks like a correct bearer token (in the Response Body field however), the &lt;STRONG&gt;Call&lt;/STRONG&gt; field is empty, R&lt;STRONG&gt;esponse Code&lt;/STRONG&gt; reads n/a, and Response Headers just has empty brackets. &amp;nbsp;But when I click on &lt;STRONG&gt;Create Data Binding&lt;/STRONG&gt; (which has ‘db_coreauthorize’ in the edit box to its left)&amp;nbsp; I get:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P class="p1"&gt;&lt;STRONG&gt;&lt;SPAN class="s1"&gt;Error saving service binding&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P class="p1"&gt;&lt;STRONG&gt;&lt;SPAN class="s1"&gt;No paths chosen in response body.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P class="p1"&gt;&lt;STRONG&gt;&lt;SPAN class="s1"&gt;(Hint: click some of those checkboxes below)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P class="p2"&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;But there are no checkboxes in the response body or anywhere else.&amp;nbsp; And no service modules have been deposited in the tray on the left (though there is now a services folder).&lt;/SPAN&gt;&lt;/P&gt;

&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Is this enough to go on?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Yours,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Andrew Scott&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 22:23:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Reference-to-exports-and-helpers/m-p/1100681#M68557</guid>
      <dc:creator>Andrew_S_1</dc:creator>
      <dc:date>2016-01-27T22:23:53Z</dc:date>
    </item>
    <item>
      <title>Hi Andrew,</title>
      <link>https://community.intel.com/t5/Software-Archive/Reference-to-exports-and-helpers/m-p/1100682#M68558</link>
      <description>&lt;P&gt;Hi Andrew,&lt;/P&gt;

&lt;P&gt;1. What type of values are you seeing in the response body section? Is it not a json object?&amp;nbsp;&lt;/P&gt;

&lt;P&gt;2. Do you see the data binding you created in the web services's "Saved DAta binding" section?&lt;/P&gt;

&lt;P&gt;3. The "helpers" object has the helpers function. Depending on where you want to access it and what you want to do with it, try any of these ways &amp;nbsp;:&lt;/P&gt;

&lt;P&gt;a) Use the "Create a new web service" button and enter any value and generate the files. The .js file is automatically passed the helpers object. You can see what it has and the function implementation.&lt;/P&gt;

&lt;P&gt;b) If you use the "Debug It" option in the web services explorer, you will be able to step through the code and see exactly what the helpers object contains and how the functions are implemented.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;c) Create any random data binding. Maybe use the "API explorer sandbox" in the web services list, enter "http://jsonplaceholder.typicode.com/posts" in the GET api's parameter field&amp;nbsp;and just create a data binding. Look for www/js/xdk/services/service-methods.js file. The "helpers" object is defined here. Note that these files are auto-generated and editing them here would not be of any use. You can use the implementation to guide you to write your own helper functions.You can include another script that will over-ride or extend the existing helpers.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Anjali&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 18:52:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Reference-to-exports-and-helpers/m-p/1100682#M68558</guid>
      <dc:creator>Anjali_G_Intel</dc:creator>
      <dc:date>2016-01-29T18:52:50Z</dc:date>
    </item>
    <item>
      <title>Oh, one more thing to note. </title>
      <link>https://community.intel.com/t5/Software-Archive/Reference-to-exports-and-helpers/m-p/1100683#M68559</link>
      <description>&lt;P&gt;Oh, one more thing to note.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;When one uses any of the authorize methods that are implemented in the xdk services. The returned string result i.e. the token is stored in local storage. So one would not need to create a data binding for the authorize APIs. If you make a call of any of the other APIs from the explorer, they would automatically use the returned token from localstorage. If you want to access the returned token in your own code, use this :&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;    var db = window.localStorage;
    return db.getItem(&amp;lt;name of token&amp;gt;);&lt;/PRE&gt;

&lt;P&gt;We store the tokens with this convention : {servicename}_access_token. So for dropbox, it would be :&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt; window.localStorage.getItem('dropbox_access_token');&lt;/PRE&gt;

&lt;P&gt;Hope this helps!&lt;/P&gt;

&lt;P&gt;Anjali&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 19:08:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Reference-to-exports-and-helpers/m-p/1100683#M68559</guid>
      <dc:creator>Anjali_G_Intel</dc:creator>
      <dc:date>2016-01-29T19:08:39Z</dc:date>
    </item>
  </channel>
</rss>

