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.datadictionary.parse.BeanTag;
21 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
22 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
23 import org.kuali.rice.krad.uif.UifConstants.ViewType;
24 import org.kuali.rice.krad.uif.component.RequestParameter;
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 @BeanTag(name = "maintenanceView", parent="Uif-MaintenanceView")
46 public class MaintenanceDocumentView extends DocumentView {
47 private static final long serialVersionUID = -3382802967703882341L;
48
49 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(MaintenanceDocumentView.class);
50
51 private Class<?> dataObjectClassName;
52
53 private String docTypeName;
54
55 private String oldObjectBindingPath;
56
57 @RequestParameter
58 private String maintenanceAction;
59
60 public MaintenanceDocumentView() {
61 super();
62
63 setViewTypeName(ViewType.MAINTENANCE);
64 }
65
66
67
68
69
70
71
72
73
74
75 @Override
76 public void performInitialization(Object model) {
77 super.performInitialization(model);
78
79 getObjectPathToConcreteClassMapping().put(getDefaultBindingObjectPath(), getDataObjectClassName());
80 getObjectPathToConcreteClassMapping().put(getOldObjectBindingPath(), getDataObjectClassName());
81 }
82
83
84
85
86
87
88 @Override
89 protected MaintenanceDocumentEntry getDocumentEntryForView() {
90 MaintenanceDocumentEntry documentEntry = null;
91 String docTypeName = KRADServiceLocatorWeb.getDocumentDictionaryService().getMaintenanceDocumentTypeName(
92 getDataObjectClassName());
93 if (StringUtils.isNotBlank(docTypeName)) {
94 documentEntry = KRADServiceLocatorWeb.getDocumentDictionaryService().getMaintenanceDocumentEntry(
95 docTypeName);
96 }
97
98 if (documentEntry == null) {
99 throw new RuntimeException(
100 "Unable to find maintenance document entry for data object class: " + getDataObjectClassName()
101 .getName());
102 }
103
104 return documentEntry;
105 }
106
107
108
109
110
111
112
113
114
115
116
117 @BeanTagAttribute
118 public Class<?> getDataObjectClassName() {
119 return this.dataObjectClassName;
120 }
121
122
123
124
125 public void setDataObjectClassName(Class<?> dataObjectClassName) {
126 this.dataObjectClassName = dataObjectClassName;
127 }
128
129
130
131
132
133
134
135
136
137
138
139 @BeanTagAttribute(name="docTypeName")
140 public String getDocTypeName() {
141 return this.docTypeName;
142 }
143
144
145
146
147 public void setDocTypeName(String docTypeName) {
148 this.docTypeName = docTypeName;
149 }
150
151
152
153
154
155
156
157 @BeanTagAttribute
158 public String getOldObjectBindingPath() {
159 return this.oldObjectBindingPath;
160 }
161
162
163
164
165 public void setOldObjectBindingPath(String oldObjectBindingPath) {
166 this.oldObjectBindingPath = oldObjectBindingPath;
167 }
168
169
170
171
172
173
174 @BeanTagAttribute
175 public String getMaintenanceAction() {
176 return maintenanceAction;
177 }
178
179
180
181
182 public void setMaintenanceAction(String maintenanceAction) {
183 this.maintenanceAction = maintenanceAction;
184 }
185 }