Updating DMS objects with user interaction

Released: HTML page

You can select the Storage feature to update the properties and file of a DMS object. Mappings are required before the action can be performed. In the Basic information about mapping chapter, you can find general information for helping you to create mappings.

To update a DMS object, perform the following steps:

  • Determine the ID for the existing DMS object

  • Provide the file to be stored (optional)

  • Determine the link relation for the storage dialog

  • Create a storage dialog with predefined properties and files

  • Displaying the storage dialog with predefined properties and files

  • Perform more actions after storing (optional)

Determine the ID for the existing DMS object

In the chapter Searching for DMS objects, you can learn how to determine the ID for an existing DMS object. If the d.3 document status of the existing DMS object is Processing, the authenticated user must be the processor of the DMS object.

Provide the file to be stored (optional)

In the chapter Provision of files, you can learn how to provide a file.

Determine the link relation for the storage dialog

In the chapter Determining a repository, you can learn how to determine the URL for a repository. Then, execute an HTTP Get request on the URL for a repository as follows:

Request

GET /dms/r/dee1f3d3-eae8-5d9d-84d8-2d758c5ddc27
Accept: application/hal+json

The JSON object for a repository contains the link relation new.

Response

{
        "_links": {
                "new": {
                        "href": "/dms/r/dee1f3d3-eae8-5d9d-84d8-2d758c5ddc27/new/"
                }
        },
        "id": "dee1f3d3-eae8-5d9d-84d8-2d758c5ddc27"
}

Create a storage dialog with predefined properties and files

Send an HTTP POST request with the required properties as the Body to the URL that you received in the new link relation.

Request

POST /dms/r/dee1f3d3-eae8-5d9d-84d8-2d758c5ddc27/new
Origin: https://baseuri
Accept: application/hal+json
Content-Type: application/hal+json

{
    "storeObjects": [{
        "dmsObjectId": "D123456789",
        "displayValue": "Please verify the XYZ invoice",
        "filename": "myfile.txt",
        "contentLocationUri": "/dms/blob/chunk/2016-May-24-14-20-26-393-1720.part",
        "sourceId": "/myapp/sources/mysourcel",
        "sourcePropertiesUri": "/myapp/sources/mysourcel/properties/myfile.haljson",
        "successCallbackUri": "/myapp/sources/mysourcel/success/myfile"
    },
    {
        ...
    }]
}

The JSON object that is transferred to POST is described as follows:

Property

Description

storeObjects

Specifies the array of item properties and files that should be used to define the storage dialog. For information about an item of the array, see Defining the parameters for storing.

To update a single DMS object, you can also specify the JSON object of the item properties without the storeObjects parent array.

If the call is successful, the URL is returned to the storage dialog in the Location header:

Response

HTTP/1.1 201 Created
Location: /dms/r/dee1f3d3-eae8-5d9d-84d8-2d758c5ddc27/new/a09dd457-5a21-4b90-8134-e562092b50ea

If creating the storage dialog fails, an appropriate response is displayed. For more information see Response format for errors.

Displaying the storage dialog with predefined properties and files

Open the storage dialog URL that you received in the Location header in the browser to display the storage dialog to the user. The user can edit the properties and finish updating the DMS objects.

Perform more actions after storing (optional)

The URL is opened if the successCallbackUri parameter is specified while creating the storage dialog and the user has successfully completed the storage process. You can perform additional steps after performing this action. For more information see Feedback using "SuccessCallback" and "Userdata".