Forums de discussion

New Section in ControlPanel

Deepjyoti Nath, modifié il y a 13 années.

New Section in ControlPanel

Junior Member Publications: 86 Date d'inscription: 02/11/10 Publications récentes
Hi,
Is it possible to add a new Section under control panel? By default when an adminstrator goes to control panel, he can see portlets under Content, Portal and Server sections. Is it possible to add a custom section under which custom user created portlets can be put? If yes can anyone please provide a solution?

Thanks in advance!!!
thumbnail
Piotr Filipowicz, modifié il y a 13 années.

RE: New Section in ControlPanel

Junior Member Publications: 52 Date d'inscription: 18/11/10 Publications récentes
Hi!
It's possible to add custom section in control panel.
The simpliest way is create ext environment in your project and override com.liferay.portal.util.PortletCategoryKeys util.

For example add Test section:

public static final String TEST = "test";
public static final String[] ALL = {MY, CONTENT, PORTAL, SERVER, TEST};


Then you go into your specific portlet and put <control-panel-entry-category>test</control-panel-entry-category> in liferay-portlet.xml

--
Best regards,
Piotr Filipowicz
Deepjyoti Nath, modifié il y a 13 années.

RE: New Section in ControlPanel

Junior Member Publications: 86 Date d'inscription: 02/11/10 Publications récentes
Hi Piotr,

Thnaks for your reply. Now my custom section is coming in the Control Panel. But instead of Test, the section is coming as "category.test". How this "category" has been appended?

Thanks again.
thumbnail
Piotr Filipowicz, modifié il y a 13 années.

RE: New Section in ControlPanel

Junior Member Publications: 52 Date d'inscription: 18/11/10 Publications récentes
Hello again!
This is easy. Put the key category.<your_category_name> in Language.properties or Language_<your country>.properties.

--
Piotr Filipowicz
thumbnail
Piotr Filipowicz, modifié il y a 13 années.

RE: New Section in ControlPanel

Junior Member Publications: 52 Date d'inscription: 18/11/10 Publications récentes
Sory, I read your post in a hurry.

Deepjyoti Nath:
How this "category" has been appended?



"Category" is append in file: portal/portal-web/docroot/html/portlet/control_panel_menu/view.jsp

title = LanguageUtil.get(pageContext, "category." + curCategory);


--
Piotr Filipowicz
thumbnail
Mati Khan, modifié il y a 13 années.

RE: New Section in ControlPanel

Junior Member Publications: 25 Date d'inscription: 01/11/10 Publications récentes
Hi,

Can you tell me where you placed the package com.liferay.portal.util in ext-plugin

in ext-impl or ext-service

And example will be good to implement it.

Thanks.
thumbnail
Piotr Filipowicz, modifié il y a 13 années.

RE: New Section in ControlPanel

Junior Member Publications: 52 Date d'inscription: 18/11/10 Publications récentes
This is very good question. This class should be in the portal-service package. But in the ext plugin you cannot override PortletCategoryKeys. This is not as easy as I thought. So, you'll need change your liferay source?!?

Who can give us better way?
Daniel Lipski, modifié il y a 12 années.

RE: New Section in ControlPanel

New Member Publications: 3 Date d'inscription: 13/04/11 Publications récentes
Hi,

I got exactly the same issue. Have you found solution for this ?

Reagrds
Daniel
thumbnail
Tomas Polesovsky, modifié il y a 12 années.

RE: New Section in ControlPanel

Liferay Master Publications: 676 Date d'inscription: 13/02/09 Publications récentes
Hi,

I don't know which version do you use - so take it as a tutorial emoticon

You'll need to use Ext Plugin.

1, in liferay source of your version find ./portal-impl/src/com/liferay/portal/util/PortalImpl.java and search for lines with PortletCategoryKeys.ALL.
2, create new class MyPortalImpl that extends PortalImpl and override the methods you find (replace PortletCategoryKeys.ALL with new String[]{....})
3. using your ext-spring.xml redefine bean: <bean id="com.liferay.portal.util.Portal" class="xxx.MyPortalImpl" />
4, copy portal-web/docroot/html/portlet/control_panel_menu/view.jsp from liferay sources into ext-web/docroot/html/portlet/control_panel_menu/view.jsp and change
String[] allCategories = PortletCategoryKeys.ALL;
into
String[] allCategories = new String[]{....}


I think this way could work.
thumbnail
Apoorva Prakash, modifié il y a 12 années.

RE: New Section in ControlPanel

Liferay Master Publications: 658 Date d'inscription: 15/06/10 Publications récentes
Hi all,
In my case, making category entry in language-ext.properties worked.
So why it is needed to modify the view.jsp of control panel, I can't understand.
Thanks
Nguyen Hong Duy Anh, modifié il y a 9 années.

RE: New Section in ControlPanel

New Member Publications: 2 Date d'inscription: 17/09/14 Publications récentes
I want set permission for my custom portlet in custom section I was created. I don't see my portlet in Add Permission select menu. I think because my portlet put in my custom section. I see the icon of my custom section is a User icon. So, how do I set permission for my custom section like a content section. I want add permission for my custom portlet in custom section.
Sr for my english.
Thanks
Deepjyoti Nath, modifié il y a 13 années.

RE: New Section in ControlPanel

Junior Member Publications: 86 Date d'inscription: 02/11/10 Publications récentes
Thanks man!!!