Interface DataUtility
- All Known Subinterfaces:
LogicSeparatedDataUtility
- All Known Implementing Classes:
com.ptc.core.components.factory.dataUtilities.AbstractAttributeDataUtility,AbstractBooleanValueDataUtility,AbstractDataUtility,AbstractMailToDataUtility,AbstractNonSelectableRowDataUtility,AbstractRowStrikeThroughDataUtility,AutomateFastTrackDataUtility,BusinessRuleConflictsDataUtility,ChangeLinkAttributeDataUtility,ChangeTransitionDataUtility,DefaultBooleanValueDataUtility,com.ptc.core.components.factory.dataUtilities.DefaultDataUtility,DesignContextNameDataUtility,DispositionDataUtility,EquivalenceNetworkDataUtility,FloatingBaselineMemberStatusDataUtility,ImpactIntentDataUtility,com.ptc.windchill.lotbaseline.data.util.LotBaselinableMultiObjectDataUtility,MpmlSequenceCategoryDataUtility,com.ptc.core.components.factory.dataUtilities.NameDataUtility,com.ptc.core.components.factory.dataUtilities.NameNumberDataUtility,NewCadDocFileNameDataUtility,NewCadDocNameDataUtility,NewCadDocNumberDataUtility,NmActionDataUtility,com.ptc.core.components.factory.dataUtilities.NumberDataUtility,PartSupplierStatusDataUtility,PersistedCollectionCustomAttributesDelegate,SmartCollectionDataUtility,com.ptc.core.components.factory.dataUtilities.StringDataUtility,TraceCodeDataUtility,VisualizationDataUtility,WorkItemAttributeDataUtility
public interface DataUtility
Don't implement this class directly, instead extend AbstractDataUtility.
Encapsulates the way data values are extracted from model objects and inserted into view objects. Data utilities may
or not be stateful. Stateful data utilities may do batch processing of the model data during a call to
setModelData.
Data utilities are retrieved by the DataUtilityHelper.
Also, controls some display attributes about the data values. Like what label to use to describe the data values.
Please note that this interface and extending classes are not completely solidified yet. Design changes are
expected in the next few releases to more tightly control the types of objects in the api and to simplify certain
aspects of implementations with respect to data and rendering. While this class is marked as supported as it is
intended for customization, the intention is to continue the design forward to make it better.
Supported API: true
Extendable: false
- See Also:
-
For information on how to configure new DataUtlity mappings
-
Method Summary
Modifier and TypeMethodDescriptiongetDataValue(String component_id, Object datum, ModelContext mc) Get a view object that can be used to represent the given component id, using the given model data.getLabel(String component_id, ModelContext mc) Get a default label for the component id.getToolTip(String component_id, ModelContext mc) Specify the tooltip of the column header in case there is some localization issue from constructing the tooltip from the label.voidsetModelData(String component_id, List<?> objects, ModelContext mc) Allows implementations to do batch processing on a list of data objects before getDataValue is called for each object.
-
Method Details
-
setModelData
Allows implementations to do batch processing on a list of data objects before getDataValue is called for each object. If this method is implemented, then you must configure the data utility to be stateful.
Supported API: true
Extendable: true- Parameters:
component_id- The identifier of the component that requested this data utilityobjects- The data objects that will subsequently be processed by calls to getDataValue.- Throws:
WTException- If a problem happens while batch processing the data objects.
-
getDataValue
Get a view object that can be used to represent the given component id, using the given model data.
Supported API: true
Extendable: true- Parameters:
component_id- The id to build a view object fordatum- The object to extract model data frommc- The context in which the component model data is being extracted- Returns:
- An object that can be sent to a view for rendering
- Throws:
WTException- If a problem occurs while extracting the data
-
getLabel
Get a default label for the component id. May return null, in which case the rendering engine may choose to use something else, or the component id itself. The returned label is displayed as the column label if the column descriptor getDisplayHeaderLabel() returns true for displaying a label. Also, the label is the display value used for Export, Column Freeze and to construct the Sort by {0} tooltip.
Supported API: true
Extendable: true- Parameters:
component_id- The component to get a label formc- The model context- Returns:
- A String label, or null
- Throws:
WTException
-
getToolTip
Specify the tooltip of the column header in case there is some localization issue from constructing the tooltip from the label. Currently this getTooltip api does not control the column's tooltip in a JSCA table. The tooltips for those tables are constructed from the column's label. (e.g. "Sort by {0}" where {0} is replaced by the column label) So for the tooltip to show up in JSCA tables, make sure to override getLabel() and return an appropriate label. If the column's label should not be displayed, override displayLabel() and return false.
Supported API: true
Extendable: true- Parameters:
component_id- The id of the componentmc- The model context to get the component descriptor from if needed.- Returns:
- a String tooltip
- Throws:
WTException
-