1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.view;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.krad.datadictionary.MaintenanceDocumentEntry;
20 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
21 import org.kuali.rice.krad.uif.UifConstants;
22 import org.kuali.rice.krad.uif.UifConstants.ViewType;
23 import org.kuali.rice.krad.uif.component.RequestParameter;
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 public class MaintenanceView extends DocumentView {
51 private static final long serialVersionUID = -3382802967703882341L;
52
53 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(MaintenanceView.class);
54
55 private Class<?> dataObjectClassName;
56
57 private String oldObjectBindingPath;
58
59 @RequestParameter
60 private String maintenanceAction;
61
62 public MaintenanceView() {
63 super();
64
65 setViewTypeName(ViewType.MAINTENANCE);
66 }
67
68
69
70
71
72
73
74
75
76
77
78 @Override
79 public void performInitialization(View view, Object model) {
80 super.performInitialization(view, model);
81
82
83 MaintenanceDocumentEntry documentEntry = null;
84 String docTypeName = KRADServiceLocatorWeb.getDocumentDictionaryService()
85 .getMaintenanceDocumentTypeName(getDataObjectClassName());
86 if (StringUtils.isNotBlank(docTypeName)) {
87 documentEntry =
88 KRADServiceLocatorWeb.getDocumentDictionaryService().getMaintenanceDocumentEntry(docTypeName);
89 }
90
91 if (documentEntry != null) {
92 pushObjectToContext(UifConstants.ContextVariableNames.DOCUMENT_ENTRY, documentEntry);
93 } else {
94 LOG.error("Unable to find maintenance document entry for data object class: " +
95 getDataObjectClassName().getName());
96 throw new RuntimeException("Unable to find maintenance document entry for data object class: " +
97 getDataObjectClassName().getName());
98 }
99
100 getAbstractTypeClasses().put(getDefaultBindingObjectPath(), getDataObjectClassName());
101 getAbstractTypeClasses().put(getOldObjectBindingPath(), getDataObjectClassName());
102 }
103
104
105
106
107
108
109
110
111
112
113
114
115
116 public Class<?> getDataObjectClassName() {
117 return this.dataObjectClassName;
118 }
119
120
121
122
123
124
125 public void setDataObjectClassName(Class<?> dataObjectClassName) {
126 this.dataObjectClassName = dataObjectClassName;
127 }
128
129
130
131
132
133
134
135 public String getOldObjectBindingPath() {
136 return this.oldObjectBindingPath;
137 }
138
139
140
141
142
143
144 public void setOldObjectBindingPath(String oldObjectBindingPath) {
145 this.oldObjectBindingPath = oldObjectBindingPath;
146 }
147
148
149
150
151
152
153
154 public String getMaintenanceAction() {
155 return maintenanceAction;
156 }
157
158
159
160
161
162
163 public void setMaintenanceAction(String maintenanceAction) {
164 this.maintenanceAction = maintenanceAction;
165 }
166
167 }