Steps to add custom liferay portlet into control panel:
To add custom portlet into control panel need to write the following property
1. liferay-portlet.xml file
<control-panel-entry-category>users</control-panel-entry-category>
<control-panel-entry-weight>1.0</control-panel-entry-weight>
For ref: Please find below the code of liferay-portlet.xml fil
<?xml version="1.0"?>
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 6.1.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_6_1_0.dtd">
<liferay-portlet-app>
<portlet>
<portlet-name>newportlet</portlet-name>
<icon>/icon.png</icon>
<control-panel-entry-category>users</control-panel-entry-category>
<control-panel-entry-weight>1.0</control-panel-entry-weight>
<instanceable>false</instanceable>
<header-portlet-css>/css/main.css</header-portlet-css>
<footer-portlet-javascript>
/js/main.js
</footer-portlet-javascript>
<css-class-wrapper>newportlet-portlet</css-class-wrapper>
</portlet>
<role-mapper>
<role-name>administrator</role-name>
<role-link>Administrator</role-link>
</role-mapper>
<role-mapper>
<role-name>guest</role-name>
<role-link>Guest</role-link>
</role-mapper>
<role-mapper>
<role-name>power-user</role-name>
<role-link>Power User</role-link>
</role-mapper>
<role-mapper>
<role-name>user</role-name>
<role-link>User</role-link>
</role-mapper>
</liferay-portlet-app>
2. liferay-display.xml file
user category.hidden into name attribute of category tag
<?xml version="1.0"?>
<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 6.1.0//EN" "http://www.liferay.com/dtd/liferay-display_6_1_0.dtd">
<display>
<category name="category.hidden">
<portlet id="newportlet"></portlet>
</category>
</display>
No comments:
Post a Comment