Adding your own functions (DMSApp)
In this section, you can learn how to add your own functions to the DMSApp.
Using extension points
Extension points allow you to enhance the DMSApp with your own functions. The DMSApp provides extension points at the following positions:
There are two ways you can extend the extension points in the DMSApp:
Providing via URL
Creating via the API in the DMSApp
Preparing your app
To ensure that you can find extensions for context actions or for displaying documents from the DMSApp, your app must provide this user interface. To find apps that provide extensions, DMSApp uses the concept of an HTTP GET request for the root resource (systemBaseUri path with the app name) for the apps. All apps registered to the d.ecs http gateway will be requested. Make sure that the administrator did not actively exclude your app.
Providing the URL for the extension points
The root resources for these apps are requested cyclically. The response of an app is then checked to determine whether a link relation with the name dmsobjectextensions is included. This link relation serves as the signal that the app provides extensions for DMSApp. DMSApp executes an HTTP GET to the specified link and waits for a standardized JSON object with the HTTP status code 200 from the responding app.
Request
GET https://host/myapp/ HTTP/1.1 Accept: application/hal+json
Response
HTTP/1.1 200 OK Content-Type: application/hal+json { "_links" : { "dmsobjectextensions" : { "href" : "/myapp/dmsobjectextensions" } } }
Note
The root resources are queried anonymously (without authentication) and this process is executed as an asynchronous background process within DMSApp.
Creating via the API in the DMSApp
With a HTTP POST request for the URL /dms/extensions you can create an extension in the DMSApp. If you want to create multiple extensions, repeat the process. The request must be made by a user with administration rights only. If the request response is successful, the extension is stored in the DMSApp and you get a location URL in the response header. The structure of the standardized JSON object is described in the following pages.
Request
POST /dms/extensions Origin: https://baseuri Content-Type: application/json Content-Length: 619 { "id": "myapp.openExternalApp", "activationConditions": [{ "propertyId": "repository.id", "operator": "or", "values": ["e632f767-5cfa-538d-ab55-6756c36a74c9"] } ], "captions": [{ "culture": "de", "caption": "Externe Applikation öffnen" }, { "culture": "en", "caption": "Open external application" } ], "context": "DmsObjectDetailsContextAction", "uriTemplate": "/myapp/dosomething?id={dmsobject.property_document_id}", "iconUri": "/myapp/images/goto.svg" }
Response
HTTP/1.1 201 Created Location: /dms/extensions/dmsapp-custom-myapp.openExternalApp
Via the location URL, a user with administration rights can also delete the extension in the DMSApp. To do this, an HTTP DELETE requestmust be sent to the Location URLvalue.
Request
DELETE /dms/extensions/dmsapp-custom-myapp.openExternalApp Origin: https://baseuri
Response
HTTP/1.1 200 OK
Displaying extension points
Released: HTML page
You can display the extension points registered with DMSApp. Simply enter the URL /dms/extensions in the browser.
Request
GET /dms/extensions Accept: text/html
Adding context actions to lists
Released: Extension point
If you add context actions to lists with items (e.g. documents and dossiers), they are displayed in the following sections:
Results in the Search feature
Content of a dossier
Your lists of favorites and watched items in the Personal Area feature
If the user clicks a context action in a list, the list always first switches to selection mode. In selection mode, the user can select the desired items and execute the context action.
The app that you want to provide such extensions must return an HTTP response in JSON format under the dmsobjectextensions link relation. This response must provide the following information for each context action:
Extension point context: DmsObjectListContextAction
Activation condition for displaying the context action.
Display name for the context action in the available translations.
Link to the context action icon.
The action to be performed once the user has completed the selection. Specify a relative link that is called from DMSApp using HTTP GET.
Any context action can also be created via HTTP POST requestfor the URL /dms/extensions in the DMSApp. The request must be made by a user with administration rights only. If the request response is successful, the extension is stored in the DMSApp and you get a location URLin the response header. Via the location URL, a user with administration rights can also delete the extension in the DMSApp. To do this, an HTTP DELETE requestmust be sent to the Location URLvalue.
Example
The example shows how you arrange the HTTP response of the dmsobjectextensions link relation to add a context action using the DmsObjectListContextAction extension point. You define different properties for each context action.
{ "extensions": [ { "id": "myapp.exportList", "activationConditions": [{ "propertyId": "repository.id", "operator": "or", "values": ["e632f767-5cfa-538d-ab55-6756c36a74c9"] }], "captions": [{ "culture": "de", "caption": "Exportieren" }, { "culture": "en", "caption": "Export" }, { "culture": "en-GB", "caption": "Exportin Great Britain" }], "descriptions": [{ "culture": "de", "description": "Liste als CSV exportieren" }, { "culture": "en", "description": "Export list as CSV" }, { "culture": "en-GB", "description": "Export list as CSV in Great Britain" }], "context": "DmsObjectListContextAction", "uriTemplate": "/myapp/dosomething?url={dmsobjectlist.url}", "iconUri": "/myapp/images/export-list.svg", "target": "dapi_navigate" }] }
Property | Properties of a contained object | Description |
---|---|---|
id | - | Specifies the unique technical name used to differentiate the extension from other extensions. |
activationConditions | For each extension, the application notifies you of which activation conditions are used to display the context action. These activation conditions are reported by the application in advance. If the activation conditions were not reported in advance, DMSApp would have to query other apps with a network request at a later time when the user is viewing an item. The waiting time for the user would then increase significantly if an app only responds to this request with a delay. A context action is displayed if all the sub-conditions are met. If the list of activation conditions does not contain an entry, the extension is generally active. You specify the activation conditions as an array. | |
propertyId | Specifies the ID of the property that is tested for the activation condition. The available values are described in more detail below. | |
operator | The operator specifies how a sub-condition is evaluated. The following operator is available: or: An or condition is fulfilled if the current value of the property corresponds to one of the values. Capitalization is not taken into account. notOr: A notOr condition is fulfilled if the current value of the property does not correspond to any of the values. Capitalization is not taken into account. | |
values | Specifies the values in the form of an array that is compared with the value of the propertyId property. | |
captions | Each context action notifies you of the name under which it is displayed. You can also include different languages. In this case, the language-dependent names are specified as an array. To ensure the language packages are fully compatible, specify the languages for the following Cultures names:
If the user requests a language for which the extension app does not have any specification for the localized (language-specific) name, an alternative language is determined for the view based on the following rules:
| |
culture | Specifies the language ID for which the name of the context action is defined. The specification includes the language code (e.g. en) and optionally an additional regional code (e.g. en-GB). | |
caption | Specifies the language-dependent name of the context action. | |
descriptions | (Optional) Each context action can indicate which description is displayed for that context action. This description is displayed as a tooltip for the context action. Different languages are specified as in the captions property. | |
culture | Specifies the language ID for which the description of the context action is defined. The specification includes the language code (e.g. en) and optionally an additional regional code (e.g. en-GB). | |
description | Specifies the language-dependent description of the context action. | |
context | - | Specifies the extension point to which you want to add the context action. Specify the following value for context actions for the detail view: DmsObjectListContextAction |
uriTemplate | - | In the uriTemplate property, you define the URL that you want to be called when the user has completed the selection. You can define placeholders to receive more information about the current context. The placeholders are replaced by the actual properties when the extension is called. The properties are transferred to the URI with URL encoding. You can find the available placeholders below. NoteUsing a placeholder in the host part of the URL is not permitted for security reasons and leads to an error. |
iconUri | - | Specifies the link to the icon that is displayed for the context action. The icon file must be available in SVG format. The color of the SVG's fill must not be specified, so that the fill color can be adjusted by using the theming. If you want to use a custom SVG file for a symbol, we recommend saving the SVG file to the installation directory d.3one/dms/Client/Custom. |
target | - | (Optional) Specifies where the content of the context action should be displayed. Possible values:
|
When defining activation conditions for context actions for lists, use the following values for the propertyId property:
Condition context | propertyId | Description |
---|---|---|
Repository | repository.id | ID of the repository as specified in the d.ecs repo app. You can find the repository ID in the detail section of the d.3 repositories feature (https://<Base address>/repo/repositories/). You can obtain this ID either by using the URL or clicking All Programs > d.velop > d.3one > Repository Configuration in the Start menu. In the chapter Determining a repository, you can learn how to determine the ID for a repository with the program. |
User | user.d3.group_id | Activation condition: ID of a d.3 user group (maximum of eight characters) of which the user that is currently logged in is a member. |
user.idp.group_id | Activation condition: GUID of an identity provider app user group of which the user that is currently logged in is a member. |
For a context action of the DmsObjectListContextAction type, you can use the following properties as placeholders in the uriTemplate property:
Property | Description |
---|---|
dmsobjectlist.url | A URL-encoded URL under which the list of items selected by the user (documents and dossiers) can be queried. As an HTTP response, you receive this URL as a selectionList JSON array that returns the following information for each item:
Example: selectionList { "selectionList": [{ "_links": { "self": { "href": "/dms/r/e632f767-5cfa-538d-ab55-6756c36a74c9/o2/A0000000001" } }, "id": "A0000000001", "caption": "Title of the item" }, ... ] } |
repository.id | ID of the repository as specified in the d.ecs repo app. You can find the repository ID in the detail section of the d.3 repositories feature (https://<Base address>/repo/repositories/). You can obtain this ID either by using the URL or clicking All Programs > d.velop > d.3one > Repository Configuration in the Start menu. In the chapter Determining a repository, you can learn how to determine the ID for a repository with the program. |
user.d3.group_id | Placeholder uriTemplate: List of IDs of the d.3 user groups (each a maximum of eight characters) of which the user currently logged in is a member as an array in JSON format. |
user.idp.group_id | Placeholder uriTemplate: List of GUIDs of the identity provider app user groups of which the user currently logged in is a member as an array in JSON format. |
Adding context actions to detail view
Released: Extension point
You can add context actions to the detail view for an item (DMS object, document or dossier). These context actions are also summarized in the menu for context actions (three stacked dots) for an item. The app that you want to provide such an extension must return an HTTP response in JSON format under the link relation dmsobjectextensions. The response must provide the following information for each context action:
Extension point context: DmsObjectDetailsContextAction
Activation condition for displaying the context action.
Display name for the context action in the available translations.
Link to the context action icon.
The action to be performed once the user has clicked on the context action. Specify a relative link that is called from DMSApp using HTTP GET.
Any context action can also be created via HTTP POST requestfor the URL /dms/extensions in the DMSApp. The request must be made by a user with administration rights only. If the request response is successful, the extension is stored in the DMSApp and you get a location URLin the response header. Via the location URL, a user with administration rights can also delete the extension in the DMSApp. To do this, an HTTP DELETE requestmust be sent to the Location URLvalue.
Example
The example shows how you arrange the HTTP response of the dmsobjectextensions link relation to add a context action using the DmsObjectDetailsContextAction extension point. You define different properties for each context action.
{ "extensions": [ { "id": "myapp.openExternalApp", "activationConditions": [{ "propertyId": "repository.id", "operator": "or", "values": ["e632f767-5cfa-538d-ab55-6756c36a74c9"] }], "captions": [{ "culture": "de", "caption": "Externe Applikation öffnen" }, { "culture": "en", "caption": "Open external application" }], "context": "DmsObjectDetailsContextAction", "uriTemplate": "/myapp/dosomething?id={dmsobject.property_document_id}", "iconUri": "/myapp/images/goto.svg", "target": "dapi_navigate" }] }
Property | Properties of a contained object | Description |
---|---|---|
id | - | Specifies the unique technical name used to differentiate the extension from other extensions. |
activationConditions | For each extension, the application notifies you of which activation conditions are used to display the context action. These activation conditions are reported by the application in advance. If the activation conditions were not reported in advance, DMSApp would have to query other apps with a network request at a later time when the user is viewing a document. The waiting time for the user would then increase significantly if an app only responds to this request with a delay. A context action is displayed if all the sub-conditions are met. If the list of activation conditions does not contain an entry, the extension is generally active. You specify the activation conditions as an array. | |
propertyId | Specifies the ID of the property that is tested for the activation condition. The available values are described in more detail below. | |
operator | The operator specifies how a sub-condition is evaluated. The following operator is available: or: An or condition is fulfilled if the current value of the property corresponds to one of the values. Capitalization is not taken into account. notOr: A notOr condition is fulfilled if the current value of the property does not correspond to any of the values. Capitalization is not taken into account. | |
values | Specifies the values in the form of an array that is compared with the value of the propertyId property. | |
captions | Each context action notifies you of the name under which it is displayed. You can also include different languages. In this case, the language-dependent names are specified as an array. To ensure the language packages are fully compatible, specify the languages for the following Cultures names:
If the user requests a language for which the extension app does not have any specification for the localized (language-specific) name, an alternative language is determined for the view based on the following rules:
| |
culture | Specifies the language ID for which the name of the context action is defined. The specification includes the language code (e.g. en) and optionally an additional regional code (e.g. en-GB). | |
caption | Specifies the language-dependent name of the context action. | |
context | - | Specifies the extension point to which you want to add the context action. Specify the following value for context actions for the detail view: DmsObjectDetailsContextAction |
uriTemplate | - | In the uriTemplate property, you define the URL that is to be called when the user clicks on the context action. You can define placeholders to receive more information about the current context. The placeholders are replaced by the actual properties when the extension is called. The properties are transferred to the URI with URL encoding. You can find the available placeholders below. |
iconUri | - | Specifies the link to the icon that is displayed for the context action. The icon file must be available in SVG format. The color of the SVG's fill must not be specified, so that the fill color can be adjusted by using the theming. If you want to use a custom SVG file for a symbol, we recommend saving the SVG file to the installation directory d.3one/dms/Client/Custom. |
target | - | (Optional) Specifies where the content of the context action should be displayed. Possible values:
|
You can use the following values when defining context actions for the detail view in the following areas:
Defining activation conditions for the propertyId property
Defining placeholders in the uriTemplate property
Topic | Value | Description |
---|---|---|
Repository | repository.id | ID of the repository as specified in the d.ecs repo app. You can find the repository ID in the detail section of the d.3 repositories feature (https://<Base address>/repo/repositories/). You can obtain this ID either by using the URL or clicking All Programs > d.velop > d.3one > Repository Configuration in the Start menu. |
User | user.d3.group_id | Activation condition: ID of a d.3 user group (maximum of eight characters) of which the user that is currently logged in is a member. Placeholder uriTemplate: List of IDs of the d.3 user groups (each a maximum of eight characters) of which the user currently logged in is a member as an array in JSON format. |
user.idp.group_id | Activation condition: GUID of an identity provider app user group of which the user that is currently logged in is a member. Placeholder uriTemplate: List of GUIDs of the identity provider app user groups of which the user currently logged in is a member as an array in JSON format. | |
Property for the item | dmsobject.property_editor | Editor of the item. |
dmsobject.property_owner | Owner of the item. | |
dmsobject.property_filename | File name for the item. | |
dmsobject.property_filetype | File type for the item. | |
dmsobject.property_document_number | Document number of the item. | |
dmsobject.property_creation_date | Creation date of the item. | |
dmsobject.property_size | File size of the item. | |
dmsobject.property_state | Document status of the item. Possible values:
| |
dmsobject.property_variant_number | Variant number of the item. | |
dmsobject.property_access_date | Access date for the item. | |
dmsobject.property_remark | Remarks about the item. | |
dmsobject.property_last_alteration_date | Alteration date of the item. | |
dmsobject.property_caption | Title for the item. | |
dmsobject.property_category | Item category ID. | |
dmsobject.property_category_uuid | UUID of the item category. | |
dmsobject.property_colorcode | Color marking for the item. | |
dmsobject.property_document_class | Activation condition: A document class abbreviation for the item. Placeholder uriTemplate: List of document class IDs for the item as an array in JSON format. | |
dmsobject.property_document_id | Document ID of the item. | |
dmsobject.property_display_version_id | Unique ID for the display version for the DMSApp. | |
dmsobject.type | The item type. Possible values:
| |
dmsobject.<NUMBER|UUID> | For the <NUMBER|UUID> placeholder, enter the advanced property ID or UUID as it is defined in the d.3 repository. If the d.3 property is a multi-value property, the placeholder will be replaced by the first or the first filled value of the property (depending on the d.3 repository configuration). If there are multiple values for the multi-value property, three dots (...) are added to the value returned. | |
dmsobject.fieldposition.<NUMBER> | For the <NUMBER> placeholder, enter the database position of the advanced property. NoteWe strongly recommend using the advanced property ID (dmsobject.<NUMBER>). Use the database position only in exceptional cases when the advanced property ID is not available to you or can only be determined in a very time-consuming process. If the d.3 property is a multi-value property, the placeholder will be replaced by the first or the first filled value of the property (depending on the d.3 repository configuration). If there are multiple values for the multi-value property, three dots (...) are added to the value returned. | |
dmsobject.self_url_relative | Relative URL of the item. | |
Original file for the item | dmsobject.mainblob.content_type | MIME type of the original file (e.g. text\plain or image\jpeg). |
dmsobject.mainblob.content_url | (Obsolete) Absolute URL of the original file. If the user does not have the authorization to export the document, then this parameter is empty. | |
dmsobject.mainblob.content_url_relative | Relative URL of the original file. If the user does not have the authorization to export the document, then this parameter is empty. | |
dmsobject.mainblob.id | ID of the original file if the user has the right to export the original file. | |
Dependent files for the item | dmsobject.dependentblobs | List of the IDs of dependent files if the user has the right to export the dependent file. |
dmsobject.dependentblob.ID.content_url | (Obsolete) Absolute URL of the dependent file with the ID from dmsobject.dependentblobs. | |
dmsobject.dependentblob.ID.content_url_relative | Relative URL of the dependent file with the ID from dmsobject.dependentblobs. |
Replacing the content of the "View" perspective in the detail view
Released: Extension point
You can replace the content of the View perspective for the detail view for an item (e.g. a document or dossier) so that you can display your own preview under certain conditions.
The app that you want to provide such an extension must return an HTTP response in JSON format under the dmsobjectextensions link relation. This response must provide the following information for each extension point of the View perspective:
Extension point context: DmsObjectDetailsPreview
Activation condition for displaying your preview.
The URL for the preview that you want to display when the user opens the View perspective in the detail view and meets your predefined activation conditions. Specify a relative link that is called from DMSApp using HTTP GET.
Any context action can also be created via HTTP POST requestfor the URL /dms/extensions in the DMSApp. The request must be made by a user with administration rights only. If the request response is successful, the extension is stored in the DMSApp and you get a location URLin the response header. Via the location URL, a user with administration rights can also delete the extension in the DMSApp. To do this, an HTTP DELETE requestmust be sent to the Location URLvalue.
Example
The example shows how you arrange the HTTP request to add an extension for the DmsObjectDetailsPreview extension point. You define different properties for each extension.
{ "id": "myapp.viewer", "activationConditions": [{ "propertyId": "dmsobject.mainblob.content_type", "operator": "or", "values": [ "text/plain", "application/pdf" ] }], "context": "DmsObjectDetailsPreview", "uriTemplate": "/myapp/preview?layer0={dmsobject.mainblob.content_url}" }
Property | Properties of a contained object | Description |
---|---|---|
id | - | Specifies the unique technical name used to differentiate the extension from other extensions. |
activationConditions | For each extension, the application notifies you of which activation conditions are used to display the extension of the View perspective. These activation conditions are reported by the application in advance. If the activation conditions were not reported in advance, DMSApp would have to query other apps with a network request at a later time when the user is viewing an item. The waiting time for the user would then increase significantly if an app only responds to this request with a delay. An extension is displayed if all the sub-conditions are met. If the list of activation conditions does not contain an entry, the extension is generally active. You specify the activation conditions as an array. | |
propertyId | Specifies the ID of the property that is tested for the activation condition. The available values are described in more detail below. | |
operator | The operator specifies how a sub-condition is evaluated. The following operator is available: or: An or condition is fulfilled if the current value of the property corresponds to one of the values. Capitalization is not taken into account. notOr: A notOr condition is fulfilled if the current value of the property does not correspond to any of the values. Capitalization is not taken into account. | |
values | Specifies the values in the form of an array that is compared with the value of the propertyId property. | |
context | - | Specifies the extension point to which you want to add the extension. Enter the following value for extensions of the View perspective in the detail view: DmsObjectDetailsPreview |
uriTemplate | - | In the uriTemplate property, you define the URL that you want to be called when the user opens the View perspective in the detail view. You can define placeholders to receive more information about the current context. The placeholders are replaced by the actual properties when the extension is called. The properties are transferred to the URI with URL encoding. You can find the available placeholders below. NoteUsing a placeholder in the host part of the URL is not permitted for security reasons and leads to an error. |
While defining extensions that replace the content of the View perspective, you can use the following values in the following areas:
Defining activation conditions for the propertyId property
Defining placeholders in the uriTemplate property
Topic | Value | Description |
---|---|---|
Repository | repository.id | ID of the repository as specified in the d.ecs repo app. You can find the repository ID in the detail section of the d.3 repositories feature (https://<Base address>/repo/repositories/). You can obtain this ID either by using the URL or clicking All Programs > d.velop > d.3one > Repository Configuration in the Start menu. In the chapter Determining a repository, you can learn how to determine the ID for a repository with the program. |
User | user.d3.group_id | Activation condition: ID of a d.3 user group (maximum of eight characters) of which the user that is currently logged in is a member. Placeholder uriTemplate: List of IDs of the d.3 user groups (each a maximum of eight characters) of which the user currently logged in is a member as an array in JSON format. |
user.idp.group_id | Activation condition: GUID of an identity provider app user group of which the user that is currently logged in is a member. Placeholder uriTemplate: List of GUIDs of the identity provider app user groups of which the user currently logged in is a member as an array in JSON format. | |
Property for the item | dmsobject.property_editor | Editor of the item. |
dmsobject.property_owner | Owner of the item. | |
dmsobject.property_filename | File name for the item. | |
dmsobject.property_filetype | File type for the item. | |
dmsobject.property_document_number | Document number of the item. | |
dmsobject.property_creation_date | Creation date of the item. | |
dmsobject.property_size | File size of the item. | |
dmsobject.property_state | Document status of the item. Possible values:
| |
dmsobject.property_variant_number | Variant number of the item. | |
dmsobject.property_access_date | Access date for the item. | |
dmsobject.property_remark | Remarks about the item. | |
dmsobject.property_last_alteration_date | Alteration date of the item. | |
dmsobject.property_caption | Title for the item. | |
dmsobject.property_category | Item category ID. | |
dmsobject.property_category_uuid | UUID of the item category. | |
dmsobject.property_colorcode | Color marking for the item. | |
dmsobject.property_document_class | Activation condition: A document class ID for the item. Placeholder uriTemplate: List of document class IDs for the item as an array in JSON format. | |
dmsobject.property_document_id | Document ID of the item. | |
dmsobject.property_display_version_id | Unique ID for the display version for the DMSApp. | |
dmsobject.property_version_id | Unique ID for the current version for the DMSApp. | |
dmsobject.type | The item type. Possible values:
| |
dmsobject.<NUMBER|UUID> | For the <NUMBER|UUID> placeholder, enter the advanced property ID or UUID as it is defined in the d.3 repository. If the d.3 property is a multi-value property, the placeholder will be replaced by the first or the first filled value of the property (depending on the d.3 repository configuration). If there are multiple values for the multi-value property, three dots (...) are added to the value returned. | |
dmsobject.fieldposition.<NUMBER> | For the <NUMBER> placeholder, enter the database position of the advanced property. NoteWe strongly recommend using the advanced property ID (dmsobject.<NUMBER>). Use the database position only in exceptional cases when the advanced property ID is not available to you or can only be determined in a very time-consuming process. If the d.3 property is a multi-value property, the placeholder will be replaced by the first or the first filled value of the property (depending on the d.3 repository configuration). If there are multiple values for the multi-value property, three dots (...) are added to the value returned. | |
dmsobject.self_url_relative | Relative URL of the item. | |
Original file for the item | dmsobject.mainblob.content_type | MIME type of the original file (e.g. text\plain or image\jpeg). |
dmsobject.mainblob.content_url | (Obsolete) Absolute URL of the original file. If the user does not have the authorization to export the document, then this parameter is empty. | |
dmsobject.mainblob.content_url_relative | Relative URL of the original file. If the user does not have the authorization to export the document, then this parameter is empty. | |
dmsobject.mainblob.id | ID of the original file if the user has the right to export the original file. | |
Dependent files for the item | dmsobject.dependentblobs | List of the IDs of dependent files if the user has the right to export the dependent file. |
dmsobject.dependentblob.ID.content_url | (Obsolete) Absolute URL of the dependent file with the ID from dmsobject.dependentblobs. | |
dmsobject.dependentblob.ID.content_url_relative | Relative URL of the dependent file with the ID from dmsobject.dependentblobs. |