Coverage Report - org.kuali.rice.kim.rules.ui.RoleDocumentDelegationRule
 
Classes in this File Line Coverage Branch Coverage Complexity
RoleDocumentDelegationRule
0%
0/7
0%
0/4
3
 
 1  
 /*
 2  
  * Copyright 2007-2009 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.kim.rules.ui;
 17  
 
 18  
 import org.apache.commons.lang.StringUtils;
 19  
 import org.kuali.rice.core.util.RiceKeyConstants;
 20  
 import org.kuali.rice.kim.bo.ui.RoleDocumentDelegation;
 21  
 import org.kuali.rice.kim.rule.event.ui.AddDelegationEvent;
 22  
 import org.kuali.rice.kim.rule.ui.AddDelegationRule;
 23  
 import org.kuali.rice.kns.rules.DocumentRuleBase;
 24  
 import org.kuali.rice.kns.util.GlobalVariables;
 25  
 
 26  
 /**
 27  
  * This is a description of what this class does - shyu don't forget to fill this in. 
 28  
  * 
 29  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 30  
  *
 31  
  */
 32  0
 public class RoleDocumentDelegationRule extends DocumentRuleBase implements AddDelegationRule {
 33  
 
 34  
         protected static final String ERROR_PATH = "permission.permissionId";
 35  
         
 36  
         public boolean processAddDelegation(AddDelegationEvent addDelegationEvent) {
 37  0
                 RoleDocumentDelegation newDelegation = addDelegationEvent.getDelegation();
 38  0
                 boolean rulePassed = true;
 39  0
                 if (newDelegation == null || StringUtils.isBlank(newDelegation.getDelegationTypeCode())) {
 40  0
             rulePassed = false;
 41  0
             GlobalVariables.getMessageMap().putError(ERROR_PATH, RiceKeyConstants.ERROR_EMPTY_ENTRY, new String[] {"Permission"});
 42  
         }
 43  0
                 return rulePassed;
 44  
         } 
 45  
 
 46  
 }