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 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 | /** | |
37 | * This overridden method ... | |
38 | * | |
39 | * @see org.kuali.rice.kew.service.impl.DocumentTypeResponsibilityTypeServiceImpl#performResponsibilityMatches(org.kuali.rice.core.util.Map<String, String>, java.util.List) | |
40 | */ | |
41 | @Override | |
42 | protected List<Responsibility> performResponsibilityMatches( | |
43 | Map<String, String> requestedDetails, | |
44 | List<Responsibility> responsibilitiesList) { | |
45 | // get the base responsibility matches based on the route level and document type | |
46 | 0 | List<Responsibility> 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<Responsibility> respIter = baseMatches.iterator(); |
53 | 0 | while ( respIter.hasNext() ) { |
54 | 0 | Map<String, String> respDetails = respIter.next().getAttributes(); |
55 | 0 | if ( respDetails.containsKey( KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER ) && StringUtils.isNotBlank( respDetails.get(KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER) ) ) { |
56 | 0 | if ( !requestedDetails.containsKey( KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER ) |
57 | || !StringUtils.equals( respDetails.get(KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER) | |
58 | , requestedDetails.get(KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER))) { | |
59 | 0 | respIter.remove(); |
60 | } | |
61 | } | |
62 | 0 | } |
63 | 0 | return baseMatches; |
64 | } | |
65 | } |