Foros

Inicio » Liferay Portal » Pусский

Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Rojalin Patri
Removal of dock bar from liferay.
28 de junio de 2011 20:45
Respuesta

Rojalin Patri

Ranking: Expert

Mensajes: 287

Fecha de incorporación: 22 de marzo de 2011

Mensajes recientes

Hi all,
i have a requirement which needs the dockbar should be removed from liferay and instead a single link will be available at the header which will enable the admin only to add "web content".
Let me explain it clearly...in general when we click on a"add application' present in dock bar we get a number of options like "sample",content management" etc.but i want the dock bar to be removed and in replacement one link will be there clicking on which it'll directly add only "web content display" portlet (present under content management).Other options present under add application is not required not even content management.
So first i added the following piece of code in "portal-normal.vm" to accomplish this.
#set($portlet_url = $portletURLFactory.create($request, "56", $page.getPlid(), "ACTION_PHASE"))
$portlet_url.setWindowState("maximized")
$portlet_url.setPortletMode("view")
$portlet_url.setParameter("_spage", "/journal_content/view")
<a href="${portlet_url.toString()}">my portlet link</a>
but upon clicking on the link it's refreshing the page and all other portlets present on the page is not visible.
I went through the link "http://www.liferay.com/community/wiki/-/wiki/Main/Link+to+Dockbar".Using this approach i am able to add "Add Application" option in the header,but i don't want the whole "add application".
Can anyone tell me how to take only the "web content display" out of the "add application"???????????
Please help me out....

Thanks
Rojalin
Nisarg Parikh
RE: Removal of dock bar from liferay.
29 de junio de 2011 1:50
Respuesta

Nisarg Parikh

Ranking: Expert

Mensajes: 262

Fecha de incorporación: 30 de diciembre de 2009

Mensajes recientes

Hi,

Dockbar is a portlet implementation.
You can find the implementation of this dockbar under below path.

"ROOT.war//html/portlet/dockbar/view.jsp"

you can create a HOOK to override the current functionality.

Hope this will help you.

Nisarg Parikh
Rojalin Patri
RE: Removal of dock bar from liferay.
29 de junio de 2011 2:07
Respuesta

Rojalin Patri

Ranking: Expert

Mensajes: 287

Fecha de incorporación: 22 de marzo de 2011

Mensajes recientes

Hi Nisarg,
i am able to remove the dock bar from the header.But my problem is instead of dockbar i want to add one link which will allow me to add "web content portlet" just as we do clicking on the "add application".i want upon clicking on that i should get the "web content Display" portlet in my home page but the user/admin should not be able to see the other options present under "Add application".
please help me out...

Thanks
Rojalin
Nisarg Parikh
RE: Removal of dock bar from liferay.
29 de junio de 2011 2:33
Respuesta

Nisarg Parikh

Ranking: Expert

Mensajes: 262

Fecha de incorporación: 30 de diciembre de 2009

Mensajes recientes

Hey,

which version of Liferay you are using?

What I suggest is, do NOT remove the whole dockbar. Remove all other links/images etc which are not needed. By using this you do not have to worry about the adding portlet to pages functionality. Liferay will take care of all other aspects also. And creating hook that will be very easy.

In Liferay 6 you can configure that which portlet you want using portal-ext.properties.

##
## Dockbar Portlet
##

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

You can set the ID of "Web Content" portlet and remove all other.

Please review image for your reference.
Adjunto

archivos adjuntos: Portlet.png (18,8k)
Rojalin Patri
RE: Removal of dock bar from liferay.
29 de junio de 2011 21:04
Respuesta

Rojalin Patri

Ranking: Expert

Mensajes: 287

Fecha de incorporación: 22 de marzo de 2011

Mensajes recientes

Hi Nisarg,
i am using liferay6.0.6 and my first requirement is to remove the dock bar.Instead the client wants a link where i can get only web-content portlet.So there is no point of disabling other option of "add application".it's completely a new requirement and the dialogue box of "add application" also shouldn't come.i am attaching the screen shot for please reference.now upon clicking on the link i am able to get the portlet interface (i mean the title "web content display","return to full screen")but i am getting error "you don't have roles" error message with no exception in the logs.please help me out.....
Adjunto

archivos adjuntos: webContentDisplay.png (193,4k)
Nisarg Parikh
RE: Removal of dock bar from liferay.
30 de junio de 2011 1:03
Respuesta

Nisarg Parikh

Ranking: Expert

Mensajes: 262

Fecha de incorporación: 30 de diciembre de 2009

Mensajes recientes

Rojalin Patri:
Hi Nisarg,
i am using liferay6.0.6 and my first requirement is to remove the dock bar.Instead the client wants a link where i can get only web-content portlet.So there is no point of disabling other option of "add application".it's completely a new requirement and the dialogue box of "add application" also shouldn't come.i am attaching the screen shot for please reference.now upon clicking on the link i am able to get the portlet interface (i mean the title "web content display","return to full screen")but i am getting error "you don't have roles" error message with no exception in the logs.please help me out.....



