<?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: JavaScript - Finding Current Site. in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/javascript-finding-current-site/m-p/247056#M200186</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can anyone simply direct me to an example, where it's clear how to pass Alfresco.constants FROM SHARE TO DATA WEBSCRIPTS IN ALFRESCO EXPLORER.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;THATS ALL I ASK. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please and thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anybody help, I'm new to Alfresco. I've read several pages of documentation etc… I just can't wrap my head around this concept from what i've seen in current samples.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Apr 2011 14:53:47 GMT</pubDate>
    <dc:creator>cedorfm</dc:creator>
    <dc:date>2011-04-01T14:53:47Z</dc:date>
    <item>
      <title>JavaScript - Finding Current Site.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/javascript-finding-current-site/m-p/247053#M200183</link>
      <description>Hello,I am trying to search the repository according to what site the user is currently in. There are several sites and I wan't to avoid creating a seperate webscript for each dashlet. If i had the current site, the search for a specific folder can be updated according to the current site. This woul</description>
      <pubDate>Wed, 30 Mar 2011 14:03:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/javascript-finding-current-site/m-p/247053#M200183</guid>
      <dc:creator>cedorfm</dc:creator>
      <dc:date>2011-03-30T14:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript - Finding Current Site.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/javascript-finding-current-site/m-p/247054#M200184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Have a look at the webscripts in share, many (most?) of them support this scenario.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For client side javascript you also have a constant for this&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alfresco.constants.SITE = "currentsitename";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do a view source to get available constants.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Once you have the site name, it has to be passed to your webscript in the repository, either as you suggested as a url template or as an argument.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 14:52:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/javascript-finding-current-site/m-p/247054#M200184</guid>
      <dc:creator>loftux</dc:creator>
      <dc:date>2011-03-30T14:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript - Finding Current Site.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/javascript-finding-current-site/m-p/247055#M200185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am uncertain about what you mean by "client side javascript".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you refering to webscripting in Alfresco share or Alfresco explorer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My Alfresco SHARE .js uses remote.connect() to connect to the EXPLORER webscript.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My Alfresco EXPLORER .js is as follows…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;var name = "Hello "&lt;BR /&gt;var site = Alfresco.constants.USERNAME;&lt;BR /&gt;&lt;BR /&gt;model.name = name;&lt;BR /&gt;model.site = site;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I get a reference error saying "Alfresco" is not defined. Bear in mind without Alfresco.constants.USERNAME&amp;nbsp;&amp;nbsp; it works and prints hello just fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I appreciate your assistance in the matter.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2011 17:36:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/javascript-finding-current-site/m-p/247055#M200185</guid>
      <dc:creator>cedorfm</dc:creator>
      <dc:date>2011-03-31T17:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript - Finding Current Site.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/javascript-finding-current-site/m-p/247056#M200186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can anyone simply direct me to an example, where it's clear how to pass Alfresco.constants FROM SHARE TO DATA WEBSCRIPTS IN ALFRESCO EXPLORER.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;THATS ALL I ASK. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please and thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anybody help, I'm new to Alfresco. I've read several pages of documentation etc… I just can't wrap my head around this concept from what i've seen in current samples.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 14:53:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/javascript-finding-current-site/m-p/247056#M200186</guid>
      <dc:creator>cedorfm</dc:creator>
      <dc:date>2011-04-01T14:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript - Finding Current Site.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/javascript-finding-current-site/m-p/247057#M200187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No need to shout.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's all over our existing code, but here's some further explanation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- all the Alfresco.constants.* are within client-side JavaScript only. By "client-side" I mean code that is run by the browser.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- you seem to be working with web-tier JavaScript, i.e. code that is run by the Rhino JS engine that we embed with Surf. In other words, running on the web server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Without further details, it's not possible to tell exactly how you're implementing the search, but I'm presuming your user POSTs a form containing the search term to your webscript which then calls the Repository via remote.call. You need to also POST the user's current site which, as Peter pointed out, is held within Alfresco.constants.SITE. If the HTML mark-up for the form is being generated on the web server, you can populate a hidden form field with the current site using a bit of Freemarker: ${(page.url.templateArgs.site!"")?html}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 15:22:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/javascript-finding-current-site/m-p/247057#M200187</guid>
      <dc:creator>mikeh</dc:creator>
      <dc:date>2011-04-01T15:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript - Finding Current Site.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/javascript-finding-current-site/m-p/247058#M200188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Mike,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry about that, this whole thing is just very frustrating at times. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for the reply.&amp;nbsp; &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 15:37:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/javascript-finding-current-site/m-p/247058#M200188</guid>
      <dc:creator>cedorfm</dc:creator>
      <dc:date>2011-04-01T15:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript - Finding Current Site.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/javascript-finding-current-site/m-p/247059#M200189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So, I understand what you are trying say! Finally.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately there is nothing in the current Surf Plateform API that will give me the Site Name, however, I can retreive the site name using the HTTP Client API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I didn't realize webscripts were available on several plateforms. I didn't even realize there were other plateforms!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Though i did read over the Web Script Wiki. I don't know how I missed that part.&amp;nbsp; :shock:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2011 13:33:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/javascript-finding-current-site/m-p/247059#M200189</guid>
      <dc:creator>cedorfm</dc:creator>
      <dc:date>2011-04-06T13:33:07Z</dc:date>
    </item>
  </channel>
</rss>

