This article describes the API used to develop client plug-ins, as well as client-side form scripts.
...
If you want a format different from JSON, you have to add a third parameter {responseType: 'arraybuffer' | 'blob' | 'json' | 'text'}.
scope.api.http.get
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
// 1st example: show some user´s inbox workitems in the message box: scope.api.http.get('/get?size=10', scope.api.config.get().inboxBase).then( function(result) { var inbox=''; result.data.content.forEach(function(row) { inbox+=row.title+'</br>'; }); scope.api.util.notifier.success(inbox,'Some inbox workitems'); }, function(error) { scope.api.util.notifier.error('Failed to load inbox', 'Error'); } ); // 2nd example: show all users' favorites scope.api.http.get('/service/user/favorites', scope.api.config.get().serviceBase).then( function(result) { var favs=''; result.data.forEach(function(row) { favs+=row.title+'</br>'; }); scope.api.util.notifier.success(favs,'Your favorites'); }, function(error) { scope.api.util.notifier.error('Failed to load favorites', 'Error'); } ); // 3nd3rd example: own custom service with context path scope.api.http.get('/method/param/value', scope.api.config.get().loginBase + '/mycatalogservice').then( function(result) { var values=''; result.data.forEach(function(row) { values+=row.title+'</br>'; }); scope.api.util.notifier.success(values,'Your result'); }, function(error) { scope.api.util.notifier.error('Failed to load something', 'Error'); } ); // For more information, see the REST function descriptions. |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
// how to create a subscription var objectId = '7B683C8E19BD492198F6A262D14EF43F'; var body = {subject: 'My subscription', type: 'document'}; scope.api.http.post('/dms/subscription/' + objectId, body, scope.api.config.get().serviceBase).then( function(result){ scope.api.util.notifier.info('Created subscription for ' + objectId, 'Success'); }, function(error){ scope.api.util.notifier.error('Failed to create subscription for ' + objectId, 'Error'); } ); // For more information, see the REST function descriptions. |
scope.api.dms
This section describes the read access to object information.
scope.api.dms.getObject()
Loads a DMS object from the backend
Parameter | Type | Description |
---|---|---|
id | string | The id of the DMS object to be fetched. |
type | string | optional: The object type of the selected DMS object. Will improve performance if set. |
version | string | optional: retrieve a specific version of the DMS object. |
...
Parameter | Type | Description |
---|---|---|
dmsObject | DmsObject | the DMS object with the content to download |
rendition | string | (optional) the type of the content file ('PDF', 'TIFF', 'TEXT', 'JPEG') if you don't want to have the original file |
scope.api.config
Gets information about configurations.
scope.api.config.get()
This function returns information about the location of special resources (including an eventually configured context path).
config entry | description |
---|---|
serviceBase | relative URL to the yuuvis® RAD rest services |
searchBase | relative URL to the yuuvis® RAD search service |
contextBase | relative URL to the yuuvis® RAD structure service |
inboxBase | relative URL to the yuuvis® RAD inbox service |
bpmBase | relative URL to the yuuvis® RAD bpm service |
loginBase | relative URL to context path of the yuuvis® RAD gateway. empty if no context path is configured. |
scope.api.agent
These functions help to handle custom actions with yuuvis® RAD agent.
scope.api.agent.getAvailability()
This function gets the agent availability and returns a promise which is resolved with the agent availability.
Promise | Description |
---|---|
agentAvailability.CONNECTED | The user has an agent connected and the current browser session is connected. |
agentAvailability.AVAILABLE | The user has an agent connected to the system, but there is no pairing between the current browser session and an agent. |
agentAvailability.UNAVAILABLE | The user is not connected with any agent. |
For examples, see the Client-side Custom Action Scripting documentation.
...