Hi,

PFA screenshot. Is this the thing what you want? and upon clicking on that it will add the "Web Content Display" portlet, right?

What I did is remove the unwanted links and changed the CSS of the docbar so it looks like we have put the link specifically for "Web Content Display" portlet.

let other things be as it is.

And if you want to open a portlet in MAXIMIZED mode then you have to change one parameter of renderURL of portlet.

You can find that code in below file
/html/portlet/journal_content/view.jsp

Hope this will help you.

Nisarg Parikh
Adjunto

archivos adjuntos: Portlet.png (12,4k)
Rojalin Patri
RE: Removal of dock bar from liferay.
30 de junio de 2011 1:40
Respuesta

Rojalin Patri

Ranking: Expert

Mensajes: 287

Fecha de incorporación: 22 de marzo de 2011

Mensajes recientes

Hi Nisarg,
i think you didn't understand the requirement.i am attaching the screen shots here for a clear understanding.in web.png the link "My web content Display"is there in top left corner.upon clicking on that i should get the web content display portlet.though i m able to add the link but it's showing "roles not there error".
Do you have any idea how can we take out the web content display portlet from add application or any path/address to that portlet which i can give in href for the link present in web.png.that would satisfy the requirement...
Thanks
Rojalin
Adjunto

Adjunto

archivos adjuntos: web.png (172,4k), web2.png (168,1k)
Nisarg Parikh
RE: Removal of dock bar from liferay.
30 de junio de 2011 3:38
Respuesta

Nisarg Parikh

Ranking: Expert

Mensajes: 262

Fecha de incorporación: 30 de diciembre de 2009

Mensajes recientes

Rojalin Patri:
Hi Nisarg,
Do you have any idea how can we take out the web content display portlet from add application or any path/address to that portlet which i can give in href for the link present in web.png.that would satisfy the requirement...


Hi Rojalin,

If I am not wrong you want too remove the "Web Content Display" portlet from Add - > Application (which is in Dockbar). Please read below:

In Liferay 6 you can configure that which portlet you want using portal-ext.properties. remove the 56 no portlet. That will remove this portlet from Add -> Application

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


AND

regarding the code you can find this code in below files
"/html/portlet/layout_configuration/view.jsp" and
"/html/portlet/layout_configuration/view_category.jsp"

You will get idea of how you can get link that will work fine.

Hope this will help you.

Nisarg Parikh
Namrata Hangal
RE: Removal of dock bar from liferay.
30 de junio de 2011 3:46
Respuesta

Namrata Hangal

Ranking: Regular Member

Mensajes: 161

Fecha de incorporación: 26 de julio de 2010

Mensajes recientes

Nisarg Parikh:


In Liferay 6 you can configure that which portlet you want using portal-ext.properties. remove the 56 no portlet. That will remove this portlet from Add -> Application

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


AND

regarding the code you can find this code in below files
"/html/portlet/layout_configuration/view.jsp" and
"/html/portlet/layout_configuration/view_category.jsp"



Hi Nisarg,

Actually, I think what Rojalin is trying to say is not "removing" the Add Web Content Display literally speaking, but "separating it out"!
As is visible in the screenshots, there is a simple hyperlink "Add Web Content Display" on the portal page. On click, a web content display should be added to the page in the same manner as using the Dockbar option would work.

Any idea how to do this?

Thanks!
Namrata Hangal
RE: Removal of dock bar from liferay.
30 de junio de 2011 3:52
Respuesta

Namrata Hangal

Ranking: Regular Member

Mensajes: 161

Fecha de incorporación: 26 de julio de 2010

Mensajes recientes

Nisarg Parikh:

PFA screenshot. Is this the thing what you want? and upon clicking on that it will add the "Web Content Display" portlet, right?

What I did is remove the unwanted links and changed the CSS of the docbar so it looks like we have put the link specifically for "Web Content Display" portlet.

let other things be as it is.

And if you want to open a portlet in MAXIMIZED mode then you have to change one parameter of renderURL of portlet.

You can find that code in below file
/html/portlet/journal_content/view.jsp


This is the exact functionality we'd like to have - minus the dockbar modification method of doing it. Instead of making changes to the dockbar (which we're tried and customer wouldn't like to have), we'd like to have a simple link on the portal page to do the same thing.

I hope I could explain my requirement....?
Nisarg Parikh
RE: Removal of dock bar from liferay.
30 de junio de 2011 4:48
Respuesta

Nisarg Parikh

Ranking: Expert

Mensajes: 262

Fecha de incorporación: 30 de diciembre de 2009

Mensajes recientes

Namrata Hangal:


On click, a web content display should be added to the page in the same manner as using the Dockbar option would work.

