<?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 Call a repository webscript from share in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/call-a-repository-webscript-from-share/m-p/264974#M218104</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;my apologies if the question has already been asked (I didn't find it searching the forum) or if it seems a newbie question (I'm one). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, my question is: I need to call a webscript deployed in Alfresco (Repository) from a bean deployed in share. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've seen many examples on how to do that in javascript using the root scope object remote. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is its Java counterpart, if any exist?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How could I emulate its behaviour in Java? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance for any reply. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Angelo&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Sep 2012 10:43:46 GMT</pubDate>
    <dc:creator>eureka</dc:creator>
    <dc:date>2012-09-27T10:43:46Z</dc:date>
    <item>
      <title>Call a repository webscript from share</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/call-a-repository-webscript-from-share/m-p/264974#M218104</link>
      <description>Hi, my apologies if the question has already been asked (I didn't find it searching the forum) or if it seems a newbie question (I'm one). So, my question is: I need to call a webscript deployed in Alfresco (Repository) from a bean deployed in share. I've seen many examples on how to do that in java</description>
      <pubDate>Thu, 27 Sep 2012 10:43:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/call-a-repository-webscript-from-share/m-p/264974#M218104</guid>
      <dc:creator>eureka</dc:creator>
      <dc:date>2012-09-27T10:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Call a repository webscript from share</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/call-a-repository-webscript-from-share/m-p/264975#M218105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Angelo, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not sure what you want to do but I this will be helpful to you from some corner.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;there are classes extending BaseScopableProcessorExtension which allow you to use them from js.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for eg, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;we do people.createPerson(person) in javascripts, which create person.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Note here, there are two people class, one org.alfresco.repo.jscript.People and another org.alfresco.repo.template.People&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;you can see them which one extends BaseScopableProcessorExtension .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to use those root scope object from your own java application then I will be not helpful to you.&amp;nbsp; :wink:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2012 12:54:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/call-a-repository-webscript-from-share/m-p/264975#M218105</guid>
      <dc:creator>pmverma</dc:creator>
      <dc:date>2012-09-27T12:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Call a repository webscript from share</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/call-a-repository-webscript-from-share/m-p/264976#M218106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&amp;nbsp; pmverma,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you for your fast reply. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately my goal is to mimic a javascript code like &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;var connector = remote.connect("alfresco");&lt;BR /&gt;var data = connector.get("/sample/docprop.json");&lt;BR /&gt;&lt;BR /&gt;// create json object from data&lt;BR /&gt;var result = eval('(' + data + ')');&lt;BR /&gt;model.docprop = result["docprop"];&lt;BR /&gt;&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in java. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to know if there is a service or some other wrapper that acts as the remote object in javascript (see for example search object in javascript and SearchService in Foundation Java API), keeping in mind that tha java bean I have to write is going to be deployed in alfresco share app.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Angelo&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2012 14:19:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/call-a-repository-webscript-from-share/m-p/264976#M218106</guid>
      <dc:creator>eureka</dc:creator>
      <dc:date>2012-09-27T14:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Call a repository webscript from share</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/call-a-repository-webscript-from-share/m-p/264977#M218107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I sorted that out. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to use code like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;final RequestContext rc = ThreadLocalRequestContext.getRequestContext();&lt;BR /&gt;final String userId rc.getUserId();&lt;BR /&gt;final Connector conn = rc.getServiceRegistry().getConnectorService().getConnector(ALFRESCO_ENDPOINT_ID, userId, ServletUtil.getSession());&lt;BR /&gt;final Response response = conn.call(REPO_WEB_SERVICE_URL);&lt;BR /&gt;if (response.getStatus().getCode() == Status.STATUS_OK) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//do something&lt;BR /&gt;} else {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//do something else&lt;BR /&gt;}&lt;BR /&gt;&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;/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;Hope this helps someone else out there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Angelo&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2012 13:16:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/call-a-repository-webscript-from-share/m-p/264977#M218107</guid>
      <dc:creator>eureka</dc:creator>
      <dc:date>2012-10-05T13:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Call a repository webscript from share</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/call-a-repository-webscript-from-share/m-p/264978#M218108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That's exactly the way to do it, thanks for posting it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kev&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2012 09:33:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/call-a-repository-webscript-from-share/m-p/264978#M218108</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2012-10-08T09:33:49Z</dc:date>
    </item>
  </channel>
</rss>

