001    /*
002     * Copyright 2011 The Kuali Foundation.
003     * 
004     * Licensed under the Educational Community License, Version 2.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/ecl2.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.kfs.module.bc;
017    
018    import java.math.BigDecimal;
019    import java.util.ArrayList;
020    import java.util.Arrays;
021    import java.util.HashMap;
022    import java.util.List;
023    
024    import org.kuali.kfs.module.bc.document.web.struts.BudgetConstructionRequestImportAction;
025    import org.kuali.kfs.module.bc.document.web.struts.MonthlyBudgetAction;
026    import org.kuali.kfs.module.bc.document.web.struts.OrganizationSelectionTreeAction;
027    import org.kuali.kfs.module.bc.document.web.struts.QuickSalarySettingAction;
028    import org.kuali.kfs.sys.KFSConstants;
029    import org.kuali.kfs.sys.KFSPropertyConstants;
030    import org.kuali.kfs.sys.KFSConstants.ParameterValues;
031    import org.kuali.rice.core.util.JSTLConstants;
032    
033    public class BCConstants extends JSTLConstants {
034        public static final String BUDGET_CONSTRUCTION_NAMESPACE = "KFS-BC";
035    
036        // max depth to check runaway account organization hierarchy builds
037        public final static Integer MAXIMUM_ORGANIZATION_TREE_DEPTH = new Integer(1000);
038    
039        // formkey prefix to use for all screens we will store in session
040        public static final String FORMKEY_PREFIX = "BcDoc";
041        public static final String BC_IN_PROGRESS_SESSIONFLAG = FORMKEY_PREFIX + "BCInProgress";
042        public static final String BC_HEARTBEAT_SESSIONFLAG = FORMKEY_PREFIX + "BCHeartBeat";
043        public static final String BC_DOC_AUTHORIZATION_STATUS_SESSIONKEY = FORMKEY_PREFIX + "EditStatus";
044    
045        // this are used in expansion screen session security cleanup management
046        public static final String MAPPING_ATTRIBUTE_KUALI_FORM = "KualiForm";
047        public static final String MAPPING_SCOPE_SESSION = "session";
048        
049        public static final String MAPPING_SAVE = "save";
050    
051        // screen tab error keys
052        public static final String BUDGET_CONSTRUCTION_SALARY_SETTING_TAB_ERRORS = "document.budgetConstructionSalarySetting*";
053        public static final String BUDGET_CONSTRUCTION_REVENUE_TAB_ERRORS = "document.pendingBudgetConstructionGeneralLedgerRevenueLines*,newRevenueLine*";
054        public static final String BUDGET_CONSTRUCTION_EXPENDITURE_TAB_ERRORS = "document.pendingBudgetConstructionGeneralLedgerExpenditureLines*,newExpenditureLine*";
055        public static final String BUDGET_CONSTRUCTION_MONTHLY_BUDGET_ERRORS = "budgetConstructionMonthly*";
056        public static final String BUDGET_CONSTRUCTION_REPORTDUMP_TAB_ERRORS = "document.budgetConstructionDocumentReportModes*";
057        public static final String BUDGET_CONSTRUCTION_SYSTEM_INFORMATION_TAB_ERRORS = "accountOrgHierLevels*";
058        public static final String BUDGET_CONSTRUCTION_SELECTION_ERRORS = "budgetConstructionHeader*";
059    
060        public static final String NEW_EXPENDITURE_LINE_PROPERTY_NAME = "newExpenditureLine";
061        public static final String NEW_REVENUE_LINE_PROPERTY_NAME = "newRevenueLine";
062    
063        public static final String DISABLE_SALARY_SETTING_FLAG = "DISABLE_SALARY_SETTING_FLAG";
064        public static final String DISABLE_BENEFITS_CALCULATION_FLAG = "DISABLE_BENEFITS_CALCULATION_FLAG";
065    
066        public static final String BC_SELECTION_ACTION = "budgetBudgetConstructionSelection.do";
067        public static final String BC_SELECTION_REFRESH_METHOD = "refresh";
068    
069        public static final String ORG_SEL_TREE_REFRESH_CALLER = OrganizationSelectionTreeAction.class.getName();
070        public static final String ORG_SEL_TREE_ACTION = "budgetOrganizationSelectionTree.do";
071        public static final String ORG_SEL_TREE_METHOD = "loadExpansionScreen";
072        public static final String ORG_TEMP_LIST_LOOKUP = "budgetTempListLookup.do";
073        public static final String ORG_REPORT_SELECTION_ACTION = "budgetOrganizationReportSelection.do";
074        public static final String REPORT_EXPORT_ACTION = "budgetReportExport.do";
075        public static final String REPORT_EXPORT_PATH = "budgetReportExport";
076        public static final String REQUEST_IMPORT_ACTION = "budgetBudgetConstructionRequestImport.do";
077        public static final String PAYRATE_IMPORT_EXPORT_ACTION = "budgetPayrateImportExport.do";
078    
079        public static final String REQUEST_IMPORT_REFRESH_CALLER = BudgetConstructionRequestImportAction.class.getName();
080        public static final String REQUEST_IMPORT_FILE_PROCESSING_ERROR_MESSAGE_GENERIC = "Bad file format at line";
081    
082        public static final String REQUEST_IMPORT_OUTPUT_FILE = "budgetImportLog.pdf";
083        public static final String PAYRATE_IMPORT_LOG_FILE = "payrate_import_log.pdf";
084        public static final String PAYRATE_EXPORT_FILE = "payrate_export.txt";
085    
086        public static final String LABOR_OBJECT_FRINGE_CODE = "F";
087        public static final String MAPPING_IMPORT_EXPORT = "import_export";
088    
089        public static final String POSITION_NUMBER_NOT_FOUND = "NotFnd";
090    
091        public static final String IS_ORG_REPORT_REQUEST_PARAMETER = "orgReport";
092    
093        public enum OrgSelOpMode {
094            PULLUP, PUSHDOWN, REPORTS, SALSET, ACCOUNT
095        }
096    
097        /**
098         * This class represents Select control options mapping explicit Integer values to an enum value. The explicit values can then
099         * be used in a database stored procedure call in the event procedure calls are used instead of calls to a java method.
100         */
101        public enum OrgSelControlOption {
102            NO(0, "No"), YES(1, "Yes"), NOTSEL(0, "Not Sel"), ORG(1, "Org"), SUBORG(2, "Sub Org"), BOTH(3, "Both"), ORGLEV(1, "Org Lev"), MGRLEV(2, "Mgr Lev"), ORGMGRLEV(3, "Org+Mgr Lev"), LEVONE(4, "Lev One"), LEVZERO(5, "Lev Zero");
103            private String label;
104            private Integer key;
105    
106            private OrgSelControlOption(Integer key, String label) {
107                this.key = key;
108                this.label = label;
109            }
110    
111            public String getLabel() {
112                return label;
113            }
114    
115            public Integer getKey() {
116                return key;
117            }
118        }
119    
120        // type of month spread delete used in rules checking when deleting monthly spreads
121        public enum MonthSpreadDeleteType {
122            NONE, REVENUE, EXPENDITURE
123        }
124    
125        // the reason a document (account) is allowed only salary setting lines
126        public enum AccountSalarySettingOnlyCause {
127            MISSING_PARAM, NONE, FUND, SUBFUND, FUND_AND_SUBFUND
128        }
129    
130    
131        // some constants used in rule checking - may eventually move these to system parameters
132    
133        // latest period and number of fiscal years before active bcfy that an account becomes not budgetable
134        public static final String NO_BUDGET_ALLOWED_EXPIRE_ACCOUNTING_PERIOD = "06";
135        public static final Integer NO_BUDGET_ALLOWED_FY_OFFSET = Integer.valueOf(2);
136    
137        // latest period and number of fiscal years before active bcfy that an account expire warning message gets issued
138        public static final String ACCOUNT_EXPIRE_WARNING_ACCOUNTING_PERIOD = "12";
139        public static final Integer ACCOUNT_EXPIRE_WARNING_FY_OFFSET = Integer.valueOf(1);
140    
141        // account budgetRecordingLevelCode where no budget is allowed
142        public static final String BUDGET_RECORDING_LEVEL_N = "N";
143    
144        // by default employees are assumed to work the entire 12-month year
145        public static final Integer DEFAULT_NORMAL_WORK_MONTHS = 12;
146    
147        public static final String BC_DOCUMENT_REFRESH_CALLER = "BudgetConstruction";
148        public static final String BC_DOCUMENT_ACTION = "budgetBudgetConstruction.do";
149        public static final String BC_DOCUMENT_REFRESH_METHOD = "refresh";
150        public static final String BC_DOCUMENT_METHOD = "docHandler";
151        public static final String BC_DOCUMENT_PULLUP_METHOD = "performAccountPullup";
152        public static final String BC_DOCUMENT_PUSHDOWN_METHOD = "performAccountPushdown";
153    
154        public static final String MONTHLY_BUDGET_REFRESH_CALLER = MonthlyBudgetAction.class.getName();
155        public static final String MONTHLY_BUDGET_ACTION = "budgetMonthlyBudget.do";
156        public static final String MONTHLY_BUDGET_METHOD = "loadExpansionScreen";
157    
158        public static final String QUICK_SALARY_SETTING_REFRESH_CALLER = QuickSalarySettingAction.class.getName();
159        public static final String QUICK_SALARY_SETTING_ACTION = "budgetQuickSalarySetting.do";
160        public static final String QUICK_SALARY_SETTING_METHOD = "loadExpansionScreen";
161    
162        public static final String POSITION_SALARY_SETTING_REFRESH_CALLER = "PositionSalarySetting";
163        public static final String POSITION_SALARY_SETTING_ACTION = "budgetPositionSalarySetting.do";
164        public static final String POSITION_SALARY_SETTING_METHOD = "loadExpansionScreen";
165        public static final String POSITION_SALARY_SETTING_TITLE = "Salary Setting by Position";
166    
167        public static final String INCUMBENT_SALARY_SETTING_REFRESH_CALLER = "IncumbentSalarySetting";
168        public static final String INCUMBENT_SALARY_SETTING_ACTION = "budgetIncumbentSalarySetting.do";
169        public static final String INCUMBENT_SALARY_SETTING_METHOD = "loadExpansionScreen";
170        public static final String INCUMBENT_SALARY_SETTING_TITLE = "Salary Setting by Incumbent";
171        
172        public static final String LOAD_EXPANSION_SCREEN_METHOD = "loadExpansionScreen";
173        public static final String LOAD_EXPANSION_SCREEN_METHOD_SESSION_TIMEOUT = "loadExpansionScreenSessionTimeOut";
174    
175        public static final String REPORT_RUNNER_ACTION = "budgetReportRunner.do";
176    
177        public static final String RETURN_ANCHOR = "returnAnchor";
178        public static final String RETURN_FORM_KEY = "returnFormKey";
179    
180        public static final String INSERT_REVENUE_LINE_METHOD = "insertRevenueLine";
181        public static final String INSERT_EXPENDITURE_LINE_METHOD = "insertExpenditureLine";
182    
183        public final static String SELECTION_SUB_TREE_ORGS = "selectionSubTreeOrgs";
184        public final static String SHOW_INITIAL_RESULTS = "showInitialResults";
185        public final static String CURRENT_POINT_OF_VIEW_KEYCODE = "currentPointOfViewKeyCode";
186        public final static String FORCE_TO_ACCOUNT_LIST_SCREEN = "forceToAccountListScreen";
187        
188        public final static String LOCK_STRING_DELIMITER = "!";
189    
190    
191        /*
192         * fund groups and subfund groups that are NOT loaded to the GL from budget construction (these are the constants used, not the
193         * ones in KFSConstants/BudgetConstructionConstants)
194         */
195        public final static List<String> NO_BC_GL_LOAD_SUBFUND_GROUPS = Arrays.asList("SIDC");
196        public final static List<String> NO_BC_GL_LOAD_FUND_GROUPS = Arrays.asList("CG");
197    
198        /*
199         * values for the CSF funding status flag
200         */
201        public enum csfFundingStatusFlag {
202            LEAVE("L"), VACANT("V"), UNFUNDED("U"), ACTIVE("-");
203    
204            private csfFundingStatusFlag(String flagValue) {
205                this.flagValue = flagValue;
206            }
207    
208            public String getFlagValue() {
209                return flagValue;
210            }
211    
212            private String flagValue;
213        }
214    
215        /*
216         * value of employee ID field in a vacant line in budget construction appointment funding or budget construction CSF
217         */
218        public final static String VACANT_EMPLID = "VACANT";
219    
220        // the transaction ledger description for the general ledger budget load
221        public final static String BC_TRN_LDGR_ENTR_DESC = "Beginning Budget Load";
222    
223        // this is a pairing of the OJB "property" for the monthly amount and its corresponding accounting period
224        public final static ArrayList<String[]> BC_MONTHLY_AMOUNTS = buildMonthlyProperties();
225    
226        private static ArrayList<String[]> buildMonthlyProperties() {
227            ArrayList<String[]> monthlyProperties = new ArrayList<String[]>(12);
228            monthlyProperties.add((new String[] { KFSPropertyConstants.FINANCIAL_DOCUMENT_MONTH_1_LINE_AMOUNT, KFSConstants.MONTH1 }));
229            monthlyProperties.add((new String[] { KFSPropertyConstants.FINANCIAL_DOCUMENT_MONTH_2_LINE_AMOUNT, KFSConstants.MONTH2 }));
230            monthlyProperties.add((new String[] { KFSPropertyConstants.FINANCIAL_DOCUMENT_MONTH_3_LINE_AMOUNT, KFSConstants.MONTH3 }));
231            monthlyProperties.add((new String[] { KFSPropertyConstants.FINANCIAL_DOCUMENT_MONTH_4_LINE_AMOUNT, KFSConstants.MONTH4 }));
232            monthlyProperties.add((new String[] { KFSPropertyConstants.FINANCIAL_DOCUMENT_MONTH_5_LINE_AMOUNT, KFSConstants.MONTH5 }));
233            monthlyProperties.add((new String[] { KFSPropertyConstants.FINANCIAL_DOCUMENT_MONTH_6_LINE_AMOUNT, KFSConstants.MONTH6 }));
234            monthlyProperties.add((new String[] { KFSPropertyConstants.FINANCIAL_DOCUMENT_MONTH_7_LINE_AMOUNT, KFSConstants.MONTH7 }));
235            monthlyProperties.add((new String[] { KFSPropertyConstants.FINANCIAL_DOCUMENT_MONTH_8_LINE_AMOUNT, KFSConstants.MONTH8 }));
236            monthlyProperties.add((new String[] { KFSPropertyConstants.FINANCIAL_DOCUMENT_MONTH_9_LINE_AMOUNT, KFSConstants.MONTH9 }));
237            monthlyProperties.add((new String[] { KFSPropertyConstants.FINANCIAL_DOCUMENT_MONTH_10_LINE_AMOUNT, KFSConstants.MONTH10 }));
238            monthlyProperties.add((new String[] { KFSPropertyConstants.FINANCIAL_DOCUMENT_MONTH_11_LINE_AMOUNT, KFSConstants.MONTH11 }));
239            monthlyProperties.add((new String[] { KFSPropertyConstants.FINANCIAL_DOCUMENT_MONTH_12_LINE_AMOUNT, KFSConstants.MONTH12 }));
240            return monthlyProperties;
241        }
242    
243        // budget construction report constants
244        public static class Report {
245            public final static String INCOME_EXP_TYPE_A = "A";
246            public final static String INCOME_EXP_TYPE_E = "E";
247            public final static String INCOME_EXP_TYPE_T = "T";
248            public final static String INCOME_EXP_TYPE_X = "X";
249            public final static String VACANT = VACANT_EMPLID;
250            public final static String BLANK_SUB_OBJECT_CODE = DASH_SUB_OBJECT_CODE;
251            public final static String BLANK = KFSConstants.EMPTY_STRING;
252            public final static String DASHES_SUB_ACCOUNT_CODE = DASH_SUB_ACCOUNT_NUMBER;
253            public final static String DELETE_MARK = "*";
254            public final static String DIVIDER = "/";
255            public final static String TOTAL_REVENUES = "Total Revenues";
256            public final static String TOTAL_EXPENDITURES_MARGIN = "Total Expenditures & Margin";
257            public final static String REVENUE = "REVENUE";
258            public final static String EXPENDITURE = "EXPENDITURE";
259            public final static String CONSOLIIDATED = "Consolidated";
260            public final static String NONE = "NONE";
261            public final static String PLUS = "+";
262            public final static String UNDF = "UnDf";
263            public final static String YES = "Y";
264            public final static String NO = "N";
265            public final static String THRESHOLD = "Threshold: ";
266            public final static String SELECTED_REASONS = "Selected Reasons: ";
267            public final static String THRESHOLD_GREATER = "greater then or equal to ";
268            public final static String THRESHOLD_LESS = "less than or equal to ";
269            public final static String PERCENT = "%";
270            public final static String MSG_REPORT_NO_DATA = "No data found.";
271            // selection screen
272            public final static String NONE_SELECTION_TITLE = "";
273            public final static String SUB_FUND_SELECTION_TITLE = "Sub-Fund List Selection";
274            public final static String OBJECT_CODE_SELECTION_TITLE = "Salary Object List Selection";
275            public final static String REASON_CODE_SELECTION_TITLE = "Reason Code Selection";
276            public final static String REPORT_MODE = "reportMode";
277            public final static String BUILD_CONTROL_LIST = "buildControlList";
278            public final static String REPORT_CONSOLIDATION = "reportConsolidation";
279            public final static String CONTROL_BUILD_HELPER_SESSION_NAME = "controlBuildHelper";
280            public final static String SUB_FUND_LIST_EMPTY_MESSAGE_KEY = "error.budget.report.emptySubFundList";
281            public final static String OBJECT_CODE_LIST_EMPTY_MESSAGE_KEY = "error.budget.report.emptyObjectCodeList";
282            public final static String REASON_CODE_LIST_EMPTY_MESSAGE_KEY = "error.budget.report.emptyReasonCodeList";
283            public final static String THRESHOLD_SELECTION_MESSAGE_KEY = "message.budget.thresholdSelection";
284            public final static String SELECTED_OBJECT_CODES_MESSAGE_KEY = "message.budget.selectedObjectCodes";
285            public final static String NOT_DEFINED = " not defined";
286            public final static String CHART = "Chart";
287            public final static String OBJECT = "Object";
288    
289            // report file name
290            public static final String REPORT_TEMPLATE_CLASSPATH = "org/kuali/kfs/module/bc/report/";
291            public static final String REPORT_MESSAGES_CLASSPATH = REPORT_TEMPLATE_CLASSPATH + "BudgetOrgReport";
292    
293            // Represents the three modes in which report data is restricted
294            public enum BuildMode {
295                PBGL(), MONTH(), BCAF();
296            }
297    
298            // Represents the varoius reports criteria selections
299            public enum ReportSelectMode {
300                ACCOUNT(), OBJECT_CODE(), SUBFUND(), REASON();
301            }
302        }
303    
304        // constants that represent a mode for the TempListLookupAction.
305        public static class TempListLookupMode {
306            public final static String TEMP_LIST_LOOKUP_MODE = "tempListLookupMode";
307    
308            public final static int DEFAULT_LOOKUP_MODE = 0;
309            public final static int INTENDED_INCUMBENT_SELECT = 1;
310            public final static int POSITION_SELECT = 2;
311            public final static int ACCOUNT_SELECT_ABOVE_POV = 3;
312            public final static int ACCOUNT_SELECT_BUDGETED_DOCUMENTS = 4;
313            public final static int LOCK_MONITOR = 5;
314            public final static int CSF_TRACKER_POSITION_LOOKUP = 6;
315            public final static int ACCOUNT_SELECT_PULLUP_DOCUMENTS = 7;
316            public final static int ACCOUNT_SELECT_PUSHDOWN_DOCUMENTS = 8;
317            public final static int ACCOUNT_SELECT_MANAGER_DELEGATE = 9;
318            public final static int BUDGET_POSITION_LOOKUP = 10;
319            public final static int INTENDED_INCUMBENT = 11;
320            public final static int SHOW_BENEFITS = 12;
321        }
322    
323        public final static String BC_BO_CLASSPATH = "org.kuali.kfs.module.bc.businessobject";
324        public final static String REQUEST_BENEFITS_BO = BC_BO_CLASSPATH+".RequestBenefits";
325    
326        public enum RequestImportFileType {
327            MONTHLY("MONTHLY"), ANNUAL("ANNUAL");
328    
329            private String fileType;
330    
331            private RequestImportFileType(String fileType) {
332                this.fileType = fileType;
333            }
334        }
335    
336        public enum RequestImportFieldSeparator {
337            COMMA("COMMA"), TAB("TAB"), OTHER("OTHER");
338    
339            private String separator;
340    
341            private RequestImportFieldSeparator(String separator) {
342                this.separator = separator;
343            }
344    
345            public String getSeparator() {
346                if (this.equals(COMMA))
347                    return ",";
348                if (this.equals(TAB))
349                    return "\t";
350    
351                return this.toString();
352            }
353    
354        }
355    
356        public enum RequestImportTextFieldDelimiter {
357            QUOTE("QUOTE"), NOTHING("NOTHING"), OTHER("OTHER");
358    
359            private String separator;
360    
361            private RequestImportTextFieldDelimiter(String separator) {
362                this.separator = separator;
363            }
364    
365            public String getDelimiter() {
366                if (this.equals(QUOTE))
367                    return "\"";
368                if (this.equals(NOTHING))
369                    return "";
370    
371                return this.toString();
372            }
373        }
374    
375        // budget construction request move data validation error codes
376        public enum RequestImportErrorCode {
377            DATA_VALIDATION_NO_BUDGETED_ACCOUNT_SUB_ACCOUNT_ERROR_CODE("ACSA", "Error: No budgeted account/sub-account found"), DATA_VALIDATION_ACCOUNT_CLOSED_ERROR_CODE("CLAC", "Error: Account is closed"), DATA_VALIDATION_ACCOUNT_EXPIRED_ERROR_CODE("EXAC", "Error: Account is expired"), DATA_VALIDATION_SUB_ACCOUNT_INACTIVE_ERROR_CODE("INSA", "Error: Sub-account is inactive"), DATA_VALIDATION_OBJECT_TYPE_NULL_ERROR_CODE("NOOB", "Error: Null object code"), DATA_VALIDATION_OBJECT_TYPE_INVALID_ERROR_CODE("NOOB", "Error: Invalid object code"), DATA_VALIDATION_OBJECT_CODE_INACTIVE_ERROR_CODE("INOB", "Error: Inactive object code"), DATA_VALIDATION_SUB_OBJECT_INACTIVE_ERROR_CODE("INSO", "Error: Inactive sub-object code"), DATA_VALIDATION_SUB_OBJECT_INVALID_ERROR_CODE("NOSO", "Error: Invalid sub-object code"), DATA_VALIDATION_NO_WAGE_ACCOUNT_ERROR_CODE("CMPA", "Error: Wage object in no wages account"), DATA_VALIDATION_COMPENSATION_OBJECT_CODE_ERROR_CODE("COMP", "Error: Compensation object code"), UPDATE_ERROR_CODE_MONTHLY_BUDGET_DELETED(
378                    "MNTH", "Warning: Monthly budget deleted"), UPDATE_ERROR_CODE_BUDGET_ACCOUNT_LOCKED("LOCK", "Error: Budgeted account locked"), UPDATE_ERROR_CODE_NO_ACCESS_TO_BUDGET_ACCOUNT("ACCE", "Error: No update access to budgeted account");
379    
380            private String errorCode;
381            private String message;
382    
383            private RequestImportErrorCode(String errorCode, String message) {
384                this.errorCode = errorCode;
385                this.message = message;
386            }
387    
388            public String getErrorCode() {
389                return this.errorCode;
390            }
391    
392            public String getMessage() {
393                return this.message;
394            }
395        }
396    
397        public enum SalaryAdjustmentMeasurement {
398            PERCENT("Percent", "%"), AMOUNT("FlatAmount", "flat");
399    
400            public String measurement;
401            public String label;
402    
403            private SalaryAdjustmentMeasurement(String measurement, String label) {
404                this.measurement = measurement;
405                this.label = label;
406            }
407        }
408    
409        public final static String POSITION_CODE_INACTIVE = "I";
410        public final static String DOCUMENT_TYPE_CODE_ALL = "ALL";
411    
412        public static class LockTypes {
413            public final static String ACCOUNT_LOCK = "account lock";
414            public final static String FUNDING_LOCK = "orphan funding lock";
415            public final static String POSITION_FUNDING_LOCK = "position/funding lock";
416            public final static String POSITION_LOCK = "position lock";
417            public final static String TRANSACTION_LOCK = "transaction lock";
418        }
419    
420        public static final String PICK_LIST_MODE = "pickListMode";
421    
422        public static final BigDecimal ONE_HUNDRED = BigDecimal.valueOf(100);
423    
424        // constants for lock monitor
425        public static final String TEMP_LIST_UNLOCK_METHOD = "unlock";
426        public static final String UNLOCK_BUTTON_NAME = "tinybutton-unlock.gif";
427        public static final String UNLOCK_CONFIRMATION_QUESTION = "UnlockConfirmationQuestion";
428    
429        public static final String DASH_SUB_ACCOUNT_NUMBER = KFSConstants.getDashSubAccountNumber();
430        public static final String DASH_SUB_OBJECT_CODE = KFSConstants.getDashFinancialSubObjectCode();
431    
432        public static final String SHOW_SALARY_BY_POSITION_ACTION = "showSalaryByPositionAction";
433        public static final String REFRESH_POSITION_BEFORE_SALARY_SETTING = "refreshPositionBeforeSalarySetting";
434        public static final String TEMP_LIST_REFRESH_POSITION_METHOD = "refreshPosition";
435        public static final String REFRESH_POSITION_BUTTON_NAME = "tinybutton-sync.gif";
436    
437        public static final String SHOW_SALARY_BY_INCUMBENT_ACTION = "showSalaryByIncumbentAction";
438        public static final String REFRESH_INCUMBENT_BEFORE_SALARY_SETTING = "refreshIncumbentBeforeSalarySetting";
439        public static final String TEMP_LIST_REFRESH_INCUMBENT_METHOD = "refreshIncumbent";
440        public static final String REFRESH_INCUMBENT_BUTTON_NAME = "tinybutton-sync.gif";
441        public static final String MAPPING_ORGANIZATION_SALARY_SETTING_RETURNING = "organizationSalarySettingReturning";
442        public static final String MAPPING_LOST_SESSION_RETURNING = "lostSessionReturning";
443    
444    
445    
446        public enum LockStatus {
447            SUCCESS, BY_OTHER, NO_DOOR, OPTIMISTIC_EX, FLOCK_FOUND
448        }
449    
450        public static final int maxLockRetry = 20;
451    
452    
453        /* KFSConstants for the budget construction flag names */
454        private static int NUMBER_OF_CTRL_FLAGS = 8;
455    
456        /* state for current year budget construction flags after genesis */
457        private static HashMap<String, String> buildCurrentYear() {
458            HashMap<String, String> mapSLF;
459            mapSLF = new HashMap<String, String>(NUMBER_OF_CTRL_FLAGS, (float) 1.00);
460            mapSLF.put(KFSConstants.BudgetConstructionConstants.BUDGET_ADMINSTRATION_ACTIVE, ParameterValues.YES);
461            mapSLF.put(KFSConstants.BudgetConstructionConstants.BASE_BUDGET_UPDATES_OK, ParameterValues.YES);
462            mapSLF.put(KFSConstants.BudgetConstructionConstants.BUDGET_BATCH_SYNCHRONIZATION_OK, ParameterValues.NO);
463            mapSLF.put(KFSConstants.BudgetConstructionConstants.CSF_UPDATES_OK, ParameterValues.NO);
464            mapSLF.put(KFSConstants.BudgetConstructionConstants.BUDGET_CONSTRUCTION_ACTIVE, ParameterValues.NO);
465            mapSLF.put(KFSConstants.BudgetConstructionConstants.BUDGET_CONSTRUCTION_GENESIS_RUNNING, ParameterValues.NO);
466            mapSLF.put(KFSConstants.BudgetConstructionConstants.BUDGET_CONSTRUCTION_UPDATES_OK, ParameterValues.NO);
467            mapSLF.put(KFSConstants.BudgetConstructionConstants.BUDGET_ON_LINE_SYNCHRONIZATION_OK, ParameterValues.NO);
468            return mapSLF;
469        }
470    
471        public final static HashMap<String, String> CURRENT_FSCL_YR_CTRL_FLAGS = buildCurrentYear();
472    
473        /* state for next year budget construction flags after genesis */
474        private static HashMap<String, String> buildNextYear() {
475            HashMap<String, String> mapSLF;
476            mapSLF = new HashMap<String, String>(NUMBER_OF_CTRL_FLAGS, (float) 1.00);
477            mapSLF.put(KFSConstants.BudgetConstructionConstants.BUDGET_ADMINSTRATION_ACTIVE, ParameterValues.NO);
478            mapSLF.put(KFSConstants.BudgetConstructionConstants.BASE_BUDGET_UPDATES_OK, ParameterValues.NO);
479            mapSLF.put(KFSConstants.BudgetConstructionConstants.BUDGET_BATCH_SYNCHRONIZATION_OK, ParameterValues.YES);
480            mapSLF.put(KFSConstants.BudgetConstructionConstants.CSF_UPDATES_OK, ParameterValues.YES);
481            mapSLF.put(KFSConstants.BudgetConstructionConstants.BUDGET_CONSTRUCTION_ACTIVE, ParameterValues.YES);
482            mapSLF.put(KFSConstants.BudgetConstructionConstants.BUDGET_CONSTRUCTION_GENESIS_RUNNING, ParameterValues.NO);
483            mapSLF.put(KFSConstants.BudgetConstructionConstants.BUDGET_CONSTRUCTION_UPDATES_OK, ParameterValues.NO);
484            mapSLF.put(KFSConstants.BudgetConstructionConstants.BUDGET_ON_LINE_SYNCHRONIZATION_OK, ParameterValues.YES);
485            return mapSLF;
486        }
487    
488        public final static HashMap<String, String> NEXT_FSCL_YR_CTRL_FLAGS_AFTER_GENESIS = buildNextYear();
489    
490        /* constants for the budget construction header */
491        public final static String DEFAULT_BUDGET_HEADER_LOCK_IDS = null;
492        public final static Integer INITIAL_ORGANIZATION_LEVEL_CODE = new Integer(0);
493        public final static String INITIAL_ORGANIZATION_LEVEL_CHART_OF_ACCOUNTS_CODE = null;
494        public final static String INITIAL_ORGANIZATION_LEVEL_ORGANIZATION_CODE = null;
495    
496        /* Budget Construction document type */
497        public final static String BUDGET_CONSTRUCTION_DOCUMENT_TYPE = "BC";
498        public final static String BUDGET_CONSTRUCTION_BEGINNING_BALANCE_DOCUMENT_TYPE = "BCBB";
499        public final static String BUDGET_CONSTRUCTION_DOCUMENT_NAME = "BC";
500        public final static String BUDGET_CONSTRUCTION_DOCUMENT_DESCRIPTION = "Budget Construction";
501        public final static String BUDGET_CONSTRUCTION_DOCUMENT_INITIAL_STATUS = "$";
502        public final static String ORG_REVIEW_RULE_TEMPLATE = "KualiOrgReviewTemplate";
503    
504        /*
505         * initial sizes for hash maps used in genesis supposedly starting the map out with about the right amount of space makes
506         * look-ups more efficient these numbers shouldn't need to be very precise
507         */
508        public final static Integer AVERAGE_REPORTING_TREE_SIZE = 4;
509        
510        /**
511         *  value indicating that a CSF row is Active
512         */
513        public final static String ACTIVE_CSF_DELETE_CODE = "-";
514            
515        
516        
517        /**
518         * enumerate the leave duration code
519         */
520        public enum AppointmentFundingDurationCodes {
521            NONE("NONE", "No Leave"), LWP1("LWP1", "LWOP:  First Semester"), LWP2("LWP2", "LWOP:  Second Semester"), LWPA("LWPA", "LWOP:  10 months"), LWPF("LWPF", "LWOP:  12 months"), LWPH("LWPH", "LWOP:  6 months"), LWPX("LWPX", "LWOP:  ACROSS FISCAL YEARS"), SAB1("SAB1", "Sabbatical Leave:  First Semester"), SAB2("SAB2", "Sabbatical Leave:  Second Semester"), SABA("SABA", "Sabbatical Leave:  Academic Year"), SABF("SABF", "Sabbatical Leave:  12 months"), SABH("SABH", "Sabbatical Leave:  6 months"), SABX("SABX", "Sabbatical Leave:  ACROSS FISCAL YEARS");
522    
523            public String durationCode;
524            public String durationDescription;
525    
526            private AppointmentFundingDurationCodes(String durationCode, String durationDescription) {
527                this.durationCode = durationCode;
528                this.durationDescription = durationDescription;
529            }
530    
531            /**
532             * Gets the durationCode attribute. 
533             * @return Returns the durationCode.
534             */
535            public String getDurationCode() {
536                return durationCode;
537            }
538    
539            /**
540             * Gets the durationDescription attribute. 
541             * @return Returns the durationDescription.
542             */
543            public String getDurationDescription() {
544                return durationDescription;
545            }
546        }
547        
548        public class EditModes {
549            public static final String SYSTEM_VIEW_ONLY = "systemViewOnly";
550        }
551        
552        public class KimConstants {
553            public static final String BC_PROCESSOR_ROLE_NAME = "Processor";
554            public static final String USE_ORG_SALARY_SETTING_PERMISSION_NAME = "Use Organization Salary Setting";
555            public static final String EDIT_BCAF_PERMISSION_NAME = "Edit Appointment Funding";
556            public static final String VIEW_BCAF_AMOUNTS_PERMISSION_NAME = "View Appointment Funding Amounts";
557            public static final String IMPORT_EXPORT_PAYRATE_PERMISSION_NAME = "Import / Export Payrate";
558            public static final String UNLOCK_PERMISSION_NAME = "Unlock";
559            public static final String DOCUMENT_VIEWER_ROLE_NAME = "Document Viewer";
560            public static final String DOCUMENT_EDITOR_ROLE_NAME = "Document Editor";
561        }
562        
563        /**
564         * enumerate the synchronization check type
565         */
566        public enum SynchronizationCheckType {
567            NONE("NONE", "No Sync Check"), POSN("POSN", "Snyc by Position"), EID("EID", "Snyc by Employee"), ALL("ALL", "Snyc by Position and Employee");
568            
569            public String typeCode;
570            public String typeDescription;
571    
572            private SynchronizationCheckType(String typeCode, String typeDescription) {
573                this.typeCode = typeCode;
574                this.typeDescription = typeDescription;
575            }
576        }
577        
578        public class ErrorKey {
579            public static final String DETAIL_SALARY_SETTING_TAB_ERRORS = "newBCAFLine*,budgetConstructionIntendedIncumbent.pendingBudgetConstructionAppointmentFunding*,budgetConstructionPosition.pendingBudgetConstructionAppointmentFunding*";
580            public static final String QUICK_SALARY_SETTING_TAB_ERRORS = "salarySettingExpansion.pendingBudgetConstructionAppointmentFunding*,adjustment*,newBCAFLine*";
581            public static final String RETURNED_DETAIL_SALARY_SETTING_TAB_ERRORS = "newBCAFLine*";
582            public static final String ORGANIZATION_REPORTS_SELECTION_ERRORS = "budgetConstructionReportThresholdSettings*";
583        }
584    }