...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
var data = scope.objects[0]; scope.api.http.del('/dms/' + data.content.id + '/content/rendition').then(()=> { scope.api.events.trigger( 'eo.dms.object.updated', data); }); |
Sample Script: Get the text of a document file
The following example shows you how to get the pure text of the document file of the currently focused object if you want to analyse this:
Code Block | ||||
---|---|---|---|---|
| ||||
var object = scope.objects[0]; //The object whose file contents should be read
scope.api.http.get('/dms/' + object.id + '/content', '', { responseType: 'text' }).then(
function (result) {
scope.api.util.notifier.info('Success');
//place your code for the file contents here
//result contains the file's data as string
},
function (error) {
scope.api.util.notifier.error(error + '', 'Error');
}
); |
Decision Script
The 'scope' object makes properties of marked objects available to the decision script.
...