Search in sources :

Example 1 with KimAttributeData

use of org.kuali.kfs.kim.impl.common.attribute.KimAttributeData in project cu-kfs by CU-CommunityApps.

the class PersonInquirableImpl method buildRowsWithQualifierFields.

private List<Row> buildRowsWithQualifierFields(String sectionId, PersonImpl person, int memberIndex) {
    List<KimTypeAttribute> attributeDefinitions;
    List<KimAttributeData> attributeDetails;
    if (StringUtils.equals(sectionId, "rolesSection")) {
        attributeDefinitions = person.getRoleMembers().get(memberIndex).getRole().getKimType().getAttributeDefinitions();
        attributeDetails = new ArrayList<>(person.getRoleMembers().get(memberIndex).getAttributeDetails());
    } else {
        attributeDefinitions = person.getDelegateMembers().get(memberIndex).getRoleMember().getRole().getKimType().getAttributeDefinitions();
        attributeDetails = new ArrayList<>(person.getDelegateMembers().get(memberIndex).getAttributeDetails());
    }
    Map<String, Field> fieldsToAdd = new LinkedHashMap<>(buildQualifierAttributeFieldMap(attributeDefinitions));
    setFieldValuesForMember(attributeDetails, fieldsToAdd);
    List<Row> qualifierRows = fieldsToAdd.values().stream().map(Row::new).collect(Collectors.toList());
    if (!fieldsToAdd.isEmpty()) {
        qualifierRows.add(0, new Row(buildSeparatorField(SUB_SECTION_LABELS.get(sectionId))));
    }
    return qualifierRows;
}
Also used : Field(org.kuali.kfs.kns.web.ui.Field) KimTypeAttribute(org.kuali.kfs.kim.impl.type.KimTypeAttribute) KimAttributeData(org.kuali.kfs.kim.impl.common.attribute.KimAttributeData) Row(org.kuali.kfs.kns.web.ui.Row) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

LinkedHashMap (java.util.LinkedHashMap)1 KimAttributeData (org.kuali.kfs.kim.impl.common.attribute.KimAttributeData)1 KimTypeAttribute (org.kuali.kfs.kim.impl.type.KimTypeAttribute)1 Field (org.kuali.kfs.kns.web.ui.Field)1 Row (org.kuali.kfs.kns.web.ui.Row)1