Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
S P
Displaying portlets based on hyperlinks using IPC
September 2, 2012 11:04 PM
Answer

S P

Rank: Junior Member

Posts: 65

Join Date: August 6, 2012

Recent Posts

Hi All,
I am trying to display portlets based on click on a hyperlink,could you please help me on this.
I have created 4 custom portlets(portlet1,portlet2,portlet3,portlet4).
one of the portlets i am using as menu bar on that i have 3 hyperlinks like Test1,Test2 and Test3. and this links are available when i am logged in to system.
After successfully logged in when i am trying to click on Test1 link ,i want to open portlet2 and its working fine,i have done using IPC.

but that portlet is displaying by default for all the links and even in home page.could you tell me how to hide the portlet2,only it should visible on click of a link.

Thanks in Advance.
S P
RE: Displaying portlets based on hyperlinks using IPC
September 3, 2012 2:15 AM
Answer

S P

Rank: Junior Member

Posts: 65

Join Date: August 6, 2012

Recent Posts

Hi All,
Could you please suggest or any links will be really greatful.


Thanks.
Stian Sigvartsen
RE: Displaying portlets based on hyperlinks using IPC
September 3, 2012 2:24 AM
Answer

Stian Sigvartsen

Rank: Regular Member

Posts: 103

Join Date: August 27, 2010

Recent Posts

Can you explain how your IPC has been designed? Then I may be able to help.

-Stian
S P
RE: Displaying portlets based on hyperlinks using IPC
September 3, 2012 3:50 AM
Answer

S P

Rank: Junior Member

Posts: 65

Join Date: August 6, 2012

Recent Posts

Thank you Stian.

yes I have designed ipc as
in portlet.xml
here is the steps i have done.
<portlet>
<portlet-name>Portlet1</portlet-name>
<supported-publishing-event>
<qname xmlns:x="http://liferay.com/events">x:sample.sendRequest</qname>
</supported-publishing-event>
</portlet>

<portlet>
<portlet-name>Portlet2</portlet-name>
<supported-publishing-event>
<qname xmlns:x="http://liferay.com/events">x:sample.sendRequest</qname>
</supported-publishing-event>
</portlet>

<portlet>
<portlet-name>Portlet2</portlet-name>
<supported-publishing-event>
<qname xmlns:x="http://liferay.com/events">x:sample.sendRequest</qname>
</supported-publishing-event>
</portlet>

<portlet>
<portlet-name>Portlet2</portlet-name>
<supported-processing-event>
<qname xmlns:x="http://liferay.com/events">x:sample.sendRequest</qname>
</supported-processing-event>
</portlet>

<event-definition>
<qname xmlns:w="http://www.liferay.com/events">x:sample.sendRequest</qname>
</event-definition>


in portlet1,i am using as Request sender and portlet2 as receiver.

and its working fine.but porlet2 should only visible if i click on particular link ,currently by default without clicking on link or logged in ,its coming.

Please suggest me if you need more info.

Thanks in advance
Stian Sigvartsen
RE: Displaying portlets based on hyperlinks using IPC
September 3, 2012 4:07 PM
Answer

Stian Sigvartsen

Rank: Regular Member

Posts: 103

Join Date: August 27, 2010

Recent Posts

I would recommend that you introduce a render parameter which can be checked during the rendering phase of portlet2. The default value of this parameter should cause portlet2 to respond with no content. Then all portlet2 has to do is process the event published by portlet1 (the menu portlet) and set the render parameter to a non-default value which will cause it to render content.

Does this solve your problem?
S P
RE: Displaying portlets based on hyperlinks using IPC
September 6, 2012 12:24 AM
Answer

S P

Rank: Junior Member

Posts: 65

Join Date: August 6, 2012

Recent Posts

Thanks very much Stain.
I am sorry to reply late,as i was got little busy doing weblogic10.3.1,jsf,Liferay portal bridge,primefaces integration.
I am definatly try your suggestion.and i will update on that.

Thanks a lot.
S P
RE: Displaying portlets based on hyperlinks using IPC
September 14, 2012 2:31 AM
Answer

S P

Rank: Junior Member

Posts: 65

Join Date: August 6, 2012

Recent Posts

Hi All,
I am ttrying IPC using rendered parameter.
based on the following link
http://www.liferay.com/community/wiki/-/wiki/Main/Portlet+to+Portlet+Communication


and I am trying to place this line inside
liferay-portlet.xml

1<private-session-attributes></private-session-attributes>
but i am getting compilation error ,basically this attribute is giving error.

Any idea will be really helpful.

 1The content of element type "portlet" must match "(portlet-name,icon?,virtual-path?,struts-path?,parent-struts-path?,configuration-path?,configuration-action-class?,indexer-
 2 class*,open-search-class?,scheduler-entry*,portlet-url-class?,friendly-url-mapper-class?,friendly-url-mapping?,friendly-url-routes?,url-encoder-class?,portlet-data-handler-
 3 class?,portlet-layout-listener-class?,poller-processor-class?,pop-message-listener-class?,social-activity-interpreter-class?,social-request-interpreter-class?,webdav-storage-
 4 token?,webdav-storage-class?,xml-rpc-method-class?,control-panel-entry-category?,control-panel-entry-weight?,control-panel-entry-class?,asset-renderer-factory*,atom-
 5 collection-adapter*,custom-attributes-display*,permission-propagator?,workflow-handler*,preferences-company-wide?,preferences-unique-per-layout?,preferences-owned-by-
 6 group?,use-default-template?,show-portlet-access-denied?,show-portlet-inactive?,action-url-redirect?,restore-current-view?,maximize-edit?,maximize-help?,pop-up-print?,layout-
 7 cacheable?,instanceable?,remoteable?,scopeable?,user-principal-strategy?,private-request-attributes?,private-session-attributes?,autopropagated-parameters?,action-
 8 timeout?,render-timeout?,render-weight?,ajaxable?,header-portal-css*,header-portlet-css*,header-portal-javascript*,header-portlet-javascript*,footer-portal-css*,footer-portlet-
 9 css*,footer-portal-javascript*,footer-portlet-javascript*,css-class-wrapper?,facebook-integration?,add-default-resource?,system?,active?,include?)".



Basically i have two portlets p1 and p2 ,in p1 i am setting a value in p2 i am trying to read but i am unable to recive the value.

Thanks.
S P
RE: Displaying portlets based on hyperlinks using IPC
September 14, 2012 2:32 AM
Answer

S P

Rank: Junior Member

Posts: 65

Join Date: August 6, 2012

Recent Posts

1<private-session-attributes>false</private-session-attributes>