Class DefaultCMSContenSlotDao

    • Field Detail

      • CATALOG_VERSIONS_QUERY_PARAM

        protected static final java.lang.String CATALOG_VERSIONS_QUERY_PARAM
        See Also:
        Constant Field Values
      • CONTENT_SLOT_UIDS_QUERY_PARAM

        protected static final java.lang.String CONTENT_SLOT_UIDS_QUERY_PARAM
        See Also:
        Constant Field Values
      • QUERY_CONTENT_SLOT

        protected static final java.lang.String QUERY_CONTENT_SLOT
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultCMSContenSlotDao

        public DefaultCMSContenSlotDao()
    • Method Detail

      • findPagesByContentSlot

        public java.util.Collection<AbstractPageModel> findPagesByContentSlot​(ContentSlotModel contentSlot)
        Find pages related to content slot.
        Specified by:
        findPagesByContentSlot in interface CMSContentSlotDao
        Parameters:
        contentSlot - the ContentSlotModel object for which pages will be obtained.
        Returns:
        the collection of AbstractPageModel objects related to ContentSlotModel object or empty list when not found.
      • findAllContentSlotRelationsByPageTemplate

        public java.util.List<ContentSlotForTemplateModel> findAllContentSlotRelationsByPageTemplate​(PageTemplateModel template)
        Find all content slot relations by page template. Note: it will return all content slot relations from all catalog versions if the multicountry is used.
        Specified by:
        findAllContentSlotRelationsByPageTemplate in interface CMSContentSlotDao
        Parameters:
        template - the page template
        Returns:
        the list of found ContentSlotForTemplateModel objects or empty list when not found.
      • findContentSlotRelationsByPageTemplateAndCatalogVersions

        public java.util.List<ContentSlotForTemplateModel> findContentSlotRelationsByPageTemplateAndCatalogVersions​(PageTemplateModel template,
                                                                                                                    java.util.Collection<CatalogVersionModel> catalogVersions)
        Description copied from interface: CMSContentSlotDao
        Find content slot relations by page template and catalog versions. This method supports multicountry because it's possible to provide a hierarchy of multicountry catalog versions.
        Specified by:
        findContentSlotRelationsByPageTemplateAndCatalogVersions in interface CMSContentSlotDao
        Parameters:
        template - the page template
        catalogVersions - the catalog versions
        Returns:
        the list of found ContentSlotForTemplateModel objects or empty list when not found
      • findContentSlotRelationsByPageTemplateAndCatalogVersionsAndContentSlot

        public java.util.List<ContentSlotForTemplateModel> findContentSlotRelationsByPageTemplateAndCatalogVersionsAndContentSlot​(PageTemplateModel template,
                                                                                                                                  ContentSlotModel contentSlot,
                                                                                                                                  java.util.Collection<CatalogVersionModel> catalogVersions)
        Description copied from interface: CMSContentSlotDao
        Finds content slot relations by page template, catalog versions and content slot. This method supports multicountry because it's possible to provide a hierarchy of multicountry catalog versions.
        Specified by:
        findContentSlotRelationsByPageTemplateAndCatalogVersionsAndContentSlot in interface CMSContentSlotDao
        Parameters:
        template - the template associated with a content catalog through relation
        contentSlot - the content slot associated with a template through relation
        catalogVersions - the list of catalog versions to search in
        Returns:
        the list of found ContentSlotForTemplateModel objects or empty list when not found
      • findAllContentSlotRelationsByPageUid

        public java.util.List<ContentSlotForPageModel> findAllContentSlotRelationsByPageUid​(java.lang.String pageUid,
                                                                                            CatalogVersionModel catalogVersion)
        Find all content slot relations for page uid and catalog version.
        Specified by:
        findAllContentSlotRelationsByPageUid in interface CMSContentSlotDao
        Parameters:
        pageUid - the page uid
        catalogVersion - the catalog versions
        Returns:
        the list of found ContentSlotForPageModel objects or empty list when not found
      • findOnlyContentSlotRelationsByContentSlot

        public java.util.Collection<CMSRelationModel> findOnlyContentSlotRelationsByContentSlot​(ContentSlotModel contentSlot)
        Find only content slot relations not content slot template relations of given content slot. The difference with findAllContentSlotRelationsByContentSlot: it does not search on the page's template for given contentSlot
        Specified by:
        findOnlyContentSlotRelationsByContentSlot in interface CMSContentSlotDao
        Parameters:
        contentSlot - the content slot
        Returns:
        the collection of found CMSRelationModel objects or empty collection when not found
      • findContentSlotsByIdAndCatalogVersions

        public java.util.List<ContentSlotModel> findContentSlotsByIdAndCatalogVersions​(java.lang.String id,
                                                                                       java.util.Collection<CatalogVersionModel> catalogVersions)
        Find content slots by id and catalog versions.
        Specified by:
        findContentSlotsByIdAndCatalogVersions in interface CMSContentSlotDao
        Parameters:
        id - the id of ContentSlotModel object to find
        catalogVersions - the catalog versions
        Returns:
        the list of found ContentSlotModel objects or empty list when not found
      • findContentSlotsByIdAndCatalogVersions

        public java.util.List<ContentSlotModel> findContentSlotsByIdAndCatalogVersions​(java.util.List<java.lang.String> slotIds,
                                                                                       java.util.Collection<CatalogVersionModel> catalogVersions)
        Description copied from interface: CMSContentSlotDao
        Find content slots by ids and catalog versions.
        Specified by:
        findContentSlotsByIdAndCatalogVersions in interface CMSContentSlotDao
        Parameters:
        slotIds - the list of IDs of the ContentSlotModel objects to find
        catalogVersions - the catalog versions
        Returns:
        the list of ContentSlotModel objects found
      • findContentSlotsById

        public java.util.List<ContentSlotModel> findContentSlotsById​(java.lang.String id)
        Find content slots by id.
        Specified by:
        findContentSlotsById in interface CMSContentSlotDao
        Parameters:
        id - the id of ContentSlotModel object to find
        Returns:
        the list of found ContentSlotModel objects or empty list when not found
      • findContentSlotRelationsByPageAndContentSlot

        public java.util.List<ContentSlotForPageModel> findContentSlotRelationsByPageAndContentSlot​(AbstractPageModel page,
                                                                                                    ContentSlotModel contentSlot,
                                                                                                    java.util.Collection<CatalogVersionModel> catalogVersions)
        Find content slot relations by page, content slot and catalog versions. This method supports multicountry cause it's possible to provide a hierarchy of multicountry catalog versions.
        Specified by:
        findContentSlotRelationsByPageAndContentSlot in interface CMSContentSlotDao
        Parameters:
        page - the page
        contentSlot - the content slot
        catalogVersions - the catalog versions
        Returns:
        the list of found ContentSlotForPageModel objects or empty list when not found
      • findContentSlotRelationsByPageAndPosition

        public java.util.List<ContentSlotForPageModel> findContentSlotRelationsByPageAndPosition​(AbstractPageModel page,
                                                                                                 java.lang.String position,
                                                                                                 java.util.Collection<CatalogVersionModel> catalogVersions)
        Find content slot relations by page, position and catalog versions.
        Specified by:
        findContentSlotRelationsByPageAndPosition in interface CMSContentSlotDao
        Parameters:
        page - the page
        position - the position
        catalogVersions - the catalog versions
        Returns:
        the list of found ContentSlotForPageModel objects or empty list when not found
      • findAllMultiCountryContentSlotsByOriginalSlots

        @Deprecated(since="2105",
                    forRemoval=true)
        public java.util.List<ContentSlotModel> findAllMultiCountryContentSlotsByOriginalSlots​(java.util.List<ContentSlotModel> contentSlots,
                                                                                               java.util.List<CatalogVersionModel> catalogVersions)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 2105, no longer needed.
        Description copied from interface: CMSContentSlotDao
        Find the content slots and their catalog hierarchy for the given content slots and catalog versions (used for multi-country)
        Specified by:
        findAllMultiCountryContentSlotsByOriginalSlots in interface CMSContentSlotDao
        Parameters:
        contentSlots - the content slots
        catalogVersions - the catalog versions
        Returns:
        the list of ContentSlotModel objects or empty list when none found
      • findAllMultiCountryContentSlotsByOriginalSlots

        public java.util.List<ContentSlotModel> findAllMultiCountryContentSlotsByOriginalSlots​(java.util.List<ContentSlotModel> contentSlots,
                                                                                               java.util.List<CatalogVersionModel> catalogVersions,
                                                                                               AbstractPageModel page)
        Description copied from interface: CMSContentSlotDao
        Find the content slots and their catalog hierarchy for the given content slots, catalog versions and the page. The page is used so the result list contains only those content slots that belong to a page or it's template. For example consider the following: 0. Before homepageUk contains: # pageId: "homepage-uk" # position: "TopHeaderSlot" # slotId: "TopHeaderSlot" # slotShared: true # slotStatus: "TEMPLATE" 1. Clone the homepageUk page 2. Unshare the slot on homepageUk. Make it custom (only for this page) # pageId: "homepage-uk" # position: "TopHeaderSlot" # slotId: "TopHeaderSlotUK" # slotShared: false # slotStatus: "OVERRIDE" 3. On cloned page slot must not exists, but it exists. Should be as in step 0. To fix such situation the page attribute is used in the method. # pageId: "homepage-uk-clone" # position: "TopHeaderSlot" # slotId: "TopHeaderSlotUK" <-- wrong slot name # slotShared: true # slotStatus: "TEMPLATE"
        Specified by:
        findAllMultiCountryContentSlotsByOriginalSlots in interface CMSContentSlotDao
        Parameters:
        contentSlots - the content slots
        catalogVersions - the catalog versions
        page - the page
        Returns:
        the list of ContentSlotModel objects or empty list when none found