Search in sources :

Example 1 with SubObjectCodeGlobalEditDetail

use of edu.cornell.kfs.coa.businessobject.SubObjectCodeGlobalEditDetail in project cu-kfs by CU-CommunityApps.

the class SubObjectCodeGlobalEditMaintainableImpl method generateMaintenanceLocks.

/**
 * This generates maintenance locks on {@link SubObjCd}
 *
 * @see org.kuali.kfs.kns.maintenance.Maintainable#generateMaintenanceLocks()
 */
@Override
public List<MaintenanceLock> generateMaintenanceLocks() {
    // create locking rep for each combination of account and object code
    List<MaintenanceLock> maintenanceLocks = new ArrayList();
    SubObjectCodeGlobalEdit subObjCdGlobal = (SubObjectCodeGlobalEdit) getBusinessObject();
    for (SubObjectCodeGlobalEditDetail subObjCdGlobalDetail : subObjCdGlobal.getSubObjCdGlobalEditDetails()) {
        MaintenanceLock maintenanceLock = new MaintenanceLock();
        maintenanceLock.setDocumentNumber(subObjCdGlobal.getDocumentNumber());
        StringBuffer lockrep = new StringBuffer();
        lockrep.append(SubObjectCode.class.getName() + KFSConstants.Maintenance.AFTER_CLASS_DELIM);
        lockrep.append("fiscalYear" + KFSConstants.Maintenance.AFTER_FIELDNAME_DELIM);
        lockrep.append(subObjCdGlobalDetail.getUniversityFiscalYear() + KFSConstants.Maintenance.AFTER_VALUE_DELIM);
        lockrep.append("chartOfAccountsCode" + KFSConstants.Maintenance.AFTER_FIELDNAME_DELIM);
        lockrep.append(subObjCdGlobalDetail.getChartOfAccountsCode() + KFSConstants.Maintenance.AFTER_VALUE_DELIM);
        lockrep.append("accountNumber" + KFSConstants.Maintenance.AFTER_FIELDNAME_DELIM);
        lockrep.append(subObjCdGlobalDetail.getAccountNumber() + KFSConstants.Maintenance.AFTER_VALUE_DELIM);
        lockrep.append("financialObjectCode" + KFSConstants.Maintenance.AFTER_FIELDNAME_DELIM);
        lockrep.append(subObjCdGlobalDetail.getFinancialObjectCode() + KFSConstants.Maintenance.AFTER_VALUE_DELIM);
        lockrep.append("financialSubObjectCode" + KFSConstants.Maintenance.AFTER_FIELDNAME_DELIM);
        lockrep.append(subObjCdGlobal.getFinancialSubObjectCode());
        maintenanceLock.setLockingRepresentation(lockrep.toString());
        maintenanceLocks.add(maintenanceLock);
    }
    return maintenanceLocks;
}
Also used : ArrayList(java.util.ArrayList) SubObjectCodeGlobalEdit(edu.cornell.kfs.coa.businessobject.SubObjectCodeGlobalEdit) SubObjectCodeGlobalEditDetail(edu.cornell.kfs.coa.businessobject.SubObjectCodeGlobalEditDetail) MaintenanceLock(org.kuali.kfs.krad.maintenance.MaintenanceLock)

Aggregations

SubObjectCodeGlobalEdit (edu.cornell.kfs.coa.businessobject.SubObjectCodeGlobalEdit)1 SubObjectCodeGlobalEditDetail (edu.cornell.kfs.coa.businessobject.SubObjectCodeGlobalEditDetail)1 ArrayList (java.util.ArrayList)1 MaintenanceLock (org.kuali.kfs.krad.maintenance.MaintenanceLock)1