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.List;
19
20 import org.kuali.ole.coa.businessobject.Account;
21 import org.kuali.ole.coa.businessobject.Organization;
22
23 /**
24 * This interface defines methods that an Org Service must provide.
25 */
26 public interface OrganizationService {
27 /**
28 * This method retrieves an organization instance by its composite primary keys (parameters passed in).
29 *
30 * @param chartOfAccountsCode
31 * @param organizationCode
32 * @return An Org instance.
33 */
34 public Organization getByPrimaryId(String chartOfAccountsCode, String organizationCode);
35
36 /**
37 * Method is used by KualiOrgReviewAttribute to enable caching of orgs for routing.
38 *
39 * @see org.kuali.ole.coa.service.OrganizationService#getByPrimaryId(java.lang.String, java.lang.String)
40 */
41 public Organization getByPrimaryIdWithCaching(String chartOfAccountsCode, String organizationCode);
42
43 /**
44 * Retrieves a List of Accounts that are active, and are tied to this Org. If there are no Accounts that meet this criteria, an
45 * empty list will be returned.
46 *
47 * @param chartOfAccountsCode - chartCode for the Org you want Accounts for
48 * @param organizationCode - orgCode for the Org you want Accounts for
49 * @return A List of Accounts that are active, and tied to this Org
50 */
51 public List<Account> getActiveAccountsByOrg(String chartOfAccountsCode, String organizationCode);
52
53 /**
54 * Retrieves a List of Orgs that are active, and that ReportTo this Org If there are no Orgs that meet this criteria, an empty
55 * list will be returned.
56 *
57 * @param chartOfAccountsCode - chartCode for the Org you want Child Orgs for
58 * @param organizationCode - orgCode for the Org you want Child Orgs for
59 * @return A List of Orgs that are active, and report to this Org
60 */
61 public List<Organization> getActiveChildOrgs(String chartOfAccountsCode, String organizationCode);
62
63 /**
64 * Returns a list of active organizations with the given organization type code.
65 *
66 * @param organizationTypeCode
67 * @return
68 */
69 public List<Organization> getActiveOrgsByType(String organizationTypeCode);
70
71
72 /**
73 * Returns a list of active financial processing organizations.
74 *
75 * @return A List of Orgs that are active and financial processing.
76 */
77 public List<Organization> getActiveFinancialOrgs();
78
79 /**
80 * returns the chart and organization of the ACTIVE root-level organization
81 */
82 public String[] getRootOrganizationCode();
83
84 /**
85 * This method traverses the hierarchy to see if the organization represented by the potentialChildChartCode and potentialChildOrganizationCode
86 * reports to the organization represented by the potentialParentChartCode and potentialParentOrganizationCode
87 *
88 * @param potentialChildChartCode
89 * @param potentialChildOrganizationCode
90 * @param potentialParentChartCode
91 * @param potentialParentOrganizationCode
92 * @return boolean indicating whether the organization represented by the first two parameters reports to one represented by the last two parameters
93 */
94 public boolean isParentOrganization(String potentialChildChartCode, String potentialChildOrganizationCode, String potentialParentChartCode, String potentialParentOrganizationCode);
95
96 /**
97 * Flushes an internal cache used to resolve parent organizations.
98 *
99 * Called from the KualiOrgMaintainable when an org is saved via the document.
100 *
101 */
102 public void flushParentOrgCache();
103 }