Search in sources :

Example 11 with IPortletDescriptorKey

use of org.apereo.portal.portlet.om.IPortletDescriptorKey in project uPortal by Jasig.

the class WebAppNameContainsStringPredicate method test.

@Override
public boolean test(final HttpServletRequest request) {
    try {
        final IPortletDefinition portletDefinition = utils.getPortletDefinitionFromServletRequest(request);
        IPortletDescriptorKey portletDescriptorKey = portletDefinition.getPortletDescriptorKey();
        String portletWebAppName = portletDescriptorKey.getWebAppName();
        boolean doesMatch = portletWebAppName.contains(this.webAppNameToMatch);
        if (logger.isDebugEnabled()) {
            if (doesMatch) {
                logger.debug("Predicate is true: observed web app name [{}]" + " does match configured name [{}].", portletWebAppName, this.webAppNameToMatch);
            } else {
                logger.debug("Predicate is false: observed web app name [{}]" + " does not match configured name [{}].", portletWebAppName, this.webAppNameToMatch);
            }
        }
        return doesMatch;
    } catch (Exception e) {
        logger.error("Failed to process web app name contains string check for redirect during pipeline. Failing gracefully by returning false.", e);
    }
    return false;
}
Also used : IPortletDescriptorKey(org.apereo.portal.portlet.om.IPortletDescriptorKey) IPortletDefinition(org.apereo.portal.portlet.om.IPortletDefinition)

Aggregations

IPortletDescriptorKey (org.apereo.portal.portlet.om.IPortletDescriptorKey)11 IPortletDefinition (org.apereo.portal.portlet.om.IPortletDefinition)8 IPortletPreference (org.apereo.portal.portlet.om.IPortletPreference)4 Test (org.junit.Test)4 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)3 IPortletDefinitionParameter (org.apereo.portal.portlet.om.IPortletDefinitionParameter)2 BigInteger (java.math.BigInteger)1 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedHashSet (java.util.LinkedHashSet)1 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ConcurrentMap (java.util.concurrent.ConcurrentMap)1 QName (javax.xml.namespace.QName)1 Attribute (javax.xml.stream.events.Attribute)1 IEntityGroup (org.apereo.portal.groups.IEntityGroup)1 IGroupMember (org.apereo.portal.groups.IGroupMember)1 ExternalPermissionDefinition (org.apereo.portal.io.xml.portlettype.ExternalPermissionDefinition)1