Coverage Report - org.kuali.student.lum.kim.permission.type.TranslatedDocumentTypePermissionTypeServiceImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
TranslatedDocumentTypePermissionTypeServiceImpl
0%
0/20
0%
0/2
1
 
 1  
 /**
 2  
  * Copyright 2010 The Kuali Foundation Licensed under the
 3  
  * Educational Community License, Version 2.0 (the "License"); you may
 4  
  * not use this file except in compliance with the License. You may
 5  
  * obtain a copy of the License at
 6  
  *
 7  
  * http://www.osedu.org/licenses/ECL-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing,
 10  
  * software distributed under the License is distributed on an "AS IS"
 11  
  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 12  
  * or implied. See the License for the specific language governing
 13  
  * permissions and limitations under the License.
 14  
  */
 15  
 
 16  
 /**
 17  
  * 
 18  
  */
 19  
 package org.kuali.student.lum.kim.permission.type;
 20  
 
 21  
 import java.util.ArrayList;
 22  
 import java.util.HashSet;
 23  
 import java.util.List;
 24  
 import java.util.Set;
 25  
 
 26  
 import org.kuali.rice.kim.bo.impl.KimAttributes;
 27  
 import org.kuali.rice.kim.bo.types.dto.AttributeSet;
 28  
 import org.kuali.rice.kns.service.impl.DocumentTypePermissionTypeServiceImpl;
 29  
 import org.kuali.student.common.rice.StudentIdentityConstants;
 30  
 import org.kuali.student.lum.kim.KimQualificationHelper;
 31  
 
 32  
 /**
 33  
  * Permission Type to be used for
 34  
  *
 35  
  */
 36  0
 public class TranslatedDocumentTypePermissionTypeServiceImpl extends DocumentTypePermissionTypeServiceImpl {
 37  
 
 38  0
         private static Set<List<String>> attributes = new HashSet<List<String>>();
 39  
 
 40  
         {
 41  0
                 checkRequiredAttributes = true;
 42  
                 // add document number as one required attribute set
 43  0
                 List<String> listOne = new ArrayList<String>();
 44  0
                 listOne.add( KimAttributes.DOCUMENT_NUMBER );
 45  0
                 attributes.add(listOne);
 46  
                 // add document type name and KEW application id as one required attribute set
 47  0
                 List<String> listTwo = new ArrayList<String>();
 48  0
                 listTwo.add( KimAttributes.DOCUMENT_TYPE_NAME );
 49  0
                 listTwo.add( StudentIdentityConstants.QUALIFICATION_KEW_OBJECT_ID );
 50  0
                 attributes.add(listTwo);
 51  
                 // add each proposal reference type as a required attribute set
 52  0
                 for (String proposalReferenceType : StudentIdentityConstants.QUALIFICATION_PROPOSAL_ID_REF_TYPES) {
 53  0
                 List<String> tempList = new ArrayList<String>();
 54  0
                 tempList.add( proposalReferenceType );
 55  0
                 attributes.add(tempList);
 56  0
         }
 57  
 //                List<String> listFour = new ArrayList<String>();
 58  
 //                listFour.add( StudentIdentityConstants.QUALIFICATION_KEW_OBJECT_ID );
 59  
 //                listFour.add( StudentIdentityConstants.QUALIFICATION_KEW_OBJECT_TYPE );
 60  
 //                attributes.add(listFour);
 61  
 
 62  0
         }
 63  
 
 64  
         @Override
 65  
     public AttributeSet translateInputAttributeSet(AttributeSet qualification) {
 66  0
                 return KimQualificationHelper.translateInputAttributeSet(super.translateInputAttributeSet(qualification));
 67  
         }
 68  
 
 69  
         @Override
 70  
     protected void validateRequiredAttributesAgainstReceived(AttributeSet receivedAttributes) {
 71  
                 // first check KS required attributes
 72  0
             KimQualificationHelper.validateRequiredAttributesAgainstReceived(attributes, receivedAttributes, isCheckRequiredAttributes(), COMMA_SEPARATOR);
 73  
             // if required KS attributes pass... test parent class required attributes
 74  0
             super.validateRequiredAttributesAgainstReceived(receivedAttributes);
 75  0
     }
 76  
 
 77  
 }