001: /*
002: * Copyright 2005-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.chart.bo;
017:
018: import java.sql.Date;
019: import java.util.HashSet;
020: import java.util.LinkedHashMap;
021: import java.util.Properties;
022: import java.util.Set;
023:
024: import org.apache.commons.lang.StringUtils;
025: import org.apache.log4j.Logger;
026: import org.kuali.core.bo.Campus;
027: import org.kuali.core.bo.Inactivateable;
028: import org.kuali.core.bo.PersistableBusinessObjectBase;
029: import org.kuali.core.bo.user.UniversalUser;
030: import org.kuali.core.service.KualiConfigurationService;
031: import org.kuali.core.service.UniversalUserService;
032: import org.kuali.core.util.UrlFactory;
033: import org.kuali.kfs.KFSConstants;
034: import org.kuali.kfs.bo.Country;
035: import org.kuali.kfs.bo.PostalZipCode;
036: import org.kuali.kfs.context.SpringContext;
037: import org.kuali.module.chart.service.OrganizationService;
038:
039: /**
040: *
041: */
042: public class Org extends PersistableBusinessObjectBase implements
043: Inactivateable {
044: private static final Logger LOG = Logger.getLogger(Org.class);
045:
046: private static final long serialVersionUID = 121873645110037203L;
047:
048: /**
049: * Default no-arg constructor.
050: */
051: public Org() {
052: organizationInFinancialProcessingIndicator = false;
053: }
054:
055: private String organizationCode;
056: private String organizationName;
057: private String organizationCityName;
058: private String organizationStateCode;
059: private String organizationZipCode;
060: private Date organizationBeginDate;
061: private Date organizationEndDate;
062: private boolean organizationActiveIndicator;
063: private boolean organizationInFinancialProcessingIndicator;
064: private String organizationManagerUniversalId;
065: private String responsibilityCenterCode;
066: private String organizationPhysicalCampusCode;
067: private String organizationTypeCode;
068: private String reportsToChartOfAccountsCode;
069: private String reportsToOrganizationCode;
070: private String organizationPlantAccountNumber;
071: private String campusPlantAccountNumber;
072: private String organizationPlantChartCode;
073: private String campusPlantChartCode;
074: private String organizationCountryCode;
075: private String organizationLine1Address;
076: private String organizationLine2Address;
077:
078: private Chart chartOfAccounts;
079: private Org hrisOrganization;
080: private Account organizationDefaultAccount;
081: private UniversalUser organizationManagerUniversal;
082: private ResponsibilityCenter responsibilityCenter;
083: private Campus organizationPhysicalCampus;
084: private OrgType organizationType;
085: private Org reportsToOrganization;
086: private Chart reportsToChartOfAccounts;
087: private Account organizationPlantAccount;
088: private Account campusPlantAccount;
089: private Chart organizationPlantChart;
090: private Chart campusPlantChart;
091: private PostalZipCode postalZip;
092: private Country organizationCountry;
093:
094: // HRMS Org fields
095: private OrganizationExtension organizationExtension;
096: private String editHrmsUnitSectionBlank;
097: private String editHrmsUnitSection;
098:
099: // fields for mixed anonymous keys
100: private String organizationDefaultAccountNumber;
101: private String chartOfAccountsCode;
102:
103: // Several kinds of Dummy Attributes for dividing sections on Inquiry page
104: private String editPlantAccountsSectionBlank;
105: private String editPlantAccountsSection;
106:
107: private boolean active;
108:
109: /**
110: * Gets the organizationCode attribute.
111: *
112: * @return Returns the organizationCode
113: */
114: public String getOrganizationCode() {
115: return organizationCode;
116: }
117:
118: /**
119: * Sets the organizationCode attribute.
120: *
121: * @param organizationCode The organizationCode to set.
122: */
123: public void setOrganizationCode(String organizationCode) {
124: this .organizationCode = organizationCode;
125: }
126:
127: /**
128: * Gets the organizationName attribute.
129: *
130: * @return Returns the organizationName
131: */
132: public String getOrganizationName() {
133: return organizationName;
134: }
135:
136: /**
137: * Sets the organizationName attribute.
138: *
139: * @param organizationName The organizationName to set.
140: */
141: public void setOrganizationName(String organizationName) {
142: this .organizationName = organizationName;
143: }
144:
145: /**
146: * Gets the organizationCityName attribute.
147: *
148: * @return Returns the organizationCityName
149: */
150: public String getOrganizationCityName() {
151: return organizationCityName;
152: }
153:
154: /**
155: * Sets the organizationCityName attribute.
156: *
157: * @param organizationCityName The organizationCityName to set.
158: */
159: public void setOrganizationCityName(String organizationCityName) {
160: this .organizationCityName = organizationCityName;
161: }
162:
163: /**
164: * Gets the organizationStateCode attribute.
165: *
166: * @return Returns the organizationStateCode
167: */
168: public String getOrganizationStateCode() {
169: return organizationStateCode;
170: }
171:
172: /**
173: * Sets the organizationStateCode attribute.
174: *
175: * @param organizationStateCode The organizationStateCode to set.
176: */
177: public void setOrganizationStateCode(String organizationStateCode) {
178: this .organizationStateCode = organizationStateCode;
179: }
180:
181: /**
182: * Gets the organizationZipCode attribute.
183: *
184: * @return Returns the organizationZipCode
185: */
186: public String getOrganizationZipCode() {
187: return organizationZipCode;
188: }
189:
190: /**
191: * Sets the organizationZipCode attribute.
192: *
193: * @param organizationZipCode The organizationZipCode to set.
194: */
195: public void setOrganizationZipCode(String organizationZipCode) {
196: this .organizationZipCode = organizationZipCode;
197: }
198:
199: /**
200: * Gets the organizationBeginDate attribute.
201: *
202: * @return Returns the organizationBeginDate
203: */
204: public Date getOrganizationBeginDate() {
205: return organizationBeginDate;
206: }
207:
208: /**
209: * Sets the organizationBeginDate attribute.
210: *
211: * @param organizationBeginDate The organizationBeginDate to set.
212: */
213: public void setOrganizationBeginDate(Date organizationBeginDate) {
214: this .organizationBeginDate = organizationBeginDate;
215: }
216:
217: /**
218: * Gets the organizationEndDate attribute.
219: *
220: * @return Returns the organizationEndDate
221: */
222: public Date getOrganizationEndDate() {
223: return organizationEndDate;
224: }
225:
226: /**
227: * Sets the organizationEndDate attribute.
228: *
229: * @param organizationEndDate The organizationEndDate to set.
230: */
231: public void setOrganizationEndDate(Date organizationEndDate) {
232: this .organizationEndDate = organizationEndDate;
233: }
234:
235: /**
236: * Gets the organizationActiveIndicator attribute.
237: *
238: * @return Returns the organizationActiveIndicator
239: */
240: public boolean isOrganizationActiveIndicator() {
241: return organizationActiveIndicator;
242: }
243:
244: /**
245: * Sets the organizationActiveIndicator attribute.
246: *
247: * @param organizationActiveIndicator The organizationActiveIndicator to set.
248: */
249: public void setOrganizationActiveIndicator(
250: boolean organizationActiveIndicator) {
251: this .organizationActiveIndicator = organizationActiveIndicator;
252: }
253:
254: /**
255: * Gets the organizationInFinancialProcessingIndicator attribute.
256: *
257: * @return Returns the organizationInFinancialProcessingIndicator
258: */
259: public boolean isOrganizationInFinancialProcessingIndicator() {
260: return organizationInFinancialProcessingIndicator;
261: }
262:
263: /**
264: * Sets the organizationInFinancialProcessingIndicator attribute.
265: *
266: * @param organizationInFinancialProcessingIndicator The organizationInFinancialProcessingIndicator to set.
267: */
268: public void setOrganizationInFinancialProcessingIndicator(
269: boolean organizationInFinancialProcessingIndicator) {
270: this .organizationInFinancialProcessingIndicator = organizationInFinancialProcessingIndicator;
271: }
272:
273: /**
274: * Gets the chartOfAccounts attribute.
275: *
276: * @return Returns the chartOfAccounts
277: */
278: public Chart getChartOfAccounts() {
279: return chartOfAccounts;
280: }
281:
282: /**
283: * Sets the chartOfAccounts attribute.
284: *
285: * @param chartOfAccounts The chartOfAccounts to set.
286: * @deprecated
287: */
288: public void setChartOfAccounts(Chart chartOfAccounts) {
289: this .chartOfAccounts = chartOfAccounts;
290: }
291:
292: /**
293: * Gets the organizationDefaultAccount attribute.
294: *
295: * @return Returns the organizationDefaultAccount
296: */
297: public Account getOrganizationDefaultAccount() {
298: return organizationDefaultAccount;
299: }
300:
301: /**
302: * Sets the organizationDefaultAccount attribute.
303: *
304: * @param organizationDefaultAccount The organizationDefaultAccount to set.
305: * @deprecated
306: */
307: public void setOrganizationDefaultAccount(
308: Account organizationDefaultAccount) {
309: this .organizationDefaultAccount = organizationDefaultAccount;
310: }
311:
312: public UniversalUser getOrganizationManagerUniversal() {
313: organizationManagerUniversal = SpringContext.getBean(
314: UniversalUserService.class)
315: .updateUniversalUserIfNecessary(
316: organizationManagerUniversalId,
317: organizationManagerUniversal);
318: return organizationManagerUniversal;
319: }
320:
321: /**
322: * Sets the organizationManagerUniversal attribute.
323: *
324: * @param organizationManagerUniversal The organizationManagerUniversal to set.
325: * @deprecated
326: */
327: public void setOrganizationManagerUniversal(
328: UniversalUser organizationManagerUniversal) {
329: this .organizationManagerUniversal = organizationManagerUniversal;
330: }
331:
332: /**
333: * Gets the responsibilityCenter attribute.
334: *
335: * @return Returns the responsibilityCenter
336: */
337: public ResponsibilityCenter getResponsibilityCenter() {
338: return responsibilityCenter;
339: }
340:
341: /**
342: * Sets the responsibilityCenter attribute.
343: *
344: * @param responsibilityCenter The responsibilityCenter to set.
345: * @deprecated
346: */
347: public void setResponsibilityCenter(
348: ResponsibilityCenter responsibilityCenter) {
349: this .responsibilityCenter = responsibilityCenter;
350: }
351:
352: /**
353: * Gets the organizationPhysicalCampus attribute.
354: *
355: * @return Returns the organizationPhysicalCampus
356: */
357: public Campus getOrganizationPhysicalCampus() {
358: return organizationPhysicalCampus;
359: }
360:
361: /**
362: * Sets the organizationPhysicalCampus attribute.
363: *
364: * @param organizationPhysicalCampus The organizationPhysicalCampus to set.
365: * @deprecated
366: */
367: public void setOrganizationPhysicalCampus(
368: Campus organizationPhysicalCampus) {
369: this .organizationPhysicalCampus = organizationPhysicalCampus;
370: }
371:
372: /**
373: * Gets the organizationType attribute.
374: *
375: * @return Returns the organizationType
376: */
377: public OrgType getOrganizationType() {
378: return organizationType;
379: }
380:
381: /**
382: * Sets the organizationType attribute.
383: *
384: * @param organizationType The organizationType to set.
385: * @deprecated
386: */
387: public void setOrganizationType(OrgType organizationType) {
388: this .organizationType = organizationType;
389: }
390:
391: /**
392: * Gets the reportsToOrganization attribute.
393: *
394: * @return Returns the reportsToOrganization
395: */
396: public Org getReportsToOrganization() {
397: return reportsToOrganization;
398: }
399:
400: /**
401: * Sets the reportsToOrganization attribute.
402: *
403: * @param reportsToOrganization The reportsToOrganization to set.
404: * @deprecated
405: */
406: public void setReportsToOrganization(Org reportsToOrganization) {
407: this .reportsToOrganization = reportsToOrganization;
408: }
409:
410: /**
411: * Gets the reportsToChartOfAccounts attribute.
412: *
413: * @return Returns the reportsToChartOfAccounts
414: */
415: public Chart getReportsToChartOfAccounts() {
416: return reportsToChartOfAccounts;
417: }
418:
419: /**
420: * Sets the reportsToChartOfAccounts attribute.
421: *
422: * @param reportsToChartOfAccounts The reportsToChartOfAccounts to set.
423: * @deprecated
424: */
425: public void setReportsToChartOfAccounts(
426: Chart reportsToChartOfAccounts) {
427: this .reportsToChartOfAccounts = reportsToChartOfAccounts;
428: }
429:
430: /**
431: * Gets the organizationPlantAccount attribute.
432: *
433: * @return Returns the organizationPlantAccount
434: */
435: public Account getOrganizationPlantAccount() {
436: return organizationPlantAccount;
437: }
438:
439: /**
440: * Sets the organizationPlantAccount attribute.
441: *
442: * @param organizationPlantAccount The organizationPlantAccount to set.
443: * @deprecated
444: */
445: public void setOrganizationPlantAccount(
446: Account organizationPlantAccount) {
447: this .organizationPlantAccount = organizationPlantAccount;
448: }
449:
450: /**
451: * Gets the campusPlantAccount attribute.
452: *
453: * @return Returns the campusPlantAccount
454: */
455: public Account getCampusPlantAccount() {
456: return campusPlantAccount;
457: }
458:
459: /**
460: * Sets the campusPlantAccount attribute.
461: *
462: * @param campusPlantAccount The campusPlantAccount to set.
463: * @deprecated
464: */
465: public void setCampusPlantAccount(Account campusPlantAccount) {
466: this .campusPlantAccount = campusPlantAccount;
467: }
468:
469: /**
470: * Gets the organizationPlantChart attribute.
471: *
472: * @return Returns the organizationPlantChart
473: */
474: public Chart getOrganizationPlantChart() {
475: return organizationPlantChart;
476: }
477:
478: /**
479: * Sets the organizationPlantChart attribute.
480: *
481: * @param organizationPlantChart The organizationPlantChart to set.
482: * @deprecated
483: */
484: public void setOrganizationPlantChart(Chart organizationPlantChart) {
485: this .organizationPlantChart = organizationPlantChart;
486: }
487:
488: /**
489: * Gets the campusPlantChart attribute.
490: *
491: * @return Returns the campusPlantChart
492: */
493: public Chart getCampusPlantChart() {
494: return campusPlantChart;
495: }
496:
497: /**
498: * Sets the campusPlantChart attribute.
499: *
500: * @param campusPlantChart The campusPlantChart to set.
501: * @deprecated
502: */
503: public void setCampusPlantChart(Chart campusPlantChart) {
504: this .campusPlantChart = campusPlantChart;
505: }
506:
507: /**
508: * Gets the organizationCountry attribute.
509: *
510: * @return Returns the organizationCountry.
511: */
512: public Country getOrganizationCountry() {
513: return organizationCountry;
514: }
515:
516: /**
517: * Sets the organizationCountry attribute value.
518: *
519: * @param organizationCountry The organizationCountry to set.
520: * @deprecated
521: */
522: public void setOrganizationCountry(Country organizationCountry) {
523: this .organizationCountry = organizationCountry;
524: }
525:
526: /**
527: * Gets the chartOfAccountsCode attribute.
528: *
529: * @return Returns the chartOfAccountsCode.
530: */
531: public String getChartOfAccountsCode() {
532: return chartOfAccountsCode;
533: }
534:
535: /**
536: * Sets the chartOfAccountsCode attribute value.
537: *
538: * @param chartOfAccountsCode The chartOfAccountsCode to set.
539: */
540: public void setChartOfAccountsCode(String chartOfAccountsCode) {
541: this .chartOfAccountsCode = chartOfAccountsCode;
542: }
543:
544: /**
545: * Gets the organizationDefaultAccountNumber attribute.
546: *
547: * @return Returns the organizationDefaultAccountNumber.
548: */
549: public String getOrganizationDefaultAccountNumber() {
550: return organizationDefaultAccountNumber;
551: }
552:
553: /**
554: * Sets the organizationDefaultAccountNumber attribute value.
555: *
556: * @param organizationDefaultAccountNumber The organizationDefaultAccountNumber to set.
557: */
558: public void setOrganizationDefaultAccountNumber(
559: String organizationDefaultAccountNumber) {
560: this .organizationDefaultAccountNumber = organizationDefaultAccountNumber;
561: }
562:
563: /**
564: * @return Returns the campusPlantAccountNumber.
565: */
566: public String getCampusPlantAccountNumber() {
567: return campusPlantAccountNumber;
568: }
569:
570: /**
571: * @param campusPlantAccountNumber The campusPlantAccountNumber to set.
572: */
573: public void setCampusPlantAccountNumber(
574: String campusPlantAccountNumber) {
575: this .campusPlantAccountNumber = campusPlantAccountNumber;
576: }
577:
578: /**
579: * @return Returns the campusPlantChartCode.
580: */
581: public String getCampusPlantChartCode() {
582: return campusPlantChartCode;
583: }
584:
585: /**
586: * @param campusPlantChartCode The campusPlantChartCode to set.
587: */
588: public void setCampusPlantChartCode(String campusPlantChartCode) {
589: this .campusPlantChartCode = campusPlantChartCode;
590: }
591:
592: /**
593: * @return Returns the organizationManagerUniversalId.
594: */
595: public String getOrganizationManagerUniversalId() {
596: return organizationManagerUniversalId;
597: }
598:
599: /**
600: * @param organizationManagerUniversalId The organizationManagerUniversalId to set.
601: */
602: public void setOrganizationManagerUniversalId(
603: String organizationManagerUniversalId) {
604: this .organizationManagerUniversalId = organizationManagerUniversalId;
605: }
606:
607: /**
608: * @return Returns the organizationPhysicalCampusCode.
609: */
610: public String getOrganizationPhysicalCampusCode() {
611: return organizationPhysicalCampusCode;
612: }
613:
614: /**
615: * @param organizationPhysicalCampusCode The organizationPhysicalCampusCode to set.
616: */
617: public void setOrganizationPhysicalCampusCode(
618: String organizationPhysicalCampusCode) {
619: this .organizationPhysicalCampusCode = organizationPhysicalCampusCode;
620: }
621:
622: /**
623: * @return Returns the organizationPlantAccountNumber.
624: */
625: public String getOrganizationPlantAccountNumber() {
626: return organizationPlantAccountNumber;
627: }
628:
629: /**
630: * @param organizationPlantAccountNumber The organizationPlantAccountNumber to set.
631: */
632: public void setOrganizationPlantAccountNumber(
633: String organizationPlantAccountNumber) {
634: this .organizationPlantAccountNumber = organizationPlantAccountNumber;
635: }
636:
637: /**
638: * @return Returns the organizationPlantChartCode.
639: */
640: public String getOrganizationPlantChartCode() {
641: return organizationPlantChartCode;
642: }
643:
644: /**
645: * @param organizationPlantChartCode The organizationPlantChartCode to set.
646: */
647: public void setOrganizationPlantChartCode(
648: String organizationPlantChartCode) {
649: this .organizationPlantChartCode = organizationPlantChartCode;
650: }
651:
652: /**
653: * @return Returns the organizationTypeCode.
654: */
655: public String getOrganizationTypeCode() {
656: return organizationTypeCode;
657: }
658:
659: /**
660: * @param organizationTypeCode The organizationTypeCode to set.
661: */
662: public void setOrganizationTypeCode(String organizationTypeCode) {
663: this .organizationTypeCode = organizationTypeCode;
664: }
665:
666: /**
667: * @return Returns the reportsToChartOfAccountsCode.
668: */
669: public String getReportsToChartOfAccountsCode() {
670: return reportsToChartOfAccountsCode;
671: }
672:
673: /**
674: * @param reportsToChartOfAccountsCode The reportsToChartOfAccountsCode to set.
675: */
676: public void setReportsToChartOfAccountsCode(
677: String reportsToChartOfAccountsCode) {
678: this .reportsToChartOfAccountsCode = reportsToChartOfAccountsCode;
679: }
680:
681: /**
682: * @return Returns the reportsToOrganizationCode.
683: */
684: public String getReportsToOrganizationCode() {
685: return reportsToOrganizationCode;
686: }
687:
688: /**
689: * @param reportsToOrganizationCode The reportsToOrganizationCode to set.
690: */
691: public void setReportsToOrganizationCode(
692: String reportsToOrganizationCode) {
693: this .reportsToOrganizationCode = reportsToOrganizationCode;
694: }
695:
696: /**
697: * @return Returns the responsibilityCenterCode.
698: */
699: public String getResponsibilityCenterCode() {
700: return responsibilityCenterCode;
701: }
702:
703: /**
704: * @param responsibilityCenterCode The responsibilityCenterCode to set.
705: */
706: public void setResponsibilityCenterCode(
707: String responsibilityCenterCode) {
708: this .responsibilityCenterCode = responsibilityCenterCode;
709: }
710:
711: /**
712: * Gets the postalZip attribute.
713: *
714: * @return Returns the postalZip.
715: */
716: public PostalZipCode getPostalZip() {
717: return postalZip;
718: }
719:
720: /**
721: * Sets the postalZip attribute value.
722: *
723: * @param postalZip The postalZip to set.
724: */
725: public void setPostalZip(PostalZipCode postalZip) {
726: this .postalZip = postalZip;
727: }
728:
729: /**
730: * Gets the organizationCountryCode attribute.
731: *
732: * @return Returns the organizationCountryCode.
733: */
734: public String getOrganizationCountryCode() {
735: return organizationCountryCode;
736: }
737:
738: /**
739: * Sets the organizationCountryCode attribute value.
740: *
741: * @param organizationCountryCode The organizationCountryCode to set.
742: */
743: public void setOrganizationCountryCode(
744: String organizationCountryCode) {
745: this .organizationCountryCode = organizationCountryCode;
746: }
747:
748: /**
749: * Gets the organizationLine1Address attribute.
750: *
751: * @return Returns the organizationLine1Address.
752: */
753: public String getOrganizationLine1Address() {
754: return organizationLine1Address;
755: }
756:
757: /**
758: * Sets the organizationLine1Address attribute value.
759: *
760: * @param organizationLine1Address The organizationLine1Address to set.
761: */
762: public void setOrganizationLine1Address(
763: String organizationLine1Address) {
764: this .organizationLine1Address = organizationLine1Address;
765: }
766:
767: /**
768: * Gets the organizationLine2Address attribute.
769: *
770: * @return Returns the organizationLine2Address.
771: */
772: public String getOrganizationLine2Address() {
773: return organizationLine2Address;
774: }
775:
776: /**
777: * Sets the organizationLine2Address attribute value.
778: *
779: * @param organizationLine2Address The organizationLine2Address to set.
780: */
781: public void setOrganizationLine2Address(
782: String organizationLine2Address) {
783: this .organizationLine2Address = organizationLine2Address;
784: }
785:
786: /**
787: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
788: */
789: protected LinkedHashMap toStringMapper() {
790: LinkedHashMap m = new LinkedHashMap();
791:
792: m.put("chartOfAccountsCode", this .chartOfAccountsCode);
793: m.put("organizationCode", this .organizationCode);
794:
795: return m;
796: }
797:
798: /**
799: * Gets the editPlantAccountsSection attribute.
800: *
801: * @return Returns the editPlantAccountsSection.
802: */
803: public String getEditPlantAccountsSection() {
804: return editPlantAccountsSection;
805: }
806:
807: /**
808: * Gets the editPlantAccountsSectionBlank attribute.
809: *
810: * @return Returns the editPlantAccountsSectionBlank.
811: */
812: public String getEditPlantAccountsSectionBlank() {
813: return editPlantAccountsSectionBlank;
814: }
815:
816: /**
817: * Gets the editHrmsUnitSection attribute.
818: *
819: * @return Returns the editHrmsUnitSection.
820: */
821: public final String getEditHrmsUnitSection() {
822: return editHrmsUnitSection;
823: }
824:
825: /**
826: * Sets the editHrmsUnitSection attribute value.
827: *
828: * @param editHrmsUnitSection The editHrmsUnitSection to set.
829: */
830: public final void setEditHrmsUnitSection(String editHrmsUnitSection) {
831: this .editHrmsUnitSection = editHrmsUnitSection;
832: }
833:
834: /**
835: * Gets the editHrmsUnitSectionBlank attribute.
836: *
837: * @return Returns the editHrmsUnitSectionBlank.
838: */
839: public final String getEditHrmsUnitSectionBlank() {
840: return editHrmsUnitSectionBlank;
841: }
842:
843: /**
844: * Sets the editHrmsUnitSectionBlank attribute value.
845: *
846: * @param editHrmsUnitSectionBlank The editHrmsUnitSectionBlank to set.
847: */
848: public final void setEditHrmsUnitSectionBlank(
849: String editHrmsUnitSectionBlank) {
850: this .editHrmsUnitSectionBlank = editHrmsUnitSectionBlank;
851: }
852:
853: /**
854: * Gets the organizationExtension attribute.
855: *
856: * @return Returns the organizationExtension.
857: */
858: public final OrganizationExtension getOrganizationExtension() {
859: return organizationExtension;
860: }
861:
862: /**
863: * Sets the organizationExtension attribute value.
864: *
865: * @param organizationExtension The organizationExtension to set.
866: */
867: public final void setOrganizationExtension(
868: OrganizationExtension organizationExtension) {
869: this .organizationExtension = organizationExtension;
870: }
871:
872: public String getOrganizationHierarchy() {
873: StringBuffer result = new StringBuffer();
874: Set<Org> seen = new HashSet<Org>();
875:
876: Org org = this ;
877:
878: while (org != null
879: && org.getReportsToOrganizationCode() != null
880: && !seen.contains(org)) {
881: String rChart = org.getReportsToChartOfAccountsCode();
882: String rOrg = org.getReportsToOrganizationCode();
883:
884: seen.add(org);
885: org = SpringContext.getBean(OrganizationService.class)
886: .getByPrimaryId(rChart, rOrg);
887:
888: result.append(rChart).append("/").append(rOrg).append(" ");
889: result.append(((org == null) ? "" : org
890: .getOrganizationName()));
891: if (org.getReportsToOrganizationCode() != null
892: && !seen.contains(org)) {
893: result.append(" ==> ");
894: }
895: result.append("\n");
896: }
897:
898: return result.toString();
899: }
900:
901: public String getOrganizationReviewHierarchy() {
902:
903: Properties params = new Properties();
904: params.put("methodToCall", "start");
905: params.put("docFormKey", "");
906: params.put("lookupableImplServiceName",
907: "RuleBaseValuesLookupableImplService");
908: params.put("fin_coa_cd", this .chartOfAccountsCode);
909: params.put("org_cd", this .organizationCode);
910: params.put("conversionFields", "");
911: params.put("returnLocation", "");
912: params.put("active_ind", "true");
913: params.put("ruleTemplateName", "KualiOrgReviewTemplate");
914:
915: return UrlFactory.parameterizeUrl(SpringContext.getBean(
916: KualiConfigurationService.class).getPropertyString(
917: KFSConstants.WORKFLOW_URL_KEY)
918: + "/Lookup.do", params);
919: }
920:
921: /**
922: * Implementing equals so Org will behave reasonably in a hashed datastructure.
923: *
924: * @see java.lang.Object#equals(java.lang.Object)
925: */
926: public boolean equals(Object obj) {
927: boolean equal = false;
928:
929: LOG.debug("Org equals");
930:
931: if (obj != null) {
932:
933: if (this == obj)
934: return true;
935:
936: if (this .getClass().isAssignableFrom(obj.getClass())) {
937:
938: Org other = (Org) obj;
939:
940: LOG.debug("this: " + this );
941: LOG.debug("other: " + other);
942:
943: if (StringUtils.equals(this .getChartOfAccountsCode(),
944: other.getChartOfAccountsCode())) {
945: if (StringUtils.equals(this .getOrganizationCode(),
946: other.getOrganizationCode())) {
947: equal = true;
948: }
949: }
950: }
951: }
952:
953: return equal;
954: }
955:
956: /**
957: * @return Returns the code and description in format: xx - xxxxxxxxxxxxxxxx
958: */
959: public String getCodeAndDescription() {
960: String theString = getOrganizationCode() + "-"
961: + getOrganizationName();
962: return theString;
963: }
964:
965: /**
966: * @see java.lang.Object#hashCode()
967: */
968: public int hashCode() {
969: String hashString = getChartOfAccountsCode() + "|"
970: + getOrganizationCode();
971: return hashString.hashCode();
972: }
973:
974: public boolean isActive() {
975: return active;
976: }
977:
978: public void setActive(boolean active) {
979: this.active = active;
980: }
981:
982: }
|