1. Override the class PortletCategoryKeys (in ext-impl\src\com\liferay\portal\util\PortletCategoryKeys.java)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
package com.liferay.portal.util;
/** * @author apoorva.prakash
*
*/
public class PortletCategoryKeys {
public static final String CONTENT = "content" ;
public static final String MY = "my" ;
public static final String PORTAL = "portal" ;
public static final String SERVER = "server" ;
public static final String MYCATEGORY = "mycategory" ;
public static final String[] ALL = {MY, CONTENT, MYCATEGORY , PORTAL, SERVER};
} |
Put the category in ALL array in the order you wish to appear your category.
2. Now add portlet in this category using the following entry in liferay-portlet-ext.xml file
1
2
3
4
5
|
< portlet >
< portlet-name >portlet_id</ portlet-name >
< control-panel-entry-category >mycategory</ control-panel-entry-category >
< control-panel-entry-weight >1</ control-panel-entry-weight >
</ portlet >
|
here portlet_id is the id of the portlet that you wish to add in our custom category. Specify the name of the category in <control-panel-entry-category> entry and sequence of portlet appearance in determined through <control-panel-entry-weight>. The higher the weight, upper will be the portlet(weight can also be in floating number).
3. In portlet.xml file, add role reference
<security-role-ref> <role-name>role-name</role-name> </security-role-ref>
4. in liferay-portlet.xml add role mapper
<role-mapper> <role-name>role-name</role-name> <role-link>actual-role-name</role-link> </role-mapper>
5. Now an important point, we must enter the category name entry in language-ext.properties file in ext-impl/src/content, so that our category can be recognized, otherwise you'll get category name as "category.mycategory"
1
|
category.mycategory=My New Category |
That's all I did, hope will work for you too.
6. In resources/resource-actions/default.xml write permission
<supports> <action-key>ACCESS_IN_CONTROL_PANEL</action-key> <action-key>VIEW</action-key> </supports>
7. point to this file in resources/portlet.properties
resource.actions.configs=resource-actions/default.xml
相关推荐
This article shows how to add your own pages to Control Panel applets by writing a property sheet handler.(14KB)
This demonstrates how to add radio buttons to your menus
source insight is the best code viewer. but it can't auto add ...the details how to add is saved in the file "how to add comment in source insight.txt". i tried it and it works. so, share it with you.
Basic Concepts – What’s control in WPF? – Control Principles? – ContentModel – ContentPresenter & ItemsPresenter Build a ColorPicker control
How to Use Source Control in MATLAB with GitHub.zip
How To Add Nand Flash Driver (CN) How To Add Nand Flash Driver (CN) How To Add Nand Flash Driver (CN)
How to make mistakes in Python
Linux流量控制指南,中文版。原文地址:http://www.tldp.org/HOWTO/html_single/Traffic-Control-HOWTO/ 水平有限,仅供参考!
HowTo PortScan in C# HowTo PortScan in C#
How to use STM32 motor control SDK v6.0 workbench
How to access a user control from another user control in ASP.NET
How to Optimize Control System Parameters in Simulink.zip
It introduces how to setup for OpenMP in Visual Studio 2005 with Inter Fortran 10.1. With a simple 'Hello world ' example
How to write a Routine in DTP
如何掌控自己的时间和生活].How.to.Get.Control.of.Your.Time.and.Your.Life.2006.Scan.CHS-INTERNET.pdf
how-to-code-in-python3 how-to-code-in-python3 how-to-code-in-python3
This demonstrates how to add images to a menu.
How to Configure User Status in mySAP SRM.pdf
Shows how to resize a picture box control on a form at run time.
How not to Program in C++A 111 Broken Programs and 3 Working Ones, or Why Does 2+2=5986