use of org.kuali.rice.core.api.util.ConcreteKeyValue in project cu-kfs by CU-CommunityApps.
the class PurchaseOrderTransmissionMethodValuesFinder method getKeyValues.
/*
* @see org.kuali.keyvalues.KeyValuesFinder#getKeyValues()
*/
public List getKeyValues() {
KeyValuesService boService = SpringContext.getBean(KeyValuesService.class);
Collection codes = boService.findAll(PurchaseOrderTransmissionMethod.class);
List labels = new ArrayList();
labels.add(new ConcreteKeyValue("", ""));
for (Iterator iter = codes.iterator(); iter.hasNext(); ) {
PurchaseOrderTransmissionMethod poTransmissionMethod = (PurchaseOrderTransmissionMethod) iter.next();
labels.add(new ConcreteKeyValue(poTransmissionMethod.getPurchaseOrderTransmissionMethodCode(), poTransmissionMethod.getPurchaseOrderTransmissionMethodDescription()));
}
return labels;
}
use of org.kuali.rice.core.api.util.ConcreteKeyValue in project cu-kfs by CU-CommunityApps.
the class BankAccountNumberValuesFinder method getKeyValues.
/**
* Get Key Values
*
* @return List of KeyLabelPair
*
* @see org.kuali.core.lookup.keyvalues.KeyValuesFinder#getKeyValues()
*/
public List<KeyValue> getKeyValues() {
Collection<Bank> banks = SpringContext.getBean(KeyValuesService.class).findAll(Bank.class);
List<KeyValue> bankKeyLabels = new ArrayList<KeyValue>();
bankKeyLabels.add(new ConcreteKeyValue("", ""));
for (Bank bank : banks) {
if (bank.isActive()) {
bankKeyLabels.add(new ConcreteKeyValue(bank.getBankAccountNumber(), bank.getBankName()));
}
}
return bankKeyLabels;
}
use of org.kuali.rice.core.api.util.ConcreteKeyValue in project cu-kfs by CU-CommunityApps.
the class CheckReconSrcValuesFinder method getKeyValues.
/**
* Get Key Values
*
* @return List of KeyLabelPair
*
* @see org.kuali.core.lookup.keyvalues.KeyValuesFinder#getKeyValues()
*/
public List<KeyValue> getKeyValues() {
Collection<CheckReconSource> sources = SpringContext.getBean(KeyValuesService.class).findAll(CheckReconSource.class);
List<KeyValue> srcKeyLabels = new ArrayList<KeyValue>();
srcKeyLabels.add(new ConcreteKeyValue("", ""));
for (CheckReconSource src : sources) {
srcKeyLabels.add(new ConcreteKeyValue(src.getSourceCode(), src.getSourceName()));
}
return srcKeyLabels;
}
use of org.kuali.rice.core.api.util.ConcreteKeyValue in project cu-kfs by CU-CommunityApps.
the class AccountReversionGlobalRule method checkDetailObjectReversionCodeValidity.
/**
* Tests if the object reversion code is a valid code.
*
* @param detail the AccountReversionGlobalDetail to check
* @return true if it the detail is valid, false if otherwise
*/
public boolean checkDetailObjectReversionCodeValidity(AccountReversionGlobalDetail detail) {
boolean success = true;
if (!StringUtils.isBlank(detail.getAccountReversionCode())) {
boolean foundInList = false;
// search through the values. Is that right good & healthy?
for (Object kvPairObj : new ReversionCodeValuesFinder().getKeyValues()) {
ConcreteKeyValue kvPair = (ConcreteKeyValue) kvPairObj;
if (kvPair.getKey().toString().equals(detail.getAccountReversionCode())) {
foundInList = true;
break;
}
}
if (!foundInList) {
// we've failed to find the code in the list...FAILED!
success = false;
GlobalVariables.getMessageMap().putError("accountReversionCode", CUKFSKeyConstants.ERROR_DOCUMENT_GLOBAL_ACCT_REVERSION_INVALID_ACCT_REVERSION_CODE, new String[] { detail.getAccountReversionCode() });
}
}
return success;
}
use of org.kuali.rice.core.api.util.ConcreteKeyValue in project cu-kfs by CU-CommunityApps.
the class ReversionCodeValuesFinder method getKeyValues.
/**
* This is a static list of {@link OrganizationReversionCode}s
* <ul>
* <li>"A", "A - CF +/- bal in same account"</li>
* <li>"C1", "C1 - CF budget then CF + and R -"</li>
* <li>"C2", "C2 - Don't CF budget then CF + and R -"</li>
* <li>"N1", "N1 - CF budget then R + and CF -"</li>
* <li>"N2", "N2 - Don't CF budget then R + and CF -"</li>
* <li>"R1", "R1 - CF budget then R Remaining"</li>
* <li>"R2", "R2 - Don't CF budget then R Remaining"</li>
* </ul>
*
* @see org.kuali.kfs.kns.lookup.keyvalues.KeyValuesFinder#getKeyValues()
*/
public List getKeyValues() {
List<KeyValue> keyValues = new ArrayList<KeyValue>();
keyValues.add(new ConcreteKeyValue("", ""));
keyValues.add(new ConcreteKeyValue("A", "A - CF +/- bal in same account"));
keyValues.add(new ConcreteKeyValue("CA", "CA - Revert cash balance"));
keyValues.add(new ConcreteKeyValue("C1", "C1 - CF budget then CF + and R -"));
keyValues.add(new ConcreteKeyValue("C2", "C2 - Don't CF budget then CF + and R -"));
keyValues.add(new ConcreteKeyValue("N1", "N1 - CF budget then R + and CF -"));
keyValues.add(new ConcreteKeyValue("N2", "N2 - Don't CF budget then R + and CF -"));
keyValues.add(new ConcreteKeyValue("R1", "R1 - CF budget then R Remaining"));
keyValues.add(new ConcreteKeyValue("R2", "R2 - Don't CF budget then R Remaining"));
return keyValues;
}
Aggregations