Class 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$
    • 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
    • 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

      • 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 new Locale 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. Use hasNewDataContentId() to differ a explicit null 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
        Returns active version based on given item id.
        Parameters:
        itemId - the item id.
        Returns:
        the active version of the content locale that contains a version with the given item id.
        Throws:
        PortalException
        Since:
        10.4.0