Fórum

unique url for document

Amit Shukla, modificado 11 Anos atrás.

unique url for document

Junior Member Postagens: 93 Data de Entrada: 07/06/12 Postagens Recentes
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 11 Anos atrás.

RE: unique url for document

Regular Member Postagens: 171 Data de Entrada: 24/06/10 Postagens Recentes
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 11 Anos atrás.

RE: unique url for document

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
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 11 Anos atrás.

RE: unique url for document

Junior Member Postagens: 93 Data de Entrada: 07/06/12 Postagens Recentes
Thanks a lot Hitesh and Oliver Bayer.I got my answer
Amit Shukla, modificado 11 Anos atrás.

RE: unique url for document

Junior Member Postagens: 93 Data de Entrada: 07/06/12 Postagens Recentes
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 11 Anos atrás.

RE: unique url for document

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
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 11 Anos atrás.

RE: unique url for document

Junior Member Postagens: 93 Data de Entrada: 07/06/12 Postagens Recentes
thanks a lot oliver

Amit