use of org.apereo.portal.portlet.om.IPortletDefinition in project uPortal by Jasig.
the class PortletExecutionManager method postExecution.
@Override
public void postExecution(HttpServletRequest request, HttpServletResponse response, IPortletExecutionContext context, Exception e) {
final IPortletWindowId portletWindowId = context.getPortletWindowId();
final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(request, portletWindowId);
final IPortletEntity portletEntity = portletWindow.getPortletEntity();
final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
final IPortletDescriptorKey portletDescriptorKey = portletDefinition.getPortletDescriptorKey();
final AtomicInteger counter = this.executionCount.get(portletDescriptorKey);
counter.incrementAndGet();
}
use of org.apereo.portal.portlet.om.IPortletDefinition in project uPortal by Jasig.
the class PortletExecutionManager method getPortletRenderTimeout.
protected long getPortletRenderTimeout(IPortletWindowId portletWindowId, HttpServletRequest request) {
if (this.ignoreTimeouts) {
return DEBUG_TIMEOUT;
}
final IPortletDefinition portletDefinition = getPortletDefinition(portletWindowId, request);
final Integer renderTimeout = portletDefinition.getRenderTimeout();
if (renderTimeout != null) {
return getModifiedTimeout(portletDefinition, request, renderTimeout);
}
return getModifiedTimeout(portletDefinition, request, portletDefinition.getTimeout());
}
use of org.apereo.portal.portlet.om.IPortletDefinition in project uPortal by Jasig.
the class PortletExecutionManager method getPortletActionTimeout.
protected long getPortletActionTimeout(IPortletWindowId portletWindowId, HttpServletRequest request) {
if (this.ignoreTimeouts) {
return DEBUG_TIMEOUT;
}
final IPortletDefinition portletDefinition = getPortletDefinition(portletWindowId, request);
final Integer actionTimeout = portletDefinition.getActionTimeout();
if (actionTimeout != null) {
return getModifiedTimeout(portletDefinition, request, actionTimeout);
}
return getModifiedTimeout(portletDefinition, request, portletDefinition.getTimeout());
}
use of org.apereo.portal.portlet.om.IPortletDefinition in project uPortal by Jasig.
the class AbstractPermissionsController method isAuthorized.
/*
* Protected API.
*/
protected final boolean isAuthorized(HttpServletRequest req) throws Exception {
/*
* This is sensitive data; we must verify that the user
* has the appropriate level of access to see it...
*/
// STEP (1): Is there an IPerson?
final IPerson person = personManager.getPerson((HttpServletRequest) req);
if (person != null) {
// STEP (2): Is the person authenticated?
final ISecurityContext securityContext = person.getSecurityContext();
if (securityContext != null && securityContext.isAuthenticated()) {
// STEP (3): Does this user have SUBSCRIBE permission for permissionsAdminChannel?
IAuthorizationPrincipal principal = authorizationService.newPrincipal((String) person.getAttribute(IPerson.USERNAME), IPerson.class);
final IPortletDefinition permissionsAdminPortlet = portletDefinitionRegistry.getPortletDefinitionByFname(PERMISSIONS_ADMIN_PORTLET_FNAME);
if (permissionsAdminPortlet == null) {
return false;
}
final String portletId = permissionsAdminPortlet.getPortletDefinitionId().getStringId();
if (authorizationService.canPrincipalSubscribe(principal, portletId)) {
return true;
}
}
}
return false;
}
use of org.apereo.portal.portlet.om.IPortletDefinition in project uPortal by Jasig.
the class RenderOnWebFlagSet method apply.
@Override
public boolean apply(final HttpServletRequest request) {
try {
final IPortletDefinition portletDefinition = utils.getPortletDefinitionFromServletRequest(request);
Iterator<IPortletPreference> iterator = portletDefinition.getPortletPreferences().iterator();
while (iterator.hasNext()) {
IPortletPreference cur = iterator.next();
if ("renderOnWeb".equalsIgnoreCase(cur.getName())) {
return cur.getValues() != null && cur.getValues().length == 1 && Boolean.parseBoolean(cur.getValues()[0]);
}
}
} catch (Exception e) {
logger.error("Failed to process renderOnWeb check for redirect during pipeline. Failing gracefully by returning false.", e);
}
return false;
}
Aggregations