Search in sources :

Example 1 with KfsKimDocumentAttributeData

use of org.kuali.kfs.coa.identity.KfsKimDocumentAttributeData in project cu-kfs by CU-CommunityApps.

the class OrgReviewRoleServiceImpl method getAttributes.

protected Map<String, String> getAttributes(OrgReviewRole orr, String kimTypeId) {
    if (StringUtils.isBlank(kimTypeId)) {
        return Collections.emptyMap();
    }
    List<KfsKimDocumentAttributeData> attributeDataList = new ArrayList<>();
    KfsKimDocumentAttributeData attributeData = getAttribute(kimTypeId, KfsKimAttributes.CHART_OF_ACCOUNTS_CODE, orr.getChartOfAccountsCode());
    if (attributeData != null) {
        attributeDataList.add(attributeData);
    }
    attributeData = getAttribute(kimTypeId, KfsKimAttributes.ORGANIZATION_CODE, orr.getOrganizationCode());
    if (attributeData != null) {
        attributeDataList.add(attributeData);
    }
    attributeData = getAttribute(kimTypeId, KimConstants.AttributeConstants.DOCUMENT_TYPE_NAME, orr.getFinancialSystemDocumentTypeCode());
    if (attributeData != null) {
        attributeDataList.add(attributeData);
    }
    attributeData = getAttribute(kimTypeId, KfsKimAttributes.ACCOUNTING_LINE_OVERRIDE_CODE, orr.getOverrideCode());
    if (attributeData != null) {
        attributeDataList.add(attributeData);
    }
    attributeData = getAttribute(kimTypeId, KfsKimAttributes.FROM_AMOUNT, orr.getFromAmountStr());
    if (attributeData != null) {
        attributeDataList.add(attributeData);
    }
    attributeData = getAttribute(kimTypeId, KfsKimAttributes.TO_AMOUNT, orr.getToAmountStr());
    if (attributeData != null) {
        attributeDataList.add(attributeData);
    }
    return orr.getQualifierAsAttributeSet(attributeDataList);
}
Also used : KfsKimDocumentAttributeData(org.kuali.kfs.coa.identity.KfsKimDocumentAttributeData) ArrayList(java.util.ArrayList)

Example 2 with KfsKimDocumentAttributeData

use of org.kuali.kfs.coa.identity.KfsKimDocumentAttributeData in project cu-kfs by CU-CommunityApps.

the class OrgReviewRoleServiceImpl method getAttribute.

protected KfsKimDocumentAttributeData getAttribute(String kimTypeId, String attributeName, String attributeValue) {
    if (StringUtils.isNotBlank(attributeValue)) {
        KimAttribute attribute = getAttributeDefinition(kimTypeId, attributeName);
        if (attribute != null) {
            KfsKimDocumentAttributeData attributeData = new KfsKimDocumentAttributeData();
            attributeData.setKimTypId(kimTypeId);
            attributeData.setAttrVal(attributeValue);
            attributeData.setKimAttrDefnId(attribute.getId());
            attributeData.setKimAttribute(attribute);
            return attributeData;
        }
    }
    return null;
}
Also used : KfsKimDocumentAttributeData(org.kuali.kfs.coa.identity.KfsKimDocumentAttributeData) KimAttribute(org.kuali.kfs.kim.impl.common.attribute.KimAttribute)

Aggregations

KfsKimDocumentAttributeData (org.kuali.kfs.coa.identity.KfsKimDocumentAttributeData)2 ArrayList (java.util.ArrayList)1 KimAttribute (org.kuali.kfs.kim.impl.common.attribute.KimAttribute)1