Fórum

Get URL for DLFileEntry

Tom Vleminckx, modificado 12 Anos atrás.

Get URL for DLFileEntry

Junior Member Postagens: 39 Data de Entrada: 27/06/11 Postagens Recentes
Hello,

Is there an util class or method to generate the URL for a fileentry in de documentlibrary?

Thank you,
thumbnail
Ravi Kumar Gupta, modificado 12 Anos atrás.

RE: Get URL for DLFileEntry

Liferay Legend Postagens: 1302 Data de Entrada: 24/06/09 Postagens Recentes
Check view_file_entry.jsp in tomcat-6.0.29\webapps\ROOT\html\portlet\document_library directory. It has fileUrl variable. See how that is formed.

HTH
thumbnail
Sagar A Vyas, modificado 12 Anos atrás.

RE: Get URL for DLFileEntry

Liferay Master Postagens: 679 Data de Entrada: 17/04/09 Postagens Recentes
Tom Vleminckx:
Hello,

Is there an util class or method to generate the URL for a fileentry in de documentlibrary?

Thank you,

Hi Tom,

Just do as below you will get url of particular DLFileEntry

<a href='<%=themeDisplay.getPortalURL()+"/c/document_library/get_file?uuid="+dlFileEntry.getUuid()+"&groupId="+themeDisplay.getScopeGroupId() %>' >
MyFile </a>

Thanks,
Sagar Vyas
Tom Vleminckx, modificado 12 Anos atrás.

RE: Get URL for DLFileEntry

Junior Member Postagens: 39 Data de Entrada: 27/06/11 Postagens Recentes
Allright,

Thank you both for the quick response.

Tom
thumbnail
Roberto Javier, modificado 12 Anos atrás.

RE: Get URL for DLFileEntry

New Member Postagens: 5 Data de Entrada: 01/03/12 Postagens Recentes
Excellent, thank you very much Sagar ...
thumbnail
Sagar A Vyas, modificado 12 Anos atrás.

RE: Get URL for DLFileEntry

Liferay Master Postagens: 679 Data de Entrada: 17/04/09 Postagens Recentes
Roberto Javier:
Excellent, thank you very much Sagar ...



Glad to know it helps you emoticon
thumbnail
me liferay, modificado 11 Anos atrás.

RE: Get URL for DLFileEntry

Junior Member Postagens: 25 Data de Entrada: 14/12/11 Postagens Recentes
Is there a way to get it in the ModelLisetener class because in that class we do not have themdisplay object reference.
all I have id dlfileEntry reference.
thumbnail
Sai Sriharsha Kasturi, modificado 9 Anos atrás.

RE: Get URL for DLFileEntry

Junior Member Postagens: 34 Data de Entrada: 21/10/12 Postagens Recentes
me liferay:
Is there a way to get it in the ModelLisetener class because in that class we do not have themdisplay object reference.
all I have id dlfileEntry reference.



Try this,

String portalURL = PortalUtil.getPortalURL(company.getVirtualHostname(), PortalUtil.getPortalPort(), false);
String url = portalURL + "/c/document_library/get_file?uuid=" + dlfileEntry.getUuid() + "&amp;groupId=" + dlfileEntry.getGroupId();