1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.maintenance;
17
18 import org.kuali.rice.krad.document.DocumentPresentationControllerBase;
19 import org.kuali.rice.krad.service.DocumentDictionaryService;
20 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
21
22
23
24
25 public class MaintenanceDocumentPresentationControllerBase extends DocumentPresentationControllerBase
26 implements MaintenanceDocumentPresentationController {
27 private static final long serialVersionUID = 2849921477944820474L;
28
29 private transient DocumentDictionaryService documentDictionaryService;
30
31 public boolean canCreate(Class boClass) {
32 return getDocumentDictionaryService().getAllowsNewOrCopy(
33 getDocumentDictionaryService().getMaintenanceDocumentTypeName(boClass));
34 }
35
36 public boolean canMaintain(Object dataObject) {
37 return true;
38 }
39
40 protected DocumentDictionaryService getDocumentDictionaryService() {
41 if (documentDictionaryService == null) {
42 documentDictionaryService = KRADServiceLocatorWeb.getDocumentDictionaryService();
43 }
44 return documentDictionaryService;
45 }
46
47 public void setDocumentDictionaryService(DocumentDictionaryService documentDictionaryService) {
48 this.documentDictionaryService = documentDictionaryService;
49 }
50 }