Nicolas,

As Elliot has suggested, application-scoped portlet session attributes is the standard way of dealing with this issue. Michelle Osmond has created an open-source library to facilitate doing IPC in a JSR-168 compliant way. Check it out at: http://www.doc.ic.ac.uk/~mo197/portlets/portlet_messaging/
/Craig



Nicolas Kalkhof <[EMAIL PROTECTED]>

06/25/2006 09:56 AM

Please respond to
[email protected]

To
[email protected]
cc
Subject
portlet communication between JSF bridged portlets





hello folks,

first of all...iŽm pretty new to portlets so please be patient with me ;). iŽd like to build a small portal using the latest pluto-trunk and myfaces/jsf bridges. so far everything seems to be smooth but now iŽm at a point where i want to share data between portlets. example: user presses a logout button in one portlet and all other portlets change their content. how can i get a portlet to do something when i klick a submitbutton in an other portlet?

i guess i have to overwrite generic methods like doView() in my own class. this method is called, whenever a portlet refreshes, right? to achieve that i did the following:

public class LogonAction extends MyFacesGenericPortlet {
....          
public void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException {
super.doView(request, response);
}
}

unfortunately doView() is never called. is this the right way?

my portlet.xml for the portlet described above looks like this:

   <portlet>
       <portlet-name>LogonPortlet</portlet-name>                                                          
       <init-param>
           <name>ViewPage</name>
           <value>/WEB-INF/jsp/index_nolog.jsp</value>
       </init-param>        
       <init-param>
           <name>default-view</name>
           <value>/WEB-INF/jsp/index_nolog.jsp</value>
       </init-param>
       <init-param>
           <name>HelpPage</name>
           <value>/WEB-INF/jsp/help.jsp</value>
       </init-param>                
       <portlet-class>org.apache.portals.bridges.jsf.FacesPortlet</portlet-class>        
       <expiration-cache>-1</expiration-cache>        
       <supports>
           <mime-type>text/html</mime-type>
           <portlet-mode>VIEW</portlet-mode>
           <portlet-mode>HELP</portlet-mode>
       </supports>                
       <portlet-info>
           <title>login</title>
           <short-title>LogonPortlet</short-title>
           <keywords>LogonPortlet</keywords>
       </portlet-info>        
   </portlet>

and my web.xml:

 <context-param>
   <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
   <param-value>server</param-value>
 </context-param>
 <context-param>
   <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
   <param-value>true</param-value>  
 </context-param>  
 <context-param>
   <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
   <param-value>false</param-value>
 </context-param>  
 <context-param>
   <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
   <param-value>true</param-value>
 </context-param>  
 <context-param>
   <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
   <param-value>false</param-value>
 </context-param>

 <filter>
   <filter-name>extensionsFilter</filter-name>
   <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
   <init-param>
     <param-name>uploadMaxFileSize</param-name>
     <param-value>100m</param-value>
   </init-param>
   <init-param>
     <param-name>uploadThresholdSize</param-name>
     <param-value>100k</param-value>
   </init-param>
 </filter>  
 <filter-mapping>
   <filter-name>extensionsFilter</filter-name>
   <url-pattern>/PlutoInvoker/LogonPortlet</url-pattern>
 </filter-mapping>  
 
 <listener>
   <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
 </listener>
 
 <servlet>
   <servlet-name>LogonPortlet</servlet-name>
   <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>  
   <init-param>
     <param-name>portlet-name</param-name>
     <param-value>LogonPortlet</param-value>
   </init-param>
   <load-on-startup>1</load-on-startup>
 </servlet>
 
 <servlet-mapping>
   <servlet-name>LogonPortlet</servlet-name>
   <url-pattern>/PlutoInvoker/LogonPortlet</url-pattern>
 </servlet-mapping>    

any help to get me out of this mess is very much apprechiated. :)

regards,
nicolas
__________________________________________________________________________
Erweitern Sie FreeMail zu einem noch leistungsstärkeren E-Mail-Postfach!                                  
Mehr Infos unter http://freemail.web.de/home/landingpad/?mc=021131

Reply via email to