001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.kuali.module.purap.util;
017:
018: import org.apache.commons.lang.StringUtils;
019: import org.kuali.core.bo.DocumentType;
020: import org.kuali.core.datadictionary.BusinessObjectEntry;
021: import org.kuali.core.datadictionary.DataDictionary;
022: import org.kuali.core.service.DataDictionaryService;
023: import org.kuali.core.service.KualiConfigurationService;
024: import org.kuali.core.util.GlobalVariables;
025: import org.kuali.core.util.ObjectUtils;
026: import org.kuali.kfs.KFSConstants;
027: import org.kuali.kfs.KFSKeyConstants;
028: import org.kuali.kfs.KFSPropertyConstants;
029: import org.kuali.kfs.bo.AccountingLine;
030: import org.kuali.kfs.bo.OriginationCode;
031: import org.kuali.kfs.bo.SourceAccountingLine;
032: import org.kuali.kfs.context.SpringContext;
033: import org.kuali.kfs.rules.AccountingLineRuleUtil;
034: import org.kuali.module.chart.bo.Account;
035: import org.kuali.module.chart.bo.Chart;
036: import org.kuali.module.chart.bo.FundGroup;
037: import org.kuali.module.chart.bo.ObjSubTyp;
038: import org.kuali.module.chart.bo.ObjectCode;
039: import org.kuali.module.chart.bo.ObjectType;
040: import org.kuali.module.chart.bo.Org;
041: import org.kuali.module.chart.bo.ProjectCode;
042: import org.kuali.module.chart.bo.SubAccount;
043: import org.kuali.module.chart.bo.SubFundGroup;
044: import org.kuali.module.chart.bo.SubObjCd;
045: import org.kuali.module.chart.service.AccountService;
046:
047: /**
048: * NOTE: COPIED FROM AccountingLineRuleUtil VERSION 1.8, COMPARE WITH THAT FILE FOR DIFF WITH BASE NOTE: DO NOT MAKE CHANGES TO THIS
049: * FILE UNLESS ABSOLUTELY NECESSARY THIS SHOULD NOT CONTAIN PURAP SPECIFIC CODE
050: */
051: public final class PurapAccountingLineRuleUtil extends
052: AccountingLineRuleUtil {
053: /**
054: * This method validates that an accounting line object contains values that actually exist in the DB. SubAccount and SubObject
055: * are only checked if there are values in them. The others throw errors if they area null.
056: *
057: * @param accountingLine
058: * @param dataDictionaryService
059: * @return success or failure of validating the AccountingLine
060: * @throws IllegalStateException
061: */
062: public static boolean validateAccountingLine(
063: AccountingLine accountingLine,
064: DataDictionaryService dataDictionaryService)
065: throws IllegalStateException {
066: if (accountingLine == null) {
067: throw new IllegalStateException(
068: SpringContext
069: .getBean(KualiConfigurationService.class)
070: .getPropertyString(
071: KFSKeyConstants.ERROR_DOCUMENT_NULL_ACCOUNTING_LINE));
072: }
073:
074: // grab the two service instances that will be needed by all the validate methods
075: DataDictionary dd = dataDictionaryService.getDataDictionary();
076:
077: BusinessObjectEntry accountingLineEntry = dd
078: .getBusinessObjectEntry(SourceAccountingLine.class
079: .getName());
080:
081: // retrieve accounting line objects to validate
082: Chart chart = accountingLine.getChart();
083: Account account = accountingLine.getAccount();
084: SubAccount subAccount = accountingLine.getSubAccount();
085: ObjectCode objectCode = accountingLine.getObjectCode();
086: SubObjCd subObjectCode = accountingLine.getSubObjectCode();
087: ProjectCode projectCode = accountingLine.getProject();
088: ObjectType objectTypeCode = accountingLine.getObjectType();
089: OriginationCode referenceOrigin = accountingLine
090: .getReferenceOrigin();
091: DocumentType referenceType = accountingLine.getReferenceType();
092:
093: boolean valid = true;
094: valid &= isValidChart(chart, dd);
095: valid &= isValidAccount(account, dd);
096: // sub account is not required
097: if (StringUtils
098: .isNotBlank(accountingLine.getSubAccountNumber())) {
099: valid &= isValidSubAccount(subAccount, dd);
100: }
101: valid &= isValidObjectCode(objectCode, dd);
102: // sub object is not required
103: if (StringUtils.isNotBlank(accountingLine
104: .getFinancialSubObjectCode())) {
105: valid &= isValidSubObjectCode(subObjectCode, dd);
106: }
107: // project code is not required
108: if (StringUtils.isNotBlank(accountingLine.getProjectCode())) {
109: valid &= isValidProjectCode(projectCode, dd);
110: }
111: // object type code is not required to be entered
112: if (StringUtils.isNotBlank(accountingLine.getObjectTypeCode())) {
113: valid &= isValidObjectTypeCode(objectTypeCode, dd);
114: }
115: if (StringUtils.isNotBlank(accountingLine
116: .getReferenceOriginCode())) {
117: valid &= isValidReferenceOriginCode(referenceOrigin,
118: accountingLineEntry);
119: }
120: if (StringUtils.isNotBlank(accountingLine
121: .getReferenceTypeCode())) {
122: valid &= isValidReferenceTypeCode(referenceType,
123: accountingLineEntry);
124: }
125: valid &= hasRequiredOverrides(accountingLine, accountingLine
126: .getOverrideCode());
127: return valid;
128: }
129:
130: /**
131: * This method validates that the chart is active for use in the system.
132: *
133: * @param chart
134: * @param dataDictionary
135: * @return boolean True if the Chart is valid.
136: */
137: public static boolean isValidChart(Chart chart,
138: DataDictionary dataDictionary) {
139: return isValidChart(chart, dataDictionary,
140: KFSConstants.CHART_OF_ACCOUNTS_CODE_PROPERTY_NAME);
141: }
142:
143: /**
144: * This method validates that the chart is active for use in the system.
145: *
146: * @param chart
147: * @param dataDictionary
148: * @param errorPropertyName
149: * @return boolean True if the Chart is valid.
150: */
151: public static boolean isValidChart(Chart chart,
152: DataDictionary dataDictionary, String errorPropertyName) {
153: String label = getChartLabel();
154:
155: // make sure it exists
156: if (ObjectUtils.isNull(chart)) {
157: GlobalVariables.getErrorMap().putError(errorPropertyName,
158: KFSKeyConstants.ERROR_EXISTENCE, label);
159: return false;
160: }
161:
162: // make sure it's active for usage
163: if (!chart.isFinChartOfAccountActiveIndicator()) {
164: GlobalVariables.getErrorMap().putError(errorPropertyName,
165: KFSKeyConstants.ERROR_INACTIVE, label);
166: return false;
167: }
168:
169: return true;
170: }
171:
172: /**
173: * This method validates that the account is active for use in the system.
174: *
175: * @param account
176: * @param dataDictionary
177: * @return boolean True if it is valid.
178: */
179: public static boolean isValidAccount(Account account,
180: DataDictionary dataDictionary) {
181: return isValidAccount(account, dataDictionary,
182: KFSConstants.ACCOUNT_NUMBER_PROPERTY_NAME);
183: }
184:
185: /**
186: * This method validates that the account is active for use in the system.
187: *
188: * @param account
189: * @param dataDictionary
190: * @param errorPropertyName
191: * @return boolean True if it is valid.
192: */
193: public static boolean isValidAccount(Account account,
194: DataDictionary dataDictionary, String errorPropertyName) {
195: String label = getAccountLabel();
196:
197: // make sure it exists
198: if (ObjectUtils.isNull(account)) {
199: GlobalVariables.getErrorMap().putError(errorPropertyName,
200: KFSKeyConstants.ERROR_EXISTENCE, label);
201: return false;
202: }
203:
204: // make sure it's active for usage
205: if (account.isAccountClosedIndicator()) {
206: GlobalVariables.getErrorMap().putError(errorPropertyName,
207: KFSKeyConstants.ERROR_DOCUMENT_ACCOUNT_CLOSED,
208: label);
209: return false;
210: }
211:
212: return true;
213: }
214:
215: /**
216: * Checks that the given overrideCode is sufficient for the given BO, adding errors to the global map if not.
217: *
218: * @param line
219: * @param overrideCode
220: * @return whether the given overrideCode is sufficient for the given BO.
221: */
222: public static boolean hasRequiredOverrides(AccountingLine line,
223: String overrideCode) {
224: // boolean retVal = true;
225: // AccountingLineOverride override = AccountingLineOverride.valueOf(overrideCode);
226: // Account account = line.getAccount();
227: // if (AccountingLineOverride.needsExpiredAccountOverride(account) &&
228: // !override.hasComponent(AccountingLineOverride.COMPONENT.EXPIRED_ACCOUNT)) {
229: // Account continuation = getUnexpiredContinuationAccountOrNull(account);
230: // if (continuation == null) {
231: // GlobalVariables.getErrorMap().putError(KFSConstants.ACCOUNT_NUMBER_PROPERTY_NAME,
232: // KFSKeyConstants.ERROR_DOCUMENT_ACCOUNT_EXPIRED_NO_CONTINUATION, new String[] { account.getAccountNumber() });
233: // }
234: // else {
235: // GlobalVariables.getErrorMap().putError(KFSConstants.ACCOUNT_NUMBER_PROPERTY_NAME,
236: // KFSKeyConstants.ERROR_DOCUMENT_ACCOUNT_EXPIRED, new String[] { account.getAccountNumber(),
237: // continuation.getChartOfAccountsCode(), continuation.getAccountNumber() });
238: // // todo: ... args in JDK 1.5
239: // }
240: // retVal = false;
241: // }
242: //
243: // ObjectCode objectCode = line.getObjectCode();
244: // if (AccountingLineOverride.needsObjectBudgetOverride(account, objectCode) &&
245: // !override.hasComponent(AccountingLineOverride.COMPONENT.NON_BUDGETED_OBJECT)) {
246: // GlobalVariables.getErrorMap().putError(KFSConstants.FINANCIAL_OBJECT_CODE_PROPERTY_NAME,
247: // KFSKeyConstants.ERROR_DOCUMENT_ACCOUNT_PRESENCE_NON_BUDGETED_OBJECT_CODE, new String[] { account.getAccountNumber(),
248: // objectCode.getFinancialObjectCode() });
249: // retVal = false;
250: // }
251: // return retVal;
252: return true;
253: }
254:
255: /**
256: * This method...
257: *
258: * @param account
259: * @return Account
260: */
261: private static Account getUnexpiredContinuationAccountOrNull(
262: Account account) {
263: int count = 0;
264: while (count++ < 10) { // prevents infinite loops
265: String continuationChartCode = account
266: .getContinuationFinChrtOfAcctCd();
267: String continuationAccountNumber = account
268: .getContinuationAccountNumber();
269: // todo: does AccountService already handle blank keys this way?
270: if (StringUtils.isBlank(continuationChartCode)
271: || StringUtils.isBlank(continuationAccountNumber)) {
272: return null;
273: }
274: account = SpringContext.getBean(AccountService.class)
275: .getByPrimaryId(continuationChartCode,
276: continuationAccountNumber);
277: if (ObjectUtils.isNull(account)) {
278: return null;
279: }
280: if (!account.isAccountClosedIndicator()
281: && !account.isExpired()) {
282: return account;
283: }
284: }
285: return null;
286: }
287:
288: /**
289: * This method validates that a sub account is active.
290: *
291: * @param subAccount
292: * @param dataDictionary
293: * @return true if it exists
294: */
295: public static boolean isValidSubAccount(SubAccount subAccount,
296: DataDictionary dataDictionary) {
297: return isValidSubAccount(subAccount, dataDictionary,
298: KFSConstants.SUB_ACCOUNT_NUMBER_PROPERTY_NAME);
299: }
300:
301: /**
302: * This method validates that a sub account is active.
303: *
304: * @param subAccount
305: * @param dataDictionary
306: * @param errorPropertyName
307: * @return true if it exists
308: */
309: public static boolean isValidSubAccount(SubAccount subAccount,
310: DataDictionary dataDictionary, String errorPropertyName) {
311: String label = getSubAccountLabel();
312:
313: // make sure it exists
314: if (ObjectUtils.isNull(subAccount)) {
315: GlobalVariables.getErrorMap().putError(errorPropertyName,
316: KFSKeyConstants.ERROR_EXISTENCE, label);
317: return false;
318: }
319:
320: // check to make sure it is active
321: if (!subAccount.isSubAccountActiveIndicator()) {
322: GlobalVariables
323: .getErrorMap()
324: .putError(
325: errorPropertyName,
326: KFSKeyConstants.ERROR_DOCUMENT_SUB_ACCOUNT_INACTIVE,
327: label);
328: return false;
329: }
330:
331: return true;
332: }
333:
334: /**
335: * This method validates that an object code is active.
336: *
337: * @param objectCode
338: * @param dataDictionary
339: * @return boolean True if the object code is valid.
340: */
341: public static boolean isValidObjectCode(ObjectCode objectCode,
342: DataDictionary dataDictionary) {
343: return isValidObjectCode(objectCode, dataDictionary,
344: KFSConstants.FINANCIAL_OBJECT_CODE_PROPERTY_NAME);
345: }
346:
347: /**
348: * This method validates that an object code is active.
349: *
350: * @param objectCode
351: * @param dataDictionary
352: * @param errorPropertyName
353: * @return boolean True if the object code is valid.
354: */
355: public static boolean isValidObjectCode(ObjectCode objectCode,
356: DataDictionary dataDictionary, String errorPropertyName) {
357: String label = getObjectCodeLabel();
358:
359: // make sure it exists
360: if (ObjectUtils.isNull(objectCode)) {
361: GlobalVariables.getErrorMap().putError(errorPropertyName,
362: KFSKeyConstants.ERROR_EXISTENCE, label);
363: return false;
364: }
365:
366: // check active status
367: if (!objectCode.isFinancialObjectActiveCode()) {
368: GlobalVariables.getErrorMap().putError(errorPropertyName,
369: KFSKeyConstants.ERROR_INACTIVE, label);
370: return false;
371: }
372:
373: return true;
374: }
375:
376: /**
377: * This method validates that a sub object code is active.
378: *
379: * @param subObjectCode
380: * @param dataDictionary
381: * @return boolean True if it is valid.
382: */
383: public static boolean isValidSubObjectCode(SubObjCd subObjectCode,
384: DataDictionary dataDictionary) {
385: return isValidSubObjectCode(subObjectCode, dataDictionary,
386: KFSConstants.FINANCIAL_SUB_OBJECT_CODE_PROPERTY_NAME);
387: }
388:
389: /**
390: * This method validates that a sub object code is active.
391: *
392: * @param subObjectCode
393: * @param dataDictionary
394: * @param errorPropertyName
395: * @return boolean True if it is valid.
396: */
397: public static boolean isValidSubObjectCode(SubObjCd subObjectCode,
398: DataDictionary dataDictionary, String errorPropertyName) {
399: String label = getSubObjectCodeLabel();
400:
401: // make sure it exists
402: if (ObjectUtils.isNull(subObjectCode)) {
403: GlobalVariables.getErrorMap().putError(errorPropertyName,
404: KFSKeyConstants.ERROR_EXISTENCE, label);
405: return false;
406: }
407:
408: // check active flag
409: if (!subObjectCode.isFinancialSubObjectActiveIndicator()) {
410: GlobalVariables.getErrorMap().putError(errorPropertyName,
411: KFSKeyConstants.ERROR_INACTIVE, label);
412: return false;
413: }
414: return true;
415: }
416:
417: /**
418: * This method validates that a project code is active.
419: *
420: * @param projectCode
421: * @param dataDictionary
422: * @return boolean True if it is valid.
423: */
424: public static boolean isValidProjectCode(ProjectCode projectCode,
425: DataDictionary dataDictionary) {
426: return isValidProjectCode(projectCode, dataDictionary,
427: KFSConstants.PROJECT_CODE_PROPERTY_NAME);
428: }
429:
430: /**
431: * This method validates that a project code is active.
432: *
433: * @param projectCode
434: * @param dataDictionary
435: * @param errorPropertyName
436: * @return boolean True if it is valid.
437: */
438: public static boolean isValidProjectCode(ProjectCode projectCode,
439: DataDictionary dataDictionary, String errorPropertyName) {
440: // note that the errorPropertyName does not match the actual attribute name
441: String label = getProjectCodeLabel();
442:
443: // make sure it exists
444: if (ObjectUtils.isNull(projectCode)) {
445: GlobalVariables.getErrorMap().putError(errorPropertyName,
446: KFSKeyConstants.ERROR_EXISTENCE, label);
447: return false;
448: }
449:
450: // check activity
451: if (!projectCode.isActive()) {
452: GlobalVariables.getErrorMap().putError(errorPropertyName,
453: KFSKeyConstants.ERROR_INACTIVE, label);
454: return false;
455: }
456:
457: return true;
458: }
459:
460: /**
461: * For the most part, object type codes aren't required on an accounting line; however, in some situations (e.g. Journal
462: * Voucher) they are entered directly into the accounting line and must be validated. In those cases, they must be validated for
463: * activeness.
464: *
465: * @param objectTypeCode
466: * @param dataDictionary
467: * @return boolean True if the object type code is valid, false otherwise.
468: */
469: public static boolean isValidObjectTypeCode(
470: ObjectType objectTypeCode, DataDictionary dataDictionary) {
471: return isValidObjectTypeCode(objectTypeCode, dataDictionary,
472: KFSConstants.OBJECT_TYPE_CODE_PROPERTY_NAME);
473: }
474:
475: /**
476: * For the most part, object type codes aren't required on an accounting line; however, in some situations (e.g. Journal
477: * Voucher) they are entered directly into the accounting line and must be validated. In those cases, they must be validated for
478: * activeness.
479: *
480: * @param objectTypeCode
481: * @param dataDictionary
482: * @param errorPropertyName
483: * @return boolean True if the object type code is valid, false otherwise.
484: */
485: public static boolean isValidObjectTypeCode(
486: ObjectType objectTypeCode, DataDictionary dataDictionary,
487: String errorPropertyName) {
488: // note that the errorPropertyName does not match the actual attribute name
489: String label = getObjectTypeCodeLabel();
490:
491: // make sure it exists
492: if (ObjectUtils.isNull(objectTypeCode)) {
493: GlobalVariables.getErrorMap().putError(errorPropertyName,
494: KFSKeyConstants.ERROR_EXISTENCE, label);
495: return false;
496: }
497:
498: // check activity
499: if (!objectTypeCode.isActive()) {
500: GlobalVariables.getErrorMap().putError(errorPropertyName,
501: KFSKeyConstants.ERROR_INACTIVE, label);
502: return false;
503: }
504:
505: return true;
506: }
507:
508: /**
509: * This method will check the reference origin code for existence in the system and whether it can actively be used.
510: *
511: * @param referenceOriginCode
512: * @param accountingLineEntry
513: * @return boolean True if the object is valid; false otherwise.
514: */
515: private static boolean isValidReferenceOriginCode(
516: OriginationCode referenceOriginCode,
517: BusinessObjectEntry accountingLineEntry) {
518: return checkExistence(referenceOriginCode, accountingLineEntry,
519: KFSPropertyConstants.REFERENCE_ORIGIN_CODE,
520: KFSPropertyConstants.REFERENCE_ORIGIN_CODE);
521: }
522:
523: /**
524: * This method will check the reference type code for existence in the system and whether it can actively be used.
525: *
526: * @param referenceType
527: * @param accountingLineEntry
528: * @return boolean True if the object is valid; false otherwise.
529: */
530: private static boolean isValidReferenceTypeCode(
531: DocumentType referenceType,
532: BusinessObjectEntry accountingLineEntry) {
533: return checkExistence(referenceType, accountingLineEntry,
534: KFSPropertyConstants.REFERENCE_TYPE_CODE,
535: KFSPropertyConstants.REFERENCE_TYPE_CODE);
536: }
537:
538: /**
539: * Checks for the existence of the given Object. This is doing an OJB-proxy-smart check, so assuming the given Object is not in
540: * need of a refresh(), this method adds an ERROR_EXISTENCE to the global error map if the given Object is not in the database.
541: *
542: * @param toCheck the Object to check for existence
543: * @param accountingLineEntry to get the property's label for the error message parameter.
544: * @param attributeName the name of the SourceAccountingLine attribute in the DataDictionary accountingLineEntry
545: * @param propertyName the name of the property within the global error path.
546: * @return whether the given Object exists or not
547: */
548: private static boolean checkExistence(Object toCheck,
549: BusinessObjectEntry accountingLineEntry,
550: String attributeName, String propertyName) {
551: String label = accountingLineEntry.getAttributeDefinition(
552: attributeName).getShortLabel();
553: if (ObjectUtils.isNull(toCheck)) {
554: GlobalVariables.getErrorMap().putError(propertyName,
555: KFSKeyConstants.ERROR_EXISTENCE, label);
556: return false;
557: }
558: return true;
559: }
560:
561: /**
562: * @return short label for chart code defined in data dictionary
563: */
564: public static String getChartLabel() {
565: return SpringContext
566: .getBean(DataDictionaryService.class)
567: .getDataDictionary()
568: .getBusinessObjectEntry(Chart.class.getName())
569: .getAttributeDefinition(
570: KFSConstants.CHART_OF_ACCOUNTS_CODE_PROPERTY_NAME)
571: .getShortLabel();
572: }
573:
574: /**
575: * @return short label for account number defined in data dictionary
576: */
577: public static String getAccountLabel() {
578: return SpringContext.getBean(DataDictionaryService.class)
579: .getDataDictionary().getBusinessObjectEntry(
580: Account.class.getName())
581: .getAttributeDefinition(
582: KFSConstants.ACCOUNT_NUMBER_PROPERTY_NAME)
583: .getShortLabel();
584: }
585:
586: /**
587: * @return short label for sub account number defined in data dictionary
588: */
589: public static String getSubAccountLabel() {
590: return SpringContext.getBean(DataDictionaryService.class)
591: .getDataDictionary().getBusinessObjectEntry(
592: SubAccount.class.getName())
593: .getAttributeDefinition(
594: KFSConstants.SUB_ACCOUNT_NUMBER_PROPERTY_NAME)
595: .getShortLabel();
596: }
597:
598: /**
599: * @return short label for object code defined in data dictionary
600: */
601: public static String getObjectCodeLabel() {
602: return SpringContext
603: .getBean(DataDictionaryService.class)
604: .getDataDictionary()
605: .getBusinessObjectEntry(ObjectCode.class.getName())
606: .getAttributeDefinition(
607: KFSConstants.FINANCIAL_OBJECT_CODE_PROPERTY_NAME)
608: .getShortLabel();
609: }
610:
611: /**
612: * @return short label for sub object code defined in data dictionary
613: */
614: public static String getSubObjectCodeLabel() {
615: return SpringContext
616: .getBean(DataDictionaryService.class)
617: .getDataDictionary()
618: .getBusinessObjectEntry(SubObjCd.class.getName())
619: .getAttributeDefinition(
620: KFSConstants.FINANCIAL_SUB_OBJECT_CODE_PROPERTY_NAME)
621: .getShortLabel();
622: }
623:
624: /**
625: * @return short label for project code defined in data dictionary
626: */
627: public static String getProjectCodeLabel() {
628: return SpringContext.getBean(DataDictionaryService.class)
629: .getDataDictionary().getBusinessObjectEntry(
630: ProjectCode.class.getName())
631: .getAttributeDefinition(KFSPropertyConstants.CODE)
632: .getShortLabel();
633: }
634:
635: /**
636: * @return short label for object type code defined in data dictionary
637: */
638: public static String getObjectTypeCodeLabel() {
639: return SpringContext.getBean(DataDictionaryService.class)
640: .getDataDictionary().getBusinessObjectEntry(
641: ObjectType.class.getName())
642: .getAttributeDefinition(
643: KFSConstants.GENERIC_CODE_PROPERTY_NAME)
644: .getShortLabel();
645: }
646:
647: /**
648: * @return short label for object sub type code defined in data dictionary
649: */
650: public static String getObjectSubTypeCodeLabel() {
651: return SpringContext.getBean(DataDictionaryService.class)
652: .getDataDictionary().getBusinessObjectEntry(
653: ObjSubTyp.class.getName())
654: .getAttributeDefinition(KFSPropertyConstants.CODE)
655: .getShortLabel();
656: }
657:
658: /**
659: * @return short label for organization code defined in data dictionary
660: */
661: public static String getOrganizationCodeLabel() {
662: return SpringContext.getBean(DataDictionaryService.class)
663: .getDataDictionary().getBusinessObjectEntry(
664: Org.class.getName()).getAttributeDefinition(
665: KFSPropertyConstants.ORGANIZATION_CODE)
666: .getShortLabel();
667: }
668:
669: /**
670: * @return short label for fund group code defined in data dictionary
671: */
672: public static String getFundGroupCodeLabel() {
673: return SpringContext.getBean(DataDictionaryService.class)
674: .getDataDictionary().getBusinessObjectEntry(
675: FundGroup.class.getName())
676: .getAttributeDefinition(KFSPropertyConstants.CODE)
677: .getShortLabel();
678: }
679:
680: /**
681: * @return short label for sub fund group code defined in data dictionary
682: */
683: public static String getSubFundGroupCodeLabel() {
684: return SpringContext.getBean(DataDictionaryService.class)
685: .getDataDictionary().getBusinessObjectEntry(
686: SubFundGroup.class.getName())
687: .getAttributeDefinition(
688: KFSPropertyConstants.SUB_FUND_GROUP_CODE)
689: .getShortLabel();
690: }
691: }
|