Class FieldUtils

java.lang.Object
org.kuali.rice.kns.util.FieldUtils

@Deprecated public final class FieldUtils extends Object
Deprecated.
Only used in KNS classes, use KRAD.
This class is used to build Field objects from underlying data dictionary and general utility methods for handling fields.
  • Method Details

    • getContentType

      public static String getContentType(Field field, BusinessObject bo)
      Deprecated.
    • getFileName

      public static String getFileName(Field field, BusinessObject bo)
      Deprecated.
    • setInquiryURL

      public static void setInquiryURL(Field field, BusinessObject bo, String propertyName)
      Deprecated.
    • setFieldControl

      public static void setFieldControl(Class businessObjectClass, String attributeName, boolean convertForLookup, Field field)
      Deprecated.
      Sets the control on the field based on the data dictionary definition
      Parameters:
      businessObjectClass - - business object class for the field attribute
      attributeName - - name of the attribute whose Field is being set
      convertForLookup - - whether the field is being build for lookup search which impacts the control chosen
      field - - Field to set control on
    • getPropertyField

      public static Field getPropertyField(Class businessObjectClass, String attributeName, boolean convertForLookup)
      Deprecated.
      Builds up a Field object based on the propertyName and business object class. See KULRICE-2480 for info on convertForLookup flag
    • setAdditionalDisplayPropertyForCodes

      public static void setAdditionalDisplayPropertyForCodes(Class businessObjectClass, String attributeName, PropertyRenderingConfigElement field)
      Deprecated.
      For attributes that are codes (determined by whether they have a reference to a KualiCode bo and similar naming) sets the name as an additional display property
      Parameters:
      businessObjectClass - - class containing attribute
      attributeName - - name of attribute in the business object
      field - - property display element
    • wrapFields

      public static List wrapFields(List fields)
      Deprecated.
      Wraps each Field in the list into a Row.
      Returns:
      List of Row objects
    • wrapFields

      public static List<Row> wrapFields(List<Field> fields, int numberOfColumns)
      Deprecated.
      This method is to implement multiple columns where the numberOfColumns is obtained from data dictionary.
    • constructContainerField

      public static Field constructContainerField(String name, String label, List fields)
      Deprecated.
      Wraps list of fields into a Field of type CONTAINER
      Parameters:
      name - name for the field
      label - label for the field
      fields - list of fields that should be contained in the container
      Returns:
      Field of type CONTAINER
    • constructContainerField

      public static Field constructContainerField(String name, String label, List fields, int numberOfColumns)
      Deprecated.
      Wraps list of fields into a Field of type CONTAINER and arrange them into multiple columns.
      Parameters:
      name - name for the field
      label - label for the field
      fields - list of fields that should be contained in the container
      numberOfColumns - the number of columns for each row that the fields should be arranged into
      Returns:
      Field of type CONTAINER
    • populateFieldsFromBusinessObject

      public static List<Field> populateFieldsFromBusinessObject(List<Field> fields, BusinessObject bo)
      Deprecated.
      Uses reflection to get the property names of the business object, then checks for a matching field property name. If found, takes the value of the business object property and populates the field value. Iterates through for all fields in the list.
      Parameters:
      fields - list of Field object to populate
      bo - business object to get field values from
      Returns:
      List of fields with values populated from business object.
    • populateReadableField

      public static void populateReadableField(Field field, BusinessObject businessObject)
      Deprecated.
    • populateSecureField

      public static void populateSecureField(Field field, Object fieldValue)
      Deprecated.
    • populateBusinessObjectFromMap

      public static Map populateBusinessObjectFromMap(BusinessObject bo, Map fieldValues)
      Deprecated.
      Uses reflection to get the property names of the business object, then checks for the property name as a key in the passed map. If found, takes the value from the map and sets the business object property.
      Returns:
      Cached Values from any formatting failures
    • populateBusinessObjectFromMap

      public static Map populateBusinessObjectFromMap(BusinessObject bo, Map<String,?> fieldValues, String propertyNamePrefix)
      Deprecated.
      Uses reflection to get the property names of the business object, then checks for the property name as a key in the passed map. If found, takes the value from the map and sets the business object property.
      Parameters:
      propertyNamePrefix - this value will be prepended to all property names in the returned unformattable values map
      Returns:
      Cached Values from any formatting failures
    • fixFieldForForm

      public static Field fixFieldForForm(Field field, List keyFieldNames, String namePrefix, String maintenanceAction, boolean readOnly, MaintenanceDocumentRestrictions auths, String documentStatus, String documentInitiatorPrincipalId)
      Deprecated.
      Does prefixing and read only settings of a Field UI for display in a maintenance document.
      Parameters:
      field - - the Field object to be displayed
      keyFieldNames - - Primary key property names for the business object being maintained.
      namePrefix - - String to prefix Field names with.
      maintenanceAction - - The maintenance action requested.
      readOnly - - Indicates whether all fields should be read only.
      Returns:
      Field
    • applyAuthorization

      public static void applyAuthorization(Field field, String maintenanceAction, MaintenanceDocumentRestrictions auths, String documentStatus, String documentInitiatorPrincipalId)
      Deprecated.
    • meshSections

      public static List meshSections(List oldSections, List newSections, List keyFieldNames, String maintenanceAction, boolean readOnly, MaintenanceDocumentRestrictions auths, String documentStatus, String documentInitiatorPrincipalId)
      Deprecated.
      Merges together sections of the old maintainable and new maintainable.
      Returns:
      List of Section objects
    • meshRows

      public static List meshRows(List oldRows, List newRows, List keyFieldNames, String maintenanceAction, boolean readOnly, MaintenanceDocumentRestrictions auths, String documentStatus, String documentInitiatorPrincipalId)
      Deprecated.
      Merges together rows of an old maintainable section and new maintainable section.
      Returns:
      List of Row objects
    • meshFields

      public static List meshFields(List oldFields, List newFields, List keyFieldNames, String maintenanceAction, boolean readOnly, MaintenanceDocumentRestrictions auths, String documentStatus, String documentInitiatorPrincipalId)
      Deprecated.
      Merges together fields and an old maintainble row and new maintainable row, for each field call fixFieldForForm.
      Returns:
      List of Field objects
    • isLookupFieldLevelHelpEnabled

      protected static boolean isLookupFieldLevelHelpEnabled(Class businessObjectClass, String attributeName)
      Deprecated.
      Determines whether field level help is enabled for the field corresponding to the dataObjectClass and attribute name If this value is true, then the field level help will be enabled. If false, then whether a field is enabled is determined by the value returned by isLookupFieldLevelHelpDisabled(Class, String) and the system-wide parameter setting. Note that if a field is read-only, that may cause field-level help to not be rendered.
      Parameters:
      businessObjectClass - the looked up class
      attributeName - the attribute for the field
      Returns:
      true if field level help is enabled, false if the value of this method should NOT be used to determine whether this method's return value affects the enablement of field level help
    • isLookupFieldLevelHelpDisabled

      protected static boolean isLookupFieldLevelHelpDisabled(Class businessObjectClass, String attributeName)
      Deprecated.
      Determines whether field level help is disabled for the field corresponding to the dataObjectClass and attribute name If this value is true and isLookupFieldLevelHelpEnabled(Class, String) returns false, then the field level help will not be rendered. If both this and isLookupFieldLevelHelpEnabled(Class, String) return false, then the system-wide setting will determine whether field level help is enabled. Note that if a field is read-only, that may cause field-level help to not be rendered.
      Parameters:
      businessObjectClass - the looked up class
      attributeName - the attribute for the field
      Returns:
      true if field level help is disabled, false if the value of this method should NOT be used to determine whether this method's return value affects the enablement of field level help
    • createAndPopulateFieldsForLookup

      public static List<Field> createAndPopulateFieldsForLookup(List<String> lookupFieldAttributeList, List<String> readOnlyFieldsList, Class businessObjectClass) throws InstantiationException, IllegalAccessException
      Deprecated.
      Throws:
      InstantiationException
      IllegalAccessException
    • createRangeDateField

      public static Field createRangeDateField(Field field)
      Deprecated.
      creates an extra field for date from/to ranges
      Returns:
      a new date field
    • modifyFieldToSupportMultipleValueLookups

      public static void modifyFieldToSupportMultipleValueLookups(Field field, String parents, MaintainableCollectionDefinition definition)
      Deprecated.
      This method modifies the passed in field so that it may be used to render a multiple values lookup button
      Parameters:
      field - this object will be modified by this method
    • isCollectionMultipleLookupEnabled

      public static boolean isCollectionMultipleLookupEnabled(MaintainableCollectionDefinition definition)
      Deprecated.
      Returns whether the passed in collection has been properly configured in the maint doc dictionary to support multiple value lookups.
    • scrubWhitespace

      public static String scrubWhitespace(String s)
      Deprecated.
      This method removes any duplicating spacing (internal or on the ends) from a String, meant to be exposed as a tag library function.
      Parameters:
      s - String to remove duplicate spacing from.
      Returns:
      String without duplicate spacing.
    • convertRemotableAttributeFields

      public static List<Row> convertRemotableAttributeFields(List<RemotableAttributeField> remotableAttributeFields)
      Deprecated.
    • convertRemotableAttributeField

      public static List<Field> convertRemotableAttributeField(RemotableAttributeField remotableAttributeField)
      Deprecated.
    • convertRowsToAttributeFields

      public static List<RemotableAttributeField> convertRowsToAttributeFields(List<Row> rows)
      Deprecated.
    • convertRowToAttributeFields

      public static List<RemotableAttributeField> convertRowToAttributeFields(Row row)
      Deprecated.
    • convertFieldToAttributeField

      public static RemotableAttributeField convertFieldToAttributeField(Field field)
      Deprecated.
    • constructColumnFromAttributeField

      public static Column constructColumnFromAttributeField(RemotableAttributeField attributeField)
      Deprecated.
    • constructColumnsFromAttributeFields

      public static List<Column> constructColumnsFromAttributeFields(List<RemotableAttributeField> attributeFields)
      Deprecated.
    • getFormatterForDataType

      public static Formatter getFormatterForDataType(DataType dataType)
      Deprecated.
    • generateCollectionSubTabName

      public static String generateCollectionSubTabName(Field field)
      Deprecated.
      Finds a container field's sub tab name
      Parameters:
      field - the field for which to derive the collection sub tab name
      Returns:
      the sub tab name