Hey dude... I am feeling very stuped right now, but know I get it!

Try it:


  | public class Listener implements PortalNodeEventListener
  | {
  | 
  |     private String uri;
  | 
  |     public PortalNodeEvent onEvent(final PortalNodeEventContext context, 
final PortalNodeEvent event)
  |     {
  |             if (event instanceof WindowNavigationEvent)
  |             {
  |                     final WindowNavigationEvent windowEvent = 
(WindowNavigationEvent) event;
  | 
  |                     final PortalNode node = windowEvent.getNode();
  | 
  |                     if (!node.getName().equals("Content"))
  |                             return context.dispatch();
  | 
  |                     final Map<String, String[]> parameters = 
windowEvent.getParameters();
  | 
  |                     final String[] param = parameters.get("uri");
  | 
  |                     if (param == null || param.length == 0 || param[0] == 
null || param[0].trim().equals(""))
  |                             return context.dispatch();
  | 
  |                     uri = param[0].replace(".html", "_related.html");
  |             }
  |             else if (event instanceof WindowRenderEvent)
  |             {
  |                     final WindowRenderEvent windowEvent = 
(WindowRenderEvent) event;
  | 
  |                     final PortalNode node = windowEvent.getNode();
  | 
  |                     if (!node.getName().equals("Related"))
  |                             return context.dispatch();
  | 
  |                     Map<String, String[]> parameters = 
windowEvent.getParameters();
  | 
  |                     parameters.put("uri", new String[] { uri });
  | 
  |                     uri = null;
  |             }
  | 
  |             return context.dispatch();
  |     }
  | 
  | }
  | 

Thanks,

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4160709
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to