Package org.ametys.cms.data.holder.impl
Class IndexableDataHolderExportHelper
java.lang.Object
org.ametys.plugins.repository.data.holder.impl.DataHolderExportHelper
org.ametys.cms.data.holder.impl.IndexableDataHolderExportHelper
- All Implemented Interfaces:
Component,Serviceable
Helper for implementations of indexable data holder
-
Field Summary
Fields inherited from class org.ametys.plugins.repository.data.holder.impl.DataHolderExportHelper
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondataToJSON(ModelAwareDataHolder dataHolder, ModelViewItem modelViewItem, DataContext context, boolean isEdition) Convert the data of the given model view item of the givenDataHolderprotected voiddataToSAX(ModelAwareDataHolder dataHolder, ContentHandler contentHandler, ModelViewItem modelViewItem, DataContext context, boolean isEdition) Generates SAX events for the data of the given model view item in the givenDataHolderelementDataToMap(ModelAwareDataHolder dataHolder, ViewElement element, DataContext context) Returns typed-value of the data for the given view element from the given DataHolderMethods inherited from class org.ametys.plugins.repository.data.holder.impl.DataHolderExportHelper
dataToJSON, dataToJSON, dataToMap, dataToSAX, dataToSAX, externalizableValuesAsJson, service
-
Constructor Details
-
IndexableDataHolderExportHelper
public IndexableDataHolderExportHelper()
-
-
Method Details
-
dataToSAX
protected void dataToSAX(ModelAwareDataHolder dataHolder, ContentHandler contentHandler, ModelViewItem modelViewItem, DataContext context, boolean isEdition) throws SAXException, BadItemTypeException Description copied from class:DataHolderExportHelperGenerates SAX events for the data of the given model view item in the givenDataHolder- Overrides:
dataToSAXin classDataHolderExportHelper- Parameters:
dataHolder- theModelAwareDataHolderto SAXcontentHandler- theContentHandlerthat will receive the SAX eventsmodelViewItem- theModelViewItemfor which to generate SAX eventscontext- The context of the data to SAXisEdition-trueif SAX events are generated in edition mode,falseotherwise- Throws:
SAXException- if an error occurs during the SAX events generationBadItemTypeException- if the saxed value's type does not matches the stored data
-
dataToJSON
protected Map<String,Object> dataToJSON(ModelAwareDataHolder dataHolder, ModelViewItem modelViewItem, DataContext context, boolean isEdition) throws BadItemTypeException Description copied from class:DataHolderExportHelperConvert the data of the given model view item of the givenDataHolder- Overrides:
dataToJSONin classDataHolderExportHelper- Parameters:
dataHolder- theModelAwareDataHoldercontaining the data to convertmodelViewItem- theModelItemto convertcontext- The context of the data to convertisEdition-trueto convert in edition mode,falseotherwise- Returns:
- The data of the given view as JSON
- Throws:
BadItemTypeException- if the value's type does not matches the stored data
-
elementDataToMap
protected Map<String,Object> elementDataToMap(ModelAwareDataHolder dataHolder, ViewElement element, DataContext context) Description copied from class:DataHolderExportHelperReturns typed-value of the data for the given view element from the given DataHolder- Overrides:
elementDataToMapin classDataHolderExportHelper- Parameters:
dataHolder- the DataHolder to exportelement- the view element to exportcontext- The context of the data- Returns:
- a Map containing all data.
-