Liferay自定义Portlet权限标签丢失 [英] Liferay custom portlet permission label missing

查看:128
本文介绍了Liferay自定义Portlet权限标签丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经按照中的说明进行操作本教程为我的自定义portlet引入了新的portlet级别权限.

I've followed the instructions from this tutorial to introduce a new portlet level permission for my custom portlet.

在资源操作映射XML中,有一个名为PARTNER_ADMIN_CONTRACTING的新操作键,我已经在Language.properties文件中添加了以下行:

In the resource-action-mapping XML there is a new action-key called PARTNER_ADMIN_CONTRACTING, and I've added the following line to the Language.properties file:

action.PARTNER_ADMIN_CONTRACTING=Admin contracting

Define permissions选项卡上,它仍显示标签键,而不是值:

On the Define permissions tab, it still shows the label key, not the value:

缺少什么?

推荐答案

您必须将action.PARTNER_ADMIN_CONTRACTING=Admin contracting语言键添加到门户网站资源包中,因为控制面板不会在您的portlet中查找翻译.您可以使用语言钩功能可以做到这一点:

You have to add the action.PARTNER_ADMIN_CONTRACTING=Admin contracting language key to the portal resource bundle, because the Control Panel does not look for the translation in your portlet. You can use the language hook feature do to this:

  1. 在您的docroot/WEB-INF目录中创建一个liferay-hook.xml:

<?xml version="1.0"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd">

<hook>
   <language-properties>content-portal/Language.properties</language-properties>
</hook>

  • 创建docroot/WEB-INF/src/content-portal/Language.properties:

    action.PARTNER_ADMIN_CONTRACTING=Admin contracting   
    

  • 这应该有效!

    这篇关于Liferay自定义Portlet权限标签丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