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;
}
Aggregations