Class DefaultCMSComponentDao
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
-
- de.hybris.platform.cms2.servicelayer.daos.impl.AbstractCMSItemDao
-
- de.hybris.platform.cms2.servicelayer.daos.impl.DefaultCMSComponentDao
-
- All Implemented Interfaces:
CMSComponentDao
,Dao
- Direct Known Subclasses:
DefaultMarketplaceCMSComponentDao
public class DefaultCMSComponentDao extends AbstractCMSItemDao implements CMSComponentDao
Default implementation ofCMSComponentDao
interface.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
CATALOG_VERSIONS_QUERY_PARAM
protected static java.lang.String
QUERY_ALIAS
-
Fields inherited from class de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
flexibleSearchService, modelService
-
-
Constructor Summary
Constructors Constructor Description DefaultCMSComponentDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<AbstractCMSComponentModel>
findAllCMSComponentsByCatalogVersion(CatalogVersionModel catalogVersion)
Find cms components that belong to a given catalog version.<T extends AbstractCMSComponentModel>
SearchPageData<T>findAllCMSComponentsByCatalogVersions(java.util.Collection<CatalogVersionModel> catalogVersions, SearchPageData searchPageData)
Find cms components that belong to a given catalog version.SearchResult<AbstractCMSComponentModel>
findByCatalogVersionAndMask(CatalogVersionModel catalogVersionModel, java.lang.String mask, PageableData pageableData)
For a given mask used as filter and aPageableData
query, will return a page object consisting of the content list of the requested page number and the total number of entities for the given maskjava.util.List<AbstractCMSComponentContainerModel>
findCMSComponentContainersByIdAndCatalogVersion(java.lang.String id, CatalogVersionModel catalogVersion)
Find cms component containers by id and catalog version.java.util.List<AbstractCMSComponentModel>
findCMSComponents(java.lang.String id, java.lang.String contentSlotId, java.util.Collection<CatalogVersionModel> catalogVersions)
Find cms components by id, contentSlotId and catalog versions.java.util.List<AbstractCMSComponentModel>
findCMSComponentsById(java.lang.String id)
Find cms components by id.java.util.List<AbstractCMSComponentModel>
findCMSComponentsByIdAndCatalogVersion(java.lang.String id, CatalogVersionModel catalogVersion)
Find cms components by id and catalog version.java.util.List<AbstractCMSComponentModel>
findCMSComponentsByIdAndCatalogVersions(java.lang.String id, java.util.Collection<CatalogVersionModel> catalogVersions)
Find cms components by id and catalog versions.<T extends AbstractCMSComponentModel>
SearchPageData<T>findCMSComponentsByIdsAndCatalogVersions(java.util.Collection<java.lang.String> ids, java.util.Collection<CatalogVersionModel> catalogVersions, SearchPageData searchPageDataInput)
Find cms components by list of IDs and catalog versions with pagination and sorting.java.util.List<SimpleCMSComponentModel>
findCMSComponentsOfContainerByIdAndCatalogVersion(java.lang.String id, CatalogVersionModel catalogVersion)
Find cms components of container by id and catalog version.long
getComponentReferenceCountOutsidePage(AbstractCMSComponentModel componentModel, AbstractPageModel pageModel)
Finds the number of times the given component is used outside a given page (e.g., other pages or shared slots).protected PaginatedFlexibleSearchService
getPaginatedFlexibleSearchService()
void
setPaginatedFlexibleSearchService(PaginatedFlexibleSearchService paginatedFlexibleSearchService)
-
Methods inherited from class de.hybris.platform.cms2.servicelayer.daos.impl.AbstractCMSItemDao
buildQuery, findSortQuery, getCmsSortQueryDataRegistry, setCmsSortQueryDataRegistry
-
Methods inherited from class de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
getAllSources, getFlexibleSearchService, getModelService, getSource, load, loadAll, search, search, searchUnique, setFlexibleSearchService, setModelService
-
-
-
-
Field Detail
-
CATALOG_VERSIONS_QUERY_PARAM
protected static final java.lang.String CATALOG_VERSIONS_QUERY_PARAM
- See Also:
- Constant Field Values
-
QUERY_ALIAS
protected static final java.lang.String QUERY_ALIAS
- See Also:
- Constant Field Values
-
-
Method Detail
-
findByCatalogVersionAndMask
public SearchResult<AbstractCMSComponentModel> findByCatalogVersionAndMask(CatalogVersionModel catalogVersionModel, java.lang.String mask, PageableData pageableData)
Description copied from interface:CMSComponentDao
For a given mask used as filter and aPageableData
query, will return a page object consisting of the content list of the requested page number and the total number of entities for the given mask- Specified by:
findByCatalogVersionAndMask
in interfaceCMSComponentDao
- Parameters:
catalogVersionModel
- the catalog version to filter onmask
- the string value on which components will be filtered, implementations may choose to filter on the component namepageableData
- thePageableData
object containing the page request details. PageableData may contain a String value for sort, this will be used by a sorting strategy to select the most appropriate query or resort to a default one.- Returns:
- a page object
-
findCMSComponentsOfContainerByIdAndCatalogVersion
public java.util.List<SimpleCMSComponentModel> findCMSComponentsOfContainerByIdAndCatalogVersion(java.lang.String id, CatalogVersionModel catalogVersion)
Find cms components of container by id and catalog version.- Specified by:
findCMSComponentsOfContainerByIdAndCatalogVersion
in interfaceCMSComponentDao
- Parameters:
id
- the id of CMS componentcatalogVersion
- the catalog version- Returns:
- the list of found simple CMS component objects or empty list when not found.
-
findCMSComponentsByIdAndCatalogVersions
public java.util.List<AbstractCMSComponentModel> findCMSComponentsByIdAndCatalogVersions(java.lang.String id, java.util.Collection<CatalogVersionModel> catalogVersions)
Find cms components by id and catalog versions.- Specified by:
findCMSComponentsByIdAndCatalogVersions
in interfaceCMSComponentDao
- Parameters:
id
- the id of CMS componentcatalogVersions
- the collection of catalog versions- Returns:
- the list of found CMS component objects or empty list when not found.
-
findCMSComponentsByIdsAndCatalogVersions
public <T extends AbstractCMSComponentModel> SearchPageData<T> findCMSComponentsByIdsAndCatalogVersions(java.util.Collection<java.lang.String> ids, java.util.Collection<CatalogVersionModel> catalogVersions, SearchPageData searchPageDataInput)
Find cms components by list of IDs and catalog versions with pagination and sorting.- Specified by:
findCMSComponentsByIdsAndCatalogVersions
in interfaceCMSComponentDao
- Type Parameters:
T
- the AbstractCMSComponentModel subclass type- Parameters:
ids
- the collection of ids of CMS componentscatalogVersions
- the collection of catalog versionssearchPageDataInput
- the searchPageData contains requested pagination and sorting information- Returns:
- the list of found CMS component objects in SearchPageData
-
findCMSComponents
public java.util.List<AbstractCMSComponentModel> findCMSComponents(java.lang.String id, java.lang.String contentSlotId, java.util.Collection<CatalogVersionModel> catalogVersions)
Find cms components by id, contentSlotId and catalog versions.- Specified by:
findCMSComponents
in interfaceCMSComponentDao
- Parameters:
id
- the id of CMS component.contentSlotId
- the if of content slotcatalogVersions
- the collection of catalog versions- Returns:
- the list of found CMS component objects or empty list when not found.
-
findCMSComponentsByIdAndCatalogVersion
public java.util.List<AbstractCMSComponentModel> findCMSComponentsByIdAndCatalogVersion(java.lang.String id, CatalogVersionModel catalogVersion)
Find cms components by id and catalog version.- Specified by:
findCMSComponentsByIdAndCatalogVersion
in interfaceCMSComponentDao
- Parameters:
id
- the id of CMS componentcatalogVersion
- the catalog version- Returns:
- the list of found CMS component objects.
-
findCMSComponentsById
public java.util.List<AbstractCMSComponentModel> findCMSComponentsById(java.lang.String id)
Find cms components by id.- Specified by:
findCMSComponentsById
in interfaceCMSComponentDao
- Parameters:
id
- the id of CMS component- Returns:
- the list of found CMS component objects or empty list when not found.
-
findCMSComponentContainersByIdAndCatalogVersion
public java.util.List<AbstractCMSComponentContainerModel> findCMSComponentContainersByIdAndCatalogVersion(java.lang.String id, CatalogVersionModel catalogVersion)
Find cms component containers by id and catalog version.- Specified by:
findCMSComponentContainersByIdAndCatalogVersion
in interfaceCMSComponentDao
- Parameters:
id
- the id of CMS componentcatalogVersion
- the catalog version- Returns:
- the list of found CMS component container objects or empty list when not found.
-
findAllCMSComponentsByCatalogVersion
public java.util.List<AbstractCMSComponentModel> findAllCMSComponentsByCatalogVersion(CatalogVersionModel catalogVersion)
Description copied from interface:CMSComponentDao
Find cms components that belong to a given catalog version.- Specified by:
findAllCMSComponentsByCatalogVersion
in interfaceCMSComponentDao
- Parameters:
catalogVersion
- - the catalog version- Returns:
- the list of cms components belonging to the given catalog version or an empty list.
-
findAllCMSComponentsByCatalogVersions
public <T extends AbstractCMSComponentModel> SearchPageData<T> findAllCMSComponentsByCatalogVersions(java.util.Collection<CatalogVersionModel> catalogVersions, SearchPageData searchPageData)
Description copied from interface:CMSComponentDao
Find cms components that belong to a given catalog version.- Specified by:
findAllCMSComponentsByCatalogVersions
in interfaceCMSComponentDao
- Parameters:
catalogVersions
- - the collection of catalog versionssearchPageData
- - the searchPageData contains requested pagination and sorting information- Returns:
- the list of cms components belonging to the given catalog version and searchPageData; or an empty list.
-
getComponentReferenceCountOutsidePage
public long getComponentReferenceCountOutsidePage(AbstractCMSComponentModel componentModel, AbstractPageModel pageModel)
Description copied from interface:CMSComponentDao
Finds the number of times the given component is used outside a given page (e.g., other pages or shared slots).- Specified by:
getComponentReferenceCountOutsidePage
in interfaceCMSComponentDao
- Parameters:
componentModel
- - The component whose references to count.pageModel
- - The page not to be included in the component references count.- Returns:
- The number of times the given component is used outside the given page.
-
getPaginatedFlexibleSearchService
protected PaginatedFlexibleSearchService getPaginatedFlexibleSearchService()
-
setPaginatedFlexibleSearchService
public void setPaginatedFlexibleSearchService(PaginatedFlexibleSearchService paginatedFlexibleSearchService)
-
-