Class 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: 24013 $ $Date: 2020-08-10 11:36:01 -0300 (Mon, 10 Aug 2020) $
    • 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
      • 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
    • 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

      • getNewDataLocale

        protected Locale getNewDataLocale​(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 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​(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