Coverage Report - org.kuali.rice.kew.service.impl.ReviewResponsibilityTypeServiceImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
ReviewResponsibilityTypeServiceImpl
0%
0/13
0%
0/10
6
 
 1  
 /*
 2  
  * Copyright 2007-2008 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.kew.service.impl;
 17  
 
 18  
 import org.apache.commons.lang.StringUtils;
 19  
 import org.kuali.rice.kim.api.responsibility.Responsibility;
 20  
 import org.kuali.rice.kim.impl.responsibility.KimResponsibilityTypeService;
 21  
 import org.kuali.rice.kim.util.KimConstants;
 22  
 
 23  
 import java.util.Iterator;
 24  
 import java.util.List;
 25  
 import java.util.Map;
 26  
 
 27  
 /**
 28  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 29  
  */
 30  0
 public class ReviewResponsibilityTypeServiceImpl extends DocumentTypeResponsibilityTypeServiceImpl implements KimResponsibilityTypeService {
 31  
         {
 32  0
                 exactMatchStringAttributeName = KimConstants.AttributeConstants.ROUTE_NODE_NAME;
 33  0
                 requiredAttributes.add( KimConstants.AttributeConstants.ROUTE_NODE_NAME );
 34  0
         }
 35  
 
 36  
         @Override
 37  
         protected List<Responsibility> performResponsibilityMatches(
 38  
                         Map<String, String> requestedDetails,
 39  
                         List<Responsibility> responsibilitiesList) {
 40  
                 // get the base responsibility matches based on the route level and document type
 41  0
                 List<Responsibility> baseMatches = super.performResponsibilityMatches(requestedDetails,
 42  
                                 responsibilitiesList);
 43  
                 // now, if any of the responsibilities have the "qualifierResolverProvidedIdentifier" detail property
 44  
                 // perform an exact match on the property with the requested details
 45  
                 // if the property does not match or does not exist in the requestedDetails, remove
 46  
                 // the responsibility from the list
 47  0
                 Iterator<Responsibility> respIter = baseMatches.iterator();
 48  0
                 while ( respIter.hasNext() ) {
 49  0
                         Map<String, String> respDetails = respIter.next().getAttributes();
 50  0
                         if ( respDetails.containsKey( KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER ) && StringUtils.isNotBlank( respDetails.get(KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER) ) ) {
 51  0
                                 if ( !requestedDetails.containsKey( KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER )
 52  
                                                 || !StringUtils.equals( respDetails.get(KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER)
 53  
                                                                 , requestedDetails.get(KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER))) {
 54  0
                                         respIter.remove();
 55  
                                 }
 56  
                         }
 57  0
                 }                
 58  0
                 return baseMatches;
 59  
         }
 60  
 }