use of org.kuali.kfs.kns.web.ui.Field in project cu-kfs by CU-CommunityApps.
the class CuVendorMaintainableImpl method getSections.
/**
* Overridden to forcibly populate the multi-select procurementMethodsArray KNS field values,
* and to forcibly hide the procurementMethods field's row.
*
* @see org.kuali.kfs.kns.maintenance.MaintainableImpl#getSections(org.kuali.kfs.kns.document.MaintenanceDocument,
* org.kuali.kfs.kns.maintenance.Maintainable)
*/
@SuppressWarnings("rawtypes")
@Override
public List getSections(MaintenanceDocument document, Maintainable oldMaintainable) {
@SuppressWarnings("unchecked") List<Section> sections = super.getSections(document, oldMaintainable);
MaintenanceDocumentRestrictions restrictions = KNSServiceLocator.getBusinessObjectAuthorizationService().getMaintenanceDocumentRestrictions(document, GlobalVariables.getUserSession().getPerson());
// Perform the forcible updates on the generated sections.
boolean doneWithSections = false;
for (int i = 0; !doneWithSections && i < sections.size(); i++) {
Section section = sections.get(i);
if (VENDOR_SECTION_ID.equals(section.getSectionId())) {
// Find and update the appropriate fields/rows.
List<Row> rows = section.getRows();
int fieldsDone = 0;
for (int j = 0; fieldsDone < 2 && j < rows.size(); j++) {
List<Field> fields = rows.get(j).getFields();
for (int k = 0; fieldsDone < 2 && k < fields.size(); k++) {
String fieldName = fields.get(k).getPropertyName();
if (PROC_METHODS_MULTISELECT_FIELD_NAME.equals(fieldName)) {
// Update the property values and security on the multiselect field.
setupMultiselectField(document, restrictions, fields.get(k), MULTISELECT_FIELD_PATH_PREFIX + fieldName);
fieldsDone++;
} else if (PROC_METHODS_FIELD_NAME.equals(fieldName)) {
// Hide the row containing the flattened version of the multiselect field.
rows.get(j).setHidden(true);
fieldsDone++;
}
}
}
doneWithSections = true;
}
}
return sections;
}
use of org.kuali.kfs.kns.web.ui.Field in project cu-kfs by CU-CommunityApps.
the class FinancialSystemSearchableAttribute method createSearchResultDisplayTypeRow.
protected Row createSearchResultDisplayTypeRow() {
Field searchField = new Field(DISPLAY_TYPE_SEARCH_ATTRIBUTE_NAME, DISPLAY_TYPE_SEARCH_ATTRIBUTE_LABEL);
searchField.setFieldType(Field.RADIO);
searchField.setIndexedForSearch(false);
searchField.setBusinessObjectClassName("");
searchField.setFieldHelpName("");
searchField.setFieldHelpSummary("");
searchField.setColumnVisible(false);
searchField.setFieldValidValues(SEARCH_RESULT_TYPE_OPTION_LIST);
searchField.setPropertyValue(DOCUMENT_DISPLAY_TYPE_VALUE);
searchField.setDefaultValue(DOCUMENT_DISPLAY_TYPE_VALUE);
return new Row(Collections.singletonList(searchField));
}
use of org.kuali.kfs.kns.web.ui.Field 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