How to inject OpenKM version to Word document content

We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
Post Reply
fredczj
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: Tue Sep 03, 2019 7:13 am

How to inject OpenKM version to Word document content

Post by fredczj » Tue Sep 03, 2019 7:18 am

Hello !
I am looking for a basic feature that I cannot find anywhere now... :(
For the .doc/.docx documents uploaded, a version in OpenKM is assigned. This version should appear somewhere in the document when this one is collected or read by any authorised user.

How can I modify the .doc/.docx content so that it collects the openKM document version?

Thank you!
Fred

jllort
Moderator
Moderator
Posts: 10868
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: How to inject OpenKM version to Word document content

Post by jllort » Wed Sep 04, 2019 5:34 pm

You are talking about modifying the document on the fly when downloading. This is not a trivial feature ( it is easiest download as pdf and apply a stamp either modifying the original content ). For it, you need to incorporate a library to modify docx files. I suggest working with docx files either microsoft propietary format ( that not means when you produce docx with Microsoft Office be 100% compliant ).

In case Microsoft Office proprietary format will be better to create a REST service integrated with Microsoft libraries for it ( we have done something in this direction to solve problems with conversion to PDF some rare and malformed documents )

Look in google for "java modify docx".

fredczj
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: Tue Sep 03, 2019 7:13 am

Re: How to inject OpenKM version to Word document content

Post by fredczj » Thu Sep 05, 2019 6:53 am

OK, got it. I have to take a look at this.
Are there some automation actions that could be triggered when downloading a document?

jllort
Moderator
Moderator
Posts: 10868
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: How to inject OpenKM version to Word document content

Post by jllort » Sat Sep 07, 2019 10:03 am

Take a look at AutomationRule, there are automation for EVENT_CONVERSION_PDF. I think you will need to extend the automation with your own and add in DownloadServer and ConverterServlet. Look how has been done for EVENT_CONVERSION_PDF, you might do something similar.

Post Reply