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