JBoss.orgCommunity Documentation

Use JavaScript

Get document properties.

Creating an URL to make a request (consists of repository name, method name, for example "/children/", and folder ID to get the children from):



 var url = "http://localhost:8080/rest/private/cmisatom/";
 url += repository;
 url += "/object/";
 url += obj_id;

Performing request:



 var params = {};
 params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET;
 params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.FEED;
 gadgets.io.makeRequest(url, handler, params);

You can also use the ContentType.DOM parameter to parse the feed in your application (Using DOMParser for example).

Get document content-stream.

Note

Performing a content stream request in JavaScript will cause the browser dialog for a file download.



 var url = "http://localhost:8080/rest/private/cmisatom/";
 url += repository;
 url += "/file/";
 url += obj_id;
 //Optionally
 url += "?";
 url += "streamid=";
 url += streamID;