use of org.kuali.kfs.core.api.util.KeyValue in project cu-kfs by CU-CommunityApps.
the class TaxReportingTypeValuesFinder method getKeyValues.
@Override
public List<KeyValue> getKeyValues() {
List<KeyValue> keyValues = new ArrayList<KeyValue>();
keyValues.add(new ConcreteKeyValue(KFSConstants.EMPTY_STRING, KFSConstants.EMPTY_STRING));
keyValues.add(new ConcreteKeyValue(CUTaxConstants.TAX_TYPE_1099, CUTaxConstants.TAX_TYPE_1099));
keyValues.add(new ConcreteKeyValue(CUTaxConstants.TAX_TYPE_1042S, CUTaxConstants.TAX_TYPE_1042S));
return keyValues;
}
use of org.kuali.kfs.core.api.util.KeyValue in project cu-kfs by CU-CommunityApps.
the class PurchaseOrderTransmissionMethodValuesFinder method getKeyValues.
public List<KeyValue> getKeyValues() {
Collection<PurchaseOrderTransmissionMethod> methods = keyValuesService.findAll(PurchaseOrderTransmissionMethod.class);
List<KeyValue> labels = new ArrayList<>();
labels.add(new ConcreteKeyValue("", ""));
for (PurchaseOrderTransmissionMethod method : methods) {
labels.add(new ConcreteKeyValue(method.getPurchaseOrderTransmissionMethodCode(), method.getPurchaseOrderTransmissionMethodDescription()));
}
return labels;
}
use of org.kuali.kfs.core.api.util.KeyValue in project cu-kfs by CU-CommunityApps.
the class LookupResource method buildLookupControlValuesMap.
private Map<String, Object> buildLookupControlValuesMap(BusinessObjectEntry businessObjectEntry) {
Class classForType = businessObjectEntry.getBusinessObjectClass();
if (!isAuthorizedForLookup(classForType)) {
throw new ForbiddenException();
}
Map<String, Object> valuesMap = new LinkedHashMap<>();
List<FormAttribute> attributes = getLookupAttributeForClass(classForType);
for (FormAttribute attribute : attributes) {
Control control = attribute.getControl();
if (control == null) {
continue;
}
String singleAttributeName = attribute.getName();
if (control.getType() == Control.Type.TREE) {
// we have to do this bean resolution here b/c batch file (the only tree) is still a snowflake
// and the DDD doesn't do the bean lookup for us (mainly b/c of the typing); hope to get rid of the
// need for special VF type eventually
String valuesFinderName = control.getValuesFinderName();
if (StringUtils.isBlank(valuesFinderName)) {
LOG.warn("A tree control without ValuesFinder name is most likely a mistake. BOE: " + businessObjectEntry.getName() + " attribute: " + singleAttributeName);
continue;
}
HierarchicalControlValuesFinder valuesFinder = getDataDictionaryService().getDDBean(HierarchicalControlValuesFinder.class, valuesFinderName);
if (valuesFinder == null) {
LOG.warn("A tree control without a valid HierarchicalControlValuesFinder is most likely a " + "mistake. BOE:" + businessObjectEntry.getName() + " attribute: " + singleAttributeName);
continue;
}
List<HierarchicalData> values = valuesFinder.getHierarchicalControlValues();
valuesMap.put(singleAttributeName, values);
} else {
KeyValuesFinder valuesFinder = control.getValuesFinder();
if (valuesFinder == null) {
continue;
}
// CU Customization: keyValues list now comes from the helper method below.
List<KeyValue> keyValues = getKeyValuesForLookup(valuesFinder);
valuesMap.put(singleAttributeName, keyValues);
}
}
return valuesMap;
}
use of org.kuali.kfs.core.api.util.KeyValue in project cu-kfs by CU-CommunityApps.
the class StatusValuesFinder method getKeyValues.
/**
* @see org.kuali.core.lookup.keyvalues.KeyValuesFinder#getKeyValues()
*/
public List<KeyValue> getKeyValues() {
List<KeyValue> keyValuesList = new ArrayList<KeyValue>();
keyValuesList.add(new ConcreteKeyValue(CRConstants.CANCELLED, "Cancelled"));
keyValuesList.add(new ConcreteKeyValue(CRConstants.CLEARED, "Cleared"));
keyValuesList.add(new ConcreteKeyValue(CRConstants.EXCP, "Exception"));
keyValuesList.add(new ConcreteKeyValue(CRConstants.ISSUED, "Issued"));
keyValuesList.add(new ConcreteKeyValue(CRConstants.STALE, "Stale"));
keyValuesList.add(new ConcreteKeyValue(CRConstants.STOP, "Stopped"));
keyValuesList.add(new ConcreteKeyValue(CRConstants.VOIDED, "Voided"));
return keyValuesList;
}
use of org.kuali.kfs.core.api.util.KeyValue in project cu-kfs by CU-CommunityApps.
the class ReversionCategoryValuesFinder method getKeyValues.
public List getKeyValues() {
Collection<ReversionCategory> codes = keyValuesService.findAll(ReversionCategory.class);
List<KeyValue> labels = new ArrayList<KeyValue>();
labels.add(new ConcreteKeyValue("", ""));
for (ReversionCategory reversionCategory : codes) {
if (reversionCategory.isActive()) {
labels.add(new ConcreteKeyValue(reversionCategory.getReversionCategoryCode(), reversionCategory.getReversionCategoryName()));
}
}
return labels;
}
Aggregations