Foros de discusión

How to get the document url in the ModelListener of DLFileEntry

thumbnail
me liferay, modificado hace 11 años.

How to get the document url in the ModelListener of DLFileEntry

Junior Member Mensajes: 25 Fecha de incorporación: 14/12/11 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.
thumbnail
jelmer kuperus, modificado hace 11 años.

RE: How to get the document url in the ModelListener of DLFileEntry

Liferay Legend Mensajes: 1191 Fecha de incorporación: 10/03/10 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