<?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: Hit External API in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/hit-external-api/m-p/274562#M227692</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thank you both for your replie!&amp;nbsp; Very appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Will be running through your suggestions today.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Mar 2012 15:53:02 GMT</pubDate>
    <dc:creator>drozes</dc:creator>
    <dc:date>2012-03-19T15:53:02Z</dc:date>
    <item>
      <title>Hit External API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/hit-external-api/m-p/274559#M227689</link>
      <description>Hello All;New to Alfresco and appreciate any help available.Trying to make a simple server side request to a URL (ie. http://mycompany.com/apiservice?method=getDocuments)I'll create the webscript's xml file and am able to hit the URL successfully:&amp;lt;webscript&amp;gt;&amp;nbsp; &amp;lt;shortname&amp;gt;Tests&amp;lt;/shortna</description>
      <pubDate>Tue, 13 Mar 2012 15:57:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/hit-external-api/m-p/274559#M227689</guid>
      <dc:creator>drozes</dc:creator>
      <dc:date>2012-03-13T15:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Hit External API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/hit-external-api/m-p/274560#M227690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Take a look at the example web scripts on the wiki.&amp;nbsp;&amp;nbsp; Or in Alfresco's source code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are examples of Java Script Controllers and Java Controllers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Java script controllers go alongside the template with a naming convention for method/response type.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Java Controllers need to be registered with Spring,&amp;nbsp; just follow the existing patterns.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 19:55:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/hit-external-api/m-p/274560#M227690</guid>
      <dc:creator>mrogers</dc:creator>
      <dc:date>2012-03-15T19:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Hit External API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/hit-external-api/m-p/274561#M227691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I published an example project that implements the Java-Backed WebScripts described in the Alfresco Wiki:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://code.google.com/p/alfresco-java-backed-webscripts-demo/" rel="nofollow noopener noreferrer"&gt;http://code.google.com/p/alfresco-java-backed-webscripts-demo/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can take a look at this Maven module and you can try the implementation running on-the-fly an Alfresco instance with Jetty.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The project is mentioned in the Alfresco Wiki here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples#The_Demo_Web_Scripts" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples#The_Demo_Web_Scripts&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 07:36:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/hit-external-api/m-p/274561#M227691</guid>
      <dc:creator>openpj</dc:creator>
      <dc:date>2012-03-16T07:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Hit External API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/hit-external-api/m-p/274562#M227692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thank you both for your replie!&amp;nbsp; Very appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Will be running through your suggestions today.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2012 15:53:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/hit-external-api/m-p/274562#M227692</guid>
      <dc:creator>drozes</dc:creator>
      <dc:date>2012-03-19T15:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Hit External API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/hit-external-api/m-p/274563#M227693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It sounds like you know how to create a web script, but your challenge is that you aren't sure how to hit a non-Alfresco service from the web script controller. Your goal is to invoke that service and then put some of that data in your web script response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Option 1: Assuming you are staying with JavaScript&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It looks like you are trying to use a JavaScript controller. The Web Script engine actually has a "remote" object that can be used to invoke remote endpoints. Typically, it is used from a Share tier web script to invoke a web script on the repository tier. But it can be used to hit any end point. If you need to do this from a Share tier web script, you should be able to configure a new end point and then invoke it using the remote object. Take a look at the slingshot-application-context.xml and find the bean with an id of "webframework.store.remote.abstract" to see how the default "alfresco" endpoint is configured.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Because the repository tier and the share tier use the same web script engine, you *might* be able to use the remote object from a repository tier web script. The problem is that the object is disabled by default (for security reasons I don't quite understand). I haven't done this since 3.0 but back then I did successfully re-enable the remote object on the repository tier so that I could invoke third-party services using the remote object in a repository tier web script. I have no idea what is involved in doing that in more recent releases, but it might be worth a look.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In any case, regardless of the tier you may find it helpful to understand how Surf defines endpoints and how it handles authentication and so on. &lt;/SPAN&gt;&lt;A href="http://www.slideshare.net/jpotts/optaros-surf-codecamp-api" rel="nofollow noopener noreferrer"&gt;Here&lt;/A&gt;&lt;SPAN&gt; is an old, but potentially interesting presentation from the &lt;/SPAN&gt;&lt;A href="http://ecmarchitect.com/archives/2009/02/05/891" rel="nofollow noopener noreferrer"&gt;Surf Code Camps&lt;/A&gt;&lt;SPAN&gt; we did a long time ago.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Option 2: Assuming you are open to switching to Java&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you were to use Java, you could use a class like HttpClient or similar to invoke a web script. Piergiorgio has provided you with links to Java-based web scripts because once you are in Java, the world is your oyster. Google should be able to point you to many examples of Java code invoking a service and getting JSON back.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A hybrid approach would be to write Java code that invokes the service as just described and then expose that Java class as a JavaScript root object. Then you'd still be able to use a JavaScript-based web script. This hybrid approach is common when you want to make it easy for web script developers to write scripts, but you've got some heavy lifting that Java is better suited for. There are numerous examples in the Alfresco source that wrap Java services as a JavaScript root object. Look in the org.alfresco.repo.jscript package for examples. This involves basically writing the wrapper class then telling Spring about it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully this gets you pointed in the write direction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 17:38:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/hit-external-api/m-p/274563#M227693</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2012-03-21T17:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Hit External API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/hit-external-api/m-p/274564#M227694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply John, your replies always are the best.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I decided to add a library to allow remotes calls from repo tier.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Used this link as a perfect and fast guide (took 10 minutes with making webscripts to test)&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.unorganizedmachines.com/site/software-and-technology/34-software-development/97-calling-web-services-from-alfresco-web-scripts" rel="nofollow noopener noreferrer"&gt;http://www.unorganizedmachines.com/site/software-and-technology/34-software-development/97-calling-web-services-from-alfresco-web-scripts&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 19:34:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/hit-external-api/m-p/274564#M227694</guid>
      <dc:creator>drozes</dc:creator>
      <dc:date>2012-03-21T19:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Hit External API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/hit-external-api/m-p/274565#M227695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Would love to understand how to expose the native 'remote' object to the repo tier.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do i need to get a JAR for it, or can i reference the one the webclient is using?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone have a guide?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 20:03:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/hit-external-api/m-p/274565#M227695</guid>
      <dc:creator>drozes</dc:creator>
      <dc:date>2012-03-21T20:03:37Z</dc:date>
    </item>
  </channel>
</rss>

