Package lumis.content.table
Class ContentMetaDataController
- java.lang.Object
-
- lumis.content.table.ContentMetaDataController
-
- Direct Known Subclasses:
LegacyContentMetaDataController
public class ContentMetaDataController extends java.lang.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$ $Date$
-
-
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 java.lang.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 java.lang.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 java.lang.String
CONTENTID_PARAMETER_SUFIX
static java.lang.String
DOUI_EDITING_VERSION_PARAMETER_NAME
Doui editing version parameter name.static java.lang.String
IS_DEFAULT_LOCALE_PARAMETER_SUFIX
static java.lang.String
LANGUAGE_ID_PARAMETER_SUFIX
protected java.lang.String
languageParameterPrefix
static java.lang.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(java.util.Collection<java.lang.String> itemIds)
Delete meta data associated to the deleted contents.ContentMetaDataController.MetaDataPersistenceResult
contentInserted(java.lang.String primaryKey)
Handles meta data manipulating necessary after inserting a content.ContentMetaDataController.MetaDataPersistenceResult
contentUpdated(java.lang.String originalItemId, java.lang.String newVersionItemId)
Do the necessary changes in a content's metadata due to its update.protected ContentVersion
getActiveVersionEquivalentOfItemId(java.lang.String itemId)
Returnsactive version
based on givenitem id
.protected java.lang.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 java.util.Locale
getNewDataLocale(java.util.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(java.lang.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(java.lang.String originalItemId, java.lang.String newVersionItemId)
Updates the content's metadata.
-
-
-
Field Detail
-
DOUI_EDITING_VERSION_PARAMETER_NAME
public static final java.lang.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 java.lang.String LANGUAGE_ID_PARAMETER_SUFIX
- See Also:
- Constant Field Values
-
CONTENTID_PARAMETER_SUFIX
public static final java.lang.String CONTENTID_PARAMETER_SUFIX
- See Also:
- Constant Field Values
-
IS_DEFAULT_LOCALE_PARAMETER_SUFIX
public static final java.lang.String IS_DEFAULT_LOCALE_PARAMETER_SUFIX
- See Also:
- Constant Field Values
-
NEW_VERSION_PRIMARY_KEY_PARAMETER
public static final java.lang.String NEW_VERSION_PRIMARY_KEY_PARAMETER
- See Also:
- Constant Field Values
-
CONTENT_VERSION_ID_ATTRIBUTE
public static final java.lang.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 java.lang.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 java.lang.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(java.lang.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(java.lang.String primaryKey) throws PortalException
Creates the meta data information for a new content.- Parameters:
primaryKey
- the content's primary key.- Throws:
PortalException
-
getNewDataLocale
protected java.util.Locale getNewDataLocale(java.util.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 java.lang.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(java.lang.String originalItemId, java.lang.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(java.lang.String originalItemId, java.lang.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(java.util.Collection<java.lang.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(java.lang.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
-
-