Forums de discussion

How to add a portlet in a Dockbar

sunil kumar biswal, modifié il y a 11 années.

How to add a portlet in a Dockbar

New Member Publications: 19 Date d'inscription: 25/03/12 Publications récentes
Hello,
Good evening my liferay friends.I hav a doubt how to add a portlet in Dockbar.can i do this by making some changed in lifeferay-display.xml configuration file.It gives idea in which category a portlet is added.
<display >
<category name="category.sample">
<portlet id="portlet name"></portlet>
</category>
</display>
thumbnail
Jignesh Vachhani, modifié il y a 11 années.

RE: How to add a portlet in a Dockbar

Liferay Master Publications: 803 Date d'inscription: 10/03/08 Publications récentes
If you are talking about Add application section ? If yes then you are referring right xml(lifeferay-display.xml ) and settings.
thumbnail
Vitaliy Koshelenko, modifié il y a 11 années.

RE: How to add a portlet in a Dockbar

Expert Publications: 319 Date d'inscription: 25/03/11 Publications récentes
Hi, Sunil.

Do you need to add portlet to the Control Panel category? You can do it with 'liferay-portlet.xml' file, like this:
<liferay-portlet-app>
	<portlet>
		<portlet-name>{YOUR_PORTLET_NAME}</portlet-name>
        <icon>/icon.png</icon>
        <control-panel-entry-category>portal</control-panel-entry-category>
        <control-panel-entry-weight>0</control-panel-entry-weight>
        <instanceable>false</instanceable>
        <render-weight>1</render-weight>
        <ajaxable>false</ajaxable>
        <header-portlet-css>/css/main.css</header-portlet-css>
        <footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
    </portlet>
...
</liferay-portlet-app>

(the order of attributes is important here).

Vitaliy
biswajit sarkar, modifié il y a 11 années.

RE: How to add a portlet in a Dockbar

Regular Member Publications: 166 Date d'inscription: 17/10/11 Publications récentes
yes you are talking about the right file(liferay-display.xml)....

if you and to change the category ,simply change the category name
thumbnail
Vitaliy Koshelenko, modifié il y a 11 années.

RE: How to add a portlet in a Dockbar

Expert Publications: 319 Date d'inscription: 25/03/11 Publications récentes
Yes, simply change the <control-panel-entry-category> value. All available portlet categories are stored in PortletCategoryKeys class (""content", "my", "portal" and "server").
If you want to add custom category - add it to this class in this case.
thumbnail
Tonu Sri, modifié il y a 11 années.

RE: How to add a portlet in a Dockbar

Regular Member Publications: 197 Date d'inscription: 15/04/11 Publications récentes
Hi Sunil,

See this section in portal.properties:

##
## Dockbar Portlet
##

#
# Set the portlet ids that will be shown directly in the "Add Application"
# menu.
#
dockbar.add.portlets=56,101,110,71


If you want to add your portlet, Add your portlet Id here.

Thanks:
thumbnail
Florence H, modifié il y a 10 années.

RE: How to add a portlet in a Dockbar

Junior Member Publications: 51 Date d'inscription: 03/11/09 Publications récentes
Can we add a custom portlet from a hook in the "Add Application" menu with dockbar.add.portlets ?
I tried to do that, but my portlet doesn't appear and there's nothing in the log.
Sergei Sorokin, modifié il y a 9 années.

RE: How to add a portlet in a Dockbar

New Member Envoyer: 1 Date d'inscription: 08/09/10 Publications récentes
As for Liferay 6.0.6 where is a restriction at the ROOT/html/js/liferay/dockbar.js

if ((/^\d+$/).test(portletId)) {
	Liferay.Portlet.add(
	{
		portletId: portletId
	}
	);
}


It means that only numerical portletIds are supported, but your custom portletIds are named portlertId_WAR_name
So try to fix dockbar.js with hook
thumbnail
Manikantha Rajamani, modifié il y a 9 années.

RE: How to add a portlet in a Dockbar

Expert Publications: 258 Date d'inscription: 25/03/14 Publications récentes
Hi
Tonu Sri

Where i can found the portlet id
I searched in portlet tabel in that I found portletId but it is Like follow
Library_WAR_Libraryportlet
where i can found the numberic portlet id


thanks and regards
Manikantha R
thumbnail
Lokhande Vishnudas D., modifié il y a 9 années.

RE: How to add a portlet in a Dockbar

Regular Member Publications: 152 Date d'inscription: 27/05/13 Publications récentes
You can find portlet id in portlet-custom.xml.
It is in webapps->root-->WEB-INF
thumbnail
Manikantha Rajamani, modifié il y a 9 années.

RE: How to add a portlet in a Dockbar

Expert Publications: 258 Date d'inscription: 25/03/14 Publications récentes
Hi
Vishnu

I searched in portlet-custom.xml. file but it contains the id of out of box portlet
but i need the custom portlet id
event I seached in liferay-display.xml file inthat also it contains the out-of box portlet only
but not custom portlet



Regars and Thanks
Manikantha R
thumbnail
Manali Lalaji, modifié il y a 9 années.

RE: How to add a portlet in a Dockbar

Expert Publications: 362 Date d'inscription: 09/03/10 Publications récentes
Manikantha Rajamani:
Hi
Vishnu

I searched in portlet-custom.xml. file but it contains the id of out of box portlet
but i need the custom portlet id
event I seached in liferay-display.xml file inthat also it contains the out-of box portlet only
but not custom portlet



Regars and Thanks
Manikantha R


Hi,

You can use portletDisplay to get PortletId :

  ThemeDisplay themeDisplay= (ThemeDisplay)renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
  PortletDisplay portletDisplay= themeDisplay.getPortletDisplay();
 String portletId= portletDisplay.getId();


HTH!