Document management

Document lifecycle

Each time an order is created, or a signature added, files are uploaded from the user or downloaded from Signing Service. For each file, a database entry is created that keeps track of the file location and status, i.e. wether it is assigned to an order or not.

File locations

File uploads end up in the directory temp. Files should never grow old in this directory: any file that is older than a few minutes is with high probability the product of a failed order creation, and can be removed.

When an upload is complete, the file is moved to the designated file storage location on disk. This location is configured using two global config parameters:

  • fileDirectory: the directory where all files are stored
  • documentLocationId: an integer that identifies a particular storage location, and must be changed every time the fileDirectory changes. If fileDirectory is changed without a new, unique documentLocationId, the system will refuse to create new orders. ¬†

If the designated file storage location is changed, it will not have any retroactive effects on existing orders. It is thus possible to change file store without moving existing files.

Order actions

Order creation:

  1. The file is uploaded to the directory temp
  2. A document entry is created in the database, containing designated disk location and status (not assigned).
  3. The file is moved to the designated disk location
  4. When the order entry has been created in the database, the document status is updated (assigned to order)

Document signing:

  1. The signed file is downloaded from the Signing Service to the directory temp 
  2. A document entry is created in the database, containing designated disk location and status (not assigned).
  3. The file is moved to the designated disk location
  4. The document currently assigned to the order is un-assigned and the new document takes its place

Document retention

The documents stored in the file area can automatically be removed by activating the document retention function. As documents are permanently deleted from the file area it is very important to have a backup scheme in place for recovery and rollback.

The function can be activated by setting the configuration parameter documentRetention.enabled to true.

More information about configuring the job can be found at Configure scheduled jobs

PDF/A-1a validation

The service offers the possibility to validate the format of uploaded files, issuing a warning to the user if the file does not comply with the format PDF/A-1a. This feature is disabled by default, and can be turned on and off with the configuration parameter signingOrders.usePdfA1Validation.