com.fatwire.cs.ui.model.bo.asset
Interface PreSaveProcess
public interface PreSaveProcess
Process to convert the Attributerender data to AttributeData.
The use of the interface is to convert the data displayed
in the JSF components to AttributeData.
In Dash AttributRenders uses the AttributeData for binding to the JSF components.
For most of the JSF components the attributeData's Data can be bound directly.But not all JSF components
can be bound to the attribute's data.For those attributes the Attributedata should be converted to JSP bindable data,
and is stored in a AuxiliaryDataMap.When the form is submitted the data in the AuxiliaryMap is changed.Before we save
the asset the data in Auxiliary map should be converted to AttributeData.The process of converting the data can be
implemented using PreSaveProcess.AttributeRenderes should implement this interface.
Eg:
How an attributerender for the Date datatype is Implemented in Dash and presaveprocess is used
1) Identify a JSF component for implementing this renderer.
CoreSelectInputDate can be used for selecting date.But there in no out of box JSP component
which would satisfy the requirements of displaying time.So it's decided to use the
CoreSelectOneChoice for time(for choosing hour,minute,seconds and periods(am,pm).
2) Are PreSaveProcess and AuxiliaryMap needed?
There are 5 JSF components to display one AttributeData.
The AttributeData cannot be used directly.So split the data and store in AuxiliaryMap,so that
the AuxiliaryMap contain date,hour,minute,seconds and period.
3) How are PreSaveProcess and AuxiliaryMap implemented?
If the AttributeData is having one Data which is "2004-10-12 12:30:59 AM".It should be converted to
AuxiliaryMap and it will look like this {{Date,2004-10-12},{Hour,12},{Min,30},{Sec,59},{Am_Pm,AM}}.
When the form is submitted(on assetsave) AuxiliaryMap will be updated automatically by the JSF components.
But the attributedata is not having the new value yet. Before asset is saved the presaveprocess for each attribute,
if present, is invoked which will reassemble the values in Map to the AttributeData's Data.
process
void process()
throws UIException
- Throws:
UIException
Copyright (c) 2003 - 2011 FatWire Corporation All Rights Reserved.