Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
S P
Suggestion and best practice for liferay portlet query
September 19, 2012 12:31 AM
Answer

S P

Rank: Junior Member

Posts: 65

Join Date: August 6, 2012

Recent Posts

Hello guys,
I have created 4 portlets ,3 using jsf2/primefaces ,i have used sample from liferay-primefaces demo ,its very good,working fine.
and 1 portlet i have created using liferay mvc portlet.

and i have connected through ipc events with all 3 portlets.
but now i am getting difficulties while displaying to users.
for example : when a user is not sign in ,some portlets should not visible,so i have managed to set portlet configuration for users.
but once logged in by default all portlets are coming but i want to hid those portlets,these portlets should only visible on click of links ,and each porlets should over ride ,other page which clicked on different link.
i have created 1-2-i column layout,on left layout i have set portlet1 and right hand side i have other portlets.
Please find the image url





Can anybody help/suggest me , what could be the best solution or suggestion for developing above scenario(css desin/iframe will it be good,or setting runtimeportlet embed util) ?
Thanks in advance!
S P
RE: Suggestion and best practice for liferay portlet query
September 19, 2012 3:33 AM
Answer

S P

Rank: Junior Member

Posts: 65

Join Date: August 6, 2012

Recent Posts

any idea?
KK rajput
RE: Suggestion and best practice for liferay portlet query
September 20, 2012 8:39 AM
Answer

KK rajput

Rank: Expert

Posts: 266

Join Date: April 10, 2008

Recent Posts

HI S.P,
As per my understanding the best option is that you display second portlet on runtime. You do not add second portlet on the page but onclick it should display. It is quite simple you need to add default-resource property in liferay-portlet.xml as true. after that you just invoke portlet url corresponding to link.

Hope this helps but still you face problem let me know.
S P
RE: Suggestion and best practice for liferay portlet query
September 20, 2012 11:05 PM
Answer

S P

Rank: Junior Member

Posts: 65

Join Date: August 6, 2012

Recent Posts

Hi Rajput,
Thanks very much for your reply.

I am trying this option but still its not happening. emoticon

 1<portlet>
 2        <portlet-name>pitcherportlet</portlet-name>
 3        <icon>/icon.png</icon>
 4        <instanceable>false</instanceable>
 5        <header-portlet-css>/css/main.css</header-portlet-css>
 6        <footer-portlet-javascript>
 7            /js/main.js
 8        </footer-portlet-javascript>
 9        <css-class-wrapper>pitcherportlet-portlet</css-class-wrapper>
10        <add-default-resource>true</add-default-resource>
11    </portlet>
KK rajput
RE: Suggestion and best practice for liferay portlet query
October 2, 2012 9:39 PM
Answer

KK rajput

Rank: Expert

Posts: 266

Join Date: April 10, 2008

Recent Posts

Hi S P,
can you show me your complete code regarding how you are invoking other portlet.
S P
RE: Suggestion and best practice for liferay portlet query
October 8, 2012 10:55 PM
Answer

S P

Rank: Junior Member

Posts: 65

Join Date: August 6, 2012

Recent Posts

Hi Rajput,
I am sorry for replying late.
I have tried as per you suggested.
Here is the sample i download from source forge
1
2http://sourceforge.net/projects/lportal/files/Liferay%20Plugins/6.1.0%20RC1/sample-icefaces-ipc-ajax-push-portlet-6.1.0.1-ce-rc1-20111219113511317.war/download?utm_expid=6384-3&utm_referrer=http%3A%2F%2Fsourceforge.net%2Fprojects%2Flportal%2Ffiles%2FLiferay%2520Plugins%2F6.1.0%2520RC1%2F


in the same war file there is liferay-portlet.xml file
 1
 2<?xml version="1.0"?>
 3<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 6.1.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_6_1_0.dtd">
 4
 5<liferay-portlet-app>
 6    <portlet>
 7        <portlet-name>sample_icefaces_ipc_customers_portlet</portlet-name>
 8        <instanceable>true</instanceable>
 9    </portlet>
10    <portlet>
11        <portlet-name>sample_icefaces_ipc_bookings_portlet</portlet-name>
12        <instanceable>true</instanceable>
13[b]        <add-default-resource>true</add-default-resource>[/b]
14    </portlet>
15    <role-mapper>
16        <role-name>administrator</role-name>
17        <role-link>Administrator</role-link>
18    </role-mapper>
19    <role-mapper>
20        <role-name>guest</role-name>
21        <role-link>Guest</role-link>
22    </role-mapper>
23    <role-mapper>
24        <role-name>power-user</role-name>
25        <role-link>Power User</role-link>
26    </role-mapper>
27    <role-mapper>
28        <role-name>user</role-name>
29        <role-link>User</role-link>
30    </role-mapper>
31</liferay-portlet-app>


and i have deployed this war file in liferay ,used default layout 1-2(30/70) and dragged customers portlet and not booking portlet,on click of customers ,booking portlet should dynamically load.
<add-default-resource>true</add-default-resource>

but still its not reflecting,please give your view/suggestion on this.


Thanks in Advance.
Neil Griffin
RE: Suggestion and best practice for liferay portlet query
October 30, 2012 12:14 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2335

Join Date: July 26, 2005

Recent Posts

The sample-icefaces-ipc-ajax-push-portlet you downloaded from SourceForge has been obsoleted by the new icefaces3-ipc-ajax-push-portlet.

However, that's probably not the best demo to try, because it uses ICEfaces Ajax Push for IPC, rather than Portlet 2.0 Events IPC. For Events, I would recommend the following two demos that are meant to be deployed at the same time, and placed on the same portal page:


Going back to the original question... If you have Portlet A and Portlet B on the same portal page, then I'm guessing your requirement is to only have Portlet B render when someone clicks on Portlet A? One way you could do that would be to have something like the following in the Facelet XHTML for Portlet B:

1
2<h:body>
3    <h:panelGroup layout="block" rendered="#{backingBean.participatingInEventsIPC}">
4    </h:panelGroup>
5</h:body>


If you turn the portlet borders off, then the portlet would basically be invisible (no visible HTML elements), even though it is partially rendered with a <div>...</div> layer.
S P
RE: Suggestion and best practice for liferay portlet query
November 14, 2012 2:13 AM
Answer

S P

Rank: Junior Member

Posts: 65

Join Date: August 6, 2012

Recent Posts

Thanks a lot Neil.
Sorry i was busy with works.I will try your suggestion and will update on that.