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