Class TabularSource<F extends ITabularSourceField>
- java.lang.Object
-
- java.util.Observable
-
- lumis.doui.source.Source<F>
-
- lumis.doui.source.TabularSource<F>
-
- Type Parameters:
F
- the source field class for this source.
- All Implemented Interfaces:
java.util.Comparator<ISourceData>
- Direct Known Subclasses:
SearchSource
,TableSource
@StableMinor(version="15.0", sinceVersion="4.0") public class TabularSource<F extends ITabularSourceField> extends Source<F> implements java.util.Comparator<ISourceData>
A source that has its data in a tabular format.- Since:
- 4.0.0
- Version:
- $Revision: 25304 $ $Date: 2022-10-22 22:51:05 -0300 (Sat, 22 Oct 2022) $
-
-
Field Summary
Fields Modifier and Type Field Description protected F
positionSourceField
The position field of this source.protected F
primaryKeySourceField
protected java.util.List<F>
searchableSourceFields
Deprecated.Since 8.1.0, lumis.search is deprecated and this field is no longer used.protected TabularData
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 TabularSource(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 void
applyPostLoadFilters()
Apply the filters specified in this source to its data.void
applyPostLoadPagination()
Adjusts the data of this source for pagination.int
compare(ISourceData row1, ISourceData row2)
Compares two rows based on theDouiContext.DOUI_ORDER_BY_FIELD
parameter value.protected int
compareField(ISourceData row1, ISourceData row2, java.lang.String fieldId, java.lang.String direction)
Returns an integer that represents the comparason between the same field value of two different rows.protected void
convertDataToDefinedDataTypes()
Converts the data in this source to the values that should be used according to its fields definitions.protected TabularData
convertDataToDefinedDataTypes(TabularData originalData)
Converts the given data to another data with the values that should be used according to this source's fields definitions.protected F
createSourceField(org.w3c.dom.Node fieldNode)
Factory method for creating a source field instance that corresponds to the field node given.int
evaluateMaxRows(int maxRows)
Helper Method for evaluating which will be the value returned bygetMaxRows()
after callingsetMaxRows(int)
with this parameter.TabularData
getData()
Returns this source's data.protected <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.protected java.lang.String
getDefaultSourceSearchContentFillerClassName()
Deprecated.Since 8.1.0 this method is no longer used and remains only for binary compatibility, due to lumis.search being replaced by lumis.portal.bigdata.DouiHyperlinkItemParameterField
getDouiHyperlinkItemParameterField()
Returns the information about the field that is associated with the item id page parameter.java.lang.Class
getFieldClass(java.lang.String fieldId)
Returns the class object of the field.java.lang.String
getFieldId(java.lang.String fieldCriteria)
Deprecated.This method may be removed in the future, because it is public and references field xml definition.java.util.Set<java.lang.String>
getFieldIds(java.lang.String fieldCriteria)
Deprecated.This method may be removed in the future, because it is public and references field xml definition.java.lang.String
getFieldName(java.lang.String fieldId)
Returns the field name given a field id.org.w3c.dom.Node
getFieldsDefinitionNode()
Returs the fields node of the source.java.util.Collection<java.lang.String>
getHyperlinkDefaultParameters()
Returns the default parameters that should be used when creating a hyperlink url from this source.java.lang.String
getIndexerEngineId()
Deprecated.Since 8.1.0, lumis.search is deprecated and this method is no longer used.java.lang.String
getIndexerId()
Deprecated.Since 8.1.0, lumis.search is deprecated and this method is no longer used.int
getMaxRows()
Returns the maximum rows that data of this source shold contain.F
getPositionField()
Returns the position field of this source.F
getPrimaryKeyField()
Returns the field id of the primary key field.java.lang.String
getReindexerTabularDataProcessorClassName()
Deprecated.Since 8.1.0 this method is no longer used and remains only for binary compatibility, due to lumis.search being replaced by lumis.portal.bigdata.java.util.List<F>
getSearchableFields()
Deprecated.Since 8.1.0, lumis.search is deprecated and this method is no longer used.java.lang.String
getSearcherEngineId()
Deprecated.Since 8.1.0, lumis.search is deprecated and this method is no longer used.java.lang.String
getSearcherId()
Deprecated.Since 8.1.0, lumis.search is deprecated and this method is no longer used.java.util.SortedSet<java.lang.String>
getSortedFieldIds(java.lang.String fieldCriteria)
Deprecated.This method may be removed in the future, because it is public and references field xml definition.java.lang.String
getSourceSearchContentFillerClassName()
Deprecated.Since 8.1.0 this method is no longer used and remains only for binary compatibility, due to lumis.search being replaced by lumis.portal.bigdata.int
getStartAt()
Returns the row start position the data of this source shold be read from.boolean
hasField(java.lang.String fieldCriteria)
Deprecated.This method may be removed in the future, because it is public and references field xml definition.boolean
isSearchEnabled()
Deprecated.Since 8.1.0, lumis.search is deprecated and this method is no longer used.protected void
readFieldsIntoFieldsMap()
Reads this source's fields into theSource.fieldsMap
.void
setData(TabularData tabularData)
Sets the data in this source.void
setMaxRows(int maxRows)
Sets the maximum rows that data of this source shold contain.void
setStartAt(int startAt)
Sets the row start position the data of this source shold be read from.-
Methods inherited from class lumis.doui.source.Source
addData, createCustomSourceField, createDefaultCompositeFilterInstance, createDefaultFilterInstance, createRenderDataChangedEvent, createSourceFilter, deleteDataByItemIds, deleteDataByItemIds, doAddData, doDeleteDataByItemIds, doUpdateData, getAddInterfaceId, getAdministrationInterfaceId, getBigDataPersister, getDataProvider, getDefinitionNode, getDetailsInterfaceId, getDistinct, getDouiContext, getEditInterfaceId, getField, getFields, getFilter, getFiltersNode, getId, getIntroductionField, getIntroductionImageField, getKeywordsField, getLoad, getMetaDataSourceId, getParameterClass, getParameterValue, getPrimaryNameField, getPublishStartDateField, getReadData, getSourceContainer, getSourceContext, getTransaction, getUpdateDataItemId, isAdministrationInterface, isDetails, isRenderDataChangedNotificationEnabled, load, postAddFieldData, postDeleteFieldData, postProcessSource, postUpdateFieldData, preAddFieldData, preDeleteFieldData, preUpdateFieldData, readData, 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
-
-
-
-
Field Detail
-
tabularData
protected TabularData tabularData
-
primaryKeySourceField
protected F extends ITabularSourceField primaryKeySourceField
-
positionSourceField
protected F extends ITabularSourceField positionSourceField
The position field of this source. Initialized byreadFieldsIntoFieldsMap()
and returned bygetPositionField()
.- Since:
- 10.3.0
-
searchableSourceFields
@Deprecated protected java.util.List<F extends ITabularSourceField> searchableSourceFields
Deprecated.Since 8.1.0, lumis.search is deprecated and this field is no longer used.
-
-
Constructor Detail
-
TabularSource
public TabularSource(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
-
createSourceField
protected F 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 classSource<F extends ITabularSourceField>
- 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)
-
readFieldsIntoFieldsMap
protected void readFieldsIntoFieldsMap() throws PortalException
Description copied from class:Source
Reads this source's fields into theSource.fieldsMap
. The order the source fields are put in the map will define the order the fields will be in theSource.fields
list. This order may affect some field processing.- Overrides:
readFieldsIntoFieldsMap
in classSource<F extends ITabularSourceField>
- Throws:
PortalException
- if an error was found while reading the source's fields into theSource.fields
map.
-
getPrimaryKeyField
public F getPrimaryKeyField()
Returns the field id of the primary key field.- Returns:
- Since:
- 4.0.11
-
getPositionField
public F getPositionField()
Returns the position field of this source.- Returns:
- the position field or
null
if this source does not have a position field. - Since:
- 10.3.0
-
getIndexerEngineId
@Deprecated public java.lang.String getIndexerEngineId() throws PortalException
Deprecated.Since 8.1.0, lumis.search is deprecated and this method is no longer used.Returns the identifier of the indexing engine for this source- Returns:
- Throws:
PortalException
- Since:
- 4.0.11
-
getSearcherEngineId
@Deprecated public java.lang.String getSearcherEngineId() throws PortalException
Deprecated.Since 8.1.0, lumis.search is deprecated and this method is no longer used.Returns the searcher engine for this source- Returns:
- Throws:
PortalException
- Since:
- 4.0.11
-
getIndexerId
@Deprecated public java.lang.String getIndexerId() throws PortalException
Deprecated.Since 8.1.0, lumis.search is deprecated and this method is no longer used.Returns the identifier of the indexer for this source.- Returns:
- Throws:
PortalException
- Since:
- 4.0.11
-
getSearcherId
@Deprecated public java.lang.String getSearcherId() throws PortalException
Deprecated.Since 8.1.0, lumis.search is deprecated and this method is no longer used.Returns the identifier of the searcher for this source.- Returns:
- Throws:
PortalException
- Since:
- 4.0.11
-
isSearchEnabled
@Deprecated public boolean isSearchEnabled()
Deprecated.Since 8.1.0, lumis.search is deprecated and this method is no longer used.Returns whether search is enabled for this source or not.- Returns:
- Since:
- 4.0.11
-
getSearchableFields
@Deprecated public java.util.List<F> getSearchableFields()
Deprecated.Since 8.1.0, lumis.search is deprecated and this method is no longer used.Returns a collection of fields that are searchable- Returns:
- Since:
- 4.0.11
-
getDouiHyperlinkItemParameterField
public DouiHyperlinkItemParameterField getDouiHyperlinkItemParameterField()
Description copied from class:Source
Returns the information about the field that is associated with the item id page parameter.- Overrides:
getDouiHyperlinkItemParameterField
in classSource<F extends ITabularSourceField>
- Returns:
- the information about the field that is associated with the item id page parameter.
- See Also:
PageConfig.PAGE_PARAMETER_ITEMID
,DouiHyperlinkItemParameterField
-
getHyperlinkDefaultParameters
public java.util.Collection<java.lang.String> getHyperlinkDefaultParameters()
Description copied from class:Source
Returns the default parameters that should be used when creating a hyperlink url from this source.- Overrides:
getHyperlinkDefaultParameters
in classSource<F extends ITabularSourceField>
- Returns:
- a collection with the default parameter names.
-
getFieldsDefinitionNode
public org.w3c.dom.Node getFieldsDefinitionNode() throws PortalException
Returs the fields node of the source.- Returns:
- Throws:
PortalException
- Since:
- 4.0.11
-
getFieldClass
public java.lang.Class getFieldClass(java.lang.String fieldId) throws PortalException
Returns the class object of the field. This implementation always returns the String.class object.- Parameters:
fieldId
-- Returns:
- Throws:
PortalException
- Since:
- 4.0.11
-
getData
public TabularData getData() throws PortalException
Description copied from class:Source
Returns this source's data.- Overrides:
getData
in classSource<F extends ITabularSourceField>
- Returns:
- this source's data.
- Throws:
PortalException
-
convertDataToDefinedDataTypes
protected void convertDataToDefinedDataTypes() throws PortalException
Description copied from class:Source
Converts the data in this source to the values that should be used according to its fields definitions.- Specified by:
convertDataToDefinedDataTypes
in classSource<F extends ITabularSourceField>
- Throws:
PortalException
-
convertDataToDefinedDataTypes
protected TabularData convertDataToDefinedDataTypes(TabularData originalData) throws PortalException
Converts the given data to another data with the values that should be used according to this source's fields definitions.- Parameters:
originalData
- the data to be converted.- Returns:
- the converted data.
- Throws:
PortalException
- Since:
- 4.1.1
-
setData
public void setData(TabularData tabularData) throws PortalException
Sets the data in this source.- Parameters:
tabularData
- the data to set in this source.- Throws:
PortalException
- Since:
- 4.0.4
-
compareField
protected int compareField(ISourceData row1, ISourceData row2, java.lang.String fieldId, java.lang.String direction)
Returns an integer that represents the comparason between the same field value of two different rows. This method is used for sorting results after the tabular data is filled.0 signifies equality 1 signifies the first row is greater -1 signifies the second row is greater
If the direction is
QuerySortOrder.DESCENDING
, the results are inverted.- Parameters:
row1
-row2
-fieldId
-direction
-QuerySortOrder.ASCENDING
orQuerySortOrder.DESCENDING
- Returns:
- Since:
- 4.0.11
-
compare
public int compare(ISourceData row1, ISourceData row2)
Compares two rows based on theDouiContext.DOUI_ORDER_BY_FIELD
parameter value.0 signifies equality 1 signifies the first row is greater -1 signifies the second row is greater
- Specified by:
compare
in interfacejava.util.Comparator<F extends ITabularSourceField>
-
getFieldName
public java.lang.String getFieldName(java.lang.String fieldId) throws PortalException
Returns the field name given a field id.- Parameters:
fieldId
-- Returns:
- Throws:
PortalException
- Since:
- 4.0.11
-
getSortedFieldIds
@Deprecated public java.util.SortedSet<java.lang.String> getSortedFieldIds(java.lang.String fieldCriteria) throws PortalException
Deprecated.This method may be removed in the future, because it is public and references field xml definition.Get this source's set of field ids having definition node matching the specified criteria, sorted- Parameters:
fieldCriteria
-- Returns:
- Throws:
PortalException
-
getFieldIds
@Deprecated public java.util.Set<java.lang.String> getFieldIds(java.lang.String fieldCriteria) throws PortalException
Deprecated.This method may be removed in the future, because it is public and references field xml definition.Get this source's set of field ids having definition node matching the specified criteria- Parameters:
fieldCriteria
-- Returns:
- Throws:
PortalException
-
getFieldId
@Deprecated public java.lang.String getFieldId(java.lang.String fieldCriteria) throws PortalException
Deprecated.This method may be removed in the future, because it is public and references field xml definition.Get this source's field id having definition node matching the specified criteria- Parameters:
fieldCriteria
-- Returns:
- Throws:
PortalException
-
hasField
@Deprecated public boolean hasField(java.lang.String fieldCriteria) throws PortalException
Deprecated.This method may be removed in the future, because it is public and references field xml definition.Check if this source have a field with definition node matching the specified criteria- Parameters:
fieldCriteria
-- Returns:
- Throws:
PortalException
-
applyPostLoadFilters
public void applyPostLoadFilters() throws PortalException
Apply the filters specified in this source to its data. This is an utility method for data providers that does not support filtering during the source load operation. After loading the source's data without filtering it, the data provider may call this method for the source to remove data that does not attend to the filters specified.Data providers that may provide significant quantity of data should implement its own filtering during load instead of using this method, to prevent unnecessary use of server's memory and cpu.
Currently this implementation supports only simple filters, without grouping and of operator 'like'.
- Overrides:
applyPostLoadFilters
in classSource<F extends ITabularSourceField>
- Throws:
PortalException
- See Also:
IDataProvider.loadData(lumis.portal.SessionConfig, Source, lumis.util.ITransaction)
-
applyPostLoadPagination
public void applyPostLoadPagination()
Adjusts the data of this source for pagination.The total rows of this data is set to its size, and then its rows are trimmed, according to the
getStartAt()
andgetMaxRows()
values.For correct behavior, the rows presence or ordering may not be changed after this processing.
- Since:
- 4.0.9
-
setStartAt
public void setStartAt(int startAt)
Sets the row start position the data of this source shold be read from. Used for pagination funcionalities. The row number is 1-based.- Parameters:
startAt
-- Since:
- 4.0.11
-
getStartAt
public int getStartAt()
Returns the row start position the data of this source shold be read from. Used for pagination funcionalities. The row number is 1-based.- Returns:
- the row start position the data of this source shold be read from.
- Since:
- 4.0.5
-
setMaxRows
public void setMaxRows(int maxRows)
Sets the maximum rows that data of this source shold contain. Used for pagination funcionalities. The row number is 1-based.- Parameters:
maxRows
-- Since:
- 4.0.11
-
getMaxRows
public int getMaxRows()
Returns the maximum rows that data of this source shold contain. Used for pagination funcionalities. The row number is 1-based.- Returns:
- Since:
- 4.0.11
-
evaluateMaxRows
public int evaluateMaxRows(int maxRows)
Helper Method for evaluating which will be the value returned bygetMaxRows()
after callingsetMaxRows(int)
with this parameter.- Parameters:
maxRows
- The value to be used in the evaluation.- Returns:
- The value that will be returned by
getMaxRows()
. - Since:
- 12.0.0
-
getDefaultSourceSearchContentFillerClassName
@Deprecated protected java.lang.String getDefaultSourceSearchContentFillerClassName()
Deprecated.Since 8.1.0 this method is no longer used and remains only for binary compatibility, due to lumis.search being replaced by lumis.portal.bigdata. Consider usinggetDefaultBigDataPersister()
instead.Returns the default source search content search filler class name.The default value defined in this class is lumis.doui.search.DouiTabularSourceSearchContentFiller.
- Returns:
- Since:
- 4.0.11
-
getSourceSearchContentFillerClassName
@Deprecated public java.lang.String getSourceSearchContentFillerClassName()
Deprecated.Since 8.1.0 this method is no longer used and remains only for binary compatibility, due to lumis.search being replaced by lumis.portal.bigdata. Consider usingSource.getBigDataPersister()
instead.Returns the defined search filler class name- Returns:
- Since:
- 4.0.11
-
getReindexerTabularDataProcessorClassName
@Deprecated public java.lang.String getReindexerTabularDataProcessorClassName()
Deprecated.Since 8.1.0 this method is no longer used and remains only for binary compatibility, due to lumis.search being replaced by lumis.portal.bigdata. Current implementation of this method throwsUnsupportedOperationException
.Returns the class name of the reindexer for this source- Returns:
- Since:
- 4.0.11
-
getDefaultProviderClass
protected java.lang.String getDefaultProviderClass() throws PortalException
Returns data provider class for the source. Always throws an exceptions since this source does not have a default provider class.- Specified by:
getDefaultProviderClass
in classSource<F extends ITabularSourceField>
- 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 classSource<F extends ITabularSourceField>
- Returns:
- the default ISourceBigDataPersister implementation.
-
-