The document load uses the Document data format. Each message contains one or more document objects in an array. The document load must be authenticated by the instance user, who is then used as the instance uuid.
The document_file object must contain a uuid property.
Using curl as an example, a document is loaded using
curl -X POST @document.json "dhinstance/load/document_with_worker/put?process=true"
An authorization header would also be required.
The document_with_worker source entity:
- Uses the Child Entity To Worker Group Message Reader to read all the worker group (folder) definitions from the document record. The connection information is translated to worker groups.
- Loads the worker groups.
- Triggers the message to be reprocessed using the document_with_worker2 source entity.
The document_with_worker2 source entity:
- Uses the Document And Worker Message Reader to:
- combine the worker into the document message,
- format the worker_connections so that they can be loaded into the worker_connection table, and
- format the document_file property to create a link to the instance_file row.
- Loads the worker, with associated worker connections and links to worker group, instance and parent worker.
- Loads the document, with links to instance and insight_file, creating a row on insight_file if necessary.
Two source entities are required because the denormalisation required to load worker groups is different from that required to load workers and documents. The name document_with_worker is used, rather than document, to avoid name clashes when resolving document keys elsewhere.