Document Preview
General Information
Browser preview works with pdf and image formats. No additional logic is required for these types, and their preview is available in the community version.
For content in unsupported formats, automatic conversion to pdf takes place (Enterprise version only). For more details, see Conversion mechanism: Document Content Transformation
Preview is automatically generated for the main content.
Main content is the content in the attribute with id
content, or another attribute that is specified incontentConfig → pathin the type configuration. For more details, see Content Configuration
Conditions for Automatic Preview Generation
The document type is inherited from user-base directly or indirectly.
The document has an attribute with the main content.
Generation Process
An entity with main content is created in the system, or the main content is modified.
The ecos-transformations microservice subscribes to the events from step 1 and creates or updates a thumbnail in pdf format.
The ecos-transformations microservice converts the document’s main content to pdf format and writes the result to the thumbnail’s main content.
Thumbnail
This is a representation of the main document in a specified format. Attributes:
content: CONTENT // основное сгенерированное содержимое
mimeType: TEXT // MIME-тип содержимого для этого thumbnail
srcSha256: TEXT // хэш исходного контента
srcAttribute: TEXT // атрибут с исходным контентом
status: TEXT // статус обработки: DRAFT, PROCESSING, PROCESSED, FAILED
nextTryTime: DATETIME // время следующей попытки сгенерировать контент в случае неудачи
failsCount: NUMBER // текущее количество неудачных попыток сгенерировать контент
failDescription: TEXT // описание последней ошибки генерации
Thumbnail entities are created as children of the main document.
Thumbnail repair job
The ecos-transformations microservice has a job configured to handle thumbnails stuck in an invalid status.
Invalid status cases:
Status: PROCESSING and the thumbnail’s last modification time is older than 30 minutes.
Status: FAILED and the time in
nextTryTimeis earlier than the current time.