Class DefaultCMSAdminPageService
java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
de.hybris.platform.cms2.servicelayer.services.admin.impl.AbstractCMSAdminService
de.hybris.platform.cms2.servicelayer.services.admin.impl.DefaultCMSAdminPageService
- All Implemented Interfaces:
CMSAdminPageService,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
public class DefaultCMSAdminPageService
extends AbstractCMSAdminService
implements CMSAdminPageService
Default implementation of the page service.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO -
Field Summary
Fields inherited from class de.hybris.platform.cms2.servicelayer.services.admin.impl.AbstractCMSAdminService
ACTIVECATALOGVERSION, ACTIVESITE, CLONE_CONTEXT, ORIGINAL_ITEM_CONTEXT, RESTORE_CONTEXT, TYPE_CONTEXTFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManagerFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateCategoryPage(String id, String name, String masterTemplateId, boolean isDefault) Creates the category page.createContentPage(String id, String name, String masterTemplateId, String label) Creates the content page.createPage(String composedType, String id, String name, String masterTemplateId) Creates the page.protected AbstractPageModelcreatePageFromType(String composedTypeCode) createProductPage(String id, String name, String masterTemplateId, boolean isDefault) Creates the product page.voiddeletePage(String id) Delete a page from the active catalog versionfindPagesByType(ComposedTypeModel composedType, boolean isDefault) Gets the all default or non-default active pages by page type from the active catalog version.findPagesByTypeAndPageStatuses(ComposedTypeModel composedType, boolean isDefault, List<CmsPageStatus> pageStatuses) Gets the all default or non-default pages by page type from the active catalog version.returns all page templates which are set to active (only of the active catalogVersion)getAllContentPages(Collection<CatalogVersionModel> catalogVersions) Gets the all active content pages.getAllContentPagesForPageStatuses(Collection<CatalogVersionModel> catalogVersions, List<CmsPageStatus> pageStatuses) Gets the all content pages for a given list of page status.Returns all pages which are assigned to the active catalog versiongetAllPages(CatalogVersionModel catalogVersion) Gets the all active pages.getAllPagesByType(String type) Returns all pages which are assigned to the active catalog version and are of the given typegetAllPagesByType(String type, CatalogVersionModel catalogVersion) Gets the all pages by type.getAllPagesForCatalogVersionAndPageStatuses(CatalogVersionModel catalogVersion, List<CmsPageStatus> pageStatuses) Returns all pages which are assigned to the given catalog version and given page statusesreturns all pages of the active catalogVersion.getAllPageTemplates(boolean active) returns all page templates (only of the active catalogVersion)getAllPageTemplates(Collection<CatalogVersionModel> catalogVersions) Gets the all page templates.Returns a collection of all available page types.getAllRestrictedPageTemplates(boolean active, CMSPageTypeModel type) returns all restricted page templates (only of the active catalogVersion)protected CatalogVersionServiceprotected CMSCatalogVersionServiceprotected Comparator<CMSItemModel>protected CMSPageDaoprotected CMSPageTemplateDaogetContentPages(Collection<CatalogVersionModel> catalogVersions, String label) Gets the content pages.getHomepage(CatalogVersionModel catalogVersion) Gets the homepage for a given catalog versiongetHomepage(CMSSiteModel siteModel) Gets the homepage for a given CMS Site.getHomepage(List<CatalogVersionModel> catalogVersions) Gets the homepage for the given catalog versions.getIdenticalPrimaryPageModel(AbstractPageModel pageModel) Returns identical primary page for provided pageModel.getPageForId(String id, Collection<CatalogVersionModel> catalogVersions) Returns the active page with the given id and the catalog versions.protected AbstractPageModelgetPageForId(String uid, Collection<CatalogVersionModel> catalogVersions, List<CmsPageStatus> pageStatuses) Returns the active page with the given id, catalog versions and page statuses.Returns the active page with the given id from the active catalogVersion.getPageForIdFromActiveCatalogVersionByPageStatuses(String id, List<CmsPageStatus> pageStatuses) Returns the page with the given id and page status list from the active catalogVersion.Gets the page template with the give id.getPageTypeByCode(String typeCode) Returns the page type with the given type code.protected PermissionCRUDServiceprotected SessionSearchRestrictionsDisablerprotected TypeServicebooleanpageExists(String id) Checks if a page exists in the active catalog versionvoidsetCatalogVersionService(CatalogVersionService catalogVersionService) voidsetCmsCatalogVersionService(CMSCatalogVersionService cmsCatalogVersionService) voidsetCmsItemCatalogLevelComparator(Comparator<CMSItemModel> cmsItemCatalogLevelComparator) voidsetCmsPageDao(CMSPageDao cmsPageDao) voidsetCmsPageTemplateDao(CMSPageTemplateDao cmsPageTemplateDao) voidsetPermissionCRUDService(PermissionCRUDService permissionCRUDService) voidsetSessionSearchRestrictionsDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionsDisabler) voidsetTypeService(TypeService typeService) voidtrashPage(String pageUid, CatalogVersionModel catalogVersion) Soft deletes a page by updating the pageStatus to DELETED.voidupdatePage(AbstractPageModel page, String name, String masterTemplateId) Updates the given page.Methods inherited from class de.hybris.platform.cms2.servicelayer.services.admin.impl.AbstractCMSAdminService
getActiveCatalogVersion, getActiveSite, getBaseSiteService, getUserService, setBaseSiteService, setUserServiceMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplaceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.cms2.servicelayer.services.admin.CMSAdminPageService
getActiveCatalogVersion
-
Constructor Details
-
DefaultCMSAdminPageService
public DefaultCMSAdminPageService()
-
-
Method Details
-
createCategoryPage
public CategoryPageModel createCategoryPage(String id, String name, String masterTemplateId, boolean isDefault) throws CMSItemCreateException Creates the category page.- Specified by:
createCategoryPagein interfaceCMSAdminPageService- Parameters:
id- the idname- the namemasterTemplateId- the master template idisDefault- the is default- Returns:
- the category page model
- Throws:
CMSItemCreateException- the cMS item create exception
-
createContentPage
public ContentPageModel createContentPage(String id, String name, String masterTemplateId, String label) throws CMSItemCreateException Creates the content page.- Specified by:
createContentPagein interfaceCMSAdminPageService- Parameters:
id- the idname- the namemasterTemplateId- the master template idlabel- the label- Returns:
- the content page model
- Throws:
CMSItemCreateException- the cMS item create exception
-
createPage
public AbstractPageModel createPage(String composedType, String id, String name, String masterTemplateId) throws CMSItemCreateException Creates the page.- Specified by:
createPagein interfaceCMSAdminPageService- Parameters:
composedType- the composed typeid- the idname- the namemasterTemplateId- the master template id- Returns:
- the abstract page model
- Throws:
CMSItemCreateException- the cMS item create exception
-
createProductPage
public ProductPageModel createProductPage(String id, String name, String masterTemplateId, boolean isDefault) throws CMSItemCreateException Creates the product page.- Specified by:
createProductPagein interfaceCMSAdminPageService- Parameters:
id- the idname- the namemasterTemplateId- the master template idisDefault- the is default- Returns:
- the product page model
- Throws:
CMSItemCreateException- the cMS item create exception
-
deletePage
Delete a page from the active catalog version- Specified by:
deletePagein interfaceCMSAdminPageService- Parameters:
id- page id- Throws:
CMSItemNotFoundException- if no page with the give id is found
-
getAllActivePageTemplates
returns all page templates which are set to active (only of the active catalogVersion)- Specified by:
getAllActivePageTemplatesin interfaceCMSAdminPageService- Returns:
- all page templates
-
getAllContentPages
public Collection<ContentPageModel> getAllContentPages(Collection<CatalogVersionModel> catalogVersions) Gets the all active content pages.- Specified by:
getAllContentPagesin interfaceCMSAdminPageService- Parameters:
catalogVersions- the catalog versions- Returns:
- the all content pages
-
getAllContentPagesForPageStatuses
public Collection<ContentPageModel> getAllContentPagesForPageStatuses(Collection<CatalogVersionModel> catalogVersions, List<CmsPageStatus> pageStatuses) Gets the all content pages for a given list of page status.Pages will be sorted in reversed order of the multicountry hierarchy. Pages defined in the lowest catalog (e.g. local catalog) level will be the first ones in the result list. Therefore, pages defined in the top level catalog (e.g. global catalog) will be last in the result list.
- Specified by:
getAllContentPagesForPageStatusesin interfaceCMSAdminPageService- Parameters:
catalogVersions- the catalog versionspageStatuses- a list of page status- Returns:
- the all content pages
-
getAllPageTypes
Description copied from interface:CMSAdminPageServiceReturns a collection of all available page types.- Specified by:
getAllPageTypesin interfaceCMSAdminPageService- Returns:
- all page types
-
getPageTypeByCode
Description copied from interface:CMSAdminPageServiceReturns the page type with the given type code.- Specified by:
getPageTypeByCodein interfaceCMSAdminPageService- Parameters:
typeCode- the type code of the page type to retrieve- Returns:
- the page type matching the given type code
-
getAllPages
Returns all pages which are assigned to the active catalog version- Specified by:
getAllPagesin interfaceCMSAdminPageService- Returns:
- all pages which are assigned to the active catalog version
-
getAllPages
Gets the all active pages.- Specified by:
getAllPagesin interfaceCMSAdminPageService- Parameters:
catalogVersion- the catalog version- Returns:
- the all pages
-
getAllPagesForCatalogVersionAndPageStatuses
public Collection<AbstractPageModel> getAllPagesForCatalogVersionAndPageStatuses(CatalogVersionModel catalogVersion, List<CmsPageStatus> pageStatuses) Returns all pages which are assigned to the given catalog version and given page statuses- Specified by:
getAllPagesForCatalogVersionAndPageStatusesin interfaceCMSAdminPageService- Parameters:
catalogVersion- the catalog version modelpageStatuses- a list of page statuses- Returns:
- all pages which are assigned to the given catalog version with the given page status
-
getAllPagesByType
Returns all pages which are assigned to the active catalog version and are of the given type- Specified by:
getAllPagesByTypein interfaceCMSAdminPageService- Parameters:
type- should be a sub-type of AbstractPage- Returns:
- all pages which are assigned to the active catalog version and are of the given type
-
getAllPagesByType
public Collection<AbstractPageModel> getAllPagesByType(String type, CatalogVersionModel catalogVersion) Gets the all pages by type.- Specified by:
getAllPagesByTypein interfaceCMSAdminPageService- Parameters:
type- the typecatalogVersion- the catalog version- Returns:
- the all pages by type
-
getAllPagesMap
returns all pages of the active catalogVersion. The pages are grouped by its type- Specified by:
getAllPagesMapin interfaceCMSAdminPageService- Returns:
- returns all pages of the active catalogVersion. The pages are grouped by its type
-
getAllPageTemplates
returns all page templates (only of the active catalogVersion)- Specified by:
getAllPageTemplatesin interfaceCMSAdminPageService- Parameters:
active- if set to true only page templates are returned which are set as active- Returns:
- all page templates
-
getAllPageTemplates
public Collection<PageTemplateModel> getAllPageTemplates(Collection<CatalogVersionModel> catalogVersions) Gets the all page templates.- Specified by:
getAllPageTemplatesin interfaceCMSAdminPageService- Parameters:
catalogVersions- the catalog versions- Returns:
- the all page templates
-
getAllRestrictedPageTemplates
public Collection<PageTemplateModel> getAllRestrictedPageTemplates(boolean active, CMSPageTypeModel type) returns all restricted page templates (only of the active catalogVersion)- Specified by:
getAllRestrictedPageTemplatesin interfaceCMSAdminPageService- Parameters:
active- if set to true only page templates are returned which are set as activetype- the page type to which the page template will be restricted- Returns:
- all restricted page templates
-
getContentPages
public Collection<ContentPageModel> getContentPages(Collection<CatalogVersionModel> catalogVersions, String label) Gets the content pages.- Specified by:
getContentPagesin interfaceCMSAdminPageService- Parameters:
catalogVersions- the catalog versionslabel- the label- Returns:
- the content pages
-
getPageForIdFromActiveCatalogVersion
Returns the active page with the given id from the active catalogVersion.- Specified by:
getPageForIdFromActiveCatalogVersionin interfaceCMSAdminPageService- Parameters:
id- the id of the page- Returns:
- the page for id
-
getPageForIdFromActiveCatalogVersionByPageStatuses
public AbstractPageModel getPageForIdFromActiveCatalogVersionByPageStatuses(String id, List<CmsPageStatus> pageStatuses) Returns the page with the given id and page status list from the active catalogVersion.- Specified by:
getPageForIdFromActiveCatalogVersionByPageStatusesin interfaceCMSAdminPageService- Parameters:
id- the id of the pagepageStatuses- a list of page statuses- Returns:
- the page for id
-
getPageForId
Description copied from interface:CMSAdminPageServiceReturns the active page with the given id and the catalog versions.- Specified by:
getPageForIdin interfaceCMSAdminPageService- Parameters:
id- the id of the pagecatalogVersions- the catalog versions- Returns:
- the page for id
-
getPageForId
protected AbstractPageModel getPageForId(String uid, Collection<CatalogVersionModel> catalogVersions, List<CmsPageStatus> pageStatuses) Returns the active page with the given id, catalog versions and page statuses.- Parameters:
uid- the id of the pagecatalogVersions- the catalog versionspageStatuses- the page statuses- Returns:
- the page
-
getPageTemplateForIdFromActiveCatalogVersion
Gets the page template with the give id. Searches only of the active catalogVersion.- Specified by:
getPageTemplateForIdFromActiveCatalogVersionin interfaceCMSAdminPageService- Parameters:
id- the id- Returns:
- found page template
-
pageExists
Checks if a page exists in the active catalog version- Specified by:
pageExistsin interfaceCMSAdminPageService- Parameters:
id- page id- Returns:
trueif the page exists in the active catalog version;falseotherwise
-
updatePage
public void updatePage(AbstractPageModel page, String name, String masterTemplateId) throws CMSItemNotFoundException Updates the given page. Method explicitly saves object.- Specified by:
updatePagein interfaceCMSAdminPageService- Parameters:
page- the page modelname- the new page name to be applied to the given page modelmasterTemplateId- the new page template to be applied to the given page model- Throws:
CMSItemNotFoundException- when an item model is not found
-
createPageFromType
protected AbstractPageModel createPageFromType(String composedTypeCode) throws CMSItemCreateException - Throws:
CMSItemCreateException
-
getHomepage
Gets the homepage for a given CMS Site.This performs the search only in the active versions of the catalogs associated to the site.
- Specified by:
getHomepagein interfaceCMSAdminPageService- Parameters:
siteModel- the site model- Returns:
- the homepage model
-
getHomepage
Description copied from interface:CMSAdminPageServiceGets the homepage for a given catalog version- Specified by:
getHomepagein interfaceCMSAdminPageService- Parameters:
catalogVersion- the catalog version containing the homepage- Returns:
- the homepage model
-
getHomepage
Gets the homepage for the given catalog versions.Pages will be sorted in reversed order of the multicountry hierarchy. Pages defined in the lowest catalog (e.g. local catalog) level will be the first ones in the result list. Therefore, pages defined in the top level catalog (e.g. global catalog) will be last in the result list.
- Specified by:
getHomepagein interfaceCMSAdminPageService- Parameters:
catalogVersions- the catalog versions- Returns:
- the homepage model from one of the catalog versions provided; can be NULL if no homepage is found or the given list of catalog version is empty.
-
findPagesByType
public Collection<AbstractPageModel> findPagesByType(ComposedTypeModel composedType, boolean isDefault) Description copied from interface:CMSAdminPageServiceGets the all default or non-default active pages by page type from the active catalog version.- Specified by:
findPagesByTypein interfaceCMSAdminPageService- Parameters:
composedType- the page type modelisDefault- true to find default pages; false otherwise- Returns:
- the all default or non-default pages for a given page type
-
findPagesByTypeAndPageStatuses
public Collection<AbstractPageModel> findPagesByTypeAndPageStatuses(ComposedTypeModel composedType, boolean isDefault, List<CmsPageStatus> pageStatuses) Description copied from interface:CMSAdminPageServiceGets the all default or non-default pages by page type from the active catalog version.- Specified by:
findPagesByTypeAndPageStatusesin interfaceCMSAdminPageService- Parameters:
composedType- the page type modelisDefault- true to find default pages; false otherwisepageStatuses- a list of page statuses- Returns:
- the all default or non-default pages for a given page type
-
getIdenticalPrimaryPageModel
Description copied from interface:CMSAdminPageServiceReturns identical primary page for provided pageModel.- Specified by:
getIdenticalPrimaryPageModelin interfaceCMSAdminPageService- Parameters:
pageModel- page mode- Returns:
- identical primary page
-
trashPage
public void trashPage(String pageUid, CatalogVersionModel catalogVersion) throws CMSItemNotFoundException Description copied from interface:CMSAdminPageServiceSoft deletes a page by updating the pageStatus to DELETED. Does nothing if the page is already deleted.- Specified by:
trashPagein interfaceCMSAdminPageService- Parameters:
pageUid- The page to be trashed.catalogVersion- The catalog version of the page.- Throws:
CMSItemNotFoundException- when the page is not found.
-
getCmsPageDao
-
setCmsPageDao
-
getCmsPageTemplateDao
-
setCmsPageTemplateDao
-
getTypeService
-
setTypeService
-
getCatalogVersionService
-
setCatalogVersionService
-
getCmsItemCatalogLevelComparator
-
setCmsItemCatalogLevelComparator
public void setCmsItemCatalogLevelComparator(Comparator<CMSItemModel> cmsItemCatalogLevelComparator) -
getCmsCatalogVersionService
-
setCmsCatalogVersionService
-
getPermissionCRUDService
-
setPermissionCRUDService
-
getSessionSearchRestrictionsDisabler
-
setSessionSearchRestrictionsDisabler
public void setSessionSearchRestrictionsDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionsDisabler)
-