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.

...

There are several client-specific events. The most common ones are bundled in the const "EnaioEvent".

Type

Description

Data

LOGOUT
on logout
CLIENT_LOCALE_CHANGED
the client locale has changedISO locale string
SCHEMA_LOCALE_CHANGED
the schema locale has changedISO locale string
DMS_OBJECT_DELETED
a DMS object was deletedthe deleted DMS object
DMS_OBJECT_VERSION_RESTORED
an older version of a DMS object was restoredthe ID of the restored DMS object
DMS_OBJECT_FAVORITE_ON
a DMS object was added to the favoritesthe ID of the DMS object
DMS_OBJECT_FAVORITE_OFF
a DMS object was removed from the favoritesthe ID of the DMS object
DMS_OBJECT_UPDATED
a DMS object was updated (index data, content, subscription, ...)the updated DMS object
DMS_OBJECT_PASTED
a DMS object was pasted into a new context folderthe pasted DMS objects
EO_DIALOG_STACK_CHANGED
the dialog stack has changedan object with ID and active status of the dialog

...

PROCESS_FILE_CHANGEDtriggering this event caues the process file list to be updated with given file entriesarray of file entries


scope.api.events.trigger()

With this function, you can trigger an event of the type mentioned above.

ParameterTypeDescription
typestringtype of the event
dataany

(optional) data associated with the event


scope.api.events.trigger(EnaioEvent.DMS_OBJECT_UPDATED, dmsObject);
Code Block
languagejs
titleExample
linenumberstrue
titleExample
linenumberstrue
scope.api.events.trigger(eo.dms.object.updated, dmsObject);

To update the process file list use this trigger:

Code Block
titleExample: trigger the process file list
scope.api.events.trigger("eo.process.file.changed",[{
	id:'BD5DEF6896D842219719CEEBF8BC355A',
	title: "Hello Again",
	description: "Hello Again from Horst",
	iconid: "8ED1E037E4D7468AB69EB8A04C2EA080",
	creator: "root",
	addtime: "2021-07-09T09:19:40.047+0000",
	type: "qdoc"
}]);


scope.api.events.on()

With this function, you can listen to events of a type mentioned above.

...

Code Block
languagejs
titleExample
linenumberstrue
scope.api.events.on(EnaioEvent.DMS_OBJECT_UPDATEDeo.dms.object.updated).subscribe(event => {
	let dmsObject = event.data;
	let eventType = event.type;
});

...

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
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
pluginsBaserelative path to the plug-ins project folder
pluginStatesBaserelative path to the plug-in states project folder
themeBaserelative path to the themes folder

scope.api.agent (version 4.0)

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.

...