| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.kns.document.authorization; |
| 17 | |
|
| 18 | |
import java.util.HashSet; |
| 19 | |
import java.util.Set; |
| 20 | |
|
| 21 | |
import org.kuali.rice.kns.bo.BusinessObject; |
| 22 | |
import org.kuali.rice.kns.document.Document; |
| 23 | |
import org.kuali.rice.kns.document.MaintenanceDocument; |
| 24 | |
import org.kuali.rice.kns.service.KNSServiceLocator; |
| 25 | |
import org.kuali.rice.kns.service.MaintenanceDocumentDictionaryService; |
| 26 | |
import org.kuali.rice.kns.workflow.service.KualiWorkflowDocument; |
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | 0 | public class MaintenanceDocumentPresentationControllerBase extends |
| 32 | |
DocumentPresentationControllerBase implements |
| 33 | |
MaintenanceDocumentPresentationController { |
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | |
protected static MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService; |
| 38 | |
|
| 39 | |
public boolean canCreate(Class boClass) { |
| 40 | 0 | return getMaintenanceDocumentDictionaryService().getAllowsNewOrCopy( |
| 41 | |
getMaintenanceDocumentDictionaryService().getDocumentTypeName( |
| 42 | |
boClass)); |
| 43 | |
} |
| 44 | |
|
| 45 | |
public Set<String> getConditionallyHiddenPropertyNames( |
| 46 | |
BusinessObject businessObject) { |
| 47 | 0 | return new HashSet<String>(); |
| 48 | |
} |
| 49 | |
|
| 50 | |
public Set<String> getConditionallyHiddenSectionIds( |
| 51 | |
BusinessObject businessObject) { |
| 52 | 0 | return new HashSet<String>(); |
| 53 | |
} |
| 54 | |
|
| 55 | |
public Set<String> getConditionallyReadOnlyPropertyNames( |
| 56 | |
MaintenanceDocument document) { |
| 57 | 0 | return new HashSet<String>(); |
| 58 | |
} |
| 59 | |
|
| 60 | |
public Set<String> getConditionallyReadOnlySectionIds( |
| 61 | |
MaintenanceDocument document) { |
| 62 | 0 | return new HashSet<String>(); |
| 63 | |
} |
| 64 | |
|
| 65 | |
public Set<String> getConditionallyRequiredPropertyNames( |
| 66 | |
MaintenanceDocument document) { |
| 67 | 0 | return new HashSet<String>(); |
| 68 | |
} |
| 69 | |
|
| 70 | |
public static MaintenanceDocumentDictionaryService getMaintenanceDocumentDictionaryService() { |
| 71 | 0 | if (maintenanceDocumentDictionaryService == null) { |
| 72 | 0 | maintenanceDocumentDictionaryService = KNSServiceLocator |
| 73 | |
.getMaintenanceDocumentDictionaryService(); |
| 74 | |
} |
| 75 | 0 | return maintenanceDocumentDictionaryService; |
| 76 | |
} |
| 77 | |
|
| 78 | |
|
| 79 | |
|
| 80 | |
|
| 81 | |
@Override |
| 82 | |
protected boolean canSave(Document document){ |
| 83 | 0 | KualiWorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument(); |
| 84 | 0 | return (!workflowDocument.stateIsEnroute() && super.canSave(document)); |
| 85 | |
} |
| 86 | |
|
| 87 | |
|
| 88 | |
|
| 89 | |
|
| 90 | |
@Override |
| 91 | |
protected boolean canBlanketApprove(Document document) { |
| 92 | 0 | KualiWorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument(); |
| 93 | 0 | return (!workflowDocument.stateIsEnroute() && super.canBlanketApprove(document)); |
| 94 | |
} |
| 95 | |
} |