Package lumis.content.table
Class ContentMetaDataController
- java.lang.Object
-
- lumis.content.table.ContentMetaDataController
-
- Direct Known Subclasses:
LegacyContentMetaDataController
public class ContentMetaDataController extends Object
This class handles all related to meta data on the select, insert, update and delete operations. While performing a select it includes on the query (gathering it from the appropriate table) all meta data information that shall be used. While performing an insert, update or delete it is responsible for all meta data manipulating, including adding/updating/removing publishing information, publishing to multiple instances, publishing to principals, comments, versioning, multi-language and tags.- Since:
- 4.2.0
- Version:
- $Revision: 24878 $ $Date: 2022-03-15 01:44:27 -0300 (Tue, 15 Mar 2022) $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ContentMetaDataController.MetaDataPersistenceResult
Stores the result of updating or adding a content.
-
Field Summary
Fields Modifier and Type Field Description static String
CONTENT_ID_ATTRIBUTE
Attribute name used by default content process action handlers to store the content identifier of the data added or updated.static String
CONTENT_VERSION_ID_ATTRIBUTE
Attribute name used by default content process action handlers to store the content version identifier of the data added or updated.static String
CONTENTID_PARAMETER_SUFIX
static String
DOUI_EDITING_VERSION_PARAMETER_NAME
Doui editing version parameter name.static String
IS_DEFAULT_LOCALE_PARAMETER_SUFIX
static String
LANGUAGE_ID_PARAMETER_SUFIX
protected String
languageParameterPrefix
static String
NEW_VERSION_PRIMARY_KEY_PARAMETER
protected IParameters
parameters
protected ContentTableSource
source
protected ITransaction
transaction
-
Constructor Summary
Constructors Constructor Description ContentMetaDataController(IParameters parameters, ContentTableSource source, ITransaction transaction)
Creates a new controller for the specified source and parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
contentDeleted(Collection<String> itemIds)
Delete meta data associated to the deleted contents.ContentMetaDataController.MetaDataPersistenceResult
contentInserted(String primaryKey)
Handles meta data manipulating necessary after inserting a content.ContentMetaDataController.MetaDataPersistenceResult
contentUpdated(String originalItemId, String newVersionItemId)
Do the necessary changes in a content's metadata due to its update.protected ContentVersion
getActiveVersionEquivalentOfItemId(String itemId)
Returnsactive version
based on givenitem id
.protected String
getNewDataContentId()
Returns the identifier of the content to use for new data.protected boolean
getNewDataDefaultLocale()
Returns whether the new data should be the default locale.protected Locale
getNewDataLocale(Locale defaultLocale)
Returns the newLocale
value to use for new data.protected boolean
hasNewDataContentId()
Returns whether the identifier of the content to use for new data was set.protected boolean
hasNewDataDefaultLocale()
Returns whether the default locale value was set in parameters.protected ContentVersion
insertMetaData(String primaryKey)
Creates the meta data information for a new content.void
selectMetaData(QuerySelect querySelect)
Modifies querySelect so it will include all necessary meta data information and restrictions filtering, such as service instance isolation, publishing to principals filtering, active version filtering and special treatment when on preview or details interface.protected ContentVersion
updateMetaData(String originalItemId, String newVersionItemId)
Updates the content's metadata.
-
-
-
Field Detail
-
DOUI_EDITING_VERSION_PARAMETER_NAME
public static final String DOUI_EDITING_VERSION_PARAMETER_NAME
Doui editing version parameter name.- Since:
- 6.0.0
- See Also:
- Constant Field Values
-
LANGUAGE_ID_PARAMETER_SUFIX
public static final String LANGUAGE_ID_PARAMETER_SUFIX
- See Also:
- Constant Field Values
-
CONTENTID_PARAMETER_SUFIX
public static final String CONTENTID_PARAMETER_SUFIX
- See Also:
- Constant Field Values
-
IS_DEFAULT_LOCALE_PARAMETER_SUFIX
public static final String IS_DEFAULT_LOCALE_PARAMETER_SUFIX
- See Also:
- Constant Field Values
-
NEW_VERSION_PRIMARY_KEY_PARAMETER
public static final String NEW_VERSION_PRIMARY_KEY_PARAMETER
- See Also:
- Constant Field Values
-
CONTENT_VERSION_ID_ATTRIBUTE
public static final String CONTENT_VERSION_ID_ATTRIBUTE
Attribute name used by default content process action handlers to store the content version identifier of the data added or updated.- Since:
- 4.2.0
- See Also:
- Constant Field Values
-
CONTENT_ID_ATTRIBUTE
public static final String CONTENT_ID_ATTRIBUTE
Attribute name used by default content process action handlers to store the content identifier of the data added or updated.- Since:
- 4.2.0
- See Also:
- Constant Field Values
-
languageParameterPrefix
protected final String languageParameterPrefix
-
source
protected final ContentTableSource source
-
parameters
protected final IParameters parameters
-
transaction
protected final ITransaction transaction
-
-
Constructor Detail
-
ContentMetaDataController
public ContentMetaDataController(IParameters parameters, ContentTableSource source, ITransaction transaction) throws PortalException
Creates a new controller for the specified source and parameters.- Parameters:
parameters
- the parameters for the operation to be performed.source
- the source where the operation is being performed.transaction
- the transaction for persistence access.- Throws:
PortalException
- Since:
- 10.4.0
-
-
Method Detail
-
contentInserted
public ContentMetaDataController.MetaDataPersistenceResult contentInserted(String primaryKey) throws PortalException
Handles meta data manipulating necessary after inserting a content.- Parameters:
primaryKey
- the content's primary key.- Throws:
PortalException
-
insertMetaData
protected ContentVersion insertMetaData(String primaryKey) throws PortalException
Creates the meta data information for a new content.- Parameters:
primaryKey
- the content's primary key.- Throws:
PortalException
-
getNewDataLocale
protected Locale getNewDataLocale(Locale defaultLocale) throws PortalException
Returns the newLocale
value to use for new data.- Parameters:
defaultLocale
- the default locale value to return if no locale was specified in parameters.- Returns:
- the locale value to use.
- Throws:
PortalException
- Since:
- 10.4.0
-
getNewDataContentId
protected String getNewDataContentId()
Returns the identifier of the content to use for new data. UsehasNewDataContentId()
to differ a explicitnull
value from non-existent value.- Returns:
- the content identifier.
- Since:
- 10.4.0
- See Also:
hasNewDataContentId()
-
hasNewDataContentId
protected boolean hasNewDataContentId()
Returns whether the identifier of the content to use for new data was set.- Returns:
true
if it was set,false
otherwise.- Since:
- 10.4.0
-
getNewDataDefaultLocale
protected boolean getNewDataDefaultLocale()
Returns whether the new data should be the default locale.Use
hasNewDataDefaultLocale()
to check if default locale value was set in parameters.- Returns:
true
if new data is to be the default locale,false
otherwise.- Since:
- 10.4.0
- See Also:
hasNewDataDefaultLocale()
-
hasNewDataDefaultLocale
protected boolean hasNewDataDefaultLocale()
Returns whether the default locale value was set in parameters.- Returns:
true
if it was set,false
otherwise.- Since:
- 10.4.0
-
contentUpdated
public ContentMetaDataController.MetaDataPersistenceResult contentUpdated(String originalItemId, String newVersionItemId) throws PortalException
Do the necessary changes in a content's metadata due to its update.- Parameters:
originalItemId
- the item identifier of the item that is being updated.newVersionItemId
- the item identifier of the item after the update. This is only used for contents with versioning and will be the item identifier for the version added for the update.- Throws:
PortalException
- Since:
- 10.4.0
-
updateMetaData
protected ContentVersion updateMetaData(String originalItemId, String newVersionItemId) throws PortalException
Updates the content's metadata.- Parameters:
originalItemId
- the item identifier of the item that is being updated.newVersionItemId
- the item identifier of the item after the update. This is only used for contents with versioning and will be the item identifier for the version added for the update.- Returns:
- the updated content version.
- Throws:
PortalException
- Since:
- 10.4.0
-
contentDeleted
public void contentDeleted(Collection<String> itemIds) throws PortalException
Delete meta data associated to the deleted contents.- Parameters:
itemIds
- the identifiers of the items being deleted.- Throws:
PortalException
- Since:
- 10.4.0
-
selectMetaData
public void selectMetaData(QuerySelect querySelect) throws PortalException
Modifies querySelect so it will include all necessary meta data information and restrictions filtering, such as service instance isolation, publishing to principals filtering, active version filtering and special treatment when on preview or details interface.- Parameters:
querySelect
-- Throws:
PortalException
-
getActiveVersionEquivalentOfItemId
protected ContentVersion getActiveVersionEquivalentOfItemId(String itemId) throws PortalException
Returnsactive version
based on givenitem id
.- Parameters:
itemId
- theitem id
.- Returns:
- the active version of the content locale that contains a version with the given item id.
- Throws:
PortalException
- Since:
- 10.4.0
-
-