`

How to add section(category) in control panel

 
阅读更多

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 Pane

    This article shows how to add your own pages to Control Panel applets by writing a property sheet handler.(14KB)

    how to add comment in source insight

    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.

    How to build a custom control in WPF

    panel.Children.Add(right); b.Content = panel; ``` 在这个示例中,我们创建了一个堆叠面板(StackPanel),并在其中添加了两个椭圆(Ellipse)和一个带有富文本的文本块(TextBlock)。然后将整个堆叠面板作为按钮的...

    Linux流量控制指南中文翻译(Traffic control HOWTO)

    Linux流量控制是一种网络管理技术,用于管理网络接口上等待发送或接收的数据包。它涉及到数据包的入队、监管、分类、调度、整流和丢弃等操作。本指南旨在介绍Linux下的流量控制机制和操作方法。...

    how to set for OpenMP in Visual Studio 2005

    It introduces how to setup for OpenMP in Visual Studio 2005 with Inter Fortran 10.1. With a simple 'Hello world ' example

    C++ How to Program, 10th Edition

    C++ How to Program presents leading-edge computing technologies in a friendly manner appropriate for introductory college course sequences, based on the curriculum recommendations of two key ...

    股票大作手操盘术英文版how to trade in stock

    《股票大作手操盘术》是传奇交易员杰西·利弗莫尔(Jesse Livermore)在1940年所著的一本经典交易书籍。这本书详细阐述了他在股票市场的具体交易策略和方法,虽然已经过去了很多年,但其交易理念至今仍然对投资者...

    Simple application that shows how to use the Data Control to

    Simple application that shows how to use the Data Control to connect to the Biblio.mdb database and display all authors in the Authors table.

    how to work with crystal report in sap business one

    how to work with crystal report in sap business one

    excel-add-ins-in_spreadsheet-control_in_

    描述中的“how-to-use-excel-add-ins-in-the-spreadsheet-control-e5012-13.2.5-”进一步指出了这是一个操作指南,详细介绍了版本号为e5012-13.2.5的Spreadsheet Control的使用方法。 首先,让我们理解什么是...

    how-to-c-response, 对"How to C in 2016"的评论.zip

    how-to-c-response, 对"How to C in 2016"的评论 Matt Matt ,Sat,Sat,Sat,updated,updatedMatt ( 据我所知他的网站没有提到他最近的NAME ) 写了一篇文章。 它被链接到来自和黑客新闻的链接;后者是我看到的。...

    how to solve it

    Polya, "How to Solve It" will show anyone in any field how to think straight. In lucid and appealing prose, Polya reveals how the mathematical method of demonstrating a proof or finding an unknown ...

    How to use epoll A complete example in C

    How to use epoll A complete example in C How to use epoll A complete example in C How to use epoll A complete example in C How to use epoll A complete example in C

    Linux Howto 中文文档

    Linux HOWTO(中文版) BootPrompt-HOWTO (28KB) 启动提示说明 CDROM-HOWTO (27KB) 如何安装, 设定及使用光驱,同时列出支援的硬体. Chinese-HOWTO (39KB) 如何在 Linux 的系统上使用中文?/TD&gt; Config-...

    How to Create a Database in Python using SQL Lite 3 epub

    How to Create a Database in Python using SQL Lite 3 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书

    How_to_write_and_publish_a_scientific_paper

    对研究生很有用的,叫你怎麽...Chapter 8 How to Write the Materials and Methods Section Chapter 9 How to Write the Results Chapter 10 How to Write the Discussion Chapter 11 How to State the Acknowledgments

    RK3399的DRM-HOWTO测试

    RK3399的DRM-HOWTO测试 最近在学习与调试RK3399的DRM显示架构,网上有很多例程,其中介绍比较多的是来于David Herrmann’s Github的drm-howto.开源代码 但这些源码下载后执行make编译出来的执行文件只能在PC机上测试...

    PDFlib-in-.NET-HowTo

    PDFlib-in-.NET-HowTo pdflibnet

Global site tag (gtag.js) - Google Analytics