javascriptdojoalfrescoaikau

What is the "remote" object in alfresco aikau?


Here is example about alfersco CRUD service. They use:

remote.call("/slingshot/datalists/lists/site/test/dataLists");

To make http request. I have examing aikau sources but it contains only calls like remote.connect or remote.call, also defined aikau modules do not contains explicit dependecies from this object. So what is remote object?


Solution

  • It's basically a "request" module to GET/POST/PUT/DELETE to external URLS.

    It has the following methods :

    .post(uri, body)—POSTs content to the given URI

    .post(uri, body,contentType)—POSTs content of the specified type to the given URI

    .get(uri)—GETs content from the given URI

    .put(uri, body)—PUTs content to the given URI

    .put(uri, body, contentType)— PUTs content of the specified type to the given URI

    .delete(uri)—Invokes a URI as a DELETE request

    See the full documentation here