Foros de discusión

Programatic way to find out portlet position and column(1 or 2 or 3)

suresh vadlamudi, modificado hace 12 años.

Programatic way to find out portlet position and column(1 or 2 or 3)

Junior Member Mensajes: 33 Fecha de incorporación: 8/09/10 Mensajes recientes
Hi All,

I need the code for finding out portlet position and column(1 or 2 or 3) based on the portlet id and layout name.My requirement is .. i have a three column layout applied to a page ....under column-1 i have 4 webcontent display portlet added with different contents added ....Column-2 also having 3 Webcontent display portletes added with different content added ...same way column-3 also.Now i am trying to replace the content of Column-1 ---second wecontentDisplay portlet same way column-3 first webContent display portlets content.But i am not getting a way to find out the Column and position based on the portletid and layout name.

Please suggest me on this.

Thanks in advance
Suresh.Vadlamudi
thumbnail
David H Nebinger, modificado hace 12 años.

RE: Programatic way to find out portlet position and column(1 or 2 or 3)

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Because a portlet should not care about how the portal chooses to aggregate the contents...
suresh vadlamudi, modificado hace 12 años.

RE: Programatic way to find out portlet position and column(1 or 2 or 3)

Junior Member Mensajes: 33 Fecha de incorporación: 8/09/10 Mensajes recientes
Hi David ,

Thankq for the responce.Actually i am looking for a API call which will give me the position and column of a given portletID and layoutId.i mean using this line
List<Portlet> portlets = layoutTypePortlet.getAllPortlets(); i will get all the portlets on that page ...now i will pass each portletId and layoutId or Name which i already have ...is thr any Api call which will give me the position and column of the portlet which i pass as a param.

Thanks in advance
Suresh.Vadlamudi
thumbnail
Jitendra Rajput, modificado hace 12 años.

RE: Programatic way to find out portlet position and column(1 or 2 or 3)

Liferay Master Mensajes: 875 Fecha de incorporación: 7/01/11 Mensajes recientes
Not sure .. But try to get read typeSettings from layout table. It will give you portlet deployed on that particular page ..

you will get some thing like this



sitemap-include=1
sitemap-changefreq=daily
layout-template-id=2_columns_ii
column-2=requestdashboard_WAR_portlet


And from above data you can get which ever required for you ..

Hope this helps ..emoticon
thumbnail
Hitoshi Ozawa, modificado hace 12 años.

RE: Programatic way to find out portlet position and column(1 or 2 or 3)

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
There some information about portlet layout in the following page but you'll have to dig into the code to find how it's actually being done.
http://www.liferay.com/community/wiki/-/wiki/Main/Layout

Also, check the child page.
http://www.liferay.com/community/wiki/-/wiki/Main/Add+runtime+portlets+to+a+layout

That said, I'm not too sure what you're trying to do. Are you disabling users from modifying their pages and setting portlets on a page dynamically?
if so, you should know which portlets are placed where.