private void printRoute(EventRoute route, PrintWriter writer,PagePortletControllerContext context, int id, String cid) { writer.print("<div onmouseover=\"showDetails(this,'details-" + id + cid + "')\" onmouseout=\"hideDetails(this,'details-" + id + cid + "')\" onclick=\"new Effect.Highlight('" + context.getPortletInfo(route.getSource()).getName() + "', {startcolor:'#990000', endcolor:'ffffdd',queue: {position:'start', scope: 'highlight', limit:2}});new Effect.Highlight('" + context.getPortletInfo(route.getDestination()).getName() + "', {startcolor:'#990000', endcolor:'ffffdd',queue: {position:'end', scope: 'highlight', limit:2}});\" >" + "<div class=\"event-header\">\n" + " <h4>" + context.getPortletInfo(route.getSource()).getName() + "</h4>\n" + " <div>Event: " + route.getName().getLocalPart() + "</div>\n" + " </div>\n"); writer.print("<div class=\"event-body\">" + "<p><label>Source: </label>" + context.getPortletInfo(route.getSource()).getName() + "<img src=\"/simple-portal/images/debug/arrow.gif\" alt=\"\"/>"); writer.print("<label>Destination: </label>" + context.getPortletInfo(route.getDestination()).getName() + "</p>\n" + " <div class=\"details\" id=\"details-" + id + cid + "\">\n" + " <div class=\"details-frame\">\n" + " " + formatAck(route.getAcknowledgement()) + "\n" + " <div class=\"dotted-white\"></div>\n" + " <label>Payload: " + route.getPayload() + "</label>\n" + " </div>\n" + " </div></div>" + ""); writer.print("</div>"); for (EventRoute child : route.getChildren()) { id = rand(1,1000); writer.println("<div class=\"children\">"); printRoute(child, writer, context, id, "a"); writer.println("</div>"); } }
if (portlet.getInfo().getName().equals(segment.value))
public String getDisplayName(String portletName, Locale locale) { String portletDisplayName = portletName; if (portletDisplayNames.get(portletName) != null) { portletDisplayName = portletDisplayNames.get(portletName).getValue(locale, true).getString(); } else if (!isPortletDisplayNamesImported) { PortletInvoker portletInvoker = (PortletInvoker) PortalContainer.getComponent(PortletInvoker.class); try { Set<org.gatein.pc.api.Portlet> portlets = portletInvoker.getPortlets(); for (org.gatein.pc.api.Portlet portlet : portlets) { portletDisplayNames.put(portlet.getInfo().getName(), portlet.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME)); } isPortletDisplayNamesImported = true; } catch (PortletInvokerException exception) { LOG.error("Error occurred when trying to import portlets", exception); } if (portletDisplayNames.get(portletName) != null) { portletDisplayName = portletDisplayNames.get(portletName).getValue(locale, true).getString(); } } return portletDisplayName; }
public PagePortletControllerContext( HttpServletRequest req, HttpServletResponse resp, PortletInvoker invoker, ServletContext servletContext, PortalPrepareResponse prepareResponse) throws IllegalRequestException, IOException, ServletException, PortletInvokerException { super(req, resp); // Map<Key, Portlet> portlets = new HashMap<Key, Portlet>(); for (Portlet portlet : invoker.getPortlets()) { PortletInfo portletInfo = portlet.getInfo(); String portletName = portletInfo.getName(); String applicationName = portletInfo.getApplicationName(); Key key = new Key(applicationName, portletName); portlets.put(key, portlet); } // this.invoker = invoker; this.portlets = portlets; this.prepareResponse = prepareResponse; this.stateControllerContext = new StateControllerContextImpl(this); this.eventControllerContext = new PageEventControllerContext(this, prepareResponse); this.serialization = new PortletPageNavigationalStateSerialization(stateControllerContext); }
&& portlet.getInfo().getName().equals(portletName))