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.endow.web.struts;
017    
018    import java.util.Arrays;
019    import java.util.List;
020    
021    import org.apache.commons.lang.StringUtils;
022    import org.kuali.rice.kns.web.struts.action.KualiAction;
023    
024    public abstract class EndowmentReportBaseAction extends KualiAction {
025        
026        protected final char KEMID_SEPERATOR = '&';
027        protected final char OTHER_CRITERIA_SEPERATOR = ',';
028        
029        public final String ERROR_REPORT_KEMID_WITH_OTHER_CRITERIA = "The use of the KEMID as a selection criterion cannot be used in combination with any orther selection criteria.";
030        public final String ERROR_REPORT_ENDING_DATE_NOT_GREATER_THAN_BEGINNING_DATE = "The ending date must be greater than the beginning date.";
031        public final String ERROR_BOTH_BEGINNING_AND_ENDING_DATE_REQUIRED = "Both Beginning Date and Ending Date are required.";
032        
033        /**
034         * Parses the string value, which can include wild cards or separators
035         * 
036         * @param valueString
037         * @param separater
038         * @return
039         */
040        public List<String> parseValueString(String valueString, char separater) {        
041            
042            List<String> values = null;        
043            if (StringUtils.isNotBlank(valueString)) {
044                values = Arrays.asList(StringUtils.split(valueString.trim().toUpperCase(), separater));
045            }        
046            return values;
047        }
048    
049    }