Liferay custom portlet permission label missing

2019-08-03 15:17发布

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

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

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

custom portlet permission label is missing

What's missing?

1条回答
干净又极端
2楼-- · 2019-08-03 15:51

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. Create a liferay-hook.xml in your docroot/WEB-INF directory:

    <?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>
    
  2. Create docroot/WEB-INF/src/content-portal/Language.properties:

    action.PARTNER_ADMIN_CONTRACTING=Admin contracting   
    

This should work!

查看更多
登录 后发表回答