Coverage Report - org.kuali.rice.krad.uif.authorization.MaintenanceDocumentPresentationControllerBase
 
Classes in this File Line Coverage Branch Coverage Complexity
MaintenanceDocumentPresentationControllerBase
0%
0/6
0%
0/8
1.667
 
 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.krad.uif.authorization;
 17  
 
 18  
 import org.kuali.rice.kew.api.WorkflowDocument;
 19  
 import org.kuali.rice.krad.document.Document;
 20  
 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
 21  
 
 22  
 /**
 23  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 24  
  */
 25  0
 public class MaintenanceDocumentPresentationControllerBase extends DocumentPresentationControllerBase {
 26  
 
 27  
     public boolean canCreate(Class<?> dataObjectClass) {
 28  0
         return KRADServiceLocatorWeb.getDocumentDictionaryService().getAllowsNewOrCopy(
 29  
                 KRADServiceLocatorWeb.getDocumentDictionaryService().getMaintenanceDocumentTypeName(dataObjectClass))
 30  
                 .booleanValue();
 31  
     }
 32  
 
 33  
     @Override
 34  
     protected boolean canSave(Document document) {
 35  0
         WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
 36  
 
 37  0
         return (!workflowDocument.isEnroute() && super.canSave(document));
 38  
     }
 39  
 
 40  
     @Override
 41  
     protected boolean canBlanketApprove(Document document) {
 42  0
         WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
 43  
 
 44  0
         return (!workflowDocument.isEnroute() && super.canBlanketApprove(document));
 45  
     }
 46  
 }