Announcement Announcement Module
No announcement yet.
Is anyone able to define a remote endpoint in Share and Surf? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is anyone able to define a remote endpoint in Share and Surf?

    Hi every,

    According to the new Wrox Alfresco book (pp. 306 - 309), the proper way of defining a remote end-point in Alfresco is to define <authenticator />, <connector />, and <endpoint /> elements and invoke them using the Webscript 'remote' object.

    For instance, if I define the following connector objects in a configuration file:

    	<config evaluator="string-compare" condition="Remote">
    				<name>Proof-of-Concept Authenticator</name>
    				<description>Proof-of-Concept Authenticator</description>
    				<name>Proof-of-Concept Connector</name>
    				<description>Proof-of-Concept Connector</description>
    				<name>Proof-of-Concept Endpoint</name>
    				<description>Proof-of-Concept Endpoint</description>
    I should be able to connect to the defined endpoint using the following script:

    var connector = remote.connect("proof-of-concept-endpoint");
    model.result = connector.get("/path/to/a/remote/service");
    The default authenticators, connectors, and endpoints are defined in the 'spring-webscripts-config.xml' file of the 'spring0webscripts' project of the Spring Surf SDK.

    Problem is, the book never tells where this configuration is supposed to be placed -- especially if you're trying to add end-points to a Share application. If you take a look at '/share/WEB-INF/classes/alfresco/slingshot-application-context.xml', it appears as though endpoints are to be added to one of the following three locations:

    If I define my endpoints in a local copy of:

    my endpoints are read, but the default endpoints defined in the Spring Surf 'spring-webscripts' project are not. Clearly, I shouldn't be overriding these settings.

    However, if I define my endpoints in:

    they don't seem to be picked up. In fact, the script doesn't seem to be processed at all, for if I deliberately introduce a syntax error into the XML file (in my case by adding a dangling '<' to the middle of the file), Share starts up just fine and does not choke on the error. And further, if I stop the Javascript Debugger on the script trying to open the endpoint and watch the following expression:

    I learn that my endpoint is not known to my application.

    Anyone have an idea on how to do this?


  • #2
    Hi darryl_staflund,

    I create a endpoint in a spring surf application, not for an alfresco connection, just for a custom webservice provider but i think it should works the same.
    I put the configuration of the endpoint, in the surf.xml file on the WEB-INF folder of my surf application. i hope this helps


    • #3
      Hi Arkhantos,

      I saw your post on defining the end-point in surf.xml but couldn't get it working. Maybe I configured it wrong?

      In any event, I just got back from the Alfresco technical meetup in New York City and got a chance to ask Michael Farman the question directly. He showed that the endpoints are to be defined in spring-webscripts-config-custom.xml inside of:

      I will give it a shot and let you know if it works.



      • #4
        Hi again,

        It works, although the config file is called webscript-framework-config-custom.xml instead of webscript-config-custom.xml. There is a sample configuration file in the Alfresco 3.3 Community edition.

        I will have to play around with this some more to see if I can place the file somewhere in:

        instead of:

        It would seem that I should be able to do this in cases where I want to deploy my Surf app to a different Tomcat instance than the one hosting Alfresco.



        • #5
          Sorry I don't have any idea hope someone else will help you........

          macbook pro cases