Search in sources :

Example 1 with ContainerRuntimeOption

use of org.apache.pluto.container.om.portlet.ContainerRuntimeOption in project uPortal by Jasig.

the class PortletExecutionManager method doesPortletNeedHeaderWorker.

/**
     * @param portletWindowId
     * @param request
     * @return
     */
protected boolean doesPortletNeedHeaderWorker(IPortletWindowId portletWindowId, HttpServletRequest request) {
    IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(request, portletWindowId);
    PortletDefinition portletDefinition = portletWindow.getPlutoPortletWindow().getPortletDefinition();
    ContainerRuntimeOption renderHeaderOption = portletDefinition.getContainerRuntimeOption(PORTLET_RENDER_HEADERS_OPTION);
    boolean result = false;
    if (renderHeaderOption != null) {
        result = renderHeaderOption.getValues().contains(Boolean.TRUE.toString());
    }
    logger.debug("Portlet {} need render header worker: {}", portletDefinition.getPortletName(), result);
    return result;
}
Also used : ContainerRuntimeOption(org.apache.pluto.container.om.portlet.ContainerRuntimeOption) IPortletWindow(org.apereo.portal.portlet.om.IPortletWindow) IPortletDefinition(org.apereo.portal.portlet.om.IPortletDefinition) PortletDefinition(org.apache.pluto.container.om.portlet.PortletDefinition)

Example 2 with ContainerRuntimeOption

use of org.apache.pluto.container.om.portlet.ContainerRuntimeOption in project uPortal by Jasig.

the class PortletEventCoordinatationService method isGlobalEvent.

protected boolean isGlobalEvent(HttpServletRequest request, IPortletWindowId sourceWindowId, Event event) {
    final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(request, sourceWindowId);
    final IPortletEntity portletEntity = portletWindow.getPortletEntity();
    final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
    final IPortletDefinitionId portletDefinitionId = portletDefinition.getPortletDefinitionId();
    final PortletApplicationDefinition parentPortletApplicationDescriptor = this.portletDefinitionRegistry.getParentPortletApplicationDescriptor(portletDefinitionId);
    final ContainerRuntimeOption globalEvents = parentPortletApplicationDescriptor.getContainerRuntimeOption(GLOBAL_EVENT__CONTAINER_OPTION);
    if (globalEvents != null) {
        final QName qName = event.getQName();
        final String qNameStr = qName.toString();
        for (final String globalEvent : globalEvents.getValues()) {
            if (qNameStr.equals(globalEvent)) {
                return true;
            }
        }
    }
    return false;
}
Also used : IPortletDefinitionId(org.apereo.portal.portlet.om.IPortletDefinitionId) PortletApplicationDefinition(org.apache.pluto.container.om.portlet.PortletApplicationDefinition) IPortletEntity(org.apereo.portal.portlet.om.IPortletEntity) QName(javax.xml.namespace.QName) ContainerRuntimeOption(org.apache.pluto.container.om.portlet.ContainerRuntimeOption) IPortletWindow(org.apereo.portal.portlet.om.IPortletWindow) IPortletDefinition(org.apereo.portal.portlet.om.IPortletDefinition)

Aggregations

ContainerRuntimeOption (org.apache.pluto.container.om.portlet.ContainerRuntimeOption)2 IPortletDefinition (org.apereo.portal.portlet.om.IPortletDefinition)2 IPortletWindow (org.apereo.portal.portlet.om.IPortletWindow)2 QName (javax.xml.namespace.QName)1 PortletApplicationDefinition (org.apache.pluto.container.om.portlet.PortletApplicationDefinition)1 PortletDefinition (org.apache.pluto.container.om.portlet.PortletDefinition)1 IPortletDefinitionId (org.apereo.portal.portlet.om.IPortletDefinitionId)1 IPortletEntity (org.apereo.portal.portlet.om.IPortletEntity)1