Class DefaultCMSSiteService
java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
de.hybris.platform.cms2.servicelayer.services.impl.AbstractCMSService
de.hybris.platform.cms2.servicelayer.services.impl.DefaultCMSSiteService
- All Implemented Interfaces:
CMSSiteService,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
MarketplaceCMSSiteService
Default implementation of
CMSSiteService- 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.impl.AbstractCMSService
CURRENTCATALOGVERSION, CURRENTSITEFields 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 TypeMethodDescriptioncompilePatterns(Collection<String> stringPatterns) booleancontainsCatalog(CMSSiteModel site, CatalogModel catalog, boolean contentOnly) checks if a given site contains the given catalogprotected booleancontainsContentCatalogImpl(CMSSiteModel site, CatalogModel catalog) protected booleancontainsProductsCatalogImpl(CMSSiteModel site, CatalogModel catalog) getAllCatalogs(CMSSiteModel site) Returns all catalogs for the specified sitesite.protected CatalogVersionServiceGets the classification catalogs forCMSSiteModelobject.protected CMSPageServiceDefault getter for CMSPageServiceprotected CMSSiteDaoGet default content catalog active version of current sitesgetSiteForURL(URL url) Returns the site which is associated with the given urlgetSites()Gets the start page label or id.booleanbooleanprotected booleanmatches(String input, Collection<Pattern> patterns) protected booleanmatchSiteForURL(CMSSiteModel site, String strUrl) voidsetCatalogVersionService(CatalogVersionService catalogVersionService) voidsetCmsSiteDao(CMSSiteDao cmsSiteDao) voidsetCurrentCatalogVersion(CatalogVersionModel catalogVersion) sets a catalogversion as current catalogversionvoidsetCurrentSite(CMSSiteModel site) sets the given site as currentsetCurrentSite(URL url, PreviewDataModel previewData) Sets the site that is associated with the given url as current site.voidsetCurrentSiteAndCatalogVersions(CMSSiteModel site, boolean setDefaultCatalog) Activates the given site and all associated catalog versions.setCurrentSiteAndCatalogVersions(String siteId, boolean setDefaultCatalog) Activates a CMSSite and all associated catalog versions.setCurrentSiteAndCatalogVersionsForURL(URL url, boolean setDefaultCatalog) Sets the site that is associated with the given url as current site.Methods inherited from class de.hybris.platform.cms2.servicelayer.services.impl.AbstractCMSService
getBaseSiteService, getCurrentCatalogVersion, getCurrentSite, getSearchRestrictionService, getUserService, setBaseSiteService, setSearchRestrictionService, 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.CMSSiteService
getCurrentCatalogVersion, getCurrentSite
-
Constructor Details
-
DefaultCMSSiteService
public DefaultCMSSiteService()
-
-
Method Details
-
containsCatalog
checks if a given site contains the given catalog- Specified by:
containsCatalogin interfaceCMSSiteService- Parameters:
site- the cms site modelcatalog- the catalog modelcontentOnly- if true, returns content catalogs only- Returns:
- true if there is a site
-
containsContentCatalogImpl
-
containsProductsCatalogImpl
-
getAllCatalogs
Returns all catalogs for the specified sitesite. This means all the content catalogs of the site as well as the product and classification system catalogs which belong to the stores associated with the site.- Specified by:
getAllCatalogsin interfaceCMSSiteService- Parameters:
site- the CMS site- Returns:
- all content, product and classification system catalogs associated with the site
- Throws:
IllegalArgumentException
-
getClassificationCatalogs
Gets the classification catalogs forCMSSiteModelobject.- Specified by:
getClassificationCatalogsin interfaceCMSSiteService- Parameters:
site- theCMSSiteModelobject for which catalogs will be obtained.- Returns:
- the list of
CatalogModelobjects.
-
getSiteForURL
Returns the site which is associated with the given url- Specified by:
getSiteForURLin interfaceCMSSiteService- Parameters:
url- the url- Returns:
- the site which is associated with the given url
- Throws:
CMSItemNotFoundException- if no site is associated with the given url
-
matchSiteForURL
-
getSites
- Specified by:
getSitesin interfaceCMSSiteService- Returns:
- List of all sites defined in this system
-
getStartPageLabelOrId
Gets the start page label or id.- Specified by:
getStartPageLabelOrIdin interfaceCMSSiteService- Parameters:
site- heCMSSiteModelobject- Returns:
- the start page label or id
-
hasCurrentCatalogVersion
public boolean hasCurrentCatalogVersion()- Specified by:
hasCurrentCatalogVersionin interfaceCMSSiteService- Returns:
- true if a catalogversion is set to current, otherwise false
-
hasCurrentSite
public boolean hasCurrentSite()- Specified by:
hasCurrentSitein interfaceCMSSiteService- Returns:
- true if a site is set to current, otherwise false
-
lookupCmsPageService
- Returns:
- a CMSPageService
- Throws:
UnsupportedOperationException
-
getCatalogVersionService
-
setCatalogVersionService
-
getCmsSiteDao
-
setCmsSiteDao
-
setCurrentCatalogVersion
public void setCurrentCatalogVersion(CatalogVersionModel catalogVersion) throws CMSItemNotFoundException sets a catalogversion as current catalogversion- Specified by:
setCurrentCatalogVersionin interfaceCMSSiteService- Parameters:
catalogVersion- the catalogversion to be set as current- Throws:
CMSItemNotFoundException- if the current site does not contain the catalog (catalogversion)
-
setCurrentSite
sets the given site as current- Specified by:
setCurrentSitein interfaceCMSSiteService- Parameters:
site- the cms site model
-
setCurrentSite
public CMSSiteModel setCurrentSite(URL url, PreviewDataModel previewData) throws CMSItemNotFoundException Sets the site that is associated with the given url as current site. Also adds all catalogversions which are provided in the previewdata the session. If a catalog version in the previewdata is not part of that site, it will not be added to the session.- Specified by:
setCurrentSitein interfaceCMSSiteService- Parameters:
url- the urlpreviewData- the preview data model- Returns:
- the corresponding CMSSiteModel which was activated
- Throws:
CMSItemNotFoundException- if no site is associated with the given url
-
setCurrentSiteAndCatalogVersions
public void setCurrentSiteAndCatalogVersions(CMSSiteModel site, boolean setDefaultCatalog) throws CMSItemNotFoundException Activates the given site and all associated catalog versions. If setDefaultCatalog is set to true the default catalog will be activated as currentcatalog.- Specified by:
setCurrentSiteAndCatalogVersionsin interfaceCMSSiteService- Parameters:
site- site to activatesetDefaultCatalog- if set to true the default catalog will be activated as currentcatalog.- Throws:
CMSItemNotFoundException- if not site with the given id could be found, no active catalogversion could be found for the associated catalogs or if setDefaultCatalog is set to true and no default catalog is set
-
setCurrentSiteAndCatalogVersions
public CMSSiteModel setCurrentSiteAndCatalogVersions(String siteId, boolean setDefaultCatalog) throws CMSItemNotFoundException Activates a CMSSite and all associated catalog versions. If setDefaultCatalog is set to true the default catalog will be activated as currentcatalog.- Specified by:
setCurrentSiteAndCatalogVersionsin interfaceCMSSiteService- Parameters:
siteId- id of the site to activatesetDefaultCatalog- if set to true the default catalog will be activated as currentcatalog.- Returns:
- the corresponding CMSSiteModel which was activated
- Throws:
CMSItemNotFoundException- if no site with the given id could be found, no active catalogversion could be found for the associated catalogs or if setDefaultCatalog is set to true and no default catalog is set
-
setCurrentSiteAndCatalogVersionsForURL
public CMSSiteModel setCurrentSiteAndCatalogVersionsForURL(URL url, boolean setDefaultCatalog) throws CMSItemNotFoundException Sets the site that is associated with the given url as current site. Also adds all active catalogversions of the site to the session.- Specified by:
setCurrentSiteAndCatalogVersionsForURLin interfaceCMSSiteService- Parameters:
url- the urlsetDefaultCatalog- if set to true the default catalog (with the active version) will be set as current catalogversion. This is only done when the current catalogversion is null.- Returns:
- the corresponding CMSSiteModel which was activated
- Throws:
CMSItemNotFoundException- if no site is associated with the given url
-
getCurrentSiteDefaultContentCatalogActiveVersion
Get default content catalog active version of current sites- Specified by:
getCurrentSiteDefaultContentCatalogActiveVersionin interfaceCMSSiteService- Returns:
- CatalogVersionModel
-
compilePatterns
-
getCmsPageService
Default getter for CMSPageService- Returns:
- the cmsPageService instance.
-
matches
-