留言板

Problem to Download a File

thumbnail
Lucas Roberto Thomaz,修改在14 年前。

Problem to Download a File

Regular Member 帖子: 138 加入日期: 09-7-21 最近的帖子
Hi friends,

I'm having problem with download file who stay into a webcontent as a link.
This file is visible for all users and stay at a folder in document libary.
To create a link in web content for this file I've used the tool for links in webcontent panel as default.

The problem is: when admin create a web content and put there a link to a file and after when the web content is showed to admin, he can see the link and download the file.
But, when some other user try to see the same content, he show the link and when the user try download, Liferay automatic redirect to /guest and the user can't do the download.

Someone have any idea?

Thank you so much and hope you can help me =]

Lucas Thomaz
thumbnail
Jonas Yuan,修改在14 年前。

RE: Problem to Download a File

Liferay Master 帖子: 993 加入日期: 07-4-27 最近的帖子
Hi Lucas,

You can use Velocity template and add permission check on the documents link.

For example, you could find following code in pages 237 and 364-365 from the book: Liferay Portal 5.2 Systems Development

#set ($currentURL = $request.render-url.substring(0, $request.renderurl.
indexOf("?")))
#set ($pos = $request.attributes.featuredContentPosition)
#set ($path = $currentURL + "?p_p_id=extJournalContent&p_p_
lifecycle=0&_extJournalContent_featuredContentPosition=")
#set ($currentPATH_1 = $path + 1)
#set ($currentPATH_2 = $path + 2)
#set ($currentPATH_3 = $path + 3)
#if($pos == 1)
<br><br><pre><code>#if ($show_add_content_admin || $show_add_content_lkr)
<font face="arial" size="2">&nbsp; &nbsp; &nbsp; &nbsp;
<a href="http://www.book.com">
$LKR.data
</a>
</font></code></pre><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><a href="http://www.packtpub.com/liferay-portal-5-2-systems-development/book">Liferay Portal 5.2 Systems Development</a><br><a href="http://www.packtpub.com/building-liferay-portal-enterprise-intranets/book">Liferay Portal Enterprise Intranets</a><table width="100%" cellpadding="0" cellspacing="0">You can update above code as:1) get current user2) get current user roles,3) get default role - your settings4) check roles.Hope that it helps,ThanksJonas Yuan-----------------The Author of Liferay Books:</table>
thumbnail
Lucas Roberto Thomaz,修改在14 年前。

RE: Problem to Download a File

Regular Member 帖子: 138 加入日期: 09-7-21 最近的帖子
Thanks Jonas for your time,

I'll try to use Velocity, but I've never used before.

While this, my ERROR log is the follow, maybe can help you to help me. :-)

This ERROR starts when the user try to click into the link.


17:03:59,274 ERROR [RequestProcessor:676] Invalid path was requested /common/error
17:03:59,275 ERROR [PortalRequestProcessor:480] User ID 14901
17:03:59,276 ERROR [PortalRequestProcessor:481] Current URL /c/document_library/get_file?uuid=c00d9440-65e5-4d6d-a057-32970a1eaebc&amp;groupId=12999
17:03:59,276 ERROR [PortalRequestProcessor:482] Referer http://172.25.2.100:8080/web/XXX/home?p_p_id=101_INSTANCE_5qDT&amp;p_p_lifecycle=0&amp;p_p_state=maximized&amp;p_p_mode=view&amp;p_p_col_id=column-2&amp;p_p_col_count=4&amp;_101_INSTANCE_5qDT_struts_action=%2Fasset_publisher%2Fview_content&amp;_101_INSTANCE_5qDT_urlTitle=conteudo-para-download-3&amp;_101_INSTANCE_5qDT_type=content&amp;redirect=%2Fweb%XXX%2Fhome
17:03:59,277 ERROR [PortalRequestProcessor:483] Remote address XXX.XXX.XX.XX
17:03:59,277 ERROR [PortalRequestProcessor:485] Invalid path was requested /common/error
17:04:02,670 INFO  [PluginPackageUtil:1153] Reloading repositories
17:04:18,799 ERROR [PluginPackageUtil:1171] Unable to load repository http://plugins.liferay.com/official com.liferay.portal.plugin.PluginPack


Thanks in advance.

Lucas Thomaz
thumbnail
Lucas Roberto Thomaz,修改在14 年前。

RE: Problem to Download a File

Regular Member 帖子: 138 加入日期: 09-7-21 最近的帖子
Hi Friends,

I found the problem, is related to LPS 5755

Regards,

Lucas
l b,修改在14 年前。

RE: Problem to Download a File

New Member 帖子: 9 加入日期: 09-8-4 最近的帖子
Any solution?