[jboss-user] [JBoss Portal] - Re: problem with IPC

sbiwal do-not-reply at jboss.com
Thu May 22 02:49:22 EDT 2008


Hi Ruchika,

There are three things important deployment descriptors for a portlet in JBoss -
1) portlet.xml - this file relates a portlet name to a portlet class
2) portlet-instances.xml - this file relates the portlet name defined above to a portlet instance. Now the same portlet can have more than one instances.
3) -object.xml - usually replace the  part with the name of your portlet. This file defines a window (which is the actual view that you see in your portal) to a portlet instance. Once again the same portlet instance can be rendered using multiple windows eg you have your portlet instance in 2 or pages. The event listeners are bound to these windows. So when you declare this window (in your *-object.xml file), you should list the listener with it. Only this window of the portlet will listen to events (with the listener id specified by you) and not the other windows for the same portlet.

I am pasting an example of the *-object.xml file here -

  | <?xml version="1.0" encoding="UTF-8"?>
  | <deployments>
  | 	<deployment>
  | 		<parent-ref>myPortal</parent-ref>
  | 		<if-exists>overwrite</if-exists>
  | 		<page>
  | 			<page-name>MyPage</page-name>
  | 			<window>
  | 				<window-name>
  | 					MyPortletWindow1
  | 				</window-name>
  | 				<instance-ref>
  | 					MyPortletInstance
  | 				</instance-ref>
  | 				<listener>ipc_listener</listener>
  | 				<region>center</region>
  | 				<height>1</height>
  | 			</window>
  | 			<window>
  | 				<window-name>
  | 					MyPortletWindow2
  | 				</window-name>
  | 				<instance-ref>
  | 					MyPortletInstance
  | 				</instance-ref>
  | 				<region>left</region>
  | 				<height>1</height>
  | 			</window>
  | 		</page>
  | 	</deployment>
  | </deployments>

In the above file, note the following things -
1) You should have a portal with the name MyPortal.
2) Now a new page will be created in this portal - MyPage
3) The first window in this page - MyPortletWindow1 uses the instance MyPortletInstance and throws events with listener id ipc_listener. Whatever is your listener class associated with this listener id, will honor such events.
4) The second window in this page - MyPortletWindow2 uses the same portlet instance MyPortletInstance but does not throw events with the listener id ipc_listener
5) Now just specify your listener class in the jboss-service.xml descriptor (as specified in the reference guide) and you'll be done.

Please do not hesitate to ask me any more doubts. I struggled with this for a long time myself and would like it if my digging could help anyone.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4152555#4152555

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4152555



More information about the jboss-user mailing list