Coverage Report - org.kuali.rice.kns.uif.authorization.MaintenanceDocumentPresentationControllerBase
 
Classes in this File Line Coverage Branch Coverage Complexity
MaintenanceDocumentPresentationControllerBase
0%
0/9
0%
0/10
1.75
 
 1  
 /*
 2  
  * Copyright 2011 The Kuali Foundation
 3  
  * 
 4  
  * Licensed under the Educational Community License, Version 1.0 (the
 5  
  * "License"); 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/ecl1.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, WITHOUT
 12  
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 13  
  * License for the specific language governing permissions and limitations under
 14  
  * the License.
 15  
  */
 16  
 package org.kuali.rice.kns.uif.authorization;
 17  
 
 18  
 import org.kuali.rice.kns.document.Document;
 19  
 import org.kuali.rice.kns.service.KNSServiceLocatorWeb;
 20  
 import org.kuali.rice.kns.service.MaintenanceDocumentDictionaryService;
 21  
 import org.kuali.rice.kns.workflow.service.KualiWorkflowDocument;
 22  
 
 23  
 /**
 24  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 25  
  */
 26  0
 public class MaintenanceDocumentPresentationControllerBase extends DocumentPresentationControllerBase {
 27  
 
 28  
     protected static MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService;
 29  
 
 30  
     public boolean canCreate(Class<?> dataObjectClass) {
 31  0
         return getMaintenanceDocumentDictionaryService().getAllowsNewOrCopy(
 32  
                 getMaintenanceDocumentDictionaryService().getDocumentTypeName(dataObjectClass)).booleanValue();
 33  
     }
 34  
 
 35  
     @Override
 36  
     protected boolean canSave(Document document) {
 37  0
         KualiWorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
 38  
 
 39  0
         return (!workflowDocument.stateIsEnroute() && super.canSave(document));
 40  
     }
 41  
 
 42  
     @Override
 43  
     protected boolean canBlanketApprove(Document document) {
 44  0
         KualiWorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
 45  
 
 46  0
         return (!workflowDocument.stateIsEnroute() && super.canBlanketApprove(document));
 47  
     }
 48  
 
 49  
     protected MaintenanceDocumentDictionaryService getMaintenanceDocumentDictionaryService() {
 50  0
         if (maintenanceDocumentDictionaryService == null) {
 51  0
             maintenanceDocumentDictionaryService = KNSServiceLocatorWeb.getMaintenanceDocumentDictionaryService();
 52  
         }
 53  0
         return maintenanceDocumentDictionaryService;
 54  
     }
 55  
 
 56  
 }