use of org.apereo.portal.url.IPortalRequestInfo in project uPortal by Jasig.
the class FocusedOnOnePortletPredicate method apply.
@Override
public boolean apply(final HttpServletRequest request) {
final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(request);
if (null == portalRequestInfo) {
logger.warn("Portal request info was not available for this request, " + "so assuming that it does not represent focus on one portlet.");
// focused-on-one-portlet portal state.
return false;
}
final UrlState urlState = portalRequestInfo.getUrlState();
// true when there is a portal request and that request is not for a portal in NORMAL state
// i.e. portal is in some other state, like Maximized or Exclusive or Detached.
// false otherwise.
final boolean doesRequestFocusOnOnePortlet = (!(UrlState.NORMAL.equals(urlState)));
logger.debug("Determined request with UrlState {} {} focus on one portlet.", urlState, doesRequestFocusOnOnePortlet ? "does" : "does not");
return doesRequestFocusOnOnePortlet;
}
use of org.apereo.portal.url.IPortalRequestInfo in project uPortal by Jasig.
the class URLInSpecificState method apply.
@Override
public boolean apply(final HttpServletRequest request) {
final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(request);
if (null == portalRequestInfo) {
logger.warn("Portal request info was not available for this request, " + "so assuming that it does not represent focus on one portlet.");
// focused-on-one-portlet portal state.
return false;
}
final UrlState urlState = portalRequestInfo.getUrlState();
boolean stateEqual = urlState.toString().equals(state);
return isNegated ? !stateEqual : stateEqual;
}
use of org.apereo.portal.url.IPortalRequestInfo in project uPortal by Jasig.
the class LocalPortletRequestContextServiceImpl method getPortletActionRequestContext.
/* (non-Javadoc)
* @see org.apache.pluto.container.PortletRequestContextService#getPortletActionRequestContext(org.apache.pluto.container.PortletContainer, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.pluto.container.PortletWindow)
*/
@Override
public PortletRequestContext getPortletActionRequestContext(PortletContainer container, HttpServletRequest containerRequest, HttpServletResponse containerResponse, PortletWindow window) {
final IPortletWindow portletWindow = this.portletWindowRegistry.convertPortletWindow(containerRequest, window);
final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(containerRequest);
return new PortletRequestContextImpl(container, portletWindow, containerRequest, containerResponse, this.requestPropertiesManager, portalRequestInfo, portletCookieService, requestAttributeService);
}
use of org.apereo.portal.url.IPortalRequestInfo in project uPortal by Jasig.
the class LocalPortletRequestContextServiceImpl method getPortletEventRequestContext.
/* (non-Javadoc)
* @see org.apache.pluto.container.PortletRequestContextService#getPortletEventRequestContext(org.apache.pluto.container.PortletContainer, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.pluto.container.PortletWindow)
*/
@Override
public PortletRequestContext getPortletEventRequestContext(PortletContainer container, HttpServletRequest containerRequest, HttpServletResponse containerResponse, PortletWindow window) {
final IPortletWindow portletWindow = this.portletWindowRegistry.convertPortletWindow(containerRequest, window);
final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(containerRequest);
return new PortletRequestContextImpl(container, portletWindow, containerRequest, containerResponse, this.requestPropertiesManager, portalRequestInfo, portletCookieService, requestAttributeService);
}
use of org.apereo.portal.url.IPortalRequestInfo in project uPortal by Jasig.
the class AnalyticsIncorporationComponent method serializePageData.
protected String serializePageData(HttpServletRequest request, long startTime) {
final Map<String, Object> pageData = new HashMap<>();
pageData.put("executionTimeNano", System.nanoTime() - startTime);
final IPortalRequestInfo portalRequestInfo = urlSyntaxProvider.getPortalRequestInfo(request);
pageData.put("urlState", portalRequestInfo.getUrlState());
final String targetedLayoutNodeId = portalRequestInfo.getTargetedLayoutNodeId();
if (targetedLayoutNodeId != null) {
final AggregatedTabMapping mappedTabForLayoutId = aggregatedTabLookupDao.getMappedTabForLayoutId(targetedLayoutNodeId);
pageData.put("tab", mappedTabForLayoutId);
}
try {
return mapper.writeValueAsString(pageData);
} catch (JsonParseException e) {
logger.warn("Failed to convert this request's page data to JSON, no page level analytics will be included", e);
} catch (JsonMappingException e) {
logger.warn("Failed to convert this request's page data to JSON, no page level analytics will be included", e);
} catch (IOException e) {
logger.warn("Failed to convert this request's page data to JSON, no page level analytics will be included", e);
}
return "{}";
}
Aggregations