Any idea how to do this?



Hi Namrata,

Regarding the code thing you can find that code in below files..

"/html/portlet/layout_configuration/view.jsp" and
"/html/portlet/layout_configuration/view_category.jsp"

You can understand that how Liferay has shown the categories and portlet and the link they have set for Dockbar..the same way you can implement.

Nisarg Parikh
Fatema Rajkotwala
RE: Removal of dock bar from liferay.
27 de febrero de 2012 23:41
Respuesta

Fatema Rajkotwala

Ranking: New Member

Mensajes: 2

Fecha de incorporación: 16 de febrero de 2012

Mensajes recientes

Hi Rojalin,
I am facing the same issue
I want the link on liferay home page and on clicking that link my portlet should get loaded on home page
The code that I have written is:

#set ($portlet_url = $portletURLFactory.create($request, "ChangePassword_WAR_ChangePasswordportlet", $page.getPlid(),"RENDER_PHASE"))
$portlet_url.setWindowState("normal");
$portlet_url.setPortletMode("view")
$portlet_url.setParameter("jspPage","/view.jsp")
Accesing the portlet from the below link:
<a href="$portlet_url.toString()" id="change-pwd">my link</a>

Have you solved the problem that you were facing
Is it that there is something more that needs to be set to access the portlet
Please help me out it is urgent..
Rojalin Patri
RE: Removal of dock bar from liferay.
7 de marzo de 2012 1:53
Respuesta

Rojalin Patri

Ranking: Expert

Mensajes: 287

Fecha de incorporación: 22 de marzo de 2011

Mensajes recientes

Hi,
i have done it in the following way.
Step 1:Remove the below code from portal_normal.vm file which is in your customized theme
#if(($is_signed_in)&&($permissionChecker.isOmniadmin()))
#dockbar()
#end
Steps 2:Add below code snippet where you want. Ex:In this given example case "Add New Web content Display portlet" is the link
if ( $layout.getFriendlyURL() == $dashboardPage)
#set ($checkMM = $roleLocalService.hasUserRole($user.getUserId(), $company.getCompanyId(), $marketingManagerRoleName, true))
#if (($is_signed_in)&&($checkMM=="true"))
<p id='addportletlink'><a href="/web/guest/login">Edit Login </a></p>
<p id='addportletlink'><a href="#" onclick="javascript:add()">Add New Web content Display Portlet</a></p>
#end
#end
Steps 3:
Javascript functionality of add() is below. (Note : portlet Id of Webcontent display portlet is '56')
function add(){
var plid = themeDisplay.getPlid();
var portletId = '56';
var onComplete = null;
var beforePortletLoaded = null;

var portletOptions = {
beforePortletLoaded: beforePortletLoaded,
onComplete: onComplete,
plid: plid,
portletId: portletId,
};
Liferay.Portlet.add(portletOptions);
document.write("<META HTTP-EQUIV='Refresh' CONTENT='2'>");
}

Hope this helps....
Regards
Rojalin
pinco pallino
RE: Removal of dock bar from liferay.
17 de diciembre de 2012 9:03
Respuesta

pinco pallino

Ranking: New Member

Mensajes: 3

Fecha de incorporación: 17 de diciembre de 2012

Mensajes recientes

Rojalin Patri:
Hi Nisarg,
i think you didn't understand the requirement.i am attaching the screen shots here for a clear understanding.in web.png the link "My web content Display"is there in top left corner.upon clicking on that i should get the web content display portlet.though i m able to add the link but it's showing "roles not there error".
Do you have any idea how can we take out the web content display portlet from add application or any path/address to that portlet which i can give in href for the link present in web.png.that would satisfy the requirement...
Thanks
Rojalin



How do you remove the "Go to" tab near the user sign out?
I saw that in your pictures in this post there is one with that tab on it a some later without the TAB "Go to".

Thank you for any advice

Pietro
Hari Dobbala
RE: Removal of dock bar from liferay.
17 de diciembre de 2012 23:34
Respuesta

Hari Dobbala

Ranking: Junior Member

Mensajes: 29

Fecha de incorporación: 17 de noviembre de 2012

Mensajes recientes

Hi Pietro,

We removed "Go to" tab in docbar by commenting the code related to Go To in ROOT\html\portlet\dockbar\view.jsp and deployed it using hook. This is the one option. I don't know if there are any other options available.
utkarsh champ
RE: Removal of dock bar from liferay.
16 de mayo de 2013 11:20
Respuesta

utkarsh champ

Ranking: New Member

Mensajes: 6

Fecha de incorporación: 16 de mayo de 2013

Mensajes recientes

Hi Hari,

We have 3 community or you can say role, based on role i want to load the default page. Same way i want to get rid out of Docbar and Go To option.

Is that doable to remove Go To option based on role and also specify the default page?

BR,
Utkarsh