Search in sources :

Example 31 with KeyValue

use of org.kuali.kfs.core.api.util.KeyValue in project cu-kfs by CU-CommunityApps.

the class CuLocaleValuesFinder method getKeyValues.

/**
 * @see org.kuali.kfs.krad.keyvalues.KeyValuesFinder#getKeyValues()
 */
public List<KeyValue> getKeyValues() {
    List<KeyValue> keyValues = new ArrayList<KeyValue>();
    keyValues.add(new ConcreteKeyValue(KFSConstants.EMPTY_STRING, KFSConstants.EMPTY_STRING));
    // In this case, the source map is a "linked" one, so we can rely on consistent iteration order.
    for (Map.Entry<String, String> locale : CUVendorConstants.LOCALES_LABEL_MAP.entrySet()) {
        keyValues.add(new ConcreteKeyValue(locale.getKey(), locale.getValue()));
    }
    return keyValues;
}
Also used : ConcreteKeyValue(org.kuali.kfs.core.api.util.ConcreteKeyValue) KeyValue(org.kuali.kfs.core.api.util.KeyValue) ConcreteKeyValue(org.kuali.kfs.core.api.util.ConcreteKeyValue) ArrayList(java.util.ArrayList) Map(java.util.Map)

Example 32 with KeyValue

use of org.kuali.kfs.core.api.util.KeyValue in project cu-kfs by CU-CommunityApps.

the class EinvoiceIndicatorValuesFinder method getKeyValues.

@Override
public List<KeyValue> getKeyValues() {
    List<KeyValue> keyValues = new ArrayList<>();
    keyValues.add(new ConcreteKeyValue(EinvoiceIndicator.NONE.code, EinvoiceIndicator.NONE.description));
    keyValues.add(new ConcreteKeyValue(EinvoiceIndicator.SFTP.code, EinvoiceIndicator.SFTP.description));
    keyValues.add(new ConcreteKeyValue(EinvoiceIndicator.WEB.code, EinvoiceIndicator.WEB.description));
    return keyValues;
}
Also used : ConcreteKeyValue(org.kuali.kfs.core.api.util.ConcreteKeyValue) KeyValue(org.kuali.kfs.core.api.util.KeyValue) ConcreteKeyValue(org.kuali.kfs.core.api.util.ConcreteKeyValue) ArrayList(java.util.ArrayList)

Example 33 with KeyValue

use of org.kuali.kfs.core.api.util.KeyValue in project cu-kfs by CU-CommunityApps.

the class ActionListFilterAction method getUserWorkgroupsDropDownList.

private List<? extends KeyValue> getUserWorkgroupsDropDownList(String principalId) {
    List<String> userWorkgroups = KimApiServiceLocator.getGroupService().getGroupIdsByPrincipalId(principalId);
    // note that userWorkgroups is unmodifiable so we need to create a new list that we can sort
    List<String> userGroupsToSort = new ArrayList<String>(userWorkgroups);
    List<KeyValue> sortedUserWorkgroups = new ArrayList<KeyValue>();
    KeyValue keyValue = null;
    keyValue = new ConcreteKeyValue(KewApiConstants.NO_FILTERING, KewApiConstants.NO_FILTERING);
    sortedUserWorkgroups.add(keyValue);
    if (userGroupsToSort != null && userGroupsToSort.size() > 0) {
        Collections.sort(userGroupsToSort);
        Group group;
        for (String groupId : userGroupsToSort) {
            group = KimApiServiceLocator.getGroupService().getGroup(groupId);
            keyValue = new ConcreteKeyValue(groupId, group.getName());
            sortedUserWorkgroups.add(keyValue);
        }
    }
    return sortedUserWorkgroups;
}
Also used : ConcreteKeyValue(org.kuali.kfs.core.api.util.ConcreteKeyValue) Group(org.kuali.kfs.kim.impl.group.Group) KeyValue(org.kuali.kfs.core.api.util.KeyValue) ConcreteKeyValue(org.kuali.kfs.core.api.util.ConcreteKeyValue) ArrayList(java.util.ArrayList)

Example 34 with KeyValue

use of org.kuali.kfs.core.api.util.KeyValue in project cu-kfs by CU-CommunityApps.

the class GroupTitleLineRenderer method buildFavoriteAccounts.

private String buildFavoriteAccounts(String accountPrefix) {
    int itemIdx = getItemIdx(accountPrefix);
    Integer accountLineId = null;
    if (isDocumentIntegratedFavoriteAccount()) {
        if (itemIdx >= 0) {
            accountLineId = ((PurchasingItemBase) ((PurchasingDocumentBase) this.getAccountingDocument()).getItem(itemIdx)).getFavoriteAccountLineIdentifier();
        } else {
            accountLineId = ((PurchasingDocumentBase) this.getAccountingDocument()).getFavoriteAccountLineIdentifier();
        }
    }
    StringBuffer favoriteAccountLine = new StringBuffer();
    favoriteAccountLine.append("<tr>");
    favoriteAccountLine.append("<th colspan=\"2\" align=\"right\" valign=\"middle\" class=\"bord-l-b\">");
    favoriteAccountLine.append("<div  align=\"right\">");
    favoriteAccountLine.append("Favorite Account");
    favoriteAccountLine.append("</div>");
    favoriteAccountLine.append("</th>");
    if (StringUtils.isBlank(accountPrefix)) {
        accountPrefix = "document.";
    }
    favoriteAccountLine.append("<td colspan=\"7\" class=\"infoline\">");
    favoriteAccountLine.append("<select name=\"").append(accountPrefix).append("favoriteAccountLineIdentifier\" id=\"").append(accountPrefix).append("favoriteAccountLineIdentifier\" title=\"* Favorite Account\">");
    FavoriteAccountValuesFinder accounts = new FavoriteAccountValuesFinder();
    accounts.setBusinessObjectService(getBusinessObjectService());
    for (KeyValue keyValue : (List<KeyValue>) accounts.getKeyValues()) {
        favoriteAccountLine.append("<option value=\"").append(keyValue.getKey());
        if (checkToAddError(accountPrefix + "favoriteAccountLineIdentifier")) {
            favoriteAccountLine.append(getSelected(accountLineId, keyValue.getKey()));
        } else {
            favoriteAccountLine.append("\" >");
        }
        favoriteAccountLine.append(keyValue.getValue());
        favoriteAccountLine.append("</option>\n");
    }
    favoriteAccountLine.append("</select>");
    if (checkToAddError(accountPrefix + "favoriteAccountLineIdentifier")) {
        favoriteAccountLine.append(getErrorIconImageTag());
    }
    favoriteAccountLine.append("</td>");
    favoriteAccountLine.append("<td valign=\"top\" class=\"infoline\">");
    favoriteAccountLine.append("<div style=\"text-align: center;\">");
    favoriteAccountLine.append("<input type=\"image\" name=\"methodToCall.addFavoriteAccount.line").append(itemIdx).append(".anchorFavoriteAnchor\" src=\"static/images/tinybutton-add1.gif\" tabindex=\"0\" class=\"tinybutton\"");
    favoriteAccountLine.append(" title=\"Add Favorite  Accounting Line\" alt=\"Add Favorite Accounting Line\">");
    favoriteAccountLine.append("</input>");
    favoriteAccountLine.append("<br></div></td>");
    favoriteAccountLine.append("</tr>");
    return favoriteAccountLine.toString();
}
Also used : KeyValue(org.kuali.kfs.core.api.util.KeyValue) ArrayList(java.util.ArrayList) List(java.util.List) PurchasingDocumentBase(org.kuali.kfs.module.purap.document.PurchasingDocumentBase) FavoriteAccountValuesFinder(edu.cornell.kfs.sys.businessobject.options.FavoriteAccountValuesFinder)

Example 35 with KeyValue

use of org.kuali.kfs.core.api.util.KeyValue in project cu-kfs by CU-CommunityApps.

the class TestPayeeAchIdTypeValuesFinder method getKeyValues.

@Override
public List<KeyValue> getKeyValues() {
    List<KeyValue> keyValues = new ArrayList<>();
    keyValues.add(new ConcreteKeyValue(PayeeIdTypeCodes.EMPLOYEE, TestPayeeIdTypeLabels.EMPLOYEE));
    keyValues.add(new ConcreteKeyValue(PayeeIdTypeCodes.FEIN, TestPayeeIdTypeLabels.FEIN));
    keyValues.add(new ConcreteKeyValue(PayeeIdTypeCodes.SSN, TestPayeeIdTypeLabels.SSN));
    keyValues.add(new ConcreteKeyValue(PayeeIdTypeCodes.ENTITY, TestPayeeIdTypeLabels.ENTITY));
    keyValues.add(new ConcreteKeyValue(PayeeIdTypeCodes.VENDOR_ID, TestPayeeIdTypeLabels.VENDOR_ID));
    keyValues.add(new ConcreteKeyValue(PayeeIdTypeCodes.OTHER, TestPayeeIdTypeLabels.OTHER));
    return keyValues;
}
Also used : ConcreteKeyValue(org.kuali.kfs.core.api.util.ConcreteKeyValue) KeyValue(org.kuali.kfs.core.api.util.KeyValue) ConcreteKeyValue(org.kuali.kfs.core.api.util.ConcreteKeyValue) ArrayList(java.util.ArrayList)

Aggregations

KeyValue (org.kuali.kfs.core.api.util.KeyValue)35 ConcreteKeyValue (org.kuali.kfs.core.api.util.ConcreteKeyValue)34 ArrayList (java.util.ArrayList)33 List (java.util.List)2 CheckReconSource (com.rsmart.kuali.kfs.cr.businessobject.CheckReconSource)1 ReversionCategory (edu.cornell.kfs.coa.businessobject.ReversionCategory)1 PaymentMethod (edu.cornell.kfs.fp.businessobject.PaymentMethod)1 SecurityGroupTab (edu.cornell.kfs.ksr.businessobject.SecurityGroupTab)1 SecurityProvisioning (edu.cornell.kfs.ksr.businessobject.SecurityProvisioning)1 AgencyOrigin (edu.cornell.kfs.module.cg.businessobject.AgencyOrigin)1 InvoiceFrequency (edu.cornell.kfs.module.cg.businessobject.InvoiceFrequency)1 InvoiceType (edu.cornell.kfs.module.cg.businessobject.InvoiceType)1 LevelOrganization (edu.cornell.kfs.module.purap.businessobject.LevelOrganization)1 FavoriteAccount (edu.cornell.kfs.sys.businessobject.FavoriteAccount)1 FavoriteAccountValuesFinder (edu.cornell.kfs.sys.businessobject.options.FavoriteAccountValuesFinder)1 FormTypes1099 (edu.cornell.kfs.tax.FormTypes1099)1 Collection (java.util.Collection)1 Comparator (java.util.Comparator)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1