« Portlets に戻る

Control Panel

The Control Panel is a unified way to access all portal administration tools within Liferay. It provides access to:

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 #

1 画像の固定
70065 参照数
平均 (0 投票)
平均評価は0.0星中の5です。
コメント
コメント 作成者 日時
Thanks for this clear post. One question... Fabrice Clari 2009/01/28 13:36
OK, here is the hack for those who are... Fabrice Clari 2009/01/29 1:08
hi all i have developed a custom portlet in ext... zahid khan 2009/02/17 22:56
here is what i have written in my... zahid khan 2009/02/17 22:57
<portlet>... Andrey Kazantsev 2009/10/01 1:12
When i add this line in... enda enda enda 2009/10/26 3:30
So there's no way other than editing that .xml... Ryan McElwain 2009/02/26 15:13
we can add our custom portlet in control... Gnaniyar Zubair 2009/03/07 2:17
I'm in the same boat as Ryan - we want to give... Andrew Gruhn 2009/03/19 9:09
How can I put chat portlet at the bottom of the... Anand Abhyankar 2009/07/07 3:50
One little notice. If you create your own... Robert Bohonek 2010/02/09 6:47
Hi all, I have to add a customizing... Elisa Ingrà 2010/11/09 9:08
Hi all, I have find a good step by step... Elisa Ingrà 2010/11/18 6:14
How do I create a ControlPanelEntry to check if... Daniele Segato 2011/01/19 8:24

Thanks for this clear post.
One question concerning the customization: it is possible to completely hide the column on the left side. I just want my users to be able to update their profile (addresses, websites, details...).

Thanks,
Fabrice.
投稿日時:09/01/28 13:36
OK, here is the hack for those who are interested. Liferay guys, if there is another solution, more "regular", I will appreciated it :-)

1/ Top title and left column must be hidden. Simplest solution is to hide through CSS related containers. But this has to be applied only for the control panel page as in another pages some divs may have same classes.

So in the portal_normal.vm, in the current theme:

#if ($layout.getName().indexOf("Control Panel") > 0)
<style type="text/css">
.panel-page-content-menu {
display: none;
}

.portlet-borderless-container {
display: none;
}
</style>
#end

2/ the settings table must be expanded to take all the width available. Edit the following file ROOT/portal/layout/view/control_panel.jsp and find the line with contains :

<table class="lfr-ctrl-panel <%= panelCategory %>"> . Update this table with the width attributes:

<table class="lfr-ctrl-panel <%= panelCategory %>" width="100%">. This line is #85 on Liferay sources from trunk version 25618. Setting a table width should be doable from CSS but does not work.

Then, you can leave the control_panel.jsp file at its location (but be careful when updating Liferay) or in a hook with the custom-jsp-dir directive.

If other solution exist, do not hesitate to share them :-)

Thanks,
Fabrice.
Fabrice Clariへのコメント。投稿日時:09/01/29 1:08
hi all i have developed a custom portlet in ext env. and trying to bring that in control panel by following the steps mentioned above, but it says that these two attributes are not valid, and ut gives me a list of attributes that i can use in the portlet tag of the liferay-portlet-ext.xml file.

can any one tell whats wrong here or what i have to do to have my custom portlet appaer in the control panel.
投稿日時:09/02/17 22:56
here is what i have written in my liferay-portlet-ext.xml file

<portlet>
<portlet-name>ADBARules</portlet-name>
<struts-path>adba/porta­l/rules</struts-path>
<use-default-template>false</use-default-template>
<contr­ol-panel-entry-category>portal</control-panel-entry-category>
<control-panel-ent­ry-weight>1.0</control-panel-entry-weight>

</portlet>
投稿日時:09/02/17 22:57
So there's no way other than editing that .xml file to give non-administrators access to the "Portal" portlet in the Control Panel?
投稿日時:09/02/26 15:13
we can add our custom portlet in control panel.

But how can we get the vertical navigation menu like control panel ?

I go through "Root/html/portla/layout/view/control_panel.jsp" this page. But i dont get proper solution.

Is there any other way? pls clarify.
Ryan McElwainへのコメント。投稿日時:09/03/07 2:17
I'm in the same boat as Ryan - we want to give web producers access to items in the "Portal" portlet, but not access to the "Server" portlet. Is there any way to manipulate this access using only role definitions (*and not by having to crack code?)
Ryan McElwainへのコメント。投稿日時:09/03/19 9:09
How can I put chat portlet at the bottom of the control panel?
投稿日時:09/07/07 3:50
<portlet>
<portlet-name>ADBARules</portlet-name>
<struts-path>adba/portal/rules</s­truts-path>
<control-panel-entry-category>portal</control-panel-entry-category>
<c­ontrol-panel-entry-weight>1.0</control-panel-entry-weight>
<use-default-template>­false</use-default-template>
</portlet>

The order of elements plays role...
zahid khanへのコメント。投稿日時:09/10/01 1:12
When i add this line in liferay-portlet-ext.xml:
<instanceable>false</instanceable>
I have an error. I don't know why?
Andrey Kazantsevへのコメント。投稿日時:09/10/26 3:30
One little notice. If you create your own control panel theme and add this line to portal-ext.properties
control.panel.layout.regular.theme.id=mycustomtheme, where mycustomtheme is ID from liferay-look-and-feel-ext.xml, so dashes are ignored from ID. eg.: <theme id="test-theme" name="Test theme">, so control.panel.layout.regular.theme.id=testtheme.
投稿日時:10/02/09 6:47
Hi all, I have to add a customizing Authentication into the settings menu, Is it possible to do as a new plugin? I mean if I create a new portlet which .xml files, or others, I have to modify and with which code lines in order to add my portlet as a customizing authentication feature? I had a look to the authentication.jsp file (LIFERAY_HOME\tomcat-6.0.26\webapps\ROOT\html\portlet\enterprise_admin\settings)­ and I saw the authentication list (names="general,ldap,cas,facebook,ntlm,open-id,open-sso,siteminder"), so I suppose I have to add here my customizing authentication name, but is it correct? Maybe It's better to make some test, but if somebody has already made this kind of test could let me know something about it?
Many thanks
Elisa
投稿日時:10/11/09 9:08
Hi all,
I have find a good step by step tutorial http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Developing+a+Custom+­Authentication+System
Elisa
Elisa Ingràへのコメント。投稿日時:10/11/18 6:14
How do I create a ControlPanelEntry to check if the user has the permission to see Portlet X into community Y?

Since I only have a PermissionChecker and a Portlet object I see no way of knowing the scope group.

Can this help to work-around the issue described here?
http://www.liferay.com/web/guest/community/forums/-/message_boards/message/­20361%2075

See also comments of this blog post:
http://www.liferay.com/web/jorge.ferrer/blog/-/blogs/1791601

thanks
投稿日時:11/01/19 8:24