Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article describes the API used to develop client plug-ins, as well as client-side form scripts.

...

Code Block
languagejs
titleExample for post
linenumberstrue
// how to create a subscription
var objectId = '7B683C8E19BD492198F6A262D14EF43F';
var body = {subject: 'My subscription', type: 'document'};


scope.api.http.post('/service/dms/subscription/' + objectId, body, '/rest-ws').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.

ParameterTypeDescription
idstringThe ID of the DMS object to be fetched.
typestringoptional: The object type of the selected DMS object. Will improve performance if set.
versionstringoptional: Retrieve a specific version of the DMS object.

...

ParameterTypeDescription
fieldsobjectthe fields to be matched. , example: {name: 'max', plz: '47111}
typestringthe target qualified name of the object type


This function returns a promise which is resolved by an array of DmsObjects matching the given parameters.(Code sample to come.)

Code Block
languagejs
// fill dynamic list with object values
var dynlist = scope.model.catalogfield;
var myRequest={};
if ( scope.situation == 'CREATE' ) { 
	 myRequest={create:true};
}
if ( scope.situation == 'EDIT' ) {
	 myRequest={edit:true};
}
scope.api.dms.getResult(myRequest,'dynlist').then( 
	function(result) {
		var dynlist = [];
		result.forEach(function(row) {
			if( row.data.value ) {
				dynlist.push({
					value: row.data.value,
					description: row.data[scope.api.session.getUser().userSettings.schemalocale]
				});
			};
		});
		dynlist.setList({
			config: {
				allelementsselectable: true
			},
			entries: dynlist
		});
	},
	function(error) {
		scope.api.util.notifier.error('Could not values',error);
	}
);



scope.api.dms.downloadContent()

...

ParameterTypeDescription
dmsObjectDmsObjectthe DMS object with the content to download
renditionstring(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.

Config entryDescription
serviceBaserelative URL to the yuuvis® RAD rest services

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.

PromiseDescription
agentAvailability.CONNECTEDThe user has an agent connected and the current browser session is connected.
agentAvailability.AVAILABLEThe user has an agent connected to the system, but there is no pairing between the current browser session and an agent.
agentAvailability.UNAVAILABLEThe user is not connected with any agent.


For examples, see the 
Client-side Custom Action Scripting documentation.

...