use of org.kuali.kfs.kns.web.ui.Field in project cu-kfs by CU-CommunityApps.
the class PersonInquirableImpl method buildQualifierAttributeFieldMap.
private Map<String, Field> buildQualifierAttributeFieldMap(List<KimTypeAttribute> attributeDefinitions) {
Map<String, Field> fieldsToAdd = new LinkedHashMap<>();
attributeDefinitions.sort(Comparator.comparing(KimTypeAttribute::getSortCode));
attributeDefinitions.stream().map(KimTypeAttribute::getKimAttribute).forEach(kimAttribute -> {
String componentName = kimAttribute.getComponentName();
String attributeName = kimAttribute.getAttributeName();
DataDictionaryService dataDictionaryService = getDataDictionaryService();
Field newField = new Field();
newField.setFieldLabel(dataDictionaryService.getAttributeLabel(componentName, attributeName));
newField.setFieldShortLabel(dataDictionaryService.getAttributeShortLabel(componentName, attributeName));
newField.setPropertyName(attributeName);
newField.setFieldType(Field.TEXT);
fieldsToAdd.put(attributeName, newField);
});
return fieldsToAdd;
}
use of org.kuali.kfs.kns.web.ui.Field in project cu-kfs by CU-CommunityApps.
the class AccountReversionMaintainableImpl method shouldIncludeField.
/**
* Determines if the given field should be included in the updated row, once we take out inactive categories
* @param field the field to check
* @return true if the field should be included (ie, it doesn't describe an organization reversion with an inactive category); false otherwise
*/
protected boolean shouldIncludeField(Field field) {
boolean includeField = true;
if (field.getContainerRows() != null) {
for (Row containerRow : field.getContainerRows()) {
for (Field containedField : containerRow.getFields()) {
if (containedField.getPropertyName().matches("accountReversionDetails\\[\\d+\\]\\.reversionCategory\\.reversionCategoryName")) {
final String categoryValue = containedField.getPropertyValue();
includeField = accountReversionService.isCategoryActiveByName(categoryValue);
}
}
}
}
return includeField;
}
use of org.kuali.kfs.kns.web.ui.Field in project cu-kfs by CU-CommunityApps.
the class AccountReversionMaintainableImpl method getSections.
/**
* @see org.kuali.kfs.kns.maintenance.MaintainableImpl#getSections(org.kuali.kfs.kns.document.MaintenanceDocument, org.kuali.kfs.kns.maintenance.Maintainable)
*/
@Override
public List getSections(MaintenanceDocument document, Maintainable oldMaintainable) {
List<Section> sections = super.getSections(document, oldMaintainable);
if (accountReversionService == null) {
accountReversionService = SpringContext.getBean(AccountReversionService.class);
}
for (Section section : sections) {
for (Row row : section.getRows()) {
List<Field> updatedFields = new ArrayList<Field>();
for (Field field : row.getFields()) {
if (shouldIncludeField(field)) {
updatedFields.add(field);
}
}
row.setFields(updatedFields);
}
}
return sections;
}
use of org.kuali.kfs.kns.web.ui.Field in project cu-kfs by CU-CommunityApps.
the class CuPaymentDetailInquirableTest method buildField.
private Field buildField(String propertyName, String propertyValue) {
Field field = new Field();
field.setPropertyName(propertyName);
field.setPropertyValue(propertyValue);
return field;
}
use of org.kuali.kfs.kns.web.ui.Field in project cu-kfs by CU-CommunityApps.
the class AccountReversionInquirable method shouldIncludeField.
/**
* Determines if the given field should be included in the updated row, once we take out inactive categories
* @param field the field to check
* @return true if the field should be included (ie, it doesn't describe an account reversion with an inactive category); false otherwise
*/
protected boolean shouldIncludeField(Field field) {
boolean includeField = true;
if (field.getContainerRows() != null) {
for (Row containerRow : field.getContainerRows()) {
for (Field containedField : containerRow.getFields()) {
if (containedField.getPropertyName().matches("accountReversionDetails\\[\\d+\\]\\.accountReversionCategoryCode")) {
final String categoryValue = containedField.getPropertyValue();
includeField = accountReversionService.isCategoryActive(categoryValue);
}
}
}
}
return includeField;
}
Aggregations