1.3 Result Format
In the Core API, we try to always return the DMS search results in the same structure. DMS objects are always returned as an array. No matter if there is only one object in the results or several. Each queried field and system field is located inside the properties property. Information about content attached to the DMS object in the ECM is located together with its metadata in the property contentstreams which is also always an array. The third important property is acl. This property contains the rights the current user has for a specific object in the results.
Changelog:
Since Version 3.1.0 the result also contains a overview at the end of the json how many objects were in the result and if there are more results fetchable. If no maxhits in the result_configuration is set by the client the DMS service set it to offset + pagesize + 1. This leads that the enaio server calculate if there is one more item. Is this true the json result tell the client that he can fetch more results with a different offset.
Since Version 5.0.0 the allowedChildObjectTypeIds is a Map of objects where also the maxCount is returned and no longer a plain list of object type Ids. The value of -1 signals, that a unlimited amount of this object type could be inserted. A value greater zero is the left amount of objects for the particular object type which could be inserted. Not insertable object types are listed with the value 0, if they are general available for the parent object type to insert.
Since Version 6.3.1 the property system:objectTypeId also include a second child-property localName where the internal name of the object type is returned in. This is good if a solution is distributed towards multiple installations and gets on each installation a different numeric objectTypeId. Then the solution can work with the internal name.
Since Version 6.8.0 the property totalNumItems was fixed to return the value enaio server tells the DMS Service. By default DMS Service query up to the enaio server default MaxHits which is 50.000. Above this limit a own MaxHits must be set within the options of a search query.
Example:
{
"objects": [{
"properties": {
"system:objectId": {
"value": "4400"
},
"system:objectTypeId": {
"value": "262144",
"localName": "<internalNameOfObjectType>"
},
"system:baseTypeId": {
"value": "DOCUMENT"
},
"system:createdBy": {
"value": "ROOT"
},
"system:creationDate": {
"value": "2010-01-01T01:13:52+02:00"
},
"system:lastModifiedBy": {
"value": "DEMO"
},
"system:lastModificationDate": {
"value": "2010-02-01T01:13:52+02:00"
},
"SEARCH_SCORE": {
"value": 0..1, // double
},
"subject": {
"value": "Security tomorrow"
},
"from": {
"value": "Joe Bloggs <joe@bloggs.com>"
},
"to": {
"value": "Jane Doe <doe.jane@outlook.com>"
},
"table": {
"columnNames": ["iColumn1", "iColumn2", "iColumn3"],
"value": [["abc", "blub", true],["bvf", "blab", false]]
},
"list": {
"value": ["a","blub"]
},
"patientFolder.patientId": {
"value": "Max Mustermann"
},
"patientFolder.system:lastModificationDate": {
"value": "2010-02-01T01:12:51+02:00"
},
"stayingRegister.number": {
"value": "481563987"
},
"stayingRegister.system:creationDate": {
"value": "2010-01-01T01:12:59+02:00"
}
},
"contentStreams": [{
"cid": "E12C7EBF4B974B3A00F296C01F90D000",
"mimeType": "message/rfc822",
"fileName": "content.eml",
"length": 456543
}],
"allowedChildObjectTypeIds": {
"65549": {
"maxCount": -1
},
"262243": {
"maxCount": 2
},
"262244": {
"maxCount": 80
},
"262245": {
"maxCount": 0
}
},
"permissions": {
"read": [
"metadata",
"content"
],
"write": [
"metadata",
"content"
],
"delete": [
"object"
]
}
"children": [
// Array of objects again.
]
}],
"numItems": 1,
"hasMoreItems": false,
"totalNumItems": 1
}Properties
The properties array hosts all queried fields and the system fields of a DMS object. System fields can be identified by their system namespace. Refer to Chapter 1.2 for more information about system fields. Each property has a value subproperty which hosts the value of the field of the DMS object. Most of the properties are strings. One exception are table controls on forms. If they are queried with certain columns, the property has two child properties. The property columnNames specifies the queried columns of the control and is a one-dimensional array. The value property is two-dimensional. On the first level, there are the rows of the table control. Each row is an array itself with one value for each defined column in columnNames.
Parent fields
The properties array can also, if queried, contain fields of a parent object. Parent fields are limitated to the fields of the folder and to the direct parent register of a object. Intermediate register fields are not queryable. In the properties array all parent fields have the internal name of the object type as a prefix and it is separated to the field name with a point. In the example above there are two parent object fields from the folder at the end of the properties array and two of the direct parent register object.
ContentStreams
In the contentStreams array, each object represents one content file attached to the DMS object in the ECM. The following table describes the properties of a contentStream object:
Property | Description |
|---|---|
cid | With this id content can be downloaded using content endpoints |
mimeType | Mimetype of the content |
fileName | File name of the content |
length | Size of the content in bytes |
AllowedChildObjectTypeIds
In single queries at the endpoint /dms/objects/{id} with active query parameter allowedChildObjectTypeIds the currently insertable children object types with their maximal counts are here returned. This is only available for folder and register object types and not for document object types. The maxCount property shows the maximal possible instances which could be inserted in the folder or register. Is the value -1, then unlimited instances of this type could be inserted.
Permissions
The permissions JSON node of each result object shows what the current user is allowed to do with the object. There are three sections: "read", "write", and "delete". Metadata always represents the index data to be shown (read), or indicates whether the user can edit the index data (write). Content represents any rendition content and the original content attached to the object. Content (read) allows the current user to fetch renditions or the original content and export it from the ECM. Content (write) allows the current user to change the attached content for the given ECM object. The "object" (delete) allows the current user to delete the entire ECM object. In enaio, the delete action does not distinguish between deleting metadata or content.
The permission output in the result json must be explicitly enabled while requesting the data in the query. For more information on this, refer to the chapters CMIS query or native Query.
Children
A Array of DMS objects if a hierarical query is send to the DMS Service search. The children structure is identical to the structure here described.