Foros de discusión

unique url for document

Amit Shukla, modificado hace 11 años.

unique url for document

Junior Member Mensajes: 93 Fecha de incorporación: 7/06/12 Mensajes recientes
Hi all,

I need unique URL for document at the time of uploading document.

Can any body help me also the regarding flow? How the docs save in document library.

Thanks

Amit Shukla
thumbnail
Hitesh Methani, modificado hace 11 años.

RE: unique url for document

Regular Member Mensajes: 171 Fecha de incorporación: 24/06/10 Mensajes recientes
Hello Amit,

If you are talking about generating urls at code level for documents, then you can refer fourth point in the link creating url.

Regarding your second question, docs are stored by default in data/document_library folder.

Thanks and Regards,
Hitesh Methani.
Oliver Bayer, modificado hace 11 años.

RE: unique url for document

Liferay Master Mensajes: 894 Fecha de incorporación: 18/02/09 Mensajes recientes
Hi Amit,

you can easily create an url for document and media entities like this:
/documents/{groupId}/{folderId}/httpUtil.encodeURL(htmlUtil.unescape({title}))

I've put the needed parameters in brackets. If you have a dlFileEntry object you can get them from it.
HTH Oli
Amit Shukla, modificado hace 11 años.

RE: unique url for document

Junior Member Mensajes: 93 Fecha de incorporación: 7/06/12 Mensajes recientes
Thanks a lot Hitesh and Oliver Bayer.I got my answer
Amit Shukla, modificado hace 11 años.

RE: unique url for document

Junior Member Mensajes: 93 Fecha de incorporación: 7/06/12 Mensajes recientes
Hi oliver,
I got url of docs by this for my localhost.

String docurl="http://localhost:8080" + "/documents/" + groupId+"/"+folderId+"/"
+HttpUtil.getHttp().encodeURL(HtmlUtil.getHtml().unescape(title));

instead of ----http://localhost:8080" how can i get this in generic manner.

Thanks
Amit
Oliver Bayer, modificado hace 11 años.

RE: unique url for document

Liferay Master Mensajes: 894 Fecha de incorporación: 18/02/09 Mensajes recientes
Hi Amit,

I think you should be able to use relative urls too (without the http://localhost:8080 prefix). But if you want or have to use an absolute url for some reasons "themeDisplay.getPortalURL()" should do the trick.

Greets Oli
Amit Shukla, modificado hace 11 años.

RE: unique url for document

Junior Member Mensajes: 93 Fecha de incorporación: 7/06/12 Mensajes recientes
thanks a lot oliver

Amit