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