Class TabularSourceBigDataPersister<S extends TabularSource<?>>
- java.lang.Object
-
- lumis.doui.bigdata.TabularSourceBigDataPersister<S>
-
- All Implemented Interfaces:
ISourceBigDataPersister<S>
- Direct Known Subclasses:
ContentTableSourceBigDataPersister
@StableMinor(version="16.1", sinceVersion="10.0") public class TabularSourceBigDataPersister<S extends TabularSource<?>> extends java.lang.Object implements ISourceBigDataPersister<S>
GenericISourceBigDataPersister
fortabular sources
.- Since:
- 8.1.0
- Version:
- $Revision: 26157 $ $Date: 2024-01-13 11:35:03 -0300 (Sat, 13 Jan 2024) $
-
-
Constructor Summary
Constructors Constructor Description TabularSourceBigDataPersister()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addContextDocuments(java.lang.String sourceId, java.lang.String contextId)
Adds alldocuments
corresponding to the given source and context to the portal big data repository.protected void
addDocumentPublications(StandardDocument standardDocument, S source, ISourceData data)
Generates and adds the publications to be used as the value forStandardDocumentType#FIELD_PUBLICATIONS
.protected void
addDocumentPublications(StandardDocument standardDocument, S source, ISourceData row, java.util.Collection<java.lang.String> serviceInstanceIds)
Generates and adds the publications to be used as the value forStandardDocumentType#FIELD_PUBLICATIONS
, for an row on a collection of service instances.void
addDocuments(S source, java.util.Collection<? extends ISourceData> datas)
Addsdocuments
to the portal big data repository for the given source data entries.void
addDocuments(S source, ISourceData... datas)
Addsdocuments
to the portal big data repository for the given source data entries.protected void
addDocuments(S source, ISourceData data, IBigDataIndexer bigDataIndexer)
Addsdocuments
to the portal big data repository for the given source data.void
deleteBigData(S source)
Deletes all structure stored in the portal big data repository relative to a source.void
deleteContextDocuments(java.lang.String sourceId, java.lang.String contextId)
Deletesdocuments
from the portal big data repository for the specified source in a context.void
deleteDocuments(S source, java.lang.String... itemIds)
Deletesdocuments
from the portal big data repository that corresponds to the data with the given primary key values.void
deleteDocuments(S source, java.util.Collection<java.lang.String> itemIds)
Deletesdocuments
from the portal big data repository that corresponds to the data with the given primary key values.protected java.lang.String
generateDocumentPublishedContextURL(S source, ISourceData row, java.lang.String serviceInstanceId)
Generates the URL For a published context to refer a row on a service instance.protected java.util.Collection<? extends Document>
generateDocuments(S source, ISourceData data)
Generates the documents to be stored for a given source data.protected IDocumentTypeBuilder<? extends StandardDocumentType>
generateDocumentType(S source)
Generates the document type definition for documents relative to the specified source.
The default implementation generates a document type using as identifier the result ofgetDocumentTypeId(S)
and this document type contains a field, with identifier of the result ofgetDocumentTypeFieldId(S)
, that holds the source fields' values.protected java.util.Collection<? extends KnowledgeStandardDocument>
generateKnowledgeDocuments(java.util.Collection<? extends Document> searchDocuments, S source, ISourceData data)
Returns the documents used by chat assistant created from the given search documents.protected double
getDocumentPopularity(StandardDocument document, S source, ISourceData data)
Returns the popularity of the given document.protected java.lang.String
getDocumentTypeFieldId(S source)
Returns the identifier to use for the document type source fieldprotected java.lang.String
getDocumentTypeId(S source)
Returns the identifier to use for the document type generated to the given source.protected java.util.Collection<java.lang.String>
getPublishedPrincipalIds(S source, ISourceData row)
Returns the published principal identifiers to composepublications
that will be added toStandardDocumentType#FIELD_PUBLICATIONS
.protected static Source<?>
getServiceSource(java.lang.String sourceId, ISourceContext sourceContext)
Returns the source of a service.void
initBigData(S source)
Initializes the big data repository with elements specifics to a source.void
updateBigData(S source)
Updates the big data repository according to a source.
-
-
-
Method Detail
-
generateDocumentType
protected IDocumentTypeBuilder<? extends StandardDocumentType> generateDocumentType(S source)
Generates the document type definition for documents relative to the specified source.
The default implementation generates a document type using as identifier the result ofgetDocumentTypeId(S)
and this document type contains a field, with identifier of the result ofgetDocumentTypeFieldId(S)
, that holds the source fields' values.- Parameters:
source
- the source.- Returns:
- the document type.
- Since:
- 8.1.0
- See Also:
getDocumentTypeId(S)
,getDocumentTypeFieldId(S)
-
getDocumentTypeId
protected java.lang.String getDocumentTypeId(S source)
Returns the identifier to use for the document type generated to the given source.- Parameters:
source
- the source.- Returns:
- the corresponding document type identifier.
- Since:
- 8.1.0
- See Also:
generateDocumentType(S)
-
getDocumentTypeFieldId
protected java.lang.String getDocumentTypeFieldId(S source)
Returns the identifier to use for the document type source field- Parameters:
source
- the source.- Returns:
- the corresponding source field identifier.
- Since:
- 8.2.0
-
initBigData
public void initBigData(S source)
Description copied from interface:ISourceBigDataPersister
Initializes the big data repository with elements specifics to a source.This method is called at some moment between the service registration and its use, or when the source big data will be recreated (after
ISourceBigDataPersister.deleteBigData(S)
is called to delete anything related to the source).This method will usually create the
document types
thatISourceBigDataPersister.addDocuments(S, lumis.doui.source.ISourceData...)
for the source will use.- Specified by:
initBigData
in interfaceISourceBigDataPersister<S extends TabularSource<?>>
- Parameters:
source
- the source.
-
updateBigData
public void updateBigData(S source)
Description copied from interface:ISourceBigDataPersister
Updates the big data repository according to a source.This method is called at some moment between the service registration and its use.
This method will usually update the
document types
for the source.- Specified by:
updateBigData
in interfaceISourceBigDataPersister<S extends TabularSource<?>>
- Parameters:
source
- the source.
-
deleteBigData
public void deleteBigData(S source)
Description copied from interface:ISourceBigDataPersister
Deletes all structure stored in the portal big data repository relative to a source.This method is called when a source will cease to exist or when recreating the big data for a source.
This method must delete elements created by
ISourceBigDataPersister.initBigData(S)
and documents added byISourceBigDataPersister.addDocuments(S, lumis.doui.source.ISourceData...)
.This method will usually delete the
document types
created inISourceBigDataPersister.initBigData(S)
and used byISourceBigDataPersister.addDocuments(S, lumis.doui.source.ISourceData...)
, which will remove related documents in cascade.- Specified by:
deleteBigData
in interfaceISourceBigDataPersister<S extends TabularSource<?>>
- Parameters:
source
- the source.
-
addContextDocuments
public void addContextDocuments(java.lang.String sourceId, java.lang.String contextId)
Description copied from interface:ISourceBigDataPersister
Adds alldocuments
corresponding to the given source and context to the portal big data repository.This method is usually called when re-indexing a source after its documents have been deleted.
- Specified by:
addContextDocuments
in interfaceISourceBigDataPersister<S extends TabularSource<?>>
- Parameters:
sourceId
- the source identifier.contextId
- the context identifier. Usually a service or service instance identifier.
-
deleteContextDocuments
public void deleteContextDocuments(java.lang.String sourceId, java.lang.String contextId)
Description copied from interface:ISourceBigDataPersister
Deletesdocuments
from the portal big data repository for the specified source in a context.- Specified by:
deleteContextDocuments
in interfaceISourceBigDataPersister<S extends TabularSource<?>>
- Parameters:
sourceId
- the source identifier.contextId
- the context identifier.
-
getServiceSource
protected static Source<?> getServiceSource(java.lang.String sourceId, ISourceContext sourceContext)
Returns the source of a service.- Parameters:
sourceId
- the desired source identifier.sourceContext
- the source context to use to create the sources.- Returns:
- the source.
- Since:
- 10.0.0
-
addDocuments
public final void addDocuments(S source, ISourceData... datas)
Addsdocuments
to the portal big data repository for the given source data entries.To override the documents generated for each data, override
generateDocuments(TabularSource, ISourceData)
instead of this method. If it is necessary to override this method, overrideaddDocuments(TabularSource, Collection)
instead, as the implementation of this method only delegates to it.- Specified by:
addDocuments
in interfaceISourceBigDataPersister<S extends TabularSource<?>>
- Parameters:
source
- the source.datas
- the source's data to be used to generate the documents.
-
addDocuments
public void addDocuments(S source, java.util.Collection<? extends ISourceData> datas)
Addsdocuments
to the portal big data repository for the given source data entries.To override the documents generated for each data, override
generateDocuments(TabularSource, ISourceData)
instead of this method.- Specified by:
addDocuments
in interfaceISourceBigDataPersister<S extends TabularSource<?>>
- Parameters:
source
- the source.datas
- the source's data to be used to generate the documents.
-
addDocuments
protected void addDocuments(S source, ISourceData data, IBigDataIndexer bigDataIndexer)
Addsdocuments
to the portal big data repository for the given source data.- Parameters:
source
- the source.data
- the source's data to be used to generate the documents.bigDataIndexer
- the big data indexer to add the documents.- Since:
- 8.1.0
-
generateKnowledgeDocuments
protected java.util.Collection<? extends KnowledgeStandardDocument> generateKnowledgeDocuments(java.util.Collection<? extends Document> searchDocuments, S source, ISourceData data)
Returns the documents used by chat assistant created from the given search documents.- Parameters:
searchDocuments
- the search documentssource
- the sourcedata
- the source data- Returns:
- the documents used by chat assistant created from the given search documents.
- Since:
- 16.1.0
-
generateDocuments
protected java.util.Collection<? extends Document> generateDocuments(S source, ISourceData data)
Generates the documents to be stored for a given source data.The default implementations of
addDocuments
methods call this method to generate the documents to be added.- Parameters:
source
- the source.data
- the source data.- Returns:
- a collection of documents to be added for the given data.
- Since:
- 8.1.0
- See Also:
#generateDocumentPublications(TabularSource, ISourceData)
-
getDocumentPopularity
protected double getDocumentPopularity(StandardDocument document, S source, ISourceData data)
Returns the popularity of the given document. The returned value must be a positivefinite
number.
See IDocumentPopularityProvider.calculateDocumentPopularity(StandardDocument) for more information.- Parameters:
document
- the documentsource
- source related to the given documentdata
- row of content- Returns:
- the popularity of the given document
- Since:
- 11.1.0
- See Also:
IDocumentPopularityProvider.calculateDocumentPopularity(StandardDocument)
-
addDocumentPublications
protected void addDocumentPublications(StandardDocument standardDocument, S source, ISourceData data)
Generates and adds the publications to be used as the value forStandardDocumentType#FIELD_PUBLICATIONS
.This method is called by
generateDocuments(TabularSource, ISourceData)
.- Parameters:
standardDocument
- the document to add the publications.source
- the source the document is being generated for.data
- the source data the document is being generated for.- Since:
- 8.1.0
-
addDocumentPublications
protected void addDocumentPublications(StandardDocument standardDocument, S source, ISourceData row, java.util.Collection<java.lang.String> serviceInstanceIds)
Generates and adds the publications to be used as the value forStandardDocumentType#FIELD_PUBLICATIONS
, for an row on a collection of service instances.This method is called by
addDocumentPublications(StandardDocument, TabularSource, ISourceData)
.- Parameters:
standardDocument
- the document to add the publications.source
- the source the document is being generated for.row
- the row being processed.serviceInstanceIds
- the service instance identifiers.- Since:
- 8.1.0
-
getPublishedPrincipalIds
protected java.util.Collection<java.lang.String> getPublishedPrincipalIds(S source, ISourceData row)
Returns the published principal identifiers to composepublications
that will be added toStandardDocumentType#FIELD_PUBLICATIONS
.This method is called by
addDocumentPublications(StandardDocument, TabularSource, ISourceData, Collection)
.- Parameters:
source
- the source that the generated document belongs to.row
- the row being processed.- Returns:
- published principal identifiers.
- Since:
- 8.1.0
-
generateDocumentPublishedContextURL
protected java.lang.String generateDocumentPublishedContextURL(S source, ISourceData row, java.lang.String serviceInstanceId)
Generates the URL For a published context to refer a row on a service instance.This method is called by
#addDocumentPublications(StandardDocument, TabularSource, String, Collection)
.This method may return
null
, if no URL is available for the given row. In this case, a publication will not be generated.- Parameters:
source
- the source the document is being generated for.row
- the row being processed.serviceInstanceId
- the service instance identifier.- Returns:
- the published context URL.
- Since:
- 8.1.0
-
deleteDocuments
public final void deleteDocuments(S source, java.lang.String... itemIds)
Description copied from interface:ISourceBigDataPersister
Deletesdocuments
from the portal big data repository that corresponds to the data with the given primary key values.- Specified by:
deleteDocuments
in interfaceISourceBigDataPersister<S extends TabularSource<?>>
- Parameters:
source
- the source.itemIds
- the source data primary key values.
-
deleteDocuments
public void deleteDocuments(S source, java.util.Collection<java.lang.String> itemIds)
Description copied from interface:ISourceBigDataPersister
Deletesdocuments
from the portal big data repository that corresponds to the data with the given primary key values.- Specified by:
deleteDocuments
in interfaceISourceBigDataPersister<S extends TabularSource<?>>
- Parameters:
source
- the source.itemIds
- the source data primary key values.
-
-