Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
Mittal Patoliya
How to get the document url in the ModelListener of DLFileEntry
11 de enero de 2013 19:49

Mittal Patoliya

Ranking: Junior Member

Mensajes: 25

Fecha de incorporación: 14 de diciembre de 2011

Mensajes recientes

I have implemented the ModelListener for DLFileEntry so that whenever anything is changed in the documentliberary it will call the listener.
Now in Listener I want to access the document URL to view the document which I am going to send with the notification mail.
Could anybody suggest how to create or retrieve the document view URL.

I have checked view_file_entry.jsp in that they are creating URL like this.

url='<%= themeDisplay.getPortalURL() + themeDisplay.getPathContext() + "/documents/" + themeDisplay.getScopeGroupId() + StringPool.SLASH + fileEntry.getUuid() %>'

but in my listener I do not have themDisplay object so not able to replicate that in my listener please help me out with this. Its very urgent.
Jelmer Kuperus
RE: How to get the document url in the ModelListener of DLFileEntry
13 de enero de 2013 1:29

Jelmer Kuperus

Ranking: Liferay Legend

Mensajes: 1192

Fecha de incorporación: 10 de marzo de 2010

Mensajes recientes

You have to understand that in Liferay content is not tied to a specific page. The same DLFileEntry could be featured on multiple pages, in multiple groups, belonging to multiple virtual hosts.

When browsing a page on a site themeDisplay gives you the groupId of the page you are viewing now, the portalURL for the current page etc.
So you'll have to be explicit about what you want and hardcode a bunch of things

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!