org.kuali.rice.krad.uif.service
Interface UifDefaultingService

All Known Implementing Classes:
UifDefaultingServiceImpl

public interface UifDefaultingService

This service helps build/define default controls for the UIF based on the associated data-level metadata. It will use the information provided by the krad-data module to attempt to build sensible default controls based on the data type, maximum length, and other attributes available in the ORM-level metadata or provided as annotations on the data object classes.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Method Summary
 Control deriveControlAttributeFromMetadata(AttributeDefinition attrDef)
          Derives a UIF control from the information available on the passed in Data Dictionary AttributeDefinition.
 String deriveHumanFriendlyNameFromPropertyName(String camelCasedName)
          Helper method to allow reasonable names to be defaulted from class or property names.
 InquiryView deriveInquiryViewFromMetadata(DataObjectEntry dataObjectEntry)
          Build an instance of an InquiryView for the given data object entry.
 LookupView deriveLookupViewFromMetadata(DataObjectEntry dataObjectEntry)
          Build an instance of an LookupView for the given data object entry.
 ValidCharactersConstraint deriveValidCharactersConstraint(AttributeDefinition attrDef)
          Derives a default valid characters constraint definition given the metadata in the AttributeDefinition
 

Method Detail

deriveControlAttributeFromMetadata

Control deriveControlAttributeFromMetadata(AttributeDefinition attrDef)
Derives a UIF control from the information available on the passed in Data Dictionary AttributeDefinition. Attempts to build reasonable defaults based on the data type and other metadata which has been included. If no special information is found in the metadata, it will return a standard/default text control.

Parameters:
attrDef - attribute definition
Returns:
derived control

deriveHumanFriendlyNameFromPropertyName

String deriveHumanFriendlyNameFromPropertyName(String camelCasedName)
Helper method to allow reasonable names to be defaulted from class or property names. This method assumes that the passed in name is camel-cased and will create the name by adding spaces before each capital letter or digit as well as capitalizing each word. In the case that the name given is a nested property, only the portion of the name after the last period will be used.

Parameters:
camelCasedName - property name, in camel case
Returns:
human friendly property name

deriveValidCharactersConstraint

ValidCharactersConstraint deriveValidCharactersConstraint(AttributeDefinition attrDef)
Derives a default valid characters constraint definition given the metadata in the AttributeDefinition

Parameters:
attrDef - attribute definition
Returns:
A ValidCharactersConstraint object or null if no information in the AttributeDefinition suggests an appropriate default.

deriveInquiryViewFromMetadata

InquiryView deriveInquiryViewFromMetadata(DataObjectEntry dataObjectEntry)
Build an instance of an InquiryView for the given data object entry. Information will be pulled from the DataObjectEntry and the embedded DataObjectMetadata and DataObjectAttribute instances as needed. In the present implementation, all non-hidden properties on the DataObjectEntry will be added to the inquiry. Additionally, any collections on the object will be displayed in their own sections.

Parameters:
dataObjectEntry - data object entry
Returns:
inquiry view based on the data object

deriveLookupViewFromMetadata

LookupView deriveLookupViewFromMetadata(DataObjectEntry dataObjectEntry)
Build an instance of an LookupView for the given data object entry. Information will be pulled from the DataObjectEntry and the embedded DataObjectMetadata and DataObjectAttribute instances as needed. In the present implementation, all non-hidden properties on the DataObjectEntry will be added to the lookup search criteria and results.

Parameters:
dataObjectEntry - data object entry
Returns:
lookup view based on the data object


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.