Interface CMSSiteService
-
- All Known Implementing Classes:
DefaultCMSSiteService,MarketplaceCMSSiteService
public interface CMSSiteServiceThe Interface CMSSiteService responsible for managing cms sites.- Spring Bean ID:
- cmsSiteService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontainsCatalog(CMSSiteModel site, CatalogModel catalog, boolean contentOnly)checks if a given site contains the given catalogjava.util.Collection<CatalogModel>getAllCatalogs(CMSSiteModel site)Returns all catalogs for the specified sitesite.java.util.List<CatalogModel>getClassificationCatalogs(CMSSiteModel site)Gets the classification catalogs forCMSSiteModelobject.CatalogVersionModelgetCurrentCatalogVersion()Returns current catalog version from the session for current user.CMSSiteModelgetCurrentSite()Returns current site from the session for current user.CMSSiteModelgetSiteForURL(java.net.URL url)Returns the site which is associated with the given urljava.util.Collection<CMSSiteModel>getSites()java.lang.StringgetStartPageLabelOrId(CMSSiteModel site)Gets the start page label or id.booleanhasCurrentCatalogVersion()booleanhasCurrentSite()voidsetCurrentCatalogVersion(CatalogVersionModel catalogVersion)sets a catalogversion as current catalogversionvoidsetCurrentSite(CMSSiteModel site)sets the given site as currentCMSSiteModelsetCurrentSite(java.net.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.CMSSiteModelsetCurrentSiteAndCatalogVersions(java.lang.String siteId, boolean setDefaultCatalog)Activates a CMSSite and all associated catalog versions.CMSSiteModelsetCurrentSiteAndCatalogVersionsForURL(java.net.URL url, boolean setDefaultCatalog)Sets the site that is associated with the given url as current site.
-
-
-
Method Detail
-
containsCatalog
boolean containsCatalog(CMSSiteModel site, CatalogModel catalog, boolean contentOnly)
checks if a given site contains the given catalog- Parameters:
site- the cms site modelcatalog- the catalog modelcontentOnly- if true, returns content catalogs only- Returns:
- true if there is a site
-
getAllCatalogs
java.util.Collection<CatalogModel> getAllCatalogs(CMSSiteModel site)
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.- Parameters:
site- the CMS site- Returns:
- all content, product and classification system catalogs associated with the site
-
getClassificationCatalogs
java.util.List<CatalogModel> getClassificationCatalogs(CMSSiteModel site)
Gets the classification catalogs forCMSSiteModelobject.- Parameters:
site- theCMSSiteModelobject for which catalogs will be obtained.- Returns:
- the list of
CatalogModelobjects.
-
getCurrentCatalogVersion
CatalogVersionModel getCurrentCatalogVersion()
Returns current catalog version from the session for current user.- Returns:
- the current catalogversion
-
getCurrentSite
CMSSiteModel getCurrentSite()
Returns current site from the session for current user.- Returns:
- the current site
-
getSiteForURL
CMSSiteModel getSiteForURL(java.net.URL url) throws CMSItemNotFoundException
Returns the site which is associated with the given url- 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
-
getSites
java.util.Collection<CMSSiteModel> getSites()
- Returns:
- List of all sites defined in this system
-
getStartPageLabelOrId
java.lang.String getStartPageLabelOrId(CMSSiteModel site)
Gets the start page label or id.- Parameters:
site- heCMSSiteModelobject- Returns:
- the start page label or id
-
hasCurrentCatalogVersion
boolean hasCurrentCatalogVersion()
- Returns:
- true if a catalogversion is set to current, otherwise false
-
hasCurrentSite
boolean hasCurrentSite()
- Returns:
- true if a site is set to current, otherwise false
-
setCurrentCatalogVersion
void setCurrentCatalogVersion(CatalogVersionModel catalogVersion) throws CMSItemNotFoundException
sets a catalogversion as current catalogversion- Parameters:
catalogVersion- the catalogversion to be set as current- Throws:
CMSItemNotFoundException- if the current site does not contain the catalog (catalogversion)
-
setCurrentSite
void setCurrentSite(CMSSiteModel site)
sets the given site as current- Parameters:
site- the cms site model
-
setCurrentSite
CMSSiteModel setCurrentSite(java.net.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.- 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
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.- 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
CMSSiteModel setCurrentSiteAndCatalogVersions(java.lang.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.- 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
CMSSiteModel setCurrentSiteAndCatalogVersionsForURL(java.net.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.- 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
-
-