Class TableSource
- java.lang.Object
-
- java.util.Observable
-
- lumis.doui.source.Source<F>
-
- lumis.doui.source.TabularSource<ITableSourceField>
-
- lumis.doui.table.TableSource
-
- All Implemented Interfaces:
java.util.Comparator<ISourceData>
- Direct Known Subclasses:
AutomationFlowSource
,ContentTableSource
,CorsRulesSource
,EventFieldGroupSource
,EventFieldSource
,EventSource
,JourneySource
,JourneyStageSource
,MonitorRequestRuleSource
,ProcessPurposeSource
,ProjectSource
,QuestionSource
,SynonymTableSource
,URLRedirectSource
,UserAttributesSource
,UserSegmentationSource
,VariantSource
@StableMinor(version="17.0", sinceVersion="4.0") public class TableSource extends TabularSource<ITableSourceField>
A source that is based on a database table.- Since:
- 4.0.0
- Version:
- $Revision$ $Date$
-
-
Field Summary
-
Fields inherited from class lumis.doui.source.TabularSource
positionSourceField, primaryKeySourceField, searchableSourceFields, tabularData
-
Fields inherited from class lumis.doui.source.Source
addInterfaceId, administrationInterfaceId, connectionId, detailsInterfaceId, editInterfaceId, fields, fieldsMap, id, introductionSourceField, keywordsSourceField, load, metaDataSourceId, parameters, primaryNameSourceField, readData, SOURCE_READ_DATA_ALWAYS, SOURCE_READ_DATA_NEVER, SOURCE_READ_DATA_ON_DEMAND, sourceContext, sourceDefinitionNode
-
-
Constructor Summary
Constructors Constructor Description TableSource(org.w3c.dom.Node sourceDefinitionNode, ISourceContext sourceContext)
Creates a tabular source.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected ITableSourceFilter
createDefaultCompositeFilterInstance()
Creates and returns a source filter instance to be used as default tofilters
nodes.protected ITableSourceFilter
createDefaultFilterInstance()
Creates and returns a source filter instance to be used as default tofilter
nodes.protected QueryBuilder
createQueryBuilder(IParameters parameters)
Creates the query builder used by this source.protected ITableSourceField
createSourceField(org.w3c.dom.Node fieldNode)
Factory method for creating a source field instance that corresponds to the field node given.ITableSourceFilter
createSourceFilter(org.w3c.dom.Node filterNode)
Creates a source filter for the given filter definition node.protected void
deleteRelatedData(java.util.Collection<java.lang.String> itemIds)
Deletes all data related to the given itemIds.protected ISourceAddDataResult
doAddData(IParameters data)
Adds the data to the persistence.protected ISourceCloneDataResult
doCloneData(ISourceData data)
Returns the result of the clone operation for the given data.protected void
doDeleteDataByItemIds(java.util.Collection<java.lang.String> itemIds)
Deletes the data in the persistence.protected ISourceUpdateDataResult
doUpdateData(IParameters data)
Updates the data in the persistence.protected java.lang.String
getCloneDataTitleSuffix(ISourceData data)
Gets the translated clone data suffixprotected <S extends Source<?>>
ISourceBigDataPersister<S>getDefaultBigDataPersister()
Returns the default ISourceBigDataPersister implementation to be used for this source if the big data persisting is not disabled and no specific persister class is configured for this source.protected java.lang.String
getDefaultProviderClass()
Returns data provider class for the source.ITableSourceFilter
getFilter()
Returns the filter for this source.protected boolean
getIsCloneDataSupportedDefaultValue()
Returns the default value for \@isCloneDataSupported source attribute name.java.lang.String
getTableName()
Returns the table name for this source.TabularData
readData(java.lang.String[] primaryKeyValues, ITransaction transaction)
Deprecated.Since 10.4.0 replaced bySource.readData(String...)
and#readData(Iterable)
for Source persistence API standardization.ISourceData
readData(java.lang.String primaryKeyValue, ITransaction transaction)
Deprecated.Since 10.4.0 replaced bySource.readData(String...)
and#readData(Iterable)
for Source persistence API standardization.java.util.List<ISourceData>
readData(java.util.Collection<java.lang.String> itemIds)
Returns the data corresponding to the givenitemIds
.-
Methods inherited from class lumis.doui.source.TabularSource
applyPostLoadFilters, applyPostLoadPagination, compare, compareField, convertDataToDefinedDataTypes, convertDataToDefinedDataTypes, evaluateMaxRows, getData, getDefaultSourceSearchContentFillerClassName, getDouiHyperlinkItemParameterField, getFieldClass, getFieldId, getFieldIds, getFieldName, getFieldsDefinitionNode, getHyperlinkDefaultParameters, getIndexerEngineId, getIndexerId, getMaxRows, getPositionField, getPrimaryKeyField, getReindexerTabularDataProcessorClassName, getSearchableFields, getSearcherEngineId, getSearcherId, getSortedFieldIds, getSourceSearchContentFillerClassName, getStartAt, hasField, isSearchEnabled, readFieldsIntoFieldsMap, setData, setMaxRows, setStartAt
-
Methods inherited from class lumis.doui.source.Source
addData, cloneData, createCustomSourceField, createRenderDataChangedEvent, deleteDataByItemIds, deleteDataByItemIds, getAddInterfaceId, getAdministrationInterfaceId, getBigDataPersister, getDataForCloning, getDataProvider, getDefinitionNode, getDetailsInterfaceId, getDistinct, getDouiContext, getEditInterfaceId, getField, getFields, getFiltersNode, getId, getIntroductionField, getIntroductionImageField, getKeywordsField, getLoad, getMetaDataSourceId, getParameterClass, getParameterValue, getPrimaryNameField, getPublishStartDateField, getReadData, getSourceContainer, getSourceContext, getTransaction, getUpdateDataItemId, isAdministrationInterface, isDataCloningSupported, isDetails, isRenderDataChangedNotificationEnabled, load, postAddFieldData, postDeleteFieldData, postProcessSource, postUpdateFieldData, preAddFieldData, preDeleteFieldData, preUpdateFieldData, readData, scheduleIndexData, scheduleIndexData, sendPostAddDataNotification, sendPostDeleteDataNotification, sendPostUpdateDataNotification, sendPreAddDataNotification, sendPreDeleteDataNotification, sendPreUpdateDataNotification, sendRenderDataChangedNotification, sendRenderDataChangedNotification, setLoad, setParameterValue, setParameterValue, setReadData, setRenderDataChangedNotificationEnabled, updateData, valueChanged
-
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
-
-
-
Constructor Detail
-
TableSource
public TableSource(org.w3c.dom.Node sourceDefinitionNode, ISourceContext sourceContext) throws PortalException
Creates a tabular source.- Parameters:
sourceDefinitionNode
- the source definition node.sourceContext
- the source context.- Throws:
PortalException
- Since:
- 4.0.4
-
-
Method Detail
-
getTableName
public java.lang.String getTableName()
Returns the table name for this source.- Returns:
- the table name for this source.
- Since:
- 4.0.5
-
createSourceFilter
public ITableSourceFilter createSourceFilter(org.w3c.dom.Node filterNode) throws PortalException
Description copied from class:Source
Creates a source filter for the given filter definition node. The node may be afilters
orfilter
node.- Overrides:
createSourceFilter
in classSource<ITableSourceField>
- Parameters:
filterNode
- the filter definition node.- Returns:
- the source filter.
- Throws:
PortalException
-
createDefaultCompositeFilterInstance
protected ITableSourceFilter createDefaultCompositeFilterInstance()
Description copied from class:Source
Creates and returns a source filter instance to be used as default tofilters
nodes.- Overrides:
createDefaultCompositeFilterInstance
in classSource<ITableSourceField>
- Returns:
- the created instance.
-
createDefaultFilterInstance
protected ITableSourceFilter createDefaultFilterInstance()
Description copied from class:Source
Creates and returns a source filter instance to be used as default tofilter
nodes.- Overrides:
createDefaultFilterInstance
in classSource<ITableSourceField>
- Returns:
- the created instance.
-
getFilter
public ITableSourceFilter getFilter()
Description copied from class:Source
Returns the filter for this source. The filter must be initialized with the appropriated parameters before each use.- Overrides:
getFilter
in classSource<ITableSourceField>
- Returns:
- the filter or null if this source has no filter.
-
createSourceField
protected ITableSourceField createSourceField(org.w3c.dom.Node fieldNode) throws PortalException
Description copied from class:Source
Factory method for creating a source field instance that corresponds to the field node given. This method instantiate and returns the source field, without initializing it.- Overrides:
createSourceField
in classTabularSource<ITableSourceField>
- Parameters:
fieldNode
- the field node.- Returns:
- the ISourceField created, or null if no field should be created for this node.
- Throws:
PortalException
- See Also:
Source.createCustomSourceField(Node)
-
readData
@Deprecated public ISourceData readData(java.lang.String primaryKeyValue, ITransaction transaction) throws PortalException
Deprecated.Since 10.4.0 replaced bySource.readData(String...)
and#readData(Iterable)
for Source persistence API standardization. This method is no longer called and kept only for backwards compatibility.Reads the data with the given primary key value, and returns it.- Parameters:
primaryKeyValue
- the primary key value of the desired data.transaction
- the transaction for persistence access.- Returns:
- the data with the given primary key value.
- Throws:
PortalException
java.lang.NullPointerException
- ifprimaryKeyValue
isnull
.
-
readData
@Deprecated public TabularData readData(java.lang.String[] primaryKeyValues, ITransaction transaction) throws PortalException
Deprecated.Since 10.4.0 replaced bySource.readData(String...)
and#readData(Iterable)
for Source persistence API standardization. This method is no longer called and kept only for backwards compatibility.Reads the data with the given primary key values, and returns it.- Parameters:
primaryKeyValues
- the primary key values of the desired data.transaction
- the transaction for persistence access.- Returns:
- the data with the given primary key values.
- Throws:
PortalException
-
getDefaultProviderClass
protected java.lang.String getDefaultProviderClass() throws PortalException
Description copied from class:TabularSource
Returns data provider class for the source. Always throws an exceptions since this source does not have a default provider class.- Overrides:
getDefaultProviderClass
in classTabularSource<ITableSourceField>
- Returns:
- Throws:
PortalException
-
getDefaultBigDataPersister
protected <S extends Source<?>> ISourceBigDataPersister<S> getDefaultBigDataPersister()
Description copied from class:Source
Returns the default ISourceBigDataPersister implementation to be used for this source if the big data persisting is not disabled and no specific persister class is configured for this source.This method is called by
Source.getBigDataPersister()
when the default is to be used.- Overrides:
getDefaultBigDataPersister
in classTabularSource<ITableSourceField>
- Returns:
- the default ISourceBigDataPersister implementation.
-
readData
public java.util.List<ISourceData> readData(java.util.Collection<java.lang.String> itemIds) throws PortalException
Description copied from class:Source
Returns the data corresponding to the givenitemIds
.The implementation of this method in
Source
throws anUnsupportedOperationException
. This method should be overridden by source implementations that provides this functionality.- Overrides:
readData
in classSource<ITableSourceField>
- Parameters:
itemIds
- the item identifiers of the data to be returned.- Returns:
- a list of
ISourceData
objects that corresponds to the givenitemIds
. If no data is found, an empty list is returned. - Throws:
PortalException
-
createQueryBuilder
protected QueryBuilder createQueryBuilder(IParameters parameters) throws PortalException
Creates the query builder used by this source.- Parameters:
parameters
- the parameters to be used by the query builder.- Returns:
- the query builder.
- Throws:
PortalException
- Since:
- 10.4.0
-
doAddData
protected ISourceAddDataResult doAddData(IParameters data) throws PortalException
Description copied from class:Source
Adds the data to the persistence.This method is called by
Source.addData(Object)
and is to be overridden by sources that supports add operation and uses the defaultaddData
implementation.The implementation of this method in
Source
throwsUnsupportedOperationException
.- Overrides:
doAddData
in classSource<ITableSourceField>
- Parameters:
data
- the data given toSource.addData(Object)
, converted toIParameters
if necessary.- Returns:
- the result object to be returned by
Source.addData(Object)
. - Throws:
PortalException
-
doUpdateData
protected ISourceUpdateDataResult doUpdateData(IParameters data) throws PortalException
Description copied from class:Source
Updates the data in the persistence.This method is called by
Source.updateData(Object)
and is to be overridden by sources that supports update operation and uses the default updateData implementation.The implementation of this method in
Source
throwsUnsupportedOperationException
.- Overrides:
doUpdateData
in classSource<ITableSourceField>
- Parameters:
data
- the data given toSource.updateData(Object)
, converted toIParameters
if necessary.- Returns:
- the result object to be returned by
Source.updateData(Object)
. - Throws:
PortalException
-
doDeleteDataByItemIds
protected void doDeleteDataByItemIds(java.util.Collection<java.lang.String> itemIds) throws PortalException
Description copied from class:Source
Deletes the data in the persistence.This method is called by
Source.deleteDataByItemIds(Collection)
and is to be overridden by sources that supports delete operation and uses the default deleteData implementation.The implementation of this method in
Source
throwsUnsupportedOperationException
.- Overrides:
doDeleteDataByItemIds
in classSource<ITableSourceField>
- Parameters:
itemIds
- the item identifiers of data to be deleted.- Throws:
PortalException
-
deleteRelatedData
protected void deleteRelatedData(java.util.Collection<java.lang.String> itemIds) throws PortalException
Deletes all data related to the given itemIds.This method looks up all the relations of the data being deleted. If any of them have the attribute cascadeOnDelete set to true, the related source data is deleted.
- Parameters:
itemIds
- the item identifiers whose related data is to be deleted.- Throws:
PortalException
- Since:
- 10.4.0
-
doCloneData
protected ISourceCloneDataResult doCloneData(ISourceData data) throws PortalException, java.lang.IllegalArgumentException, java.lang.UnsupportedOperationException
Description copied from class:Source
Returns the result of the clone operation for the given data. Typically, this method is called by theSource.cloneData(String)
method.- Overrides:
doCloneData
in classSource<ITableSourceField>
- Parameters:
data
- the data to be cloned- Returns:
- the result of the clone operation for the given data.
- Throws:
PortalException
- If any other error occur.java.lang.IllegalArgumentException
- If the given data isnull
.java.lang.UnsupportedOperationException
- If this source does not supports data cloning.
-
getIsCloneDataSupportedDefaultValue
protected boolean getIsCloneDataSupportedDefaultValue()
Description copied from class:Source
Returns the default value for \@isCloneDataSupported source attribute name.- Overrides:
getIsCloneDataSupportedDefaultValue
in classSource<ITableSourceField>
- Returns:
- the default value for \@isCloneDataSupported source attribute name.
-
getCloneDataTitleSuffix
protected java.lang.String getCloneDataTitleSuffix(ISourceData data) throws PortalException
Gets the translated clone data suffix- Returns:
- the translated clone data suffix
- Throws:
PortalException
- Since:
- 17.0.0
-
-