Appearance
Integrar el gestor documental de Nautilus
Desde Nautilus se oferta un servicio de gestión documental que permite a las aplicaciones el guardado y recuperación de ficheros.
Información funcional sobre gestor documental
Cómo consumir el servicio de gestión documental
Como el resto de servicios de Nautilus, el servicio de gestión documental se puede consumir desde el API de Nautilus. Donde encontraremos endpoints para subir, descargar y listar ficheros.
Añadir caducidad a los documentos
Para cada aplicación se puede añadir caducidad desde la parte de parametrización de la aplicación, añadiendo la propiedad "Deadline" en la llamada de añadir un archivo API de Nautilus.
Parametrización historial de versiones
En el apartado de "Parametrización" del modelo de la aplicación encontraremos la opción "Configuración de versiones" en este se podrán definir el número máximo de versiones a guardar. En el caso de no querer limitar el número de versiones se deberá dejar vacío.
Validación de metadatos de documentos
Cada aplicación se puede parametrizar para que valide los metadatos añadidos al subir un archivo. La validación se hace mediante un Json Schema que hay que crear como un item dentro del producto de Catalogos.
Ejemplo de parametrización de validación:
Importación masiva
Para hacer una importación hay que crear una carpeta dentro del contenedor de Azure Blob Storage configurado para la aplicación y dejar los archivos dentro. Si se desea incorporar metadatos para cada uno de esos documentos, hay que añadir un archivo en formato json que contenga dichos datos.
Ejemplo de archivo con metadatos:
json
[
{
"name": "miFoto.png",
"metadata": {
"primero": "1",
"segundo": "2"
}
},
{
"name": "misLogs.log",
"metadata": {
"primero": "1",
"segundo": "2"
},
"deadline": "2023-11-16T16:00:15.960+01:00",
"parentDirId": "Jiu-coUBNZgprGfV_jkE",
"fileType": "Factura"
}
]
[
{
"name": "miFoto.png",
"metadata": {
"primero": "1",
"segundo": "2"
}
},
{
"name": "misLogs.log",
"metadata": {
"primero": "1",
"segundo": "2"
},
"deadline": "2023-11-16T16:00:15.960+01:00",
"parentDirId": "Jiu-coUBNZgprGfV_jkE",
"fileType": "Factura"
}
]
Fusión de múltiples PDFs
Para fusionar varios PDFs en uno solo, hay que llamar a este endpoint: https://api.nautilus.app/doc/#documents__productinstanceid__files_merge_pdfs_post. Dicho endpoint devuelve el nombre del archivo que se va a crear en formato UUID.pdf (Ejemplo: {"name": "4454ad89-2bb8-477c-a877-06be3dfefed1.pdf"}). Si se especifica un tiempo de duración, se creará una URL temporal de descarga. Una vez que la URL haya expirado, el archivo también se eliminará físicamente del almacenamiento. Cuando dicho PDF esté creado, se publicará un mensaje en el topic: nautilus-pro.response.merge.pdfs_${tenantId}
. Este mensaje tiene el siguiente esquema:
json
{
"type": "record",
"name": "response_merge_pdf",
"namespace": "nautilus.response.merge.pdfs",
"doc": "Compound pdf response schema",
"fields": [
{
"name": "id",
"type": {
"type": "record",
"name": "composite_id",
"fields": [
{
"name": "eventId",
"doc": "the event id",
"type": "string"
},
{
"name": "parentId",
"doc": "the parent event id",
"type": [
"null",
"string"
],
"default": null
},
{
"name": "correlationId",
"doc": "the correlation id of the main parent message",
"type": [
"null",
"string"
],
"default": null
},
{
"name": "parentCorrelationIds",
"doc": "the correlations ids of all the parent messages",
"type": [
"null",
{
"type": "array",
"items": [
"string"
]
}
],
"default": null
}
]
}
},
{
"name": "created",
"doc": "the creation timestamp",
"type": "string"
},
{
"name": "eventType",
"doc": " allowed event types for the schema",
"type": {
"type": "enum",
"name": "EventType",
"symbols": [
"COMPOUND_PDF"
]
}
},
{
"name": "payload",
"doc": "the event data",
"type": {
"name": "payload",
"type": "record",
"fields": [
{
"name": "tenantId",
"type": "string",
"doc": "The tenant id"
},
{
"name": "fileIds",
"type": {
"type": "array",
"items": "string"
},
"doc": "Pdf validated ids"
},
{
"name": "fileName",
"type": "string",
"doc": "The name of the file"
},
{
"name": "downloadUrl",
"type": [
"null",
"string"
],
"doc": "Download URL",
"default": null
},
{
"name": "metadata",
"type": [
"null",
"string"
],
"doc": "External data sent on the creation of the merge request",
"default": null
},
{
"name": "id",
"type": "string",
"doc": "New compund PDF id"
}
]
}
}
]
}
{
"type": "record",
"name": "response_merge_pdf",
"namespace": "nautilus.response.merge.pdfs",
"doc": "Compound pdf response schema",
"fields": [
{
"name": "id",
"type": {
"type": "record",
"name": "composite_id",
"fields": [
{
"name": "eventId",
"doc": "the event id",
"type": "string"
},
{
"name": "parentId",
"doc": "the parent event id",
"type": [
"null",
"string"
],
"default": null
},
{
"name": "correlationId",
"doc": "the correlation id of the main parent message",
"type": [
"null",
"string"
],
"default": null
},
{
"name": "parentCorrelationIds",
"doc": "the correlations ids of all the parent messages",
"type": [
"null",
{
"type": "array",
"items": [
"string"
]
}
],
"default": null
}
]
}
},
{
"name": "created",
"doc": "the creation timestamp",
"type": "string"
},
{
"name": "eventType",
"doc": " allowed event types for the schema",
"type": {
"type": "enum",
"name": "EventType",
"symbols": [
"COMPOUND_PDF"
]
}
},
{
"name": "payload",
"doc": "the event data",
"type": {
"name": "payload",
"type": "record",
"fields": [
{
"name": "tenantId",
"type": "string",
"doc": "The tenant id"
},
{
"name": "fileIds",
"type": {
"type": "array",
"items": "string"
},
"doc": "Pdf validated ids"
},
{
"name": "fileName",
"type": "string",
"doc": "The name of the file"
},
{
"name": "downloadUrl",
"type": [
"null",
"string"
],
"doc": "Download URL",
"default": null
},
{
"name": "metadata",
"type": [
"null",
"string"
],
"doc": "External data sent on the creation of the merge request",
"default": null
},
{
"name": "id",
"type": "string",
"doc": "New compund PDF id"
}
]
}
}
]
}