Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Amit Shukla
unique url for document
September 10, 2012 10:25 PM
Answer

Amit Shukla

Rank: Junior Member

Posts: 92

Join Date: June 7, 2012

Recent Posts

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
Hitesh Methani
RE: unique url for document
September 10, 2012 11:57 PM
Answer

Hitesh Methani

Rank: Regular Member

Posts: 160

Join Date: June 24, 2010

Recent Posts

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
RE: unique url for document
September 11, 2012 1:01 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 858

Join Date: February 18, 2009

Recent Posts

Hi Amit,

you can easily create an url for document and media entities like this:
1/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
RE: unique url for document
September 13, 2012 4:11 AM
Answer

Amit Shukla

Rank: Junior Member

Posts: 92

Join Date: June 7, 2012

Recent Posts

Thanks a lot Hitesh and Oliver Bayer.I got my answer
Amit Shukla
RE: unique url for document
November 15, 2012 10:23 PM
Answer

Amit Shukla

Rank: Junior Member

Posts: 92

Join Date: June 7, 2012

Recent Posts

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
RE: unique url for document
November 16, 2012 1:00 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 858

Join Date: February 18, 2009

Recent Posts

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
RE: unique url for document
November 20, 2012 11:13 PM
Answer

Amit Shukla

Rank: Junior Member

Posts: 92

Join Date: June 7, 2012

Recent Posts

thanks a lot oliver

Amit