
Control Panel
The Control Panel is a unified way to access all portal administration tools within Liferay. It provides access to:
- Administration of the user account (My account)
- Content Administration (if any)
- Portal Administration: user administration, organization administration, role administration, ...
- Server Administration: memory used, cache, log levels, plugins, etc.
Each of the above tools are organized in the corresponding categories and will be accessible through a link in the left menu of the Control Panel as shown in the screenshot below:
Accessing the Control Panel #
All registered users have access to the Control Panel through a link in the dock menu in the upper right corner.
Once in the Control Panel the users will only be able to see those tools in the left menu which they have access to. A regular user with no administration rights will only see the option to administer his own account.
Providing access from a custom theme #
If a custom theme has been developed with its own dock navigation it may be necessary to update it to add a link to the Control Panel. The following velocity code can be used as an example for that purpose:
#if ($show_control_panel) <li class="control-panel"> <a href="$control_panel_url">$control_panel_text</a> </li> #end
Customizing the Control Panel #
Look and feel #
The Control Panel comes with a default theme but it's possible to configure it to use any custom theme available. To that end a new property has been created in the portal.properties configuration file:
control.panel.layout.regular.theme.id=mycustomtheme
Available portlets #
Each of the items in the left menu is implemented through an independent portlet. That makes the menu very dynamic since when any of those portlets is disabled it simply disappears from the menu automatically.
Also it's possible to configure the control panel to remove certain portlets (even if they are enabled) and to add custom portlets to it. This is done individually for each portlet through the liferay-portlet.xml file. For each portlet two parameters have to be provided: The category of the control panel where it will appear. There are four allowed values: 'my', 'content', 'portal' and 'server' The weight: this parameter controls the position within the elements of the same category. The higher the weight the lower it'll appear in the menu. This number can have decimals for complete control of the position
Here is an example configuration for the users administration portlet:
<portlet> <portlet-name>125</portlet-name> .... <control-panel-entry-category>portal</control-panel-entry-category> <control-panel-entry-weight>1.0</control-panel-entry-weight> .... </portlet>
In this example the portlet has been added to the category 'portal' and has a weight of 1.0 which by default puts it in the first position.
Note that it's also possible to add to the Control Panel portlets developed either within the ext environment or as plugins by just filling these two properties in their corresponding liferay-portlet.xml files.
Also note that the portlet cannot be instanceable. (ie the property in liferay-portlet.xml must be false:
<instanceable>false</instanceable>)
Permissions #
By default all portlets added to to the Control Panel will only be available only to users with the Administrator role. It is also possible to provide more finegrained permissioning by providing a custom class that determines whether or not a Control Panel portlet should be available depending on the permissions of the user.
That class is registered in the liferay-portlet.xml entry for each portlet. Following with the example of the previous section, for the users administration portlet we add:
<portlet> <portlet-name>125</portlet-name> .... <control-panel-entry-category>portal</control-panel-entry-category> <control-panel-entry-weight>1.0</control-panel-entry-weight> <control-panel-entry-class> com.liferay.portlet.enterpriseadmin.UsersControlPanelEntry </control-panel-entry-class> ... </portlet>
The class provided must implement the interface com.liferay.portlet.ControlPanelEntry:
public interface ControlPanelEntry { public boolean isVisible( PermissionChecker permissionChecker, Portlet portlet) throws Exception; }
To ease migration to future versions of Liferay which may add new methods to this interface it's recommended to extend the class BaseControlPanelEntry instead of implementing the interface directly. For example:
public class UsersControlPanelEntry extends BaseControlPanelEntry { ... }
Related resources #
- New in Liferay: The Control Panel, an administration UI to rule them all: Blog entry announcing the introduction of the Control Panel in Liferay Portal 5.2