| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| ReviewResponsibilityTypeServiceImpl |
|
| 6.0;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 java.util.Iterator; | |
| 19 | import java.util.List; | |
| 20 | ||
| 21 | import org.apache.commons.lang.StringUtils; | |
| 22 | import org.kuali.rice.kim.bo.impl.KimAttributes; | |
| 23 | import org.kuali.rice.kim.bo.role.dto.KimResponsibilityInfo; | |
| 24 | import org.kuali.rice.kim.bo.types.dto.AttributeSet; | |
| 25 | import org.kuali.rice.kim.service.support.KimResponsibilityTypeService; | |
| 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 = KimAttributes.ROUTE_NODE_NAME; |
| 33 | 0 | requiredAttributes.add( KimAttributes.ROUTE_NODE_NAME ); |
| 34 | 0 | } |
| 35 | ||
| 36 | /** | |
| 37 | * This overridden method ... | |
| 38 | * | |
| 39 | * @see org.kuali.rice.kew.service.impl.DocumentTypeResponsibilityTypeServiceImpl#performResponsibilityMatches(org.kuali.rice.kim.bo.types.dto.AttributeSet, java.util.List) | |
| 40 | */ | |
| 41 | @Override | |
| 42 | protected List<KimResponsibilityInfo> performResponsibilityMatches( | |
| 43 | AttributeSet requestedDetails, | |
| 44 | List<KimResponsibilityInfo> responsibilitiesList) { | |
| 45 | // get the base responsibility matches based on the route level and document type | |
| 46 | 0 | List<KimResponsibilityInfo> baseMatches = super.performResponsibilityMatches(requestedDetails, |
| 47 | responsibilitiesList); | |
| 48 | // now, if any of the responsibilities have the "qualifierResolverProvidedIdentifier" detail property | |
| 49 | // perform an exact match on the property with the requested details | |
| 50 | // if the property does not match or does not exist in the requestedDetails, remove | |
| 51 | // the responsibility from the list | |
| 52 | 0 | Iterator<KimResponsibilityInfo> respIter = baseMatches.iterator(); |
| 53 | 0 | while ( respIter.hasNext() ) { |
| 54 | 0 | AttributeSet respDetails = respIter.next().getDetails(); |
| 55 | 0 | if ( respDetails.containsKey( KimAttributes.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER ) && StringUtils.isNotBlank( respDetails.get(KimAttributes.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER) ) ) { |
| 56 | 0 | if ( !requestedDetails.containsKey( KimAttributes.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER ) |
| 57 | || !StringUtils.equals( respDetails.get(KimAttributes.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER) | |
| 58 | , requestedDetails.get(KimAttributes.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER))) { | |
| 59 | 0 | respIter.remove(); |
| 60 | } | |
| 61 | } | |
| 62 | 0 | } |
| 63 | 0 | return baseMatches; |
| 64 | } | |
| 65 | } |