Package org.kuali.rice.kns.util
Class FieldUtils
java.lang.Object
org.kuali.rice.kns.util.FieldUtils
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 Summary
Modifier and TypeMethodDescriptionstatic voidapplyAuthorization(Field field, String maintenanceAction, MaintenanceDocumentRestrictions auths, String documentStatus, String documentInitiatorPrincipalId) Deprecated.static ColumnconstructColumnFromAttributeField(RemotableAttributeField attributeField) Deprecated.constructColumnsFromAttributeFields(List<RemotableAttributeField> attributeFields) Deprecated.static FieldconstructContainerField(String name, String label, List fields) Deprecated.Wraps list of fields into a Field of type CONTAINERstatic FieldconstructContainerField(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.static RemotableAttributeFieldDeprecated.convertRemotableAttributeField(RemotableAttributeField remotableAttributeField) Deprecated.convertRemotableAttributeFields(List<RemotableAttributeField> remotableAttributeFields) Deprecated.static List<RemotableAttributeField> convertRowsToAttributeFields(List<Row> rows) Deprecated.static List<RemotableAttributeField> Deprecated.createAndPopulateFieldsForLookup(List<String> lookupFieldAttributeList, List<String> readOnlyFieldsList, Class businessObjectClass) Deprecated.static FieldcreateRangeDateField(Field field) Deprecated.creates an extra field for date from/to rangesstatic FieldfixFieldForForm(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.static StringDeprecated.Finds a container field's sub tab namestatic StringgetContentType(Field field, BusinessObject bo) Deprecated.static StringgetFileName(Field field, BusinessObject bo) Deprecated.static FormattergetFormatterForDataType(DataType dataType) Deprecated.static FieldgetPropertyField(Class businessObjectClass, String attributeName, boolean convertForLookup) Deprecated.Builds up a Field object based on the propertyName and business object class.static booleanDeprecated.Returns whether the passed in collection has been properly configured in the maint doc dictionary to support multiple value lookups.protected static booleanisLookupFieldLevelHelpDisabled(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 andisLookupFieldLevelHelpEnabled(Class, String)returns false, then the field level help will not be rendered.protected static booleanisLookupFieldLevelHelpEnabled(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.static ListmeshFields(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.static ListmeshRows(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.static ListmeshSections(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.static voidmodifyFieldToSupportMultipleValueLookups(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 buttonstatic MappopulateBusinessObjectFromMap(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.static MappopulateBusinessObjectFromMap(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.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.static voidpopulateReadableField(Field field, BusinessObject businessObject) Deprecated.static voidpopulateSecureField(Field field, Object fieldValue) Deprecated.static StringDeprecated.This method removes any duplicating spacing (internal or on the ends) from a String, meant to be exposed as a tag library function.static voidsetAdditionalDisplayPropertyForCodes(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 propertystatic voidsetFieldControl(Class businessObjectClass, String attributeName, boolean convertForLookup, Field field) Deprecated.Sets the control on the field based on the data dictionary definitionstatic voidsetInquiryURL(Field field, BusinessObject bo, String propertyName) Deprecated.static ListwrapFields(List fields) Deprecated.Wraps each Field in the list into a Row.wrapFields(List<Field> fields, int numberOfColumns) Deprecated.This method is to implement multiple columns where the numberOfColumns is obtained from data dictionary.
-
Method Details
-
getContentType
Deprecated. -
getFileName
Deprecated. -
setInquiryURL
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 -
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 attributeattributeName- - name of attribute in the business objectfield- - property display element
-
wrapFields
Deprecated.Wraps each Field in the list into a Row.- Returns:
- List of Row objects
-
wrapFields
Deprecated.This method is to implement multiple columns where the numberOfColumns is obtained from data dictionary. -
constructContainerField
Deprecated.Wraps list of fields into a Field of type CONTAINER- Parameters:
name- name for the fieldlabel- label for the fieldfields- 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 fieldlabel- label for the fieldfields- list of fields that should be contained in the containernumberOfColumns- the number of columns for each row that the fields should be arranged into- Returns:
- Field of type CONTAINER
-
populateFieldsFromBusinessObject
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 populatebo- business object to get field values from- Returns:
- List of fields with values populated from business object.
-
populateReadableField
Deprecated. -
populateSecureField
Deprecated. -
populateBusinessObjectFromMap
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 displayedkeyFieldNames- - 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 byisLookupFieldLevelHelpDisabled(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 classattributeName- 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 andisLookupFieldLevelHelpEnabled(Class, String)returns false, then the field level help will not be rendered. If both this andisLookupFieldLevelHelpEnabled(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 classattributeName- 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. -
createRangeDateField
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
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
Deprecated. -
convertRowToAttributeFields
Deprecated. -
convertFieldToAttributeField
Deprecated. -
constructColumnFromAttributeField
Deprecated. -
constructColumnsFromAttributeFields
public static List<Column> constructColumnsFromAttributeFields(List<RemotableAttributeField> attributeFields) Deprecated. -
getFormatterForDataType
Deprecated. -
generateCollectionSubTabName
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
-