1 /*
2 * Copyright 2005 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.ole.coa.service;
17
18 import java.util.Collection;
19 import java.util.List;
20 import java.util.Map;
21
22 import org.kuali.ole.coa.businessobject.Chart;
23 import org.kuali.rice.kim.api.identity.Person;
24
25 /**
26 * This interface defines methods that a Chart Service must provide
27 */
28 public interface ChartService {
29 /**
30 * Retrieves a chart object by its primary key - the chart code.
31 *
32 * @param chartOfAccountsCode
33 * @return
34 */
35 public Chart getByPrimaryId(String chartOfAccountsCode);
36
37 /**
38 *
39 * This method returns the university chart
40 * @return
41 */
42 public Chart getUniversityChart();
43
44
45 /**
46 * Retrieves all of the charts in the system and returns them in a List.
47 *
48 * @return A List of chart codes.
49 */
50 public List<String> getAllChartCodes();
51
52 /**
53 * Retrieves all of the "active" charts in the system in chart code order.
54 *
55 * @return
56 */
57 Collection<Chart> getAllActiveCharts();
58
59 /**
60 * Retrieves a map of reportsTo relationships (e.g. A reports to B, B reports to B, C reports to A)
61 *
62 * @return
63 */
64 public Map<String, String> getReportsToHierarchy();
65
66 /**
67 * Returns the chart manager form KIM for the given chart code
68 *
69 * @param chartOfAccountsCode chart code to get manager for
70 * @return chart manager <code>Person</code>
71 */
72 public Person getChartManager(String chartOfAccountsCode);
73
74 /**
75 * This method traverses the hierarchy to see if the potentialChildChartCode reports to the potentialParentChartCode
76 *
77 * @param potentialChildChartCode
78 * @param potentialParentChartCode
79 * @return boolean indicating whether the first parameter reports to the second
80 */
81 public boolean isParentChart(String potentialChildChartCode, String potentialParentChartCode);
82 }
83