2013-02-13 33 views
3

我的门户中有一个对话框,它打开了一个portlet。当我点击链接并打开对话框时,对话框将显示无法在liferay对话框中打开portlet

您没有访问此portlet所需的角色。

但是,如果我在页面上添加相同的portlet,那么portlet在页面和对话框上都会打开,不会出现任何问题。我在这里错过了什么?任何人有任何想法?

我的代码是:提前为任何帮助,任何人都可以提供

#set ($profile_url = $portletURLFactory.create($request, "profile_WAR_profileportlet", $getterUtil.getLong($plid), "RENDER_PHASE")) 
$profile_url.setParameter("p_p_state", "exclusive") 

<a href="#" id="profile" onclick="openDialog('$profile_url','preferences-dialog',500,500)"> Profile </a> 



window, 
     'openDialog', //function name 
     function(url, popupID, wd, ht) { // parameters to the function 
      var A = AUI(); 

      popupDialog = new A.Dialog({ 

        id: popupID, // popupId passed so that it would be easy to close it through events other than the close button 
        centered: false, // all the different parameters function you can check in the Alloy API 
        draggable: true, 
        resizable: false, 
        width: wd, 
        stack: true, 
        modal: true, 
        height: ht, 
        scrollbars: true, 
        xy: [getWidth()/2-wd/2,10] 
       } 
      ).plug(
       A.Plugin.IO, 
       { 
        uri: url 
       } 
      ); 

      popupDialog.render(); 
     }, 
     ['aui-dialog','aui-dialog-iframe'] 
    ); 

感谢。

回答

4

我认为你缺少的profile_WAR_profileportlet portlet的liferay-portlet.xml以下配置:

<add-default-resource>true</add-default-resource> 

这应设置为true为这是在对话框内访问的门户弹出窗口,这里是这个元素的documentation

欲了解更多信息,你可以看看这个answer积分4 & 5的答案会对你有帮助。

+1

感谢您的帮助,我一直在寻找一天的修复程序......非常感谢 – saurjk 2013-02-13 10:06:43

0

难道是你设置了$ profile_url但实际上打开$ preferences_url上的对话框?我猜先前已经定义了preferences_url - 并且首选项(例如portlet编辑模式)通常需要比正常呈现阶段更多的权限。通过访问该管理员交叉检查..

+0

哎呀,我发布了两个不同的代码,我只是编辑它。实际上我有两个变量$ profile_url和$ preferences_url,并且有两个链接调用这两个portlet。当我以我的开发环境中的管理员身份登录时,会出现此问题。所以是的,我正在以管理员身份进行检查。有什么建议么? – saurjk 2013-02-13 09:15:44

0

添加下面两行的portal-ext.properties文件

portlet.add.default.resource.check.enabled=true 
portlet.add.default.resource.check.whitelist=3,56_INSTANCE_0000,58,82,86,103,113,145,164,166,170,33,---here append the portlet id which you want to display