@StableMinor(version="12.5", sinceVersion="4.0") public class ContentTableSource extends TableSource
TableSource
it extends.Modifier and Type | Class and Description |
---|---|
static class |
ContentTableSource.LockStrategy
Strategy on how to handle
ContentLocale 's locks during content operation. |
Modifier and Type | Field and Description |
---|---|
static String |
ASSIGNED_TO_PARAMETER_NAME
The parameter that defines the value for workflow's assignedTo.
|
static String |
ASSIGNED_TO_PARAMETER_VALUE_NULL
Value to indicate the assigned to is to be set to null.
|
static String |
TRANSITION_PARAMETER_NAME
The parameter that defines the workflow's transition to be executed.
|
positionSourceField, primaryKeySourceField, searchableSourceFields, tabularData
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 and Description |
---|
ContentTableSource(Node sourceDefinitionNode,
ISourceContext sourceContext)
Creates a content table source.
|
Modifier and Type | Method and Description |
---|---|
IContentTableSourceAddDataResult |
addData(Object data)
Adds a data in the persistence this source represents.
|
protected ITableSourceFilter |
createDefaultFilterInstance()
Creates and returns a source filter instance to be used
as default to
filter nodes. |
protected QueryBuilder |
createQueryBuilder(IParameters parameters)
Creates the query builder used by this source.
|
protected Collection<IPortalEvent> |
createRenderDataChangedEvent(PortalEventOperationType operationType,
Collection<String> itemIds)
Returns the render data changed event to be sent by
Source.sendRenderDataChangedNotification(PortalEventOperationType, Collection) . |
protected ITableSourceField |
createSourceField(Node fieldNode)
Factory method for creating a source field instance that corresponds
to the field node given.
|
void |
deleteDataByItemIds(Collection<String> itemIds)
Calls
deleteDataByItemIds(Collection, LockStrategy) using same lock strategy of current operation if
this delete is cascaded from another content, or with lock strategy of
ContentTableSource.LockStrategy.CHECK_AND_RELEASE_AUTOMATIC_ON_COMMIT otherwise. |
void |
deleteDataByItemIds(Collection<String> itemIds,
ContentTableSource.LockStrategy lockStrategy)
Deletes data from the persistence this source represents.
|
protected void |
deleteVersionDataByItemIds(Collection<String> itemIds)
Deletes the data related to the versions of the given item identifiers.
|
protected IContentTableSourceAddDataResult |
doAddData(IParameters data)
Adds the data to the persistence.
|
protected void |
doDeleteDataByItemIds(Collection<String> itemIds)
Deletes the data in the persistence.
|
protected IContentTableSourceUpdateDataResult |
doUpdateData(IParameters data)
Updates the data in the persistence.
|
IContentTableSourceBigDataPersister |
getBigDataPersister()
Returns the ISourceBigDataPersister implementation to be used for this source.
|
protected IContentTableSourceBigDataPersister |
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 String |
getDefaultProviderClass()
Returns data provider class for the source.
|
protected 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 using
getDefaultBigDataPersister()
instead. |
MetaDataSourceField |
getField(MetaDataSourceField.Type type)
Returns the filed based on the metadata type passed in.
|
Collection<String> |
getHyperlinkDefaultParameters()
Returns the default parameters that should be used when creating a
hyperlink url from this source.
|
protected String |
getUpdateDataItemId(IParameters data)
Returns the item identifier of a data being updated, this will consider the id
to the right active version.
|
WorkflowConfig |
getWorkflowConfig()
Returns the workflow associated with this source.
|
protected boolean |
isAdministrationInterface(IServiceInterface serviceInterface)
Returns true if the given service interface is the main administration interface for this source.
|
boolean |
isPublishAllAccessibleContents()
Indicates if contents not published to the current service instance
but accessible by the current user should also be published.
|
boolean |
isWorkflowSupported()
Verifies if the current source supports a workflow.
|
protected void |
postDeleteDataByItemIds(Collection<String> itemIds)
Called after delete operation.
|
protected void |
preDeleteDataByItemIds(Collection<String> itemIds)
Called before delete operation.
|
protected void |
scheduleContentAddedEvent(ContentVersion contentVersion)
Schedules a content added event for the given content to be executed once the transaction is commited.
|
void |
scheduleIndexData(Collection<String> itemIds)
Schedules the indexing of the data that corresponds to the specified item identifiers.
|
IContentTableSourceUpdateDataResult |
updateData(Object data)
Calls
updateData(data, LockStrategy.CHECK_AND_RELEASE_AUTOMATIC_ON_COMMIT) . |
IContentTableSourceUpdateDataResult |
updateData(Object data,
ContentTableSource.LockStrategy lockStrategy)
Updates a data in the persistence this source represents.
|
createDefaultCompositeFilterInstance, createSourceFilter, deleteRelatedData, getFilter, getTableName, readData, readData, readData
applyPostLoadFilters, applyPostLoadPagination, compare, compareField, convertDataToDefinedDataTypes, convertDataToDefinedDataTypes, evaluateMaxRows, getData, getDouiHyperlinkItemParameterField, getFieldClass, getFieldId, getFieldIds, getFieldName, getFieldsDefinitionNode, getIndexerEngineId, getIndexerId, getMaxRows, getPositionField, getPrimaryKeyField, getReindexerTabularDataProcessorClassName, getSearchableFields, getSearcherEngineId, getSearcherId, getSortedFieldIds, getSourceSearchContentFillerClassName, getStartAt, hasField, isSearchEnabled, readFieldsIntoFieldsMap, setData, setMaxRows, setStartAt
createCustomSourceField, deleteDataByItemIds, getAddInterfaceId, getAdministrationInterfaceId, getDataProvider, getDefinitionNode, getDetailsInterfaceId, getDistinct, getDouiContext, getEditInterfaceId, getField, getFields, getFiltersNode, getId, getIntroductionField, getIntroductionImageField, getKeywordsField, getLoad, getMetaDataSourceId, getParameterClass, getParameterValue, getPrimaryNameField, getPublishStartDateField, getReadData, getSourceContainer, getSourceContext, getTransaction, isDetails, isRenderDataChangedNotificationEnabled, load, postAddFieldData, postDeleteFieldData, postProcessSource, postUpdateFieldData, preAddFieldData, preDeleteFieldData, preUpdateFieldData, readData, scheduleIndexData, sendPostAddDataNotification, sendPostDeleteDataNotification, sendPostUpdateDataNotification, sendPreAddDataNotification, sendPreDeleteDataNotification, sendPreUpdateDataNotification, sendRenderDataChangedNotification, sendRenderDataChangedNotification, setLoad, setParameterValue, setParameterValue, setReadData, setRenderDataChangedNotificationEnabled, valueChanged
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static final String TRANSITION_PARAMETER_NAME
"authoring.approve"
). The transition must exist in the
current content workflow state. If the parameter is not present or is set to null
, no transition is
executed.public static final String ASSIGNED_TO_PARAMETER_NAME
ASSIGNED_TO_PARAMETER_VALUE_NULL
indicates to change to null, and any other value indicates to change to
that value. If the parameter is not present or is set to null, the assigned to is not to be changed.ASSIGNED_TO_PARAMETER_VALUE_NULL
,
Constant Field Valuespublic static final String ASSIGNED_TO_PARAMETER_VALUE_NULL
ASSIGNED_TO_PARAMETER_NAME
,
Constant Field Valuespublic ContentTableSource(Node sourceDefinitionNode, ISourceContext sourceContext) throws PortalException
sourceDefinitionNode
- the source definition node.sourceContext
- the source context.PortalException
protected boolean isAdministrationInterface(IServiceInterface serviceInterface)
isAdministrationInterface
in class Source<ITableSourceField>
serviceInterface
- the service interface.protected String getDefaultProviderClass() throws PortalException
TabularSource
getDefaultProviderClass
in class TableSource
PortalException
public WorkflowConfig getWorkflowConfig() throws PortalException
PortalException
public boolean isWorkflowSupported() throws PortalException
PortalException
public boolean isPublishAllAccessibleContents()
protected ITableSourceField createSourceField(Node fieldNode) throws PortalException
Source
createSourceField
in class TableSource
fieldNode
- the field node.PortalException
Source.createCustomSourceField(Node)
public Collection<String> getHyperlinkDefaultParameters()
Source
getHyperlinkDefaultParameters
in class TabularSource<ITableSourceField>
public MetaDataSourceField getField(MetaDataSourceField.Type type)
type
- @Deprecated protected String getDefaultSourceSearchContentFillerClassName()
getDefaultBigDataPersister()
instead.TabularSource
The default value defined in this class is lumis.doui.search.DouiTabularSourceSearchContentFiller.
getDefaultSourceSearchContentFillerClassName
in class TabularSource<ITableSourceField>
protected ITableSourceFilter createDefaultFilterInstance()
Source
filter
nodes.createDefaultFilterInstance
in class TableSource
public IContentTableSourceBigDataPersister getBigDataPersister()
Source
getBigDataPersister
in class Source<ITableSourceField>
protected IContentTableSourceBigDataPersister getDefaultBigDataPersister()
Source
This method is called by Source.getBigDataPersister()
when the default is to be used.
getDefaultBigDataPersister
in class TableSource
protected QueryBuilder createQueryBuilder(IParameters parameters) throws PortalException
TableSource
createQueryBuilder
in class TableSource
parameters
- the parameters to be used by the query builder.PortalException
public void scheduleIndexData(Collection<String> itemIds) throws PortalException
Note that differently from Source
's implementation, ContentTableSource
does not call this method
by its standard operations that add/update/delete data, since it is expected to content JPA trigger data
indexing.
scheduleIndexData
in class Source<ITableSourceField>
itemIds
- the item identifiers.PortalException
public IContentTableSourceAddDataResult addData(Object data) throws PortalException
The implementation of this method in Source
does the following:
doAddData(IParameters)
, method to be implemented by sources that supports this operation.Sends the render data changed
notification
.scheduleContentAddedEvent(ContentVersion)
to add a content added event in monitoring framework
(in the default implementation, the event will only be added if the source context's transaction is correctly
commited).
Differently from Source
default implementation, for optimization reasons, ContentTableSource
assumes that doAddData(IParameters)
will already schedule the index of the data, so this method does not call
scheduleIndexData(Collection)
.
Special parameters that may be set on data for ContentTableSource
:
TRANSITION_PARAMETER_NAME
: optional parameter that may be set with the identifier of the workflow
transition to perform during this add operation.ASSIGNED_TO_PARAMETER_NAME
: optional parameter that may be set with the identifier of the principal
to be set as workflow's assigned to.language field identifier
>.languageId
: optional
String
parameter specifying the locale to set for the content being added. This parameter is for
backwards compatibility, as the locale may also be set using a parameter with name equals to the language field
identifier (which accepts String
and Locale
values). If no locale is specified in any of these
parameters, the current SessionConfig
's locale will be used.language field identifier
>.contentId
: optional
parameter that when set with the identifier of a Content
, indicates that the ContentLocale
being
added is to belong to that Content
.language field identifier
>.isDefaultLocale
: optional
parameter that when set to true
indicates the content's default locale
is to be set to the locale of the data being added.publish to principals
field identifier: optional
parameters that may be a string with comma-separated identifiers or a Collection
of identifiers. Default
value is everyone group.publish to service instances
field identifier:
optional parameters that may be a string with comma-separated identifiers or a Collection
of identifiers.
Default value is this source's service instance.addData
in class Source<ITableSourceField>
data
- the acceptable types of data object depends on the source implementation. The default Source
implementation expects an object compatible with IParameters.asParameters(Object)
.PortalException
protected void scheduleContentAddedEvent(ContentVersion contentVersion) throws PortalException
contentVersion
- the content version.PortalException
protected IContentTableSourceAddDataResult doAddData(IParameters data) throws PortalException
This method is called by addData(Object)
.
ContentTableSource
expects this method to automatically schedule the content indexing, if required. This
is usually automatically triggered by content JPA entities.
doAddData
in class TableSource
data
- the data given to Source.addData(Object)
, converted to IParameters
if necessary.Source.addData(Object)
.PortalException
public IContentTableSourceUpdateDataResult updateData(Object data) throws PortalException
updateData(data, LockStrategy.CHECK_AND_RELEASE_AUTOMATIC_ON_COMMIT)
.updateData
in class Source<ITableSourceField>
data
- the acceptable types of data object depends on the source implementation. The default Source
implementation expects an object compatible with IParameters.asParameters(Object)
.PortalException
updateData(Object, LockStrategy)
public IContentTableSourceUpdateDataResult updateData(Object data, ContentTableSource.LockStrategy lockStrategy) throws PortalException
The implementation of this method in ContentTableSource
does the following:
lockStrategy
.doUpdateData(IParameters)
.Sends the render data changed
notification
.
Accepts the same special parameters available in addData(Object)
.
data
- the data to be updated. Expects an object compatible with IParameters.asParameters(Object)
.lockStrategy
- how content lock state is to be handled.ContentLockedException
- if update operation could not be executed because the content is locked by another
user.PortalException
protected String getUpdateDataItemId(IParameters data)
getUpdateDataItemId
in class Source<ITableSourceField>
data
- the data.protected IContentTableSourceUpdateDataResult doUpdateData(IParameters data) throws PortalException
This method is called by updateData(Object, LockStrategy)
.
If the source has versioning, this method calls Source.preAddFieldData(SourcePreAddDataEvent)
. Otherwise it
calls Source.preUpdateFieldData(SourcePreUpdateDataEvent)
.
ContentTableSource
expects this method to automatically schedule the content indexing, if required. This
is usually automatically triggered by content JPA entities.
doUpdateData
in class TableSource
data
- the data argument given to updateData(Object, LockStrategy)
, converted to
IParameters
if necessary.updateData(Object, LockStrategy)
.PortalException
protected Collection<IPortalEvent> createRenderDataChangedEvent(PortalEventOperationType operationType, Collection<String> itemIds) throws PortalException
Source
Source.sendRenderDataChangedNotification(PortalEventOperationType, Collection)
.createRenderDataChangedEvent
in class Source<ITableSourceField>
operationType
- the operation type for the notification.itemIds
- the item identifiers.null
to nothing be sent.PortalException
public void deleteDataByItemIds(Collection<String> itemIds) throws PortalException
deleteDataByItemIds(Collection, LockStrategy)
using same lock strategy of current operation if
this delete is cascaded from another content, or with lock strategy of
ContentTableSource.LockStrategy.CHECK_AND_RELEASE_AUTOMATIC_ON_COMMIT
otherwise.deleteDataByItemIds
in class Source<ITableSourceField>
itemIds
- the item identifiers of data to be deleted.PortalException
deleteDataByItemIds(Collection, LockStrategy)
public void deleteDataByItemIds(Collection<String> itemIds, ContentTableSource.LockStrategy lockStrategy) throws PortalException
The implementation of this method in ContentTableSource
does the following:
lockStrategy
.Sends the render data changed
notification
.#preDeleteFieldData(ISourcePreDeleteDataEvent)
on a source instance created from the source
definition at service level.doDeleteDataByItemIds(Collection)
.itemIds
- the item identifiers of data to be deleted.lockStrategy
- how content lock state is to be handled.PortalException
protected void doDeleteDataByItemIds(Collection<String> itemIds) throws PortalException
This method is called by deleteDataByItemIds(Collection, LockStrategy)
.
The implementation of this method does the following:
preDeleteDataByItemIds(Collection)
.deleteVersionDataByItemIds(Collection)
.postDeleteDataByItemIds(Collection)
.
ContentTableSource
expects this method to automatically schedule the delete of the related indexed data.
This is usually automatically triggered by content JPA entities.
doDeleteDataByItemIds
in class TableSource
itemIds
- the item identifiers of data to be deleted.PortalException
deleteDataByItemIds(Collection, LockStrategy)
protected void preDeleteDataByItemIds(Collection<String> itemIds) throws PortalException
It is called by doDeleteDataByItemIds(Collection)
and by special operations that deletes versions
without deleting the whole ContentLocale
.
This method calls Source.sendPreDeleteDataNotification(SourcePreDeleteDataEvent)
and
Source.preDeleteFieldData(SourcePreDeleteDataEvent)
.
itemIds
- the item identifiers being deleted.PortalException
protected void postDeleteDataByItemIds(Collection<String> itemIds) throws PortalException
It is called by doDeleteDataByItemIds(Collection)
and by special operations that deletes versions
without deleting the whole ContentLocale
.
This method calls Source.sendPostDeleteDataNotification(SourcePostDeleteDataEvent)
and
Source.postDeleteFieldData(SourcePostDeleteDataEvent)
.
itemIds
- the item identifiers being deleted.PortalException
protected void deleteVersionDataByItemIds(Collection<String> itemIds) throws PortalException
It is called by doDeleteDataByItemIds(Collection)
and by special operations that deletes versions
without deleting the whole ContentLocale
.
itemIds
- the item identifiers.PortalException
LumisXP 12.5.0.200928 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.