Question

When updating a document in alfresco's repository, it gets versioned on each check in, am looking for a way to dynamically include a version history table into one of my document's pages.

Exactly like the 'Version history' shown in the document details inside Share, is there any way to let alfresco automatically update my document to insert that part ? or in a simpler way, is there anyway to automatically put the version history table inside my deliverable documents ?

Was it helpful?

Solution

Oke for this to work you'll need JAVA knowledge to inject content in a document. BTW this is a very old implementation so there could be nicer/faster ways to do this.

What we did was the following: All the code is already in the Openoffice libraries within Alfresco. e.g. take a look at this library; openoffice-unoil-3.1.0.jar

Created a custom Action which takes as input a node.

  1. Use XComponentLoader to get the current connection
  2. Use XComponent to get the file (we copied the content to a JAVA tempFile)
  3. Use XBookmarksSupplier to get the current bookmarks in Word (so in this case, set a bookmark for the version history table)
  4. When looping through the bookmarks, get the Anchor. Within this object you can setString and then set your table string. I'm not sure how to set a table in this String. But it won't be fun if everything is known ;). Here is a bit Java code.
  5. In the end use XStorable to store the file by using it's url

Good luck!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top