JSR286: Wildcards in Eventing

The eventing feature in JSR 286 supports wildcard. In order to use wildcard, the portlet must organize the local part of the event names in the event-definition element in a hierarchical manner using the dot(‘.’) as separator. for example: "foo.event.one". 

Wildcards should only be used in the supported-processing-event or supported-publishing-event elements.

If the wildcard string should match a part of a hierarchy two dots are required at the end of the wildcard string: one to denote the hierarchy and one for the wildcard, for example: "foo..".

The event name must be part of the hierarchy, not a substring. For example "foo." matches "foo.bar", but it does not match "football"


Consider the following example:

<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
             http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
             id="myPortletApp" version="2.0">
   <portlet>
      ...
      <portlet-name>Portlet1</portlet-name>
      ...
      <supported-publishing-event>
         <qname xmlns:x=”http:example.com/events”>x:foo.event.</qname>
      </supported-publishing-event>
      ...
   </portlet>
   <portlet>
      ...
      <portlet-name>Portlet2</portlet-name>
      ...
      <supported-processing-event>
         <qname xmlns:x=”http:example.com/events”>x:foo.event.</qname>
      </supported-processing-event>
      ...
   </portlet>
   <portlet>
      ...
      <portlet-name>Portlet3</portlet-name>
      ...
      <supported-processing-event>
         <qname xmlns:x=”http:example.com/events”>x:foo..</qname>
      </supported-processing-event>
      ...
   </portlet>
   <portlet>
      ...
      <portlet-name>Portlet4</portlet-name>
      ...
      <supported-processing-event>
         <qname xmlns:x=”http:example.com/events”>x:foo.e.</qname>
      </supported-processing-event>
      ...
   </portlet>

   <event-definition>
      <qname xmlns:x=”http:example.com/events”>x:foo.event.one</qname>
      <value-type>com.example.Address</value-type>
   </event-definition>
   <event-definition>
      <qname xmlns:x=”http:example.com/events”>x:foo.event.two</qname>
      <value-type>com.example.Address</value-type>
   </event-definition>
   <event-definition>
      <qname xmlns:x=”http:example.com/events”>x:foo.bar.event</qname>
      <value-type>com.example.Address</value-type>
   </event-definition>
</portlet-app>

  • Portlet1 can publish the events x:foo.event.one and x:foo.event.two as the event definitions "x:foo.event.one" and "x:foo.event.two" begins with "x:foo.event."
  • Portlet2 can process the events x:foo.event.one and x:foo.event.two as the event definitions "x:foo.event.one" and "x:foo.event.two" begins with "x:foo.event."
  • Portlet3 can process the events x:foo.event.one, x:foo.event.two and x:foo.bar.event as the event definitions "x:foo.event.one", "x:foo.event.two" and "x:foo.bar.event" begins with the hierarchy "x:foo."
  • Portlet4 cannot process any event as there is no event that begins with the hierarchy x:foo.e. (Note: e. and event. are two different hierarchies, i.e, e. does not mean starting with e)

The recently released OpenPortal Portlet Container 2.0 supports wildcard in eventing.

Comments:

Hello Deepak Ji, Please help me in developing JSF complaint Inter Portlet Communication by putting some samples and letting me know. How to build IPC portlet and use JSF within it..

Posted by Bimal Thapa on July 05, 2008 at 08:05 AM IST #

Hi Bimal Ji, you can check portal server forum thread " http://forum.java.sun.com/thread.jspa?threadID=5174029" . Also if you pose queries in the forum, you can get responses from the community, this would help you and all.

Posted by Deepak Gothe on July 07, 2008 at 04:38 AM IST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Deepak Gothe

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today