public PortletInfo getInfo() { return next.getInfo(); }
public Set<Portlet> getPortlets() throws PortletInvokerException { Set<Portlet> federatedPortlets = new LinkedHashSet<Portlet>(); for (Portlet portlet : portletInvoker.getPortlets()) { Portlet federatedPortlet = new FederatedPortlet(this, reference(portlet.getContext()), portlet); federatedPortlets.add(federatedPortlet); } return federatedPortlets; }
public boolean isRemote() { return next.isRemote(); }
public Iterable<WindowEvent> eventProduced(EventPhaseContext context, WindowEvent producedEvent, WindowEvent sourceEvent) { try { LinkedList<WindowEvent> toConsume = new LinkedList<WindowEvent>(); for (Portlet portlet : invoker.getPortlets()) { PortletInfo portletInfo = portlet.getInfo(); if (portletInfo.getEventing().getConsumedEvents().containsKey(producedEvent.getName())) { WindowEvent distributedEvent = new WindowEvent(producedEvent.getName(), producedEvent.getPayload(), portlet.getContext().getId()); toConsume.addLast(distributedEvent); } } return toConsume; } catch (PortletInvokerException e) { System.out.println("e = " + e); return null; } }
if (portlet.getInfo().getApplicationName().equals(portletAppName) && portlet.getInfo().getName().equals(portletName)) involvedPortlets.add(portlet.getContext().getId());
public PortletInfo getInfo() { return next.getInfo(); }
PortletInvocationResponse response = context.render(properties.getCookies(), pageNavigationalState, portlet.getContext().getId());
public boolean isRemote() { return next.isRemote(); }
public PortletInfo getInfo() { return portlet.getInfo(); }
render.setTarget(window.portlet.getContext()); render.setRequest(req); render.setResponse(resp);
public boolean isRemote() { return portlet.isRemote(); }
public PortletInfo getPortletInfo(String windowId) { try { return getPortlet(windowId).getInfo(); } catch (PortletInvokerException e) { log.error("Could not access portlet invoker for locating window " + windowId, e); // return null; } }
public PortletInvocationResponse invoke(String windowId, List<Cookie> requestCookies, RenderInvocation renderInvocation) throws PortletInvokerException { Portlet portlet = getPortlet(windowId); // renderInvocation.setClientContext(new AbstractClientContext(req, requestCookies)); renderInvocation.setServerContext(new AbstractServerContext(req, resp)); renderInvocation.setInstanceContext(new AbstractInstanceContext(portlet.getContext().getId())); renderInvocation.setUserContext(new AbstractUserContext(req)); renderInvocation.setWindowContext(new AbstractWindowContext(windowId)); renderInvocation.setPortalContext(PORTAL_CONTEXT); renderInvocation.setSecurityContext(new AbstractSecurityContext(req)); renderInvocation.setTarget(portlet.getContext()); // return invoke(renderInvocation); }
/** * Returns the windows that can consume the wanted event name. * * @param wanted the wanted event name * @return the collection of windows that can consume the wanted event */ Collection<Window> getConsumers(QName wanted) { List<Window> consumers = null; for (Window window : windows.values()) { if (window.portlet != null) { for (QName name : window.portlet.getInfo().getEventing().getConsumedEvents().keySet()) { if (wanted.equals(name)) { if (consumers == null) { consumers = new ArrayList<Window>(); } consumers.add(window); } } } } return consumers == null ? Collections.<Window>emptyList() : consumers; } }
public PortletInvocationResponse invoke(String windowId, List<Cookie> requestCookies, EventInvocation eventInvocation) throws PortletInvokerException { Portlet portlet = getPortlet(windowId); // eventInvocation.setClientContext(new AbstractClientContext(req, requestCookies)); eventInvocation.setServerContext(new AbstractServerContext(req, resp)); eventInvocation.setInstanceContext(new AbstractInstanceContext(portlet.getContext().getId())); eventInvocation.setUserContext(new AbstractUserContext(req)); eventInvocation.setWindowContext(new AbstractWindowContext(windowId)); eventInvocation.setPortalContext(PORTAL_CONTEXT); eventInvocation.setSecurityContext(new AbstractSecurityContext(req)); eventInvocation.setTarget(portlet.getContext()); // return invoke(eventInvocation); }
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 PortletInvocationResponse invoke(String windowId, ActionInvocation actionInvocation) throws PortletInvokerException { // Portlet portlet = getPortlet(windowId); // actionInvocation.setClientContext(new AbstractClientContext(req)); actionInvocation.setServerContext(new AbstractServerContext(req, resp)); actionInvocation.setInstanceContext(new AbstractInstanceContext(portlet.getContext().getId())); actionInvocation.setUserContext(new AbstractUserContext(req)); actionInvocation.setWindowContext(new AbstractWindowContext(windowId)); actionInvocation.setPortalContext(PORTAL_CONTEXT); actionInvocation.setSecurityContext(new AbstractSecurityContext(req)); actionInvocation.setRequestContext(new AbstractRequestContext(req)); actionInvocation.setTarget(portlet.getContext()); // return invoke(actionInvocation); }
if (portlet.getInfo().getName().equals(segment.value))
resource.setTarget(window.portlet.getContext()); resource.setRequest(req); resource.setResponse(resp);
PreferencesInfo prefs = portlet.getInfo().getPreferences();