Document Content Transformation
Note
Available in the Enterprise version only.
Transformations are performed in the ecos-transformations microservice.
Spring settings for the transformations microservice:
ecos:
webapp:
task:
executors:
transformations:
corePoolSize: 10 # количество потоков трансформации
Conversion is a specific case of transformation that involves changing content from one format to another.
OnlyOffice is used for conversion between document types.
OnlyOffice
Settings:
ecos:
integrations:
onlyoffice:
host: only-office-app # хост, на котором доступен сервер OnlyOffice
port: 80 # http порт для работы с OnlyOffice
Content source types (input)
Identifier |
Configuration |
Description |
|---|---|---|
entity-content |
entityRef: String — the entity from which the content should be loaded
attribute: String — the attribute containing the content. Defaults to the document’s main content
|
Loading content from a document attribute |
template |
entityRef: EntityRef — reference to the entity based on which the template will be evaluated
templateRef: EntityRef — reference to the template
|
Generating content based on a template |
Transformation types (transformations)
Identifier |
Configuration |
Description |
|---|---|---|
convert |
converter: String — identifier of a specific converter. If not set, it is determined automatically
toMimeType: String — the MIME type of the content to be produced by the conversion
|
Converting content from one MIME type to another |
barcode |
— |
Adding a barcode to the document |
Transformation output types (output)
Identifier |
Configuration |
Description |
|---|---|---|
temp-file |
— |
Saves the result to a temporary file. Typically used when the result needs to be downloaded. |
mutate |
entityRef: EntityRef — reference to the entity to be mutated
attribute: String — the target attribute for the content. Defaults to _content
additionalAttributes: Map<String, Any?> — additional attributes for the mutation
|
Perform a mutation with the resulting content. Can be used both to create new entities and to modify existing ones. |
General Transformation Configuration Structure
The general transformation description consists of three parts:
input — description of the content source;
transformations — list of transformations in order;
output — description of the target for the resulting content.
Example:
Take the main content from entity
emodel/anysrc@123-123-123;Convert it to pdf;
Add a barcode;
Save the result to a temporary file.
{
"input": {
"type": "entity-content",
"config": {
"entityRef": "emodel/anysrc@123-123-123"
}
},
"transformations": [
{ "type": "convert", "config": { "toMimeType": "application/pdf" } },
{ "type": "barcode" }
],
"output": {
"type": "temp-file"
}
}
UI Action
The transformation action is described in the UI actions section with ID transform here