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
You can create an extension for the DMSApp using an HTTP POST
request for the URL /dms/extensions
. 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 header of the response. 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