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.coa.service;
017    
018    import java.util.List;
019    import java.util.Map;
020    
021    import org.kuali.kfs.coa.businessobject.Chart;
022    import org.kuali.rice.kim.bo.Person;
023    
024    /**
025     * This interface defines methods that a Chart Service must provide
026     */
027    public interface ChartService {
028        /**
029         * Retrieves a chart object by its primary key - the chart code.
030         * 
031         * @param chartOfAccountsCode
032         * @return
033         */
034        public Chart getByPrimaryId(String chartOfAccountsCode);
035    
036        /**
037         * 
038         * This method returns the university chart
039         * @return
040         */
041        public Chart getUniversityChart();
042    
043    
044        /**
045         * Retrieves all of the charts in the system and returns them in a List.
046         * 
047         * @return A List of chart codes.
048         */
049        public List<String> getAllChartCodes();
050    
051        /**
052         * Retrieves a map of reportsTo relationships (e.g. A reports to B, B reports to B, C reports to A)
053         * 
054         * @return
055         */
056        public Map<String, String> getReportsToHierarchy();
057    
058        /**
059         * Retrieves a list of chart objects that the User is responsible for
060         * 
061         * @param kualiUser
062         * @return
063         */
064        public List getChartsThatUserIsResponsibleFor(Person kualiUser);
065        
066        /**
067         * Returns the chart manager form KIM for the given chart code
068         * 
069         * @param chartOfAccountsCode chart code to get manager for
070         * @return chart manager <code>Person</code>
071         */
072        public Person getChartManager(String chartOfAccountsCode);
073    
074        /**
075         * This method traverses the hierarchy to see if the potentialChildChartCode reports to the potentialParentChartCode
076         * 
077         * @param potentialChildChartCode
078         * @param potentialParentChartCode
079         * @return boolean indicating whether the first parameter reports to the second
080         */
081        public boolean isParentChart(String potentialChildChartCode, String potentialParentChartCode);
082    }
083