ecm.dms
The ecm.dms namespace contains all operations related to ECM objects: folders, registers, and documents.
| Method | Description |
|---|---|
Returns a HOL query builder (with hierarchy, variants, file info, base parameters). |
|
Returns a LOL query builder (faster for large, flat result sets; no hierarchy, variants, or file properties). |
|
Loads a single object by its ID. |
|
Creates a new object and returns its ID. |
|
Creates a new object and returns the full instance. |
|
Creates a new variant of an existing document. |
|
Creates a new variant and returns the full instance. |
|
Reads the variant tree of a document, without a model class. |
|
Returns the currently active variant of a document. |
|
Switches the active variant of an existing variant tree. |
|
Updates an existing object. |
|
Updates an existing object and returns the updated instance. |
|
Returns an upsert builder (XMLImport). |
|
Deletes an object by its ID. |
|
Moves a document or register to a new location. |
|
Copies a folder, register, or document to a new location. |
|
Returns the files of a document. |
|
Reads a byte range from a document file (streaming / chunking). |
|
Streams a document’s files chunk-by-chunk without local buffering (context manager). |
|
Returns the digest of a document for integrity verification. |
|
Checks out a document, locking it for the current user. |
|
Checks in a document, replacing its files and releasing the lock. |
|
Undoes a document checkout, releasing the lock. |
|
Checks whether the current user has specific permissions on an object. |
|
Returns the modification history of an object. |
|
Adds a custom history entry to an object. |
|
Resolves the object type ID for a given object ID. |
1. ID parameters also take strings
Every ID parameter of this namespace takes an int or a string holding one, and converts a
string to int before the call goes out. This covers object IDs (object_id, model,
document, variant, parent_document_id, previously_active_id) as well as type and
location IDs (object_type_id, folder_id, register_id, register_type).
The reason is the route an ID takes through application code: a Flask or FastAPI route
parameter, a CSV column, a JSON body, an SQL column read as text — it arrives as a string
everywhere. The server does not accept it in that shape: ObjectID is typed and answers a
string with -1024 "A job parameter is missing", a thoroughly misleading message, and only
after a full round trip. The conversion therefore belongs at the edge of the library rather
than in every caller.
folder = ecm.dms.get(InvoiceFolder, "12345") # same as get(InvoiceFolder, 12345)
doc_id, _ = ecm.dms.insert(doc, folder_id="12345") # location IDs likewise
A string that is not a number raises ValueError naming the parameter and the value before any
job reaches the server. A float raises TypeError rather than being silently truncated to
int.
|
|