02-09-2017 07:03 AM
Dear all,
I am in the middle of the migration process to Alfresco, and I am stuck in a problem which I do not know exactly how to approach.
The previous system provided a generated code for each document, according to the type of document to be recorded. That means that, given a certain classification, the id number of the document would be one or another.
I've created a model, which provides a series of options to user to classify the document. (testModel.xml). Information has been modified in order to avoid any confidentiality issues.
The desired behavior would be:
Once selected these options, there must be a new field on the properties, which would concatenate the codes of each category and a sequence number. In this case, the code would be: DIR-GD1CMF-MG-0001.
Is there a way to find a solution to my proposal? I know it is quite specific, but I would appreciate any clue about what would be a suitable solution (Webscripts, Java development, Javascript development). If you could also provide any reference or link I could check that would be great.
Thank you so much for your help!
Dani
02-09-2017 07:36 AM
Hola Daniel.
Sí que la hay, y no es muy complicada. Lo que tienes que hacer es lo siguiente:
- En tu modelo de datos debes crear una propiedad read only de tipo texto que por defecto estará sin nada.
- Al usuario seleccionar esas propiedades, puedes configurar una regla en el espacio padre para que cada vez que se actualice un documento ejecute un script.
- Ese script puedes leer estas propiedades y formar el contenido para introducirle en la "read-only":
Para hacer el script te dejo algunos enlaces que puedes de utilidad:
- Tutorial de Javascript en Alfresco (algo antiguo pero te servirá para aprender lo básico).
- Creating a rule | Alfresco Documentation
- Javascript API en alfresco: JavaScript API | Alfresco Documentation
- Javascript Console | Alfresco Add-ons - Alfresco Customizations - Utilidad gratuita para lanzar y probar javascripts en share.
Ve comentándonos y si necesitas algo pregúntanos 😉
Un saludo,
Cris.
Explore our Alfresco products with the links below. Use labels to filter content by product module.