1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.coa.document;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import org.kuali.ole.coa.businessobject.AccountGlobalDetail;
22 import org.kuali.ole.coa.businessobject.SubObjectCode;
23 import org.kuali.ole.coa.businessobject.SubObjectCodeGlobal;
24 import org.kuali.ole.coa.businessobject.SubObjectCodeGlobalDetail;
25 import org.kuali.ole.sys.OLEConstants;
26 import org.kuali.ole.sys.document.FinancialSystemGlobalMaintainable;
27 import org.kuali.rice.krad.bo.PersistableBusinessObject;
28 import org.kuali.rice.krad.maintenance.MaintenanceLock;
29
30
31
32
33
34 public class SubObjCdGlobalMaintainableImpl extends FinancialSystemGlobalMaintainable {
35
36
37
38
39
40
41 @Override
42 public List<MaintenanceLock> generateMaintenanceLocks() {
43
44 List<MaintenanceLock> maintenanceLocks = new ArrayList();
45 SubObjectCodeGlobal subObjCdGlobal = (SubObjectCodeGlobal) getBusinessObject();
46
47 for (AccountGlobalDetail accountGlobalDetail : subObjCdGlobal.getAccountGlobalDetails()) {
48 for (SubObjectCodeGlobalDetail subObjCdGlobalDetail : subObjCdGlobal.getSubObjCdGlobalDetails()) {
49 MaintenanceLock maintenanceLock = new MaintenanceLock();
50 maintenanceLock.setDocumentNumber(subObjCdGlobal.getDocumentNumber());
51
52 StringBuffer lockrep = new StringBuffer();
53 lockrep.append(SubObjectCode.class.getName() + OLEConstants.Maintenance.AFTER_CLASS_DELIM);
54 lockrep.append("fiscalYear" + OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
55 lockrep.append(subObjCdGlobalDetail.getUniversityFiscalYear() + OLEConstants.Maintenance.AFTER_VALUE_DELIM);
56 lockrep.append("chartOfAccountsCode" + OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
57 lockrep.append(accountGlobalDetail.getChartOfAccountsCode() + OLEConstants.Maintenance.AFTER_VALUE_DELIM);
58 lockrep.append("accountNumber" + OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
59 lockrep.append(accountGlobalDetail.getAccountNumber() + OLEConstants.Maintenance.AFTER_VALUE_DELIM);
60 lockrep.append("financialObjectCode" + OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
61 lockrep.append(subObjCdGlobalDetail.getFinancialObjectCode() + OLEConstants.Maintenance.AFTER_VALUE_DELIM);
62 lockrep.append("financialSubObjectCode" + OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
63 lockrep.append(subObjCdGlobal.getFinancialSubObjectCode());
64
65 maintenanceLock.setLockingRepresentation(lockrep.toString());
66 maintenanceLocks.add(maintenanceLock);
67 }
68 }
69 return maintenanceLocks;
70 }
71
72 @Override
73 public Class<? extends PersistableBusinessObject> getPrimaryEditedBusinessObjectClass() {
74 return SubObjectCode.class;
75 }
76 }