留言板

How to expose getPreviewURL() method of DLUtil as JSON web service

Ronak Parekh,修改在8 年前。

How to expose getPreviewURL() method of DLUtil as JSON web service

Junior Member 帖子: 76 加入日期: 15-4-6 最近的帖子
Hi Team,

I am new to JSON web service in Liferay. I just wanted to get download url of any document of Document & Media portlet using getPreviewURL() method as web service api. So please suggest me any solution.

Thank you.
thumbnail
Jan Geißler,修改在8 年前。

RE: How to expose getPreviewURL() method of DLUtil as JSON web service

Liferay Master 帖子: 735 加入日期: 11-7-5 最近的帖子
Go to localhost:8080/api/jsonws
There you can see all Available WebService methods. Search for:
dlapp/get-file-entries-and-file-shortcuts

If the method you are searching for is not there, or the methods are insufficent, you could try and implement a "dummy service" descripbed here in David's blog post:
https://www.liferay.com/de/web/26526/blog/-/blogs/fake-servicebuilder-entities
thumbnail
James Falkner,修改在8 年前。

RE: How to expose getPreviewURL() method of DLUtil as JSON web service (答复)

Liferay Legend 帖子: 1399 加入日期: 10-9-17 最近的帖子
Why not just use existing web services (like /dlapp/get-file-entry) to get the UUID and groupId of the document you want to preview, then construct the url as follows:

http://localhost:8080/c/document_library/get_file?uuid=83fd1e65-655b-465d-90d1-efd308c73b1f&groupId=20182


replace localhost:8080 with your hostname and port, and the uuid and groupId parameters with their appropriate values.
Ronak Parekh,修改在8 年前。

RE: How to expose getPreviewURL() method of DLUtil as JSON web service

Junior Member 帖子: 76 加入日期: 15-4-6 最近的帖子
Hi James Falkner,

Thanks for reply.
I have question like what if i want this url as result. For example if i provide fileEntryId and invoke it then in result it should give download url.
Suggest me, if this approach is right or wrong?

Thanks in advance.
Ronak Parekh,修改在8 年前。

RE: How to expose getPreviewURL() method of DLUtil as JSON web service

Junior Member 帖子: 76 加入日期: 15-4-6 最近的帖子
Hi,

I got it.
Thanks for help.