View Javadoc
1   /*
2    * The Kuali Financial System, a comprehensive financial management system for higher education.
3    * 
4    * Copyright 2005-2014 The Kuali Foundation
5    * 
6    * This program is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU Affero General Public License as
8    * published by the Free Software Foundation, either version 3 of the
9    * License, or (at your option) any later version.
10   * 
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU Affero General Public License for more details.
15   * 
16   * You should have received a copy of the GNU Affero General Public License
17   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  package org.kuali.kfs.module.bc;
20  
21  import static org.kuali.kfs.module.bc.BCConstants.Report.BuildMode.BCAF;
22  import static org.kuali.kfs.module.bc.BCConstants.Report.BuildMode.MONTH;
23  import static org.kuali.kfs.module.bc.BCConstants.Report.BuildMode.PBGL;
24  import static org.kuali.kfs.module.bc.BCConstants.Report.ReportSelectMode.ACCOUNT;
25  import static org.kuali.kfs.module.bc.BCConstants.Report.ReportSelectMode.OBJECT_CODE;
26  import static org.kuali.kfs.module.bc.BCConstants.Report.ReportSelectMode.REASON;
27  import static org.kuali.kfs.module.bc.BCConstants.Report.ReportSelectMode.SUBFUND;
28  
29  import java.util.EnumSet;
30  
31  import org.kuali.kfs.module.bc.BCConstants.Report.BuildMode;
32  import org.kuali.kfs.module.bc.BCConstants.Report.ReportSelectMode;
33  
34  /**
35   * Contains properties related to a budget construction report.
36   */
37  public enum BudgetConstructionReportMode {
38      ACCOUNT_FUNDING_DETAIL_REPORT("AccountFundingDetailReport", BCAF, OBJECT_CODE, "BudgetOrgAccountFundingDetail", true), 
39      ACCOUNT_OBJECT_DETAIL_REPORT("AccountObjectDetailReport", PBGL, SUBFUND, "BudgetOrgAccountObjectDetail", true),
40      ACCOUNT_SUMMARY_REPORT("AccountSummaryReport", PBGL, SUBFUND, "BudgetOrgAccountSummary", true), 
41      LEVEL_SUMMARY_REPORT("LevelSummaryReport", PBGL, SUBFUND, "BudgetOrgLevelSummary", true),
42      MONTH_SUMMARY_REPORT("MonthSummaryReport", MONTH, SUBFUND, "BudgetOrgMonthSummary", true),
43      OBJECT_SUMMARY_REPORT("ObjectSummaryReport", PBGL, SUBFUND, "BudgetOrgObjectSummary", true),    
44      POSITION_FUNDING_DETAIL_REPORT("PositionFundingDetailReport", BCAF, OBJECT_CODE, "BudgetOrgPositionFundingDetail", true), 
45      REASON_STATISTICS_REPORT("ReasonStatisticsReport", BCAF, REASON, "BudgetOrgReasonStatistics", false),
46      REASON_SUMMARY_REPORT("ReasonSummaryReport", BCAF, REASON, "BudgetOrgReasonSummary", false), 
47      SALARY_STATISTICS_REPORT("SalaryStatisticsReport", BCAF, OBJECT_CODE, "BudgetOrgSalaryStatistics", true),
48      SALARY_SUMMARY_REPORT("SalarySummaryReport", BCAF, OBJECT_CODE, "BudgetOrgSalarySummary", false), 
49      SUBFUND_SUMMARY_REPORT("SubFundSummaryReport", PBGL, SUBFUND, "BudgetOrgSubFundSummary", true),
50      SYNCHRONIZATION_PROBLEMS_REPORT("SynchronizationProblemsReport", PBGL, ACCOUNT, "BudgetOrgSynchronizationProblems", true), 
51      TWOPLG_LIST_REPORT("TwoPLGListReport", PBGL, ACCOUNT, "BudgetOrgTwoPLGList", true),
52      ACCOUNT_EXPORT("AccountExport", PBGL, SUBFUND, true),
53      MONTHLY_EXPORT("MonthlyExport", MONTH, SUBFUND, true),
54      FUNDING_EXPORT("FundingExport", BCAF, SUBFUND, true);
55  
56  
57      public final String reportModeName;
58      public final BuildMode reportBuildMode;
59      public final ReportSelectMode reportSelectMode;
60      public final String jasperFileName;
61      public final boolean lockThreshold;
62      public final boolean export;
63  
64      /**
65       * Constructs a BudgetConstructionReportMode.java.
66       */
67      private BudgetConstructionReportMode(final String reportModeName, final BuildMode reportBuildMode, final ReportSelectMode reportSelectMode, final String jasperFileName, final boolean lockThreshold) {
68          this.reportModeName = reportModeName;
69          this.reportBuildMode = reportBuildMode;
70          this.reportSelectMode = reportSelectMode;
71          this.jasperFileName = jasperFileName;
72          this.lockThreshold = lockThreshold;
73          this.export = false;
74      }
75      
76      /**
77       * Constructs a BudgetConstructionReportMode.java.
78       */
79      private BudgetConstructionReportMode(final String reportModeName, final BuildMode reportBuildMode, final ReportSelectMode reportSelectMode, final boolean export) {
80          this.reportModeName = reportModeName;
81          this.reportBuildMode = reportBuildMode;
82          this.reportSelectMode = reportSelectMode;
83          this.lockThreshold = false;
84          this.export = export;
85          this.jasperFileName = "";
86      }
87  
88      /**
89       * Returns the BudgetConstructionReportMode with name that matches given report mode name.
90       * 
91       * @param reportModeName - report name to find BudgetConstructionReportMode for
92       * @return BudgetConstructionReportMode if found, or null
93       */
94      public static BudgetConstructionReportMode getBudgetConstructionReportModeByName(String reportModeName) {
95          BudgetConstructionReportMode foundReportMode = null;
96          
97          for(BudgetConstructionReportMode reportMode : EnumSet.allOf(BudgetConstructionReportMode.class)) {
98              if (reportMode.reportModeName.equals(reportModeName)) {
99                  foundReportMode = reportMode;
100                 break;
101             }
102         }
103         
104         return foundReportMode;
105     }
106 }