0

Use case: A user can bookmark a link which contains a pdf-document for downloading or viewing it online.

The url contains a version number provided by liferay.

Is it possible to ensure that you always get the latest version of the bookmarked pdf-document even if the url was bookmarked months ago ?

The uploaded pdf-documents are versioned by Liferays document library.

Of course you can remove the version number from the pdf-link but this i guess would lead to the problem that your browser will cache the document and you are again not sure if your pdf- document is the latest one.

Does anyone can drop me a hint ?

HelmutSteiner
  • 99
  • 2
  • 11
  • You would require to change the logic that is fetching the document. It will check and update the version, if newer version is available. – Parkash Kumar May 26 '16 at 10:02

1 Answers1

0

No, you cannot do it, so the only solution is to make a hook for the method that fetches the document. In this case I think you should override some of the DLFileEntryLocalServiceUtil methods. With these two links you will have enough information:

Override a service - https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/overriding-a-portal-service-using-a-hook

DLFileEntryLocalServiceUtil - https://docs.liferay.com/portal/6.2/javadocs/com/liferay/portlet/documentlibrary/service/DLFileEntryLocalServiceUtil.html

Good luck!