05-12-2020 11:59 AM
Hi.
I am new to Alfresco.
I have the following problem:
Retrieve the version of an Alfresco document (.docx). Display the version to the user. Allow the user to choose the
new version, then modify the Alfresco document by inserting the chosen version and persist the document. The version must be visible on the document in subsequent views.
How can I proceed?
Thank you in advance, Leonardo.
05-13-2020 02:56 AM
Hi,
Which UI you are using?ADF or Share or custom UI?
ADF and Share UI having version functionality where you can revert choosen version and persist ,download previous version ,view previous version properties.
05-13-2020 03:55 AM
Hi Sanjay.
Thank You for your reply. I'm using Share UI.
Thanks, Leonardo.
05-13-2020 08:56 AM
Hi @lpercoco,
Can I just clarify your requirement? Am I correct that you want to allow users to revert to an earlier version of the document, set that as the final version, and have that version number added somewhere into the document? Having the version number in the document metadata is not sufficient?
As an after thought, from a document management perspective, you may not want to have users setting an earlier version to be the final version?
Thanks,
05-13-2020 09:59 AM
Hi Eddie.
05-14-2020 06:09 AM
Hi @lpercoco,
I don't have any experience with docx4j but the process of using it is outlined on the github page.
It say that it "allows us to export metadata of a node into a docx or xlsx document, using a template" - so if the version number is part of a document metadata, it follows that it should be possible to add the version number into the document.
There is a answer by @jpotts that outlines an approach you might take using docx4j to do what you want.
HTH
05-14-2020 09:03 AM
Hi Eddie.
We have used part of the example you linked, without the metadata part.
The example says that if in the document there is the place holder ${Title} and in the metadata there is a property called Title the value of the property is passed to the template.
To do the same we would have to add a version property, but it would be double, because Alfresco already have a version property.
In addition, our customer does not use an Alfresco template, that is, He does not generate a document from scratch with alfresco, He imports his own docx and to make the changes.
Thank You, Leonardo
05-14-2020 10:43 AM
Hi @lpercoco,
You can use rules to apply aspects when a document is added to a folder - versionable is one such aspect - or add them manually. That would then give you the version property. That said, I don't understand how docx4j works regarding templates, etc.
Explore our Alfresco products with the links below. Use labels to filter content by product module.