1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.coa.businessobject.defaultvalue;
17
18 import org.kuali.ole.sys.OLEConstants;
19 import org.kuali.ole.sys.context.SpringContext;
20 import org.kuali.ole.sys.service.FinancialSystemUserService;
21 import org.kuali.rice.kim.api.identity.Person;
22 import org.kuali.rice.krad.util.GlobalVariables;
23 import org.kuali.rice.krad.valuefinder.ValueFinder;
24
25
26
27
28 public class CurrentUserChartValueFinder implements ValueFinder {
29
30
31
32
33
34
35 public String getValue() {
36 Person currentUser = GlobalVariables.getUserSession().getPerson();
37 if (currentUser != null) {
38 return SpringContext.getBean(FinancialSystemUserService.class).getPrimaryOrganization(currentUser, OLEConstants.ParameterNamespaces.CHART).getChartOfAccountsCode();
39 }
40 else {
41 return OLEConstants.EMPTY_STRING;
42 }
43 }
44
45 }
46