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