Foros de discusión

New Section in ControlPanel

Deepjyoti Nath, modificado hace 13 años.

New Section in ControlPanel

Junior Member Mensajes: 86 Fecha de incorporación: 2/11/10 Mensajes recientes
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, modificado hace 13 años.

RE: New Section in ControlPanel

Junior Member Mensajes: 52 Fecha de incorporación: 18/11/10 Mensajes recientes
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, modificado hace 13 años.

RE: New Section in ControlPanel

Junior Member Mensajes: 86 Fecha de incorporación: 2/11/10 Mensajes recientes
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, modificado hace 13 años.

RE: New Section in ControlPanel

Junior Member Mensajes: 52 Fecha de incorporación: 18/11/10 Mensajes recientes
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, modificado hace 13 años.

RE: New Section in ControlPanel

Junior Member Mensajes: 52 Fecha de incorporación: 18/11/10 Mensajes recientes
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, modificado hace 13 años.

RE: New Section in ControlPanel

Junior Member Mensajes: 25 Fecha de incorporación: 1/11/10 Mensajes recientes
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, modificado hace 13 años.

RE: New Section in ControlPanel

Junior Member Mensajes: 52 Fecha de incorporación: 18/11/10 Mensajes recientes
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, modificado hace 12 años.

RE: New Section in ControlPanel

New Member Mensajes: 3 Fecha de incorporación: 13/04/11 Mensajes recientes
Hi,

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

Reagrds
Daniel
thumbnail
Tomas Polesovsky, modificado hace 12 años.

RE: New Section in ControlPanel

Liferay Master Mensajes: 676 Fecha de incorporación: 13/02/09 Mensajes recientes
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, modificado hace 12 años.

RE: New Section in ControlPanel

Liferay Master Mensajes: 658 Fecha de incorporación: 15/06/10 Mensajes recientes
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, modificado hace 9 años.

RE: New Section in ControlPanel

New Member Mensajes: 2 Fecha de incorporación: 17/09/14 Mensajes recientes
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, modificado hace 13 años.

RE: New Section in ControlPanel

Junior Member Mensajes: 86 Fecha de incorporación: 2/11/10 Mensajes recientes
Thanks man!!!