1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kns.datadictionary;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.kns.inquiry.InquiryAuthorizer;
20 import org.kuali.rice.kns.inquiry.InquiryPresentationController;
21 import org.kuali.rice.krad.datadictionary.DataDictionaryDefinitionBase;
22 import org.kuali.rice.krad.inquiry.Inquirable;
23
24 import java.util.ArrayList;
25 import java.util.List;
26
27
28
29
30
31
32
33
34
35
36
37 @Deprecated
38 public class InquiryDefinition extends DataDictionaryDefinitionBase {
39 private static final long serialVersionUID = -2506403061297774668L;
40
41 protected String title;
42 protected List<InquirySectionDefinition> inquirySections = new ArrayList<InquirySectionDefinition>();
43 protected Class<? extends Inquirable> inquirableClass;
44 protected Class<? extends InquiryPresentationController> presentationControllerClass;
45 protected Class<? extends InquiryAuthorizer> authorizerClass;
46
47 protected boolean translateCodes = true;
48
49 public InquiryDefinition() {
50 }
51
52
53 public String getTitle() {
54 return title;
55 }
56
57
58
59
60
61
62 public void setTitle(String title) {
63 if (StringUtils.isBlank(title)) {
64 throw new IllegalArgumentException("invalid (blank) title");
65 }
66
67 this.title = title;
68 }
69
70
71
72
73
74 public List<InquirySectionDefinition> getInquirySections() {
75 return inquirySections;
76 }
77
78
79
80
81
82
83 public FieldDefinition getFieldDefinition(String fieldName) {
84 for (InquirySectionDefinition section : inquirySections ) {
85 for (FieldDefinition field : section.getInquiryFields() ) {
86 if (field.getAttributeName().equals(fieldName)) {
87 return field;
88 }
89 }
90 }
91
92 return null;
93 }
94
95
96
97
98
99
100 public void completeValidation(Class rootBusinessObjectClass, Class otherBusinessObjectClass) {
101 for ( InquirySectionDefinition inquirySection : inquirySections ) {
102 inquirySection.completeValidation(rootBusinessObjectClass, null);
103 }
104 }
105
106 public InquirySectionDefinition getInquirySection( String sectionTitle ) {
107 for ( InquirySectionDefinition inquirySection : inquirySections ) {
108 if ( inquirySection.getTitle().equals(sectionTitle) ) {
109 return inquirySection;
110 }
111 }
112 return null;
113 }
114
115
116
117
118
119 public String toString() {
120 return "InquiryDefinition '" + getTitle() + "'";
121 }
122
123
124 public Class<? extends Inquirable> getInquirableClass() {
125 return inquirableClass;
126 }
127
128
129
130
131
132
133
134
135
136
137
138 public void setInquirableClass(Class<? extends Inquirable> inquirableClass) {
139 this.inquirableClass = inquirableClass;
140 }
141
142
143
144
145
146 public void setInquirySections(List<InquirySectionDefinition> inquirySections) {
147 this.inquirySections = inquirySections;
148 }
149
150
151 public Class<? extends InquiryPresentationController> getPresentationControllerClass() {
152 return this.presentationControllerClass;
153 }
154
155
156 public void setPresentationControllerClass(
157 Class<? extends InquiryPresentationController> presentationControllerClass) {
158 this.presentationControllerClass = presentationControllerClass;
159 }
160
161
162 public Class<? extends InquiryAuthorizer> getAuthorizerClass() {
163 return this.authorizerClass;
164 }
165
166
167 public void setAuthorizerClass(
168 Class<? extends InquiryAuthorizer> authorizerClass) {
169 this.authorizerClass = authorizerClass;
170 }
171
172
173 public boolean isTranslateCodes() {
174 return this.translateCodes;
175 }
176
177
178 public void setTranslateCodes(boolean translateCodes) {
179 this.translateCodes = translateCodes;
180 }
181
182 }