Foren

RE: Suggestion and best practice for liferay portlet query

S P, geändert vor 11 Jahren.

Suggestion and best practice for liferay portlet query

Junior Member Beiträge: 58 Beitrittsdatum: 06.08.12 Neueste Beiträge
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, geändert vor 11 Jahren.

RE: Suggestion and best practice for liferay portlet query

Junior Member Beiträge: 58 Beitrittsdatum: 06.08.12 Neueste Beiträge
any idea?
thumbnail
KK rajput, geändert vor 11 Jahren.

RE: Suggestion and best practice for liferay portlet query

Expert Beiträge: 266 Beitrittsdatum: 10.04.08 Neueste Beiträge
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, geändert vor 11 Jahren.

RE: Suggestion and best practice for liferay portlet query

Junior Member Beiträge: 58 Beitrittsdatum: 06.08.12 Neueste Beiträge
Hi Rajput,
Thanks very much for your reply.

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

<portlet>
		<portlet-name>pitcherportlet</portlet-name>
		<icon>/icon.png</icon>
		<instanceable>false</instanceable>
		<header-portlet-css>/css/main.css</header-portlet-css>
		<footer-portlet-javascript>
			/js/main.js
		</footer-portlet-javascript>
		<css-class-wrapper>pitcherportlet-portlet</css-class-wrapper>
		<add-default-resource>true</add-default-resource>
	</portlet>
thumbnail
KK rajput, geändert vor 11 Jahren.

RE: Suggestion and best practice for liferay portlet query

Expert Beiträge: 266 Beitrittsdatum: 10.04.08 Neueste Beiträge
Hi S P,
can you show me your complete code regarding how you are invoking other portlet.
S P, geändert vor 11 Jahren.

RE: Suggestion and best practice for liferay portlet query

Junior Member Beiträge: 58 Beitrittsdatum: 06.08.12 Neueste Beiträge
Hi Rajput,
I am sorry for replying late.
I have tried as per you suggested.
Here is the sample i download from source forge

http://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&amp;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

<!--?xml version="1.0"?-->


<liferay-portlet-app>
	<portlet>
		<portlet-name>sample_icefaces_ipc_customers_portlet</portlet-name>
		<instanceable>true</instanceable>
	</portlet>
	<portlet>
		<portlet-name>sample_icefaces_ipc_bookings_portlet</portlet-name>
		<instanceable>true</instanceable>
[b]		<add-default-resource>true</add-default-resource>[/b]
	</portlet>
	<role-mapper>
		<role-name>administrator</role-name>
		<role-link>Administrator</role-link>
	</role-mapper>
	<role-mapper>
		<role-name>guest</role-name>
		<role-link>Guest</role-link>
	</role-mapper>
	<role-mapper>
		<role-name>power-user</role-name>
		<role-link>Power User</role-link>
	</role-mapper>
	<role-mapper>
		<role-name>user</role-name>
		<role-link>User</role-link>
	</role-mapper>
</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.
thumbnail
Neil Griffin, geändert vor 11 Jahren.

RE: Suggestion and best practice for liferay portlet query

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
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:


<h:body>
    <h:panelgroup layout="block" rendered="#{backingBean.participatingInEventsIPC}">
    </h:panelgroup>
</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, geändert vor 11 Jahren.

RE: Suggestion and best practice for liferay portlet query

Junior Member Beiträge: 58 Beitrittsdatum: 06.08.12 Neueste Beiträge
Thanks a lot Neil.
Sorry i was busy with works.I will try your suggestion and will update on that.