0
votes

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?

2

2 Answers

2
votes

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

1
votes

To expand somewhat on the answer provided by xShirase... the remote object is specifically related to accessing the REST APIs that are available on the Alfresco Repository that the instance of Share (or any other Surf-based application such as a standalone Aikau client) is configured to work against.

Surf handles all of the authentication so that once authentication has been provided (i.e the user has logged in) it does not need to be provided again and this also ensures that only APIs available to that user can be be accessed.

The key thing to understand is that this is a request from one server-side application to another and may even be from one server to another. It is not a client to server call.