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.kuali.rice.kns.web.derivedvaluesetter.DerivedValuesSetter; |
19 | |
import org.kuali.rice.krad.bo.BusinessObject; |
20 | |
import org.kuali.rice.krad.datadictionary.DataDictionary; |
21 | |
import org.kuali.rice.krad.datadictionary.ReferenceDefinition; |
22 | |
import org.kuali.rice.krad.datadictionary.exception.AttributeValidationException; |
23 | |
import org.kuali.rice.krad.datadictionary.exception.ClassValidationException; |
24 | |
import org.kuali.rice.krad.datadictionary.exception.DuplicateEntryException; |
25 | |
import org.kuali.rice.krad.document.Document; |
26 | |
import org.kuali.rice.kns.document.MaintenanceDocumentBase; |
27 | |
import org.kuali.rice.krad.document.authorization.DocumentAuthorizer; |
28 | |
import org.kuali.rice.krad.document.authorization.DocumentPresentationController; |
29 | |
import org.kuali.rice.krad.document.authorization.MaintenanceDocumentAuthorizer; |
30 | |
import org.kuali.rice.kns.maintenance.Maintainable; |
31 | |
|
32 | |
import java.util.ArrayList; |
33 | |
import java.util.LinkedHashMap; |
34 | |
import java.util.List; |
35 | |
import java.util.Map; |
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
@Deprecated |
41 | |
public class MaintenanceDocumentEntry extends org.kuali.rice.krad.datadictionary.MaintenanceDocumentEntry { |
42 | 0 | protected List<MaintainableSectionDefinition> maintainableSections = new ArrayList<MaintainableSectionDefinition>(); |
43 | 0 | protected List<String> lockingKeys = new ArrayList<String>(); |
44 | |
|
45 | 0 | protected Map<String, MaintainableSectionDefinition> maintainableSectionMap = |
46 | |
new LinkedHashMap<String, MaintainableSectionDefinition>(); |
47 | |
|
48 | 0 | protected boolean allowsNewOrCopy = true; |
49 | |
protected String additionalSectionsFile; |
50 | |
|
51 | |
|
52 | 0 | protected boolean preserveLockingKeysOnCopy = false; |
53 | |
|
54 | |
|
55 | 0 | protected boolean allowsRecordDeletion = false; |
56 | |
|
57 | 0 | protected boolean translateCodes = false; |
58 | |
|
59 | |
protected Class<? extends DerivedValuesSetter> derivedValuesSetterClass; |
60 | 0 | protected List<String> webScriptFiles = new ArrayList<String>(3); |
61 | 0 | protected List<HeaderNavigation> headerNavigationList = new ArrayList<HeaderNavigation>(); |
62 | |
|
63 | |
protected Class<? extends DocumentAuthorizer> documentAuthorizerClass; |
64 | |
protected Class<? extends DocumentPresentationController> documentPresentationControllerClass; |
65 | |
|
66 | 0 | protected boolean sessionDocument = false; |
67 | |
|
68 | |
public MaintenanceDocumentEntry() { |
69 | 0 | super(); |
70 | 0 | } |
71 | |
|
72 | |
@Override |
73 | |
public Class<? extends Document> getStandardDocumentBaseClass() { |
74 | 0 | return MaintenanceDocumentBase.class; |
75 | |
} |
76 | |
|
77 | |
|
78 | |
|
79 | |
|
80 | |
|
81 | |
public void setBusinessObjectClass(Class<? extends BusinessObject> businessObjectClass) { |
82 | 0 | if (businessObjectClass == null) { |
83 | 0 | throw new IllegalArgumentException("invalid (null) dataObjectClass"); |
84 | |
} |
85 | |
|
86 | 0 | setDataObjectClass(businessObjectClass); |
87 | 0 | } |
88 | |
|
89 | |
public Class<? extends BusinessObject> getBusinessObjectClass() { |
90 | 0 | return (Class<? extends BusinessObject>) getDataObjectClass(); |
91 | |
} |
92 | |
|
93 | |
|
94 | |
|
95 | |
|
96 | |
@SuppressWarnings("unchecked") |
97 | |
@Override |
98 | |
public Class getEntryClass() { |
99 | 0 | return getDataObjectClass(); |
100 | |
} |
101 | |
|
102 | |
public Class<? extends Maintainable> getMaintainableClass() { |
103 | 0 | return (Class<? extends Maintainable>) super.getMaintainableClass(); |
104 | |
} |
105 | |
|
106 | |
|
107 | |
|
108 | |
|
109 | |
public List<MaintainableSectionDefinition> getMaintainableSections() { |
110 | 0 | return maintainableSections; |
111 | |
} |
112 | |
|
113 | |
|
114 | |
|
115 | |
|
116 | |
|
117 | |
public List<String> getLockingKeyFieldNames() { |
118 | 0 | return lockingKeys; |
119 | |
} |
120 | |
|
121 | |
|
122 | |
|
123 | |
|
124 | |
|
125 | |
|
126 | |
public boolean getAllowsNewOrCopy() { |
127 | 0 | return allowsNewOrCopy; |
128 | |
} |
129 | |
|
130 | |
|
131 | |
|
132 | |
|
133 | |
|
134 | |
|
135 | |
public void setAllowsNewOrCopy(boolean allowsNewOrCopy) { |
136 | 0 | this.allowsNewOrCopy = allowsNewOrCopy; |
137 | 0 | } |
138 | |
|
139 | |
|
140 | |
|
141 | |
|
142 | |
|
143 | |
|
144 | |
public void completeValidation() { |
145 | 0 | super.completeValidation(); |
146 | |
|
147 | 0 | for (MaintainableSectionDefinition maintainableSectionDefinition : maintainableSections) { |
148 | 0 | maintainableSectionDefinition.completeValidation(getDataObjectClass(), null); |
149 | |
} |
150 | 0 | } |
151 | |
|
152 | |
|
153 | |
|
154 | |
|
155 | |
public String toString() { |
156 | 0 | return "MaintenanceDocumentEntry for documentType " + getDocumentTypeName(); |
157 | |
} |
158 | |
|
159 | |
@Deprecated |
160 | |
public String getAdditionalSectionsFile() { |
161 | 0 | return additionalSectionsFile; |
162 | |
} |
163 | |
|
164 | |
|
165 | |
|
166 | |
|
167 | |
|
168 | |
|
169 | |
|
170 | |
@Deprecated |
171 | |
public void setAdditionalSectionsFile(String additionalSectionsFile) { |
172 | 0 | this.additionalSectionsFile = additionalSectionsFile; |
173 | 0 | } |
174 | |
|
175 | |
public List<String> getLockingKeys() { |
176 | 0 | return lockingKeys; |
177 | |
} |
178 | |
|
179 | |
|
180 | |
|
181 | |
|
182 | |
|
183 | |
|
184 | |
public void setLockingKeys(List<String> lockingKeys) { |
185 | 0 | for (String lockingKey : lockingKeys) { |
186 | 0 | if (lockingKey == null) { |
187 | 0 | throw new IllegalArgumentException("invalid (null) lockingKey"); |
188 | |
} |
189 | |
} |
190 | 0 | this.lockingKeys = lockingKeys; |
191 | 0 | } |
192 | |
|
193 | |
|
194 | |
|
195 | |
|
196 | |
|
197 | |
|
198 | |
|
199 | |
|
200 | |
|
201 | |
|
202 | |
|
203 | |
|
204 | |
|
205 | |
|
206 | |
@Deprecated |
207 | |
public void setMaintainableSections(List<MaintainableSectionDefinition> maintainableSections) { |
208 | 0 | maintainableSectionMap.clear(); |
209 | 0 | for (MaintainableSectionDefinition maintainableSectionDefinition : maintainableSections) { |
210 | 0 | if (maintainableSectionDefinition == null) { |
211 | 0 | throw new IllegalArgumentException("invalid (null) maintainableSectionDefinition"); |
212 | |
} |
213 | |
|
214 | 0 | String sectionTitle = maintainableSectionDefinition.getTitle(); |
215 | 0 | if (maintainableSectionMap.containsKey(sectionTitle)) { |
216 | 0 | throw new DuplicateEntryException( |
217 | |
"section '" + sectionTitle + "' already defined for maintenanceDocument '" + |
218 | |
getDocumentTypeName() + "'"); |
219 | |
} |
220 | |
|
221 | 0 | maintainableSectionMap.put(sectionTitle, maintainableSectionDefinition); |
222 | 0 | } |
223 | 0 | this.maintainableSections = maintainableSections; |
224 | 0 | } |
225 | |
|
226 | |
|
227 | |
|
228 | |
|
229 | |
public boolean getPreserveLockingKeysOnCopy() { |
230 | 0 | return this.preserveLockingKeysOnCopy; |
231 | |
} |
232 | |
|
233 | |
|
234 | |
|
235 | |
|
236 | |
public void setPreserveLockingKeysOnCopy(boolean preserveLockingKeysOnCopy) { |
237 | 0 | this.preserveLockingKeysOnCopy = preserveLockingKeysOnCopy; |
238 | 0 | } |
239 | |
|
240 | |
|
241 | |
|
242 | |
|
243 | |
public boolean getAllowsRecordDeletion() { |
244 | 0 | return this.allowsRecordDeletion; |
245 | |
} |
246 | |
|
247 | |
|
248 | |
|
249 | |
|
250 | |
public void setAllowsRecordDeletion(boolean allowsRecordDeletion) { |
251 | 0 | this.allowsRecordDeletion = allowsRecordDeletion; |
252 | 0 | } |
253 | |
|
254 | |
@Deprecated |
255 | |
public boolean isTranslateCodes() { |
256 | 0 | return this.translateCodes; |
257 | |
} |
258 | |
|
259 | |
@Deprecated |
260 | |
public void setTranslateCodes(boolean translateCodes) { |
261 | 0 | this.translateCodes = translateCodes; |
262 | 0 | } |
263 | |
|
264 | |
|
265 | |
|
266 | |
|
267 | |
|
268 | |
|
269 | |
public void setDocumentAuthorizerClass(Class<? extends DocumentAuthorizer> documentAuthorizerClass) { |
270 | 0 | this.documentAuthorizerClass = documentAuthorizerClass; |
271 | 0 | } |
272 | |
|
273 | |
|
274 | |
|
275 | |
|
276 | |
|
277 | |
|
278 | |
|
279 | |
|
280 | |
|
281 | |
public Class<? extends DocumentAuthorizer> getDocumentAuthorizerClass() { |
282 | 0 | return documentAuthorizerClass; |
283 | |
} |
284 | |
|
285 | |
public List<HeaderNavigation> getHeaderNavigationList() { |
286 | 0 | return headerNavigationList; |
287 | |
} |
288 | |
|
289 | |
public List<String> getWebScriptFiles() { |
290 | 0 | return webScriptFiles; |
291 | |
} |
292 | |
|
293 | |
|
294 | |
|
295 | |
|
296 | |
|
297 | |
|
298 | |
public void setWebScriptFiles(List<String> webScriptFiles) { |
299 | 0 | this.webScriptFiles = webScriptFiles; |
300 | 0 | } |
301 | |
|
302 | |
|
303 | |
|
304 | |
|
305 | |
|
306 | |
public void setHeaderNavigationList(List<HeaderNavigation> headerNavigationList) { |
307 | 0 | this.headerNavigationList = headerNavigationList; |
308 | 0 | } |
309 | |
|
310 | |
public boolean isSessionDocument() { |
311 | 0 | return this.sessionDocument; |
312 | |
} |
313 | |
|
314 | |
public void setSessionDocument(boolean sessionDocument) { |
315 | 0 | this.sessionDocument = sessionDocument; |
316 | 0 | } |
317 | |
|
318 | |
|
319 | |
|
320 | |
|
321 | |
|
322 | |
|
323 | |
|
324 | |
|
325 | |
|
326 | |
|
327 | |
public Class<? extends DocumentPresentationController> getDocumentPresentationControllerClass() { |
328 | 0 | return this.documentPresentationControllerClass; |
329 | |
} |
330 | |
|
331 | |
|
332 | |
|
333 | |
|
334 | |
public void setDocumentPresentationControllerClass( |
335 | |
Class<? extends DocumentPresentationController> documentPresentationControllerClass) { |
336 | 0 | this.documentPresentationControllerClass = documentPresentationControllerClass; |
337 | 0 | } |
338 | |
|
339 | |
|
340 | |
|
341 | |
|
342 | |
public Class<? extends DerivedValuesSetter> getDerivedValuesSetterClass() { |
343 | 0 | return this.derivedValuesSetterClass; |
344 | |
} |
345 | |
|
346 | |
|
347 | |
|
348 | |
|
349 | |
public void setDerivedValuesSetterClass(Class<? extends DerivedValuesSetter> derivedValuesSetter) { |
350 | 0 | this.derivedValuesSetterClass = derivedValuesSetter; |
351 | 0 | } |
352 | |
} |