Class AbstractDataHandler<D extends AbstractEditorData,V extends ItemModel>
- java.lang.Object
-
- de.hybris.platform.adaptivesearchbackoffice.editors.configurablemultireference.AbstractDataHandler<D,V>
-
- Type Parameters:
D- - the type of the item dataV- - the type of the item value
- All Implemented Interfaces:
DataHandler<D,V>
- Direct Known Subclasses:
AsBoostRulesDataHandler,AsExcludedFacetsDataHandler,AsExcludedItemsDataHandler,AsExcludedSortsDataHandler,AsFacetsDataHandler,AsPromotedFacetsDataHandler,AsPromotedItemsDataHandler,AsPromotedSortsDataHandler,AsSortsDataHandler
public abstract class AbstractDataHandler<D extends AbstractEditorData,V extends ItemModel> extends java.lang.Object implements DataHandler<D,V>
Base class forDataHandlerimplementations.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringSEARCH_PROFILE_PARAM
-
Constructor Summary
Constructors Constructor Description AbstractDataHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract DcreateEditorData()AsConfigurationServicegetAsConfigurationService()AsUidGeneratorgetAsUidGenerator()java.lang.Class<?>getAttributeType(D editorData, java.lang.String attributeName)Extracts an attribute class from a specific editor data object.java.lang.ObjectgetAttributeValue(D editorData, java.lang.String attributeName)Extracts an attribute value from a specific editor data object.VgetItemValue(D data)Returns the value for a single item.protected DgetOrCreateEditorData(java.util.Map<java.lang.Object,D> mapping, java.lang.String key)java.util.List<V>getValue(org.zkoss.zul.ListModel<D> data)Returns the value.org.zkoss.zul.ListModel<D>loadData(java.util.Collection<V> initialValue, SearchResultData searchResult, java.util.Map<java.lang.String,java.lang.Object> parameters)Initializes the data handler with new data.protected abstract voidloadDataFromInitialValue(java.util.Map<java.lang.Object,D> mapping, java.util.Collection<V> initialValue, java.util.Map<java.lang.String,java.lang.Object> parameters)protected abstract voidloadDataFromSearchResult(java.util.Map<java.lang.Object,D> mapping, SearchResultData searchResult, java.util.Map<java.lang.String,java.lang.Object> parameters)protected voidpostLoadData(java.util.Collection<V> initialValue, SearchResultData searchResult, java.util.Map<java.lang.String,java.lang.Object> parameters, org.zkoss.zul.ListModelList<D> data)voidsetAsConfigurationService(AsConfigurationService asConfigurationService)voidsetAsUidGenerator(AsUidGenerator asUidGenerator)voidsetAttributeValue(D editorData, java.lang.String attributeName, java.lang.Object attributeValue)Sets an attribute value to a specific data object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.adaptivesearchbackoffice.editors.configurablemultireference.DataHandler
getTypeCode
-
-
-
-
Field Detail
-
SEARCH_PROFILE_PARAM
protected static final java.lang.String SEARCH_PROFILE_PARAM
- See Also:
- Constant Field Values
-
-
Method Detail
-
loadData
public org.zkoss.zul.ListModel<D> loadData(java.util.Collection<V> initialValue, SearchResultData searchResult, java.util.Map<java.lang.String,java.lang.Object> parameters)
Description copied from interface:DataHandlerInitializes the data handler with new data.- Specified by:
loadDatain interfaceDataHandler<D extends AbstractEditorData,V extends ItemModel>- Parameters:
initialValue- - the initial valuesearchResult- - the search resultparameters- - the data handler parameters- Returns:
- the data
-
loadDataFromSearchResult
protected abstract void loadDataFromSearchResult(java.util.Map<java.lang.Object,D> mapping, SearchResultData searchResult, java.util.Map<java.lang.String,java.lang.Object> parameters)
-
loadDataFromInitialValue
protected abstract void loadDataFromInitialValue(java.util.Map<java.lang.Object,D> mapping, java.util.Collection<V> initialValue, java.util.Map<java.lang.String,java.lang.Object> parameters)
-
getValue
public java.util.List<V> getValue(org.zkoss.zul.ListModel<D> data)
Description copied from interface:DataHandlerReturns the value.- Specified by:
getValuein interfaceDataHandler<D extends AbstractEditorData,V extends ItemModel>- Parameters:
data- - the data object- Returns:
- the current value
-
getItemValue
public V getItemValue(D data)
Description copied from interface:DataHandlerReturns the value for a single item.- Specified by:
getItemValuein interfaceDataHandler<D extends AbstractEditorData,V extends ItemModel>- Parameters:
data- - the data object- Returns:
- the current value
-
postLoadData
protected void postLoadData(java.util.Collection<V> initialValue, SearchResultData searchResult, java.util.Map<java.lang.String,java.lang.Object> parameters, org.zkoss.zul.ListModelList<D> data)
-
getAttributeValue
public java.lang.Object getAttributeValue(D editorData, java.lang.String attributeName)
Description copied from interface:DataHandlerExtracts an attribute value from a specific editor data object.- Specified by:
getAttributeValuein interfaceDataHandler<D extends AbstractEditorData,V extends ItemModel>- Parameters:
editorData- - the data objectattributeName- - the attribute name- Returns:
- the attribute value
-
getAttributeType
public java.lang.Class<?> getAttributeType(D editorData, java.lang.String attributeName)
Description copied from interface:DataHandlerExtracts an attribute class from a specific editor data object.- Specified by:
getAttributeTypein interfaceDataHandler<D extends AbstractEditorData,V extends ItemModel>- Parameters:
editorData- - the data objectattributeName- - the attribute name- Returns:
- the attribute class
-
setAttributeValue
public void setAttributeValue(D editorData, java.lang.String attributeName, java.lang.Object attributeValue)
Description copied from interface:DataHandlerSets an attribute value to a specific data object.- Specified by:
setAttributeValuein interfaceDataHandler<D extends AbstractEditorData,V extends ItemModel>- Parameters:
editorData- - the data object.attributeName- - the attribute nameattributeValue- - new attribute value
-
getOrCreateEditorData
protected D getOrCreateEditorData(java.util.Map<java.lang.Object,D> mapping, java.lang.String key)
-
createEditorData
protected abstract D createEditorData()
-
getAsConfigurationService
public AsConfigurationService getAsConfigurationService()
-
setAsConfigurationService
public void setAsConfigurationService(AsConfigurationService asConfigurationService)
-
getAsUidGenerator
public AsUidGenerator getAsUidGenerator()
-
setAsUidGenerator
public void setAsUidGenerator(AsUidGenerator asUidGenerator)
-
-