This content has been marked as final.
Show 5 replies
-
1. Re: Multi-CMSPortletWindow uri change with one URL
zeenia Jun 25, 2008 1:24 AM (in response to cavani)I have read that you have made an application on Multi-CMSPortletWindow uri change with one URL.
I'm working on the same thing,so if i can get your complete code,i'll be in a better position to understand what you are doing actually.
looking forward to your reply
thanks.
My e-mail Id-- zeenia.arora@lntinfotech.com -
2. Re: Multi-CMSPortletWindow uri change with one URL
cavani Jun 25, 2008 9:38 AM (in response to cavani)It is not working yet.
I get the following "a href" updating Related but Content don't change (with IPC):/portal/MyPortal/default/Content?action=2&uri=/ItemN/index.html
I will separate the IPC code for test soon and post it.
Let me know if you get it working.
thanks, -
3. Re: Multi-CMSPortletWindow uri change with one URL
cavani Jun 25, 2008 5:27 PM (in response to cavani)This is a simple code that I isolated to further tests:
public class Listener implements PortalNodeEventListener { public PortalNodeEvent onEvent(final PortalNodeEventContext context, final PortalNodeEvent event) { if (!(event instanceof WindowNavigationEvent)) return context.dispatch(); 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(); final String uri = param[0].replace(".html", "_related.html"); final PortalNode otherNode = node.resolve("../Related"); WindowNavigationEvent otherEvent = new WindowNavigationEvent(otherNode); Map<String, String[]> otheParameters = new HashMap<String, String[]>(); otheParameters.put("uri", new String[] { uri }); otherEvent.setParameters(otheParameters); return otherEvent; } }
I set this listener on Content window.
Its working as I said before: No Content update, just Related.
Thanks, -
4. Re: Multi-CMSPortletWindow uri change with one URL
cavani Jun 25, 2008 7:46 PM (in response to cavani)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, -
5. Re: Multi-CMSPortletWindow uri change with one URL
cavani Jun 25, 2008 7:50 PM (in response to cavani)Oops... listener binging to page.... no Content...
Damn!!....
Thanks,