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:

  • cs (Czech)

  • da (Danish)

  • de (German)

  • en (English)

  • es (Spanish)

  • fr (French)

  • hr (Croatian)

  • it (Italian)

  • nl (Dutch)

  • pl (Polish)

  • sr (Serbian)

  • sk (Slovakian)

  • zh-CN (Chinese (simplified))

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:

  • If the language ID with the regional code (e.g. en-GB) is not found, the system checks whether the higher-level language without the regional code is available (en). In the example above, "Export List" is displayed for a request of the "en-GB" language because "en" is used as an alternative.

  • If the higher-level language is also unavailable, English "en" without the regional code is always used as the alternative.

  • If "en" is also not specified as the alternative, the first specified language is displayed as the alternative.

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.

Note

Using 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:

  • dapi_navigate (default value): Navigates to a new main resource with the content within the Shell app.

  • dapi_inner_supply: Opens an Inner Supply (display area below the app bar) with the content.

  • dapi_outer_supply: Opens an outer supply (display area above the app bar) with the content.

  • _blank: Opens a new tab in the browser with the content.

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:

  • _links.self.href: Relative URL for the item that you can use to retrieve more detailed information about the item.

  • id: Document ID of the item.

  • caption: Title for the 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.