• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java MaintenanceLock类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.kuali.rice.krad.maintenance.MaintenanceLock的典型用法代码示例。如果您正苦于以下问题:Java MaintenanceLock类的具体用法?Java MaintenanceLock怎么用?Java MaintenanceLock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

MaintenanceLock类属于org.kuali.rice.krad.maintenance包,在下文中一共展示了MaintenanceLock类的35个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getLockingDocumentNumber

点赞 3

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.dao.MaintenanceDocumentDao#getLockingDocumentNumber(java.lang.String, java.lang.String)
 */
public String getLockingDocumentNumber(String lockingRepresentation, String documentNumber) {

    String lockingDocNumber = "";

    // build the query criteria
    Criteria criteria = new Criteria();
    criteria.addEqualTo("lockingRepresentation", lockingRepresentation);

    // if a docHeaderId is specified, then it will be excluded from the
    // locking representation test.
    if (StringUtils.isNotBlank(documentNumber)) {
        criteria.addNotEqualTo(KRADPropertyConstants.DOCUMENT_NUMBER, documentNumber);
    }

    // attempt to retrieve a document based off this criteria
    MaintenanceLock maintenanceLock = (MaintenanceLock) getPersistenceBrokerTemplate().getObjectByQuery(QueryFactory.newQuery(MaintenanceLock.class, criteria));

    // if a document was found, then there's already one out there pending, and
    // we consider it 'locked' and we return the docnumber.
    if (maintenanceLock != null) {
        lockingDocNumber = maintenanceLock.getDocumentNumber();
    }
    return lockingDocNumber;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:28,
代码来源:MaintenanceDocumentDaoOjb.java

示例2: getLockingDocumentNumber

点赞 3

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * @see org.kuali.ole.coa.dataaccess.AccountDelegateDao#getLockingDocumentNumber(java.lang.String, java.lang.String)
 */

public String getLockingDocumentNumber(String lockingRepresentation, String documentNumber) {
    String lockingDocNumber = "";

    // build the query criteria
    Criteria criteria = new Criteria();
    criteria.addEqualTo("lockingRepresentation", lockingRepresentation);

    // if a docHeaderId is specified, then it will be excluded from the
    // locking representation test.
    if (StringUtils.isNotBlank(documentNumber)) {
        criteria.addNotEqualTo(KRADPropertyConstants.DOCUMENT_NUMBER, documentNumber);
    }

    // attempt to retrieve a document based off this criteria
    MaintenanceLock maintenanceLock = (MaintenanceLock) getPersistenceBrokerTemplate().getObjectByQuery(QueryFactory.newQuery(MaintenanceLock.class, criteria));

    // if a document was found, then there's already one out there pending, and
    // we consider it 'locked' and we return the docnumber.
    if (maintenanceLock != null) {
        lockingDocNumber = maintenanceLock.getDocumentNumber();
    }
    return lockingDocNumber;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:28,
代码来源:AccountDelegateDaoOjb.java

示例3: getLockingDocumentId

点赞 3

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * @see org.kuali.ole.coa.service.AccountDelegateService#getLockingDocumentId(org.kuali.ole.coa.document.AccountDelegateMaintainableImpl,
 *      java.lang.String)
 */
@Override
@NonTransactional
public String getLockingDocumentId(AccountDelegateMaintainableImpl delegate, String docNumber) {
    String lockingDocId = null;
    List<MaintenanceLock> maintenanceLocks = delegate.generateMaintenanceLocks();
    maintenanceLocks.add(delegate.createGlobalAccountLock());

    for (MaintenanceLock maintenanceLock : maintenanceLocks) {
        lockingDocId = accountDelegateDao.getLockingDocumentNumber(maintenanceLock.getLockingRepresentation(), docNumber);
        if (StringUtils.isNotBlank(lockingDocId)) {
            break;
        }
    }
    return lockingDocId;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:20,
代码来源:AccountDelegateServiceImpl.java

示例4: generateMaintenanceLocks

点赞 3

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * This creates the particular locking representation for this global document.
 * 
 * @see org.kuali.rice.kns.maintenance.Maintainable#generateMaintenanceLocks()
 */
@Override
public List<MaintenanceLock> generateMaintenanceLocks() {
    AccountGlobal accountGlobal = (AccountGlobal) getBusinessObject();
    List<MaintenanceLock> maintenanceLocks = new ArrayList();

    for (AccountGlobalDetail detail : accountGlobal.getAccountGlobalDetails()) {
        MaintenanceLock maintenanceLock = new MaintenanceLock();
        StringBuffer lockrep = new StringBuffer();

        lockrep.append(Account.class.getName() + OLEConstants.Maintenance.AFTER_CLASS_DELIM);
        lockrep.append("chartOfAccountsCode" + OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
        lockrep.append(detail.getChartOfAccountsCode() + OLEConstants.Maintenance.AFTER_VALUE_DELIM);
        lockrep.append("accountNumber" + OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
        lockrep.append(detail.getAccountNumber());

        maintenanceLock.setDocumentNumber(accountGlobal.getDocumentNumber());
        maintenanceLock.setLockingRepresentation(lockrep.toString());
        maintenanceLocks.add(maintenanceLock);
    }
    return maintenanceLocks;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:27,
代码来源:AccountGlobalMaintainableImpl.java

示例5: generateCustomerInvoiceItemCodeMaintenanceLocks

点赞 3

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * This utility is used for creating the special lock for customer invoice item code to ensure that 
 * no invoice item codes are created if a organization option maint. doc is pending with the same
 * chart and organization.
 */
public static List<MaintenanceLock> generateCustomerInvoiceItemCodeMaintenanceLocks(PersistableBusinessObject bo, String documentNumber) {

    List<MaintenanceLock> maintenanceLocks = new ArrayList<MaintenanceLock>();
    StringBuilder lockRepresentation = new StringBuilder(CustomerInvoiceItemCode.class.getName());
    lockRepresentation.append(KRADConstants.Maintenance.LOCK_AFTER_CLASS_DELIM);
    
    //get chart of accounts code locking representation
    String chartOfAccountsCode = String.valueOf(ObjectUtils.getPropertyValue(bo, CHART_OF_ACCOUNTS_CODE_FIELD));
    lockRepresentation.append(CHART_OF_ACCOUNTS_CODE_FIELD);
    lockRepresentation.append(KRADConstants.Maintenance.LOCK_AFTER_FIELDNAME_DELIM);
    lockRepresentation.append(chartOfAccountsCode);
    
    //get organization code locking representation
    String organizationCode = String.valueOf(ObjectUtils.getPropertyValue(bo, ORGANIZATION_CODE_FIELD));
    lockRepresentation.append(ORGANIZATION_CODE_FIELD);
    lockRepresentation.append(KRADConstants.Maintenance.LOCK_AFTER_FIELDNAME_DELIM);
    lockRepresentation.append(organizationCode);

    MaintenanceLock maintenanceLock = new MaintenanceLock();
    maintenanceLock.setDocumentNumber(documentNumber);
    maintenanceLock.setLockingRepresentation(lockRepresentation.toString());
    maintenanceLocks.add(maintenanceLock);
    return maintenanceLocks;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:30,
代码来源:CustomerInvoiceItemCodeMaintainableImplUtil.java

示例6: generateMaintenanceLocks

点赞 3

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * This creates the particular locking representation for this global document.
 *
 * @see org.kuali.rice.kns.maintenance.Maintainable#generateMaintenanceLocks()
 */
@Override
public List<MaintenanceLock> generateMaintenanceLocks() {
    CreditCardImportedExpenseClearingObject cardImportedExpenseClearingObject =  (CreditCardImportedExpenseClearingObject) getBusinessObject();
    List<MaintenanceLock> maintenanceLocks = new ArrayList();

    for (CreditCardImportedExpenseClearingDetail detail : cardImportedExpenseClearingObject.getExpenses()) {
        MaintenanceLock maintenanceLock = new MaintenanceLock();
        StringBuffer lockrep = new StringBuffer();

        lockrep.append(HistoricalTravelExpense.class.getName() + KFSConstants.Maintenance.AFTER_CLASS_DELIM);
        lockrep.append("id" + KFSConstants.Maintenance.AFTER_FIELDNAME_DELIM);
        lockrep.append(detail.getCreditCardStagingDataId() + KFSConstants.Maintenance.AFTER_VALUE_DELIM);

        maintenanceLock.setDocumentNumber(cardImportedExpenseClearingObject.getDocumentNumber());
        maintenanceLock.setLockingRepresentation(lockrep.toString());
        maintenanceLocks.add(maintenanceLock);
    }
    return maintenanceLocks;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:25,
代码来源:CreditCardImportedExpenseClearingObjectMaintainableImpl.java

示例7: getLockingDocumentNumber

点赞 3

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * @see org.kuali.kfs.coa.dataaccess.AccountDelegateDao#getLockingDocumentNumber(java.lang.String, java.lang.String)
 */

public String getLockingDocumentNumber(String lockingRepresentation, String documentNumber) {
    String lockingDocNumber = "";

    // build the query criteria
    Criteria criteria = new Criteria();
    criteria.addEqualTo("lockingRepresentation", lockingRepresentation);

    // if a docHeaderId is specified, then it will be excluded from the
    // locking representation test.
    if (StringUtils.isNotBlank(documentNumber)) {
        criteria.addNotEqualTo(KRADPropertyConstants.DOCUMENT_NUMBER, documentNumber);
    }

    // attempt to retrieve a document based off this criteria
    MaintenanceLock maintenanceLock = (MaintenanceLock) getPersistenceBrokerTemplate().getObjectByQuery(QueryFactory.newQuery(MaintenanceLock.class, criteria));

    // if a document was found, then there's already one out there pending, and
    // we consider it 'locked' and we return the docnumber.
    if (maintenanceLock != null) {
        lockingDocNumber = maintenanceLock.getDocumentNumber();
    }
    return lockingDocNumber;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:28,
代码来源:AccountDelegateDaoOjb.java

示例8: getLockingDocumentId

点赞 3

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * @see org.kuali.kfs.coa.service.AccountDelegateService#getLockingDocumentId(org.kuali.kfs.coa.document.AccountDelegateMaintainableImpl,
 *      java.lang.String)
 */
@Override
@NonTransactional
public String getLockingDocumentId(AccountDelegateMaintainableImpl delegate, String docNumber) {
    String lockingDocId = null;
    List<MaintenanceLock> maintenanceLocks = delegate.generateMaintenanceLocks();
    maintenanceLocks.add(delegate.createGlobalAccountLock());

    for (MaintenanceLock maintenanceLock : maintenanceLocks) {
        lockingDocId = accountDelegateDao.getLockingDocumentNumber(maintenanceLock.getLockingRepresentation(), docNumber);
        if (StringUtils.isNotBlank(lockingDocId)) {
            break;
        }
    }
    return lockingDocId;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:20,
代码来源:AccountDelegateServiceImpl.java

示例9: generateMaintenanceLocks

点赞 3

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * This creates the particular locking representation for this global document.
 * 
 * @see org.kuali.rice.kns.maintenance.Maintainable#generateMaintenanceLocks()
 */
@Override
public List<MaintenanceLock> generateMaintenanceLocks() {
    AccountGlobal accountGlobal = (AccountGlobal) getBusinessObject();
    List<MaintenanceLock> maintenanceLocks = new ArrayList();

    for (AccountGlobalDetail detail : accountGlobal.getAccountGlobalDetails()) {
        MaintenanceLock maintenanceLock = new MaintenanceLock();
        StringBuffer lockrep = new StringBuffer();

        lockrep.append(Account.class.getName() + KFSConstants.Maintenance.AFTER_CLASS_DELIM);
        lockrep.append("chartOfAccountsCode" + KFSConstants.Maintenance.AFTER_FIELDNAME_DELIM);
        lockrep.append(detail.getChartOfAccountsCode() + KFSConstants.Maintenance.AFTER_VALUE_DELIM);
        lockrep.append("accountNumber" + KFSConstants.Maintenance.AFTER_FIELDNAME_DELIM);
        lockrep.append(detail.getAccountNumber());

        maintenanceLock.setDocumentNumber(accountGlobal.getDocumentNumber());
        maintenanceLock.setLockingRepresentation(lockrep.toString());
        maintenanceLocks.add(maintenanceLock);
    }
    return maintenanceLocks;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:27,
代码来源:AccountGlobalMaintainableImpl.java

示例10: testStaticWeaving

点赞 3

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
@Test
public void testStaticWeaving() {
    // first, scan for all files on the classpath with an @Entity or @MappedSuperClass annotation
    Reflections reflections = new Reflections(
            DocumentAttachment.class.getPackage().getName(),
            DocumentBase.class.getPackage().getName(),
            MaintenanceLock.class.getPackage().getName(),
            Message.class.getPackage().getName());
    Set<Class<?>> entityTypes = reflections.getTypesAnnotatedWith(Entity.class);
    Set<Class<?>> superTypes = reflections.getTypesAnnotatedWith(MappedSuperclass.class);
    Set<Class<?>> embeddableTypes = reflections.getTypesAnnotatedWith(Embeddable.class);

    // next, let's assert that they have been statically weaved
    assertStaticWeaved(entityTypes, superTypes, embeddableTypes);
}
 

开发者ID:kuali,
项目名称:rice,
代码行数:16,
代码来源:StaticWeavingTest.java

示例11: getLockingDocumentNumber

点赞 3

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.dao.MaintenanceDocumentDao#getLockingDocumentNumber(java.lang.String, java.lang.String)
 */
public String getLockingDocumentNumber(String lockingRepresentation, String documentNumber) {
	String lockingDocNumber = "";

	// build the query criteria
	Criteria criteria = new Criteria(MaintenanceLock.class.getName());
	criteria.eq("lockingRepresentation", lockingRepresentation);

	// if a docHeaderId is specified, then it will be excluded from the
	// locking representation test.
	if (StringUtils.isNotBlank(documentNumber)) {
		criteria.ne(KRADPropertyConstants.DOCUMENT_NUMBER, documentNumber);
	}

	// attempt to retrieve a document based off this criteria
	MaintenanceLock maintenanceLock = (MaintenanceLock) new QueryByCriteria(entityManager, criteria).toQuery().getSingleResult();

	// if a document was found, then there's already one out there pending,
	// and we consider it 'locked' and we return the docnumber.
	if (maintenanceLock != null) {
		lockingDocNumber = maintenanceLock.getDocumentNumber();
	}
	return lockingDocNumber;
}
 

开发者ID:aapotts,
项目名称:kuali_rice,
代码行数:27,
代码来源:MaintenanceDocumentDaoJpa.java

示例12: testStaticWeaving

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
@Test
public void testStaticWeaving() {
    // first, scan for all files on the classpath with an @Entity or @MappedSuperClass annotation
    Reflections reflections = new Reflections(
            DocumentAttachment.class.getPackage().getName(),
            DocumentBase.class.getPackage().getName(),
            MaintenanceLock.class.getPackage().getName(),
            Message.class.getPackage().getName());
    Set<Class<?>> entityTypes = reflections.getTypesAnnotatedWith(Entity.class, true);
    Set<Class<?>> superTypes = reflections.getTypesAnnotatedWith(MappedSuperclass.class, true);
    Set<Class<?>> embeddableTypes = reflections.getTypesAnnotatedWith(Embeddable.class, true);

    // next, let's assert that they have been statically weaved
    assertStaticWeaved(entityTypes, superTypes, embeddableTypes);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:StaticWeavingTest.java

示例13: getLockingDocumentId

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
    * @see org.kuali.rice.krad.service.MaintenanceDocumentService#getLockingDocumentId(org.kuali.rice.krad.maintenance.Maintainable,
    *      java.lang.String)
    */
   @Override
public String getLockingDocumentId(Maintainable maintainable, final String documentNumber) {
       final List<MaintenanceLock> maintenanceLocks = maintainable.generateMaintenanceLocks();
       String lockingDocId = null;
       for (MaintenanceLock maintenanceLock : maintenanceLocks) {
           lockingDocId = getLockingDocumentNumber(maintenanceLock.getLockingRepresentation(),
                   documentNumber);
           if (StringUtils.isNotBlank(lockingDocId)) {
               break;
           }
       }

       return lockingDocId;
   }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:19,
代码来源:MaintenanceDocumentServiceImpl.java

示例14: getLockingDocumentNumber

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
protected String getLockingDocumentNumber(String lockingRepresentation, String documentNumber) {
    String lockingDocNumber = "";

    // build the query criteria
    List<Predicate> predicates = new ArrayList<Predicate>();
    predicates.add(PredicateFactory.equal("lockingRepresentation", lockingRepresentation));

    // if a docHeaderId is specified, then it will be excluded from the
    // locking representation test.
    if (StringUtils.isNotBlank(documentNumber)) {
        predicates.add(PredicateFactory.notEqual(KRADPropertyConstants.DOCUMENT_NUMBER, documentNumber));
    }

    QueryByCriteria.Builder qbc = QueryByCriteria.Builder.create();
    qbc.setPredicates(PredicateFactory.and(predicates.toArray(new Predicate[predicates.size()])));

    // attempt to retrieve a document based off this criteria
    List<MaintenanceLock> results = KradDataServiceLocator.getDataObjectService().findMatching(MaintenanceLock.class, qbc.build())
            .getResults();
    if (results.size() > 1) {
        throw new IllegalStateException(
                "Expected single result querying for MaintenanceLock. LockRep: " + lockingRepresentation);
    }

    // if a document was found, then there's already one out there pending,
    // and we consider it 'locked' and we return the docnumber.
    if (!results.isEmpty()) {
        lockingDocNumber = results.get(0).getDocumentNumber();
    }
    return lockingDocNumber;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:32,
代码来源:MaintenanceDocumentServiceImpl.java

示例15: storeLocks

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
    * @see org.kuali.rice.krad.service.MaintenanceDocumentService#storeLocks(java.util.List)
    */
   @Override
public void storeLocks(List<MaintenanceLock> maintenanceLocks) {
       if (maintenanceLocks == null) {
           return;
       }
       for (MaintenanceLock maintenanceLock : maintenanceLocks) {
           dataObjectService.save(maintenanceLock);
       }
   }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:13,
代码来源:MaintenanceDocumentServiceImpl.java

示例16: generateMaintenanceLocks

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
@Override
public List<MaintenanceLock> generateMaintenanceLocks() {
	if (getThisRule().getId() == null) {
		return Collections.emptyList();
	}
	return super.generateMaintenanceLocks();
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:8,
代码来源:RoutingRuleDelegationMaintainable.java

示例17: getLockingDocumentNumber

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
* 
* @see org.kuali.ole.coa.dataaccess.AccountDelegateGlobalDao#getLockingDocumentNumber(java.lang.String, java.lang.String)
*/

public String getLockingDocumentNumber(String lockingRepresentation, String documentNumber) {
    String lockingDocNumber = "";

    lockingRepresentation = convertForLikeCriteria(lockingRepresentation);
    
    // build the query criteria
    Criteria criteria = new Criteria();
    criteria.addLike("lockingRepresentation", lockingRepresentation);

    // if a docHeaderId is specified, then it will be excluded from the
    // locking representation test.
    if (StringUtils.isNotBlank(documentNumber)) {
        criteria.addNotEqualTo(KRADPropertyConstants.DOCUMENT_NUMBER, documentNumber);
    }

    // attempt to retrieve a document based off this criteria
    MaintenanceLock maintenanceLock = (MaintenanceLock) getPersistenceBrokerTemplate().getObjectByQuery(QueryFactory.newQuery(MaintenanceLock.class, criteria));

    // if a document was found, then there's already one out there pending, and
    // we consider it 'locked' and we return the docnumber.
    if (maintenanceLock != null) {
        lockingDocNumber = maintenanceLock.getDocumentNumber();
    }
    return lockingDocNumber;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:31,
代码来源:AccountDelegateGlobalDaoOjb.java

示例18: generateTrickleDownMaintenanceLocks

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
public List<MaintenanceLock> generateTrickleDownMaintenanceLocks(Collection<SubObjectCode> subObjects, String documentNumber) {
    Maintainable subObjectMaintainable = getSubObjectMaintainable(documentNumber);
    List<MaintenanceLock> maintenanceLocks = new ArrayList<MaintenanceLock>();
    for (SubObjectCode subObjCd : subObjects) {
        subObjectMaintainable.setBusinessObject(subObjCd);
        maintenanceLocks.addAll(subObjectMaintainable.generateMaintenanceLocks());
    }
    return maintenanceLocks;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:10,
代码来源:SubObjectTrickleDownInactivationServiceImpl.java

示例19: trickleDownInactivate

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
protected TrickleDownInactivationStatus trickleDownInactivate(Collection<SubObjectCode> subObjects, String documentNumber) {
    TrickleDownInactivationStatus trickleDownInactivationStatus = new TrickleDownInactivationStatus();
    
    if (subObjects != null && !subObjects.isEmpty()) {
        Maintainable subObjectMaintainable = getSubObjectMaintainable(documentNumber);
        for (Iterator<SubObjectCode> i = subObjects.iterator(); i.hasNext(); ) {
            SubObjectCode subObjCd = i.next();
            if (subObjCd.isActive()) {
                subObjectMaintainable.setBusinessObject(subObjCd);
                List<MaintenanceLock> subAccountLocks = subObjectMaintainable.generateMaintenanceLocks();
                
                MaintenanceLock failedLock = verifyAllLocksFromThisDocument(subAccountLocks, documentNumber);
                if (failedLock != null) {
                    // another document has locked this sub account, so we don't try to inactivate the account
                    trickleDownInactivationStatus.alreadyLockedSubObjCds.put(subObjCd, failedLock.getDocumentNumber());
                }
                else {
                    // no locks other than our own (but there may have been no locks at all), just go ahead and try to update
                    subObjCd.setActive(false);
                    
                    try {
                        subObjectMaintainable.saveBusinessObject();
                        trickleDownInactivationStatus.inactivatedSubObjCds.add(subObjCd);
                    }
                    catch (RuntimeException e) {
                        LOG.error("Unable to trickle-down inactivate sub-account " + subObjCd.toString(), e);
                        trickleDownInactivationStatus.errorPersistingSubObjCds.add(subObjCd);
                    }
                }
            }
        }
    }
    
    return trickleDownInactivationStatus;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:36,
代码来源:SubObjectTrickleDownInactivationServiceImpl.java

示例20: verifyAllLocksFromThisDocument

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
protected MaintenanceLock verifyAllLocksFromThisDocument(List<MaintenanceLock> maintenanceLocks, String documentNumber) {
    for (MaintenanceLock maintenanceLock : maintenanceLocks) {
        String lockingDocNumber = maintenanceDocumentDao.getLockingDocumentNumber(maintenanceLock.getLockingRepresentation(), documentNumber);
        if (StringUtils.isNotBlank(lockingDocNumber)) {
            return maintenanceLock;
        }
    }
    return null;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:10,
代码来源:SubObjectTrickleDownInactivationServiceImpl.java

示例21: generateMaintenanceLocks

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * Generates the appropriate maintenance locks for the {@link Delegate}
 * 
 * @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#generateMaintenanceLocks()
 */
@Override
public List<MaintenanceLock> generateMaintenanceLocks() {
    AccountDelegate delegate = (AccountDelegate) this.businessObject;
    List<MaintenanceLock> locks = super.generateMaintenanceLocks();
    if (delegate.isAccountsDelegatePrmrtIndicator()) {
        locks.add(createMaintenanceLock(new String[] { "chartOfAccountsCode", "accountNumber", "financialDocumentTypeCode", "accountsDelegatePrmrtIndicator" }));
    }
    return locks;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:15,
代码来源:AccountDelegateMaintainableImpl.java

示例22: createMaintenanceLock

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * This method creates a maintenance lock for the field names supplied
 * 
 * @param fieldNames
 * @return the maintenance lock for supplied field names
 */
protected MaintenanceLock createMaintenanceLock(String[] fieldNames) {
    MaintenanceLock lock = new MaintenanceLock();
    lock.setDocumentNumber(getDocumentNumber());
    lock.setLockingRepresentation(createLockingRepresentation(fieldNames));
    return lock;

}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:14,
代码来源:AccountDelegateMaintainableImpl.java

示例23: createGlobalAccountLock

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * This method created a MaintenanceLock for the chartOfAccountsCode and accountNumber for an AccountDelegateGlobal.
 *
 * @return the MainenanceLock
 */

public MaintenanceLock createGlobalAccountLock() {
    
    String[] fields = {"chartOfAccountsCode", "accountNumber"};
    MaintenanceLock lock = new MaintenanceLock();
    lock.setDocumentNumber(getDocumentNumber());
    
    StringBuilder lockRepresentation = new StringBuilder();

    lockRepresentation.append(AccountDelegateGlobal.class.getName());
    lockRepresentation.append(OLEConstants.Maintenance.AFTER_CLASS_DELIM);

    DataDictionaryService dataDictionaryService = SpringContext.getBean(DataDictionaryService.class); 
    EncryptionService encryptionService = SpringContext.getBean(EncryptionService.class); 
    
    int count = 0;
    for (String fieldName : fields) {
        lockRepresentation.append(fieldName);
        lockRepresentation.append(OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
        lockRepresentation.append(retrieveFieldValueForLock(fieldName, dataDictionaryService, encryptionService));
        if (count < (fields.length - 1)) {
            lockRepresentation.append(OLEConstants.Maintenance.AFTER_VALUE_DELIM);
        }
        count += 1;
    }

    lock.setLockingRepresentation(lockRepresentation.toString());
    
    return lock;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:36,
代码来源:AccountDelegateMaintainableImpl.java

示例24: generateMaintenanceLocks

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * This generates maintenance locks on {@link SubObjCd}
 * 
 * @see org.kuali.rice.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();
    SubObjectCodeGlobal subObjCdGlobal = (SubObjectCodeGlobal) getBusinessObject();

    for (AccountGlobalDetail accountGlobalDetail : subObjCdGlobal.getAccountGlobalDetails()) {
        for (SubObjectCodeGlobalDetail subObjCdGlobalDetail : subObjCdGlobal.getSubObjCdGlobalDetails()) {
            MaintenanceLock maintenanceLock = new MaintenanceLock();
            maintenanceLock.setDocumentNumber(subObjCdGlobal.getDocumentNumber());

            StringBuffer lockrep = new StringBuffer();
            lockrep.append(SubObjectCode.class.getName() + OLEConstants.Maintenance.AFTER_CLASS_DELIM);
            lockrep.append("fiscalYear" + OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
            lockrep.append(subObjCdGlobalDetail.getUniversityFiscalYear() + OLEConstants.Maintenance.AFTER_VALUE_DELIM);
            lockrep.append("chartOfAccountsCode" + OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
            lockrep.append(accountGlobalDetail.getChartOfAccountsCode() + OLEConstants.Maintenance.AFTER_VALUE_DELIM);
            lockrep.append("accountNumber" + OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
            lockrep.append(accountGlobalDetail.getAccountNumber() + OLEConstants.Maintenance.AFTER_VALUE_DELIM);
            lockrep.append("financialObjectCode" + OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
            lockrep.append(subObjCdGlobalDetail.getFinancialObjectCode() + OLEConstants.Maintenance.AFTER_VALUE_DELIM);
            lockrep.append("financialSubObjectCode" + OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
            lockrep.append(subObjCdGlobal.getFinancialSubObjectCode());

            maintenanceLock.setLockingRepresentation(lockrep.toString());
            maintenanceLocks.add(maintenanceLock);
        }
    }
    return maintenanceLocks;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:36,
代码来源:SubObjCdGlobalMaintainableImpl.java

示例25: generateMaintenanceLocks

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * This implementation locks all organization reversions that would be accessed by this global organization reversion. It does
 * not lock any OrganizationReversionDetail objects, as we expect that those will be inaccessible
 * 
 * @see org.kuali.rice.kns.maintenance.KualiGlobalMaintainableImpl#generateMaintenaceLocks()
 */
@Override
public List<MaintenanceLock> generateMaintenanceLocks() {
    List<MaintenanceLock> locks = new ArrayList<MaintenanceLock>();
    OrganizationReversionGlobal globalOrgRev = (OrganizationReversionGlobal) this.getBusinessObject();
    if (globalOrgRev.getUniversityFiscalYear() != null && globalOrgRev.getOrganizationReversionGlobalOrganizations() != null && globalOrgRev.getOrganizationReversionGlobalOrganizations().size() > 0) { // only generate locks if we're going to have primary keys
        for (OrganizationReversionGlobalOrganization orgRevOrg : globalOrgRev.getOrganizationReversionGlobalOrganizations()) {
            MaintenanceLock maintenanceLock = new MaintenanceLock();
            maintenanceLock.setDocumentNumber(globalOrgRev.getDocumentNumber());

            StringBuilder lockRep = new StringBuilder();
            lockRep.append(OrganizationReversion.class.getName());
            lockRep.append(OLEConstants.Maintenance.AFTER_CLASS_DELIM);
            lockRep.append(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE);
            lockRep.append(OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
            lockRep.append(orgRevOrg.getChartOfAccountsCode());
            lockRep.append(OLEConstants.Maintenance.AFTER_VALUE_DELIM);
            lockRep.append(OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR);
            lockRep.append(OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
            lockRep.append(globalOrgRev.getUniversityFiscalYear().toString());
            lockRep.append(OLEConstants.Maintenance.AFTER_VALUE_DELIM);
            lockRep.append(OLEPropertyConstants.ORGANIZATION_CODE);
            lockRep.append(OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
            lockRep.append(orgRevOrg.getOrganizationCode());
            lockRep.append(OLEConstants.Maintenance.AFTER_VALUE_DELIM);

            maintenanceLock.setLockingRepresentation(lockRep.toString());
            locks.add(maintenanceLock);
        }
    }

    return locks;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:39,
代码来源:OrganizationReversionGlobalMaintainableImpl.java

示例26: generateMaintenanceLocks

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
@Override
public List<MaintenanceLock> generateMaintenanceLocks() {
    List<MaintenanceLock> maintenanceLocks = super.generateMaintenanceLocks();
    boolean isClosingAccount = false;

    if (isClosingAccount()) {
        maintenanceLocks.addAll(SpringContext.getBean(SubAccountTrickleDownInactivationService.class).generateTrickleDownMaintenanceLocks((Account) getBusinessObject(), getDocumentNumber()));
        maintenanceLocks.addAll(SpringContext.getBean(SubObjectTrickleDownInactivationService.class).generateTrickleDownMaintenanceLocks((Account) getBusinessObject(), getDocumentNumber()));
    }
    return maintenanceLocks;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:12,
代码来源:KualiAccountMaintainableImpl.java

示例27: generateMaintenanceLocks

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
@Override
public List<MaintenanceLock> generateMaintenanceLocks() {
    List<MaintenanceLock> maintenanceLocks = super.generateMaintenanceLocks();
    ObjectCode maintainedObjectCode = (ObjectCode) getBusinessObject();
    if (isInactivatingObjectCode()) {
        maintenanceLocks.addAll(SpringContext.getBean(SubObjectTrickleDownInactivationService.class).generateTrickleDownMaintenanceLocks((ObjectCode) getBusinessObject(), getDocumentNumber()));
    }
    return maintenanceLocks;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:10,
代码来源:ObjectCodeMaintainableImpl.java

示例28: generateMaintenanceLocks

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * This generates the appropriate maintenance locks for the {@link ObjectCode}
 * 
 * @see org.kuali.rice.kns.maintenance.Maintainable#generateMaintenanceLocks()
 */
@Override
public List<MaintenanceLock> generateMaintenanceLocks() {
    ObjectCodeGlobal objectCodeGlobal = (ObjectCodeGlobal) getBusinessObject();
    List<MaintenanceLock> maintenanceLocks = new ArrayList();
    SubObjectTrickleDownInactivationService subObjectTrickleDownInactivationService = SpringContext.getBean(SubObjectTrickleDownInactivationService.class);
    
    for (ObjectCodeGlobalDetail detail : objectCodeGlobal.getObjectCodeGlobalDetails()) {
        MaintenanceLock maintenanceLock = new MaintenanceLock();
        StringBuffer lockrep = new StringBuffer();

        lockrep.append(ObjectCode.class.getName() + OLEConstants.Maintenance.AFTER_CLASS_DELIM);
        lockrep.append("universityFiscalYear" + OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
        lockrep.append(detail.getUniversityFiscalYear() + OLEConstants.Maintenance.AFTER_VALUE_DELIM);
        lockrep.append("chartOfAccountsCode" + OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
        lockrep.append(detail.getChartOfAccountsCode() + OLEConstants.Maintenance.AFTER_VALUE_DELIM);
        lockrep.append("financialObjectCode" + OLEConstants.Maintenance.AFTER_FIELDNAME_DELIM);
        lockrep.append(detail.getFinancialObjectCode());

        maintenanceLock.setDocumentNumber(objectCodeGlobal.getDocumentNumber());
        maintenanceLock.setLockingRepresentation(lockrep.toString());
        maintenanceLocks.add(maintenanceLock);
        
        ObjectCode objectCode = new ObjectCode();
        objectCode.setUniversityFiscalYear(detail.getUniversityFiscalYear());
        objectCode.setChartOfAccountsCode(detail.getChartOfAccountsCode());
        objectCode.setFinancialObjectCode(detail.getFinancialObjectCode());
        objectCode.setActive(objectCodeGlobal.isFinancialObjectActiveIndicator());
        
        if (isInactivatingObjectCode(objectCode)) {
            // if it turns out that the object code does not have associated sub-objects (either because the object code doesn't exist or doesn't have sub-objects)
            // then the generateTrickleDownMaintenanceLocks method returns an empty list 
            maintenanceLocks.addAll(subObjectTrickleDownInactivationService.generateTrickleDownMaintenanceLocks(objectCode, getDocumentNumber()));
        }
    }
    return maintenanceLocks;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:42,
代码来源:ObjectCodeGlobalMaintainableImpl.java

示例29: generateMaintenanceLocks

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * Generates the appropriate maintenance locks for {@link ReceivingAddress}
 *
 * @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#generateMaintenanceLocks()
 */
@Override
public List<MaintenanceLock> generateMaintenanceLocks() {
    ReceivingAddress receivingAddress = (ReceivingAddress) this.businessObject;
    List<MaintenanceLock> locks = super.generateMaintenanceLocks();
    if (receivingAddress.isDefaultIndicator() && receivingAddress.isActive()) {
        locks.add(createMaintenanceLock(new String[]{"chartOfAccountsCode", "organizationCode", "defaultIndicator", "active"}));
    }
    return locks;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:15,
代码来源:ReceivingAddressMaintainableImpl.java

示例30: createMaintenanceLock

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * Creates a maintenance lock for the field names supplied.
 *
 * @param fieldNames
 * @return the maintenance lock for supplied field names
 */
private MaintenanceLock createMaintenanceLock(String[] fieldNames) {
    MaintenanceLock lock = new MaintenanceLock();
    lock.setDocumentNumber(getDocumentNumber());
    lock.setLockingRepresentation(createLockingRepresentation(fieldNames));
    return lock;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:13,
代码来源:ReceivingAddressMaintainableImpl.java

示例31: generateMaintenanceLocks

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * Returns the locking representation of the vendor. If the vendor detail id is not null, call the super class
 * implementation of generateMaintenanceLocks which will set the locking key to be the header and detail ids. However, if the
 * detail id is null, that means this is a new vendor (parent or division) and we should ignore locking.
 * 
 * @see org.kuali.rice.kns.maintenance.Maintainable#generateMaintenanceLocks()
 */
@Override
public List<MaintenanceLock> generateMaintenanceLocks() {
    if (ObjectUtils.isNotNull(((VendorDetail) getBusinessObject()).getVendorDetailAssignedIdentifier())) {
        return super.generateMaintenanceLocks();
    }
    else {
        return new ArrayList();
    }
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:17,
代码来源:VendorMaintainableImpl.java

示例32: generateMaintenanceLocks

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 *
 * @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#generateMaintenanceLocks()
 */
@Override
public List<MaintenanceLock> generateMaintenanceLocks() {
    List<MaintenanceLock> maintenanceLocks = super.generateMaintenanceLocks();
    maintenanceLocks.addAll(CustomerInvoiceItemCodeMaintainableImplUtil.generateCustomerInvoiceItemCodeMaintenanceLocks(getBusinessObject(), getDocumentNumber()));
    return maintenanceLocks;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:11,
代码来源:OrganizationOptionsMaintainableImpl.java

示例33: generateMaintenanceLocks

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * Generates the appropriate maintenance locks for {@link ReceivingAddress}
 * 
 * @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#generateMaintenanceLocks()
 */
@Override
public List<MaintenanceLock> generateMaintenanceLocks() {
    ReceivingAddress receivingAddress = (ReceivingAddress) this.businessObject;
    List<MaintenanceLock> locks = super.generateMaintenanceLocks();
    if ( receivingAddress.isDefaultIndicator() && receivingAddress.isActive() ) {
        locks.add(createMaintenanceLock(new String[] { "chartOfAccountsCode", "organizationCode", "defaultIndicator", "active" }));
    }
    return locks;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:15,
代码来源:ReceivingAddressMaintainableImpl.java

示例34: createMaintenanceLock

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
 * Creates a maintenance lock for the field names supplied.
 * 
 * @param fieldNames
 * @return the maintenance lock for supplied field names
 */
private MaintenanceLock createMaintenanceLock(String[] fieldNames) {
    MaintenanceLock lock = new MaintenanceLock();
    lock.setDocumentNumber(getDocumentNumber());
    lock.setLockingRepresentation(createLockingRepresentation(fieldNames));
    return lock;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:13,
代码来源:ReceivingAddressMaintainableImpl.java

示例35: getLockingDocumentNumber

点赞 2

import org.kuali.rice.krad.maintenance.MaintenanceLock; //导入依赖的package包/类
/**
* 
* @see org.kuali.kfs.coa.dataaccess.AccountDelegateGlobalDao#getLockingDocumentNumber(java.lang.String, java.lang.String)
*/

public String getLockingDocumentNumber(String lockingRepresentation, String documentNumber) {
    String lockingDocNumber = "";

    lockingRepresentation = convertForLikeCriteria(lockingRepresentation);
    
    // build the query criteria
    Criteria criteria = new Criteria();
    criteria.addLike("lockingRepresentation", lockingRepresentation);

    // if a docHeaderId is specified, then it will be excluded from the
    // locking representation test.
    if (StringUtils.isNotBlank(documentNumber)) {
        criteria.addNotEqualTo(KRADPropertyConstants.DOCUMENT_NUMBER, documentNumber);
    }

    // attempt to retrieve a document based off this criteria
    MaintenanceLock maintenanceLock = (MaintenanceLock) getPersistenceBrokerTemplate().getObjectByQuery(QueryFactory.newQuery(MaintenanceLock.class, criteria));

    // if a document was found, then there's already one out there pending, and
    // we consider it 'locked' and we return the docnumber.
    if (maintenanceLock != null) {
        lockingDocNumber = maintenanceLock.getDocumentNumber();
    }
    return lockingDocNumber;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:31,
代码来源:AccountDelegateGlobalDaoOjb.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)