1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.web.form;
17
18
19 import javax.servlet.http.HttpServletRequest;
20
21 import org.apache.commons.lang.StringUtils;
22 import org.apache.log4j.Logger;
23 import org.kuali.rice.krad.inquiry.Inquirable;
24 import org.kuali.rice.krad.uif.UifConstants.ViewType;
25 import org.kuali.rice.krad.uif.view.InquiryView;
26 import org.kuali.rice.krad.web.bind.RequestAccessible;
27
28
29
30
31
32
33 public class InquiryForm extends UifFormBase {
34 private static final long serialVersionUID = 4733144086378429410L;
35
36 @RequestAccessible
37 private String dataObjectClassName;
38 private Object dataObject;
39
40 private boolean redirectedInquiry;
41
42 public InquiryForm() {
43 setViewTypeName(ViewType.INQUIRY);
44
45 redirectedInquiry = false;
46 }
47
48
49
50
51 @Override
52 public void postBind(HttpServletRequest request) {
53 super.postBind(request);
54
55 if (StringUtils.isBlank(getDataObjectClassName())) {
56 setDataObjectClassName(((InquiryView) getView()).getDataObjectClassName().getName());
57 }
58
59 Inquirable inquirable = getInquirable();
60
61
62 if (inquirable != null) {
63 Class<?> dataObjectClass;
64 try {
65 dataObjectClass = Class.forName(getDataObjectClassName());
66 } catch (ClassNotFoundException e) {
67 throw new RuntimeException("Object class " + getDataObjectClassName() + " not found", e);
68 }
69
70 inquirable.setDataObjectClass(dataObjectClass);
71 }
72 }
73
74
75
76
77
78
79 public Inquirable getInquirable() {
80 if (getViewHelperService() != null) {
81 return (Inquirable) getViewHelperService();
82 }
83
84 return null;
85 }
86
87
88
89
90
91
92
93
94
95
96
97 public String getDataObjectClassName() {
98 return this.dataObjectClassName;
99 }
100
101
102
103
104
105
106 public void setDataObjectClassName(String dataObjectClassName) {
107 this.dataObjectClassName = dataObjectClassName;
108 }
109
110
111
112
113
114
115 public Object getDataObject() {
116 return this.dataObject;
117 }
118
119
120
121
122
123
124 public void setDataObject(Object dataObject) {
125 this.dataObject = dataObject;
126 }
127
128
129
130
131
132
133
134 public boolean isRedirectedInquiry() {
135 return redirectedInquiry;
136 }
137
138
139
140
141
142
143 public void setRedirectedInquiry(boolean redirectedInquiry) {
144 this.redirectedInquiry = redirectedInquiry;
145 }
146
147 }