Calling an external rest service from Alfresco Share page

user3048258

I have created a rest service in a java application . I need to call this rest service on the click of a button in Alfresco Share page . How do i approacj it . Can i directly call the service with the url ?

alfrescian

You can add a custom endpoint to SURF & use the SURF Proxy-Servlet: Example Flickr Endpoint share-config-custom.xml:

<alfresco-config>
   <config evaluator="string-compare" condition="Remote">
      <remote>       
         <endpoint>
            <id>flickr</id>
            <name>flickr - unauthenticated access for oembed resolution</name>
            <description>Access flickr to resolve URLs to embed presentations.</description>
            <connector-id>http</connector-id>
            <endpoint-url>http://www.flickr.com/services</endpoint-url>
            <identity>none</identity>
         </endpoint>         
      </remote>
   </config>
</alfresco-config>

In Browser JS Code just use the flickr endpoint via PROXY, e.g. add a new va PROXY_FLICKR_API :

var PROXY_FLICKR_API = Alfresco.constants.PROXY_URI.replace("/alfresco/", "/flickr/");
Alfresco.util.Ajax.jsonRequest(
     {
        method: Alfresco.util.Ajax.GET,
        url: PROXY_FLICKR_API + "add your concrete URL",
        successCallback:
        {
           ...
        },
        failureCallback:
        {
           ...
        }
     });

You should add your var PROXY_FLICKR_API JS declaration via SURF Extension mechanism - your target markupid is (more details http://blogs.alfresco.com/wp/developer/2012/05/22/customizing-share-javascript-widget-instantiation-part-1/):

<@markup id="yourid" target="resources" action="after">

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Calling a Rest Service from a servlet

From Dev

Recover hybrid page Alfresco Share

From Dev

Calling WCF service from external domain

From Dev

Calling REST service method from AJAX

From Dev

Calling my evil REST service from AngularJs

From Dev

Calling a method of the ASPX page from Web Service

From Dev

Calling external page with innerHTML

From Dev

Error while calling External REST URL from netsuite using token

From Dev

Django Rest Framework: Calling Internal API from External API

From

Permission Denied error calling external service from appengine go

From Java

Alfresco - /alfresco and /share difference

From Dev

Redirection from REST service to web page

From Dev

Calling jQuery function on external page from html.actionlink

From Dev

Calling Javascript function from external file when loading html page

From Java

Calling a REST web service secured with Spring Security from Android

From Dev

CORS issue on localhost while calling REST service from angularjs

From Dev

Xamarin Forms - calling rest service from viewmodel of pcl

From Dev

How to integrate Alfresco with my website such that both share same login page?

From Dev

Create proxy service to WSO2 ESB from existing external rest web service (C#)

From Dev

Calling a SOAP service using REST service

From Java

Calling Python machine learning service from Java as an OS process or micro service via REST

From Dev

Hyperledger composer calling external REST API

From Dev

Calendar integration for Alfresco Share

From Dev

Calling a REST service inside another REST service (Apache Camel)

From Dev

Handle external WCF Service calling internal WCF Service (auth - session)

From Dev

Calling Java EE REST service through jQuery AJAX by passing the parameters from input text box

From Dev

POST method calling from service Angular 6 to the REST using web api in asp.net mvc

From Dev

Lambda Needs REST to external service and DynamoDB table

From Dev

Adding external jars in netbeans for rest service in glassfish

Related Related

  1. 1

    Calling a Rest Service from a servlet

  2. 2

    Recover hybrid page Alfresco Share

  3. 3

    Calling WCF service from external domain

  4. 4

    Calling REST service method from AJAX

  5. 5

    Calling my evil REST service from AngularJs

  6. 6

    Calling a method of the ASPX page from Web Service

  7. 7

    Calling external page with innerHTML

  8. 8

    Error while calling External REST URL from netsuite using token

  9. 9

    Django Rest Framework: Calling Internal API from External API

  10. 10

    Permission Denied error calling external service from appengine go

  11. 11

    Alfresco - /alfresco and /share difference

  12. 12

    Redirection from REST service to web page

  13. 13

    Calling jQuery function on external page from html.actionlink

  14. 14

    Calling Javascript function from external file when loading html page

  15. 15

    Calling a REST web service secured with Spring Security from Android

  16. 16

    CORS issue on localhost while calling REST service from angularjs

  17. 17

    Xamarin Forms - calling rest service from viewmodel of pcl

  18. 18

    How to integrate Alfresco with my website such that both share same login page?

  19. 19

    Create proxy service to WSO2 ESB from existing external rest web service (C#)

  20. 20

    Calling a SOAP service using REST service

  21. 21

    Calling Python machine learning service from Java as an OS process or micro service via REST

  22. 22

    Hyperledger composer calling external REST API

  23. 23

    Calendar integration for Alfresco Share

  24. 24

    Calling a REST service inside another REST service (Apache Camel)

  25. 25

    Handle external WCF Service calling internal WCF Service (auth - session)

  26. 26

    Calling Java EE REST service through jQuery AJAX by passing the parameters from input text box

  27. 27

    POST method calling from service Angular 6 to the REST using web api in asp.net mvc

  28. 28

    Lambda Needs REST to external service and DynamoDB table

  29. 29

    Adding external jars in netbeans for rest service in glassfish

HotTag

Archive