use of org.apereo.portal.portlet.om.IPortletEntity in project uPortal by Jasig.
the class PortletCacheControlServiceImpl method purgeCachedPortletData.
@Override
public boolean purgeCachedPortletData(IPortletWindowId portletWindowId, HttpServletRequest httpRequest) {
final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(httpRequest, portletWindowId);
final IPortletEntity entity = portletWindow.getPortletEntity();
final IPortletDefinitionId definitionId = entity.getPortletDefinitionId();
final HttpSession session = httpRequest.getSession();
int purgeCount = 0;
// Remove all publicly cached data
purgeCount += this.taggedCacheEntryPurger.purgeCacheEntries(PublicPortletCacheKey.createTag(definitionId));
// Remove all privately cached data
purgeCount += this.taggedCacheEntryPurger.purgeCacheEntries(PrivatePortletCacheKey.createTag(session.getId(), portletWindowId));
logger.debug("Purging all cached data for {} removed {} keys", portletWindow, purgeCount);
return purgeCount != 0;
}
use of org.apereo.portal.portlet.om.IPortletEntity in project uPortal by Jasig.
the class CachedPasswordUserInfoService method isPasswordRequested.
/**
* Determine whether the portlet has expects a password as one of the user attributes.
*
* @param request portlet request
* @param plutoPortletWindow portlet window
* @return <code>true</code> if a password is expected, <code>false</code> otherwise
* @throws PortletContainerException if expeced attributes cannot be determined
*/
public boolean isPasswordRequested(PortletRequest request, PortletWindow plutoPortletWindow) throws PortletContainerException {
// get the list of requested user attributes
final HttpServletRequest httpServletRequest = this.portalRequestUtils.getPortletHttpRequest(request);
final IPortletWindow portletWindow = this.portletWindowRegistry.convertPortletWindow(httpServletRequest, plutoPortletWindow);
final IPortletEntity portletEntity = portletWindow.getPortletEntity();
final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
final PortletApplicationDefinition portletApplicationDescriptor = this.portletDefinitionRegistry.getParentPortletApplicationDescriptor(portletDefinition.getPortletDefinitionId());
// check to see if the password key is one of the requested user attributes
List<? extends UserAttribute> requestedUserAttributes = portletApplicationDescriptor.getUserAttributes();
for (final UserAttribute userAttributeDD : requestedUserAttributes) {
final String attributeName = userAttributeDD.getName();
if (attributeName.equals(this.passwordKey))
return true;
}
// if the password key wasn't found in the list of requested attributes
return false;
}
use of org.apereo.portal.portlet.om.IPortletEntity in project uPortal by Jasig.
the class PersonDirectoryUserInfoService method getExpectedUserAttributes.
/**
* Get the list of user attributes the portlet expects
*
* @param request The current request.
* @param portletWindow The window to get the expected user attributes for.
* @return The List of expected user attributes for the portlet
* @throws PortletContainerException If expected attributes cannot be determined
*/
protected List<? extends UserAttribute> getExpectedUserAttributes(HttpServletRequest request, final IPortletWindow portletWindow) throws PortletContainerException {
final IPortletEntity portletEntity = portletWindow.getPortletEntity();
final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
final PortletApplicationDefinition portletApplicationDescriptor = this.portletDefinitionRegistry.getParentPortletApplicationDescriptor(portletDefinition.getPortletDefinitionId());
return portletApplicationDescriptor.getUserAttributes();
}
use of org.apereo.portal.portlet.om.IPortletEntity in project uPortal by Jasig.
the class PortletEnvironmentServiceImpl method createPortletSession.
@Override
public PortletSession createPortletSession(PortletContext portletContext, PortletWindow portletWindow, HttpSession session) {
// TODO pluto 1.1 PortletEnvironmentService#createPortletSession passed in the request; now
// use IPortalRequestUtils#getCurrentPortalRequest()?
final HttpServletRequest request = portalRequestUtils.getCurrentPortalRequest();
final IPortletWindow internalPortletWindow = this.portletWindowRegistry.convertPortletWindow(request, portletWindow);
final IPortletEntity portletEntity = internalPortletWindow.getPortletEntity();
final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId();
return new ScopingPortletSessionImpl(portletEntityId, portletContext, portletWindow, session);
}
use of org.apereo.portal.portlet.om.IPortletEntity in project uPortal by Jasig.
the class RequestAttributeServiceImpl method getExpectedUserAttributes.
/**
* Get the list of user attributes the portlet expects.
*
* @param request The current request.
* @param portletWindow The window to get the expected user attributes for.
* @return The List of expected user attributes for the portlet
*/
protected List<? extends UserAttribute> getExpectedUserAttributes(HttpServletRequest request, final IPortletWindow portletWindow) {
final IPortletEntity portletEntity = portletWindow.getPortletEntity();
final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
final PortletApplicationDefinition portletApplicationDescriptor = this.portletDefinitionRegistry.getParentPortletApplicationDescriptor(portletDefinition.getPortletDefinitionId());
return portletApplicationDescriptor.getUserAttributes();
}
Aggregations