use of org.apereo.portal.url.IPortalRequestInfo in project uPortal by Jasig.
the class PortalController method renderExclusive.
@RequestMapping(headers = { "org.apereo.portal.url.UrlType=RENDER", "org.apereo.portal.url.UrlState.EXCLUSIVE=true" })
public void renderExclusive(HttpServletRequest request, HttpServletResponse response) {
final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(request);
final IPortletRequestInfo portletRequestInfo = portalRequestInfo.getTargetedPortletRequestInfo();
if (portletRequestInfo == null) {
throw new IllegalArgumentException("A portlet must be targeted when using the EXCLUSIVE WindowState: " + portalRequestInfo);
}
final IPortletWindowId portletWindowId = portletRequestInfo.getPortletWindowId();
this.portletExecutionManager.getPortletOutput(portletWindowId, request, response);
}
use of org.apereo.portal.url.IPortalRequestInfo in project uPortal by Jasig.
the class PortalController method resourceRequest.
@RequestMapping(headers = { "org.apereo.portal.url.UrlType=RESOURCE" })
public void resourceRequest(HttpServletRequest request, HttpServletResponse response) {
final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(request);
final IPortletRequestInfo portletRequestInfo = portalRequestInfo.getTargetedPortletRequestInfo();
if (portletRequestInfo != null) {
final IPortletWindowId targetWindowId = portletRequestInfo.getPortletWindowId();
this.portletExecutionManager.doPortletServeResource(targetWindowId, request, response);
} else {
this.logger.error("portletRequestInfo was null for resourceRequest");
}
}
use of org.apereo.portal.url.IPortalRequestInfo in project uPortal by Jasig.
the class RequestRenderingPipelineUtilsImpl method getPortletDefinitionFromServletRequest.
@Override
public IPortletDefinition getPortletDefinitionFromServletRequest(HttpServletRequest request) {
final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(request);
if (portalRequestInfo != null && portalRequestInfo.getTargetedPortletWindowId() != null) {
IPortletWindowId targetedPortletWindowId = portalRequestInfo.getTargetedPortletWindowId();
IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(request, targetedPortletWindowId);
if (portletWindow != null && portletWindow.getPortletEntity() != null) {
final IPortletEntity portletEntity = portletWindow.getPortletEntity();
IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
return portletDefinition;
}
}
return null;
}
use of org.apereo.portal.url.IPortalRequestInfo in project uPortal by Jasig.
the class PortletRendererImpl method publishRenderEvent.
/**
* Publish the portlet render event
*/
protected void publishRenderEvent(IPortletWindow portletWindow, HttpServletRequest httpServletRequest, RenderPart renderPart, long executionTime, boolean cached) {
final IPortletWindowId portletWindowId = portletWindow.getPortletWindowId();
// Determine if the portlet was targeted
final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(httpServletRequest);
final boolean targeted = portletWindowId.equals(portalRequestInfo.getTargetedPortletWindowId());
renderPart.publishRenderExecutionEvent(this.portalEventFactory, this, httpServletRequest, portletWindowId, executionTime, targeted, cached);
}
use of org.apereo.portal.url.IPortalRequestInfo in project uPortal by Jasig.
the class WindowStateSettingsStAXComponent method getEventReader.
/* (non-Javadoc)
* @see org.apereo.portal.rendering.PipelineComponent#getEventReader(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
@Override
public PipelineEventReader<XMLEventReader, XMLEvent> getEventReader(HttpServletRequest request, HttpServletResponse response) {
final PipelineEventReader<XMLEventReader, XMLEvent> pipelineEventReader = this.wrappedComponent.getEventReader(request, response);
final XMLEventReader eventReader = pipelineEventReader.getEventReader();
final IStylesheetDescriptor stylesheetDescriptor = stylesheetAttributeSource.getStylesheetDescriptor(request);
final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(request);
final XMLEventReader filteredEventReader;
if (portalRequestInfo.getTargetedPortletWindowId() == null) {
final IStylesheetParameterDescriptor defaultWindowStateParam = stylesheetDescriptor.getStylesheetParameterDescriptor("dashboardForcedWindowState");
if (defaultWindowStateParam != null) {
// Set all window states to the specified default
final WindowState windowState = PortletUtils.getWindowState(defaultWindowStateParam.getDefaultValue());
filteredEventReader = new SinglePortletWindowStateSettingXMLEventReader(request, eventReader, windowState);
} else {
// Make sure there aren't any portlets in a "targeted" window state
filteredEventReader = new NonTargetedPortletWindowStateSettingXMLEventReader(request, eventReader);
}
} else {
// Not mobile, don't bother filtering
filteredEventReader = eventReader;
}
final Map<String, String> outputProperties = pipelineEventReader.getOutputProperties();
return new PipelineEventReaderImpl<XMLEventReader, XMLEvent>(filteredEventReader, outputProperties);
}
Aggregations