org.kuali.rice.krad.uif.service.impl
Class UifDefaultingServiceImpl
java.lang.Object
org.kuali.rice.krad.uif.service.impl.UifDefaultingServiceImpl
- All Implemented Interfaces:
- UifDefaultingService
public class UifDefaultingServiceImpl
- extends Object
- implements UifDefaultingService
Method Summary |
protected void |
addAttributeSectionsToInquiryView(InquiryView view,
DataObjectEntry dataObjectEntry)
|
protected void |
addAttributesToLookupCriteria(LookupView view,
DataObjectEntry dataObjectEntry)
|
protected void |
addAttributesToLookupResults(LookupView view,
DataObjectEntry dataObjectEntry)
|
protected void |
addCollectionSectionsToInquiryView(InquiryView view,
DataObjectEntry dataObjectEntry)
|
protected CollectionGroup |
createCollectionInquirySection(String groupId,
String headerText)
|
protected Group |
createInquirySection(String groupId,
String headerText)
|
protected void |
customizeControlInstance(Control c,
AttributeDefinition attrDef,
DataObjectAttribute dataObjectAttribute)
|
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 |
protected Control |
getControlInstance(AttributeDefinition attrDef,
DataObjectAttribute dataObjectAttribute)
|
protected UifDisplayHint |
getHintOfType(DataObjectAttribute attr,
UifDisplayHintType hintType)
|
protected boolean |
hasHintOfType(DataObjectAttribute attr,
UifDisplayHintType hintType)
Check the UifDisplayHint s on an attribute, return true if any of them have the
given type. |
void |
setDataDictionaryService(DataDictionaryService dataDictionaryService)
|
void |
setDataObjectService(DataObjectService dataObjectService)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dataDictionaryService
protected DataDictionaryService dataDictionaryService
dataObjectService
protected DataObjectService dataObjectService
ANY_CHARACTER_PATTERN_CONSTRAINT
protected static final String ANY_CHARACTER_PATTERN_CONSTRAINT
- See Also:
- Constant Field Values
DATE_PATTERN_CONSTRAINT
protected static final String DATE_PATTERN_CONSTRAINT
- See Also:
- Constant Field Values
FLOATING_POINT_PATTERN_CONSTRAINT
protected static final String FLOATING_POINT_PATTERN_CONSTRAINT
- See Also:
- Constant Field Values
BIG_DECIMAL_PATTERN_CONSTRAINT
protected static final String BIG_DECIMAL_PATTERN_CONSTRAINT
- See Also:
- Constant Field Values
TIMESTAMP_PATTERN_CONSTRAINT
protected static final String TIMESTAMP_PATTERN_CONSTRAINT
- See Also:
- Constant Field Values
CURRENCY_PATTERN_CONSTRAINT
protected static final String CURRENCY_PATTERN_CONSTRAINT
- See Also:
- Constant Field Values
UifDefaultingServiceImpl
public UifDefaultingServiceImpl()
deriveHumanFriendlyNameFromPropertyName
public String deriveHumanFriendlyNameFromPropertyName(String camelCasedName)
- Description copied from interface:
UifDefaultingService
- 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.
- Specified by:
deriveHumanFriendlyNameFromPropertyName
in interface UifDefaultingService
- Parameters:
camelCasedName
- property name, in camel case
- Returns:
- human friendly property name
getHintOfType
protected UifDisplayHint getHintOfType(DataObjectAttribute attr,
UifDisplayHintType hintType)
hasHintOfType
protected boolean hasHintOfType(DataObjectAttribute attr,
UifDisplayHintType hintType)
- Check the
UifDisplayHint
s on an attribute, return true if any of them have the
given type.
- Parameters:
attr
- data object attributehintType
- hint type
- Returns:
- true if the hint type is present on the attribute
getControlInstance
protected Control getControlInstance(AttributeDefinition attrDef,
DataObjectAttribute dataObjectAttribute)
customizeControlInstance
protected void customizeControlInstance(Control c,
AttributeDefinition attrDef,
DataObjectAttribute dataObjectAttribute)
deriveControlAttributeFromMetadata
public Control deriveControlAttributeFromMetadata(AttributeDefinition attrDef)
- Description copied from interface:
UifDefaultingService
- 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.
- Specified by:
deriveControlAttributeFromMetadata
in interface UifDefaultingService
- Parameters:
attrDef
- attribute definition
- Returns:
- derived control
deriveValidCharactersConstraint
public ValidCharactersConstraint deriveValidCharactersConstraint(AttributeDefinition attrDef)
- Description copied from interface:
UifDefaultingService
- Derives a default valid characters constraint definition given the metadata in the
AttributeDefinition
- Specified by:
deriveValidCharactersConstraint
in interface UifDefaultingService
- Parameters:
attrDef
- attribute definition
- Returns:
- A
ValidCharactersConstraint
object or null if no information in the AttributeDefinition
suggests an appropriate default.
createInquirySection
protected Group createInquirySection(String groupId,
String headerText)
createCollectionInquirySection
protected CollectionGroup createCollectionInquirySection(String groupId,
String headerText)
addAttributeSectionsToInquiryView
protected void addAttributeSectionsToInquiryView(InquiryView view,
DataObjectEntry dataObjectEntry)
addCollectionSectionsToInquiryView
protected void addCollectionSectionsToInquiryView(InquiryView view,
DataObjectEntry dataObjectEntry)
deriveInquiryViewFromMetadata
public InquiryView deriveInquiryViewFromMetadata(DataObjectEntry dataObjectEntry)
- Description copied from interface:
UifDefaultingService
- 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.
- Specified by:
deriveInquiryViewFromMetadata
in interface UifDefaultingService
- Parameters:
dataObjectEntry
- data object entry
- Returns:
- inquiry view based on the data object
- See Also:
UifDefaultingService.deriveInquiryViewFromMetadata(org.kuali.rice.krad.datadictionary.DataObjectEntry)
addAttributesToLookupCriteria
protected void addAttributesToLookupCriteria(LookupView view,
DataObjectEntry dataObjectEntry)
addAttributesToLookupResults
protected void addAttributesToLookupResults(LookupView view,
DataObjectEntry dataObjectEntry)
deriveLookupViewFromMetadata
public LookupView deriveLookupViewFromMetadata(DataObjectEntry dataObjectEntry)
- Description copied from interface:
UifDefaultingService
- 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.
- Specified by:
deriveLookupViewFromMetadata
in interface UifDefaultingService
- Parameters:
dataObjectEntry
- data object entry
- Returns:
- lookup view based on the data object
- See Also:
UifDefaultingService.deriveLookupViewFromMetadata(org.kuali.rice.krad.datadictionary.DataObjectEntry)
setDataDictionaryService
public void setDataDictionaryService(DataDictionaryService dataDictionaryService)
setDataObjectService
public void setDataObjectService(DataObjectService dataObjectService)
Copyright © 2005–2014 The Kuali Foundation. All rights reserved.