Interface CMSAdminSiteService
-
- All Known Implementing Classes:
DefaultCMSAdminSiteService
public interface CMSAdminSiteServiceThe Interface CMSAdminSiteService responsible for managing cms sites.- Spring Bean ID:
- cmsAdminSiteService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CatalogVersionModelgetActiveCatalogVersion()CMSSiteModelgetActiveSite()Returns the active site (the site the current user is working on).java.util.Collection<CatalogModel>getAllCatalogs(CMSSiteModel site)Returns all catalogs for the specified sitesite.java.util.Collection<ComposedTypeModel>getAllPageTypes()returns all composed type which extend the AbstractPagejava.util.Map<java.lang.String,java.lang.String>getCloneContext()Returns clone context.java.util.Map<java.lang.String,java.lang.Object>getOriginalItemContext()Returns the original item context.java.util.Map<java.lang.String,java.lang.Object>getRestoreContext()Returns restore context.CMSSiteModelgetSiteForId(java.lang.String id)Returns a site with the given IDjava.util.Collection<CMSSiteModel>getSites()Get all sites which are defined in the CMSjava.util.Map<java.lang.String,java.lang.Object>getTypeContext()Returns type context.booleanhasActiveCatalogVersion()checks if the current user has set an active catalog versionbooleanhasActiveSite()checks if the current user has set an active sitebooleanhasPreviewURL()check if the active site has a preview urlbooleanhasPreviewURL(CMSSiteModel site)check if the given site has a preview urlvoidsetActiveCatalogVersion(CatalogVersionModel catalogVersion)Set a catalog version as active.voidsetActiveCatalogVersion(java.lang.String catalogId, java.lang.String versionId)Set a catalog version (via catalog id and version id) as active.voidsetActiveSite(CMSSiteModel site)Sets a site as active (the site the current user is working on)voidsetActiveSiteForId(java.lang.String id)Sets a site as active (the site the current user is working on)voidsetCloneContext(java.util.Map<java.lang.String,java.lang.String> context)Set a clone context.voidsetOriginalItemContext(java.util.Map<java.lang.String,java.lang.Object> context)Set an original item context.voidsetRestoreContext(java.util.Map<java.lang.String,java.lang.Object> context)Set a restore context in the current session.voidsetTypeContext(java.util.Map<java.lang.String,java.lang.Object> context)Set a type context in the current session.
-
-
-
Method Detail
-
getSites
java.util.Collection<CMSSiteModel> getSites()
Get all sites which are defined in the CMS- Returns:
- collection of all sites
-
getSiteForId
CMSSiteModel getSiteForId(java.lang.String id) throws AmbiguousIdentifierException, UnknownIdentifierException
Returns a site with the given ID- Parameters:
id- the id of the site- Returns:
- the site object
- Throws:
AmbiguousIdentifierException- thrown when more than one object has been found.UnknownIdentifierException- thrown when no object has been found
-
setActiveSiteForId
void setActiveSiteForId(java.lang.String id) throws AmbiguousIdentifierException, UnknownIdentifierExceptionSets a site as active (the site the current user is working on)- Parameters:
id- id of the site- Throws:
AmbiguousIdentifierException- thrown when more than one object has been found.UnknownIdentifierException- thrown when no object has been found
-
setActiveSite
void setActiveSite(CMSSiteModel site)
Sets a site as active (the site the current user is working on)- Parameters:
site- the cms site model
-
getActiveSite
CMSSiteModel getActiveSite()
Returns the active site (the site the current user is working on). Returns null if no active site is set for the current user- Returns:
- the site
-
hasActiveSite
boolean hasActiveSite()
checks if the current user has set an active site- Returns:
- true if there is an active site, otherwise false
-
setActiveCatalogVersion
void setActiveCatalogVersion(java.lang.String catalogId, java.lang.String versionId) throws CMSItemNotFoundExceptionSet a catalog version (via catalog id and version id) as active. The current user will work on that catalog version- Parameters:
catalogId- the catalog idversionId- the version id- Throws:
CMSItemNotFoundException- if no catalog version with the given parameters is found
-
setActiveCatalogVersion
void setActiveCatalogVersion(CatalogVersionModel catalogVersion)
Set a catalog version as active. The current user will work on that catalog version- Parameters:
catalogVersion- the catalog version model
-
getActiveCatalogVersion
CatalogVersionModel getActiveCatalogVersion()
- Returns:
- the active catalog version for the current user. Returns null if no active catalog version is set for the current user
-
hasActiveCatalogVersion
boolean hasActiveCatalogVersion()
checks if the current user has set an active catalog version- Returns:
- true if there is an active catalog version, otherwise false
-
getAllPageTypes
java.util.Collection<ComposedTypeModel> getAllPageTypes()
returns all composed type which extend the AbstractPage- Returns:
- all page types
-
hasPreviewURL
boolean hasPreviewURL()
check if the active site has a preview url- Returns:
- true if the active site has an preview url. False if no active site is set or no preview URL is provided.
-
hasPreviewURL
boolean hasPreviewURL(CMSSiteModel site)
check if the given site has a preview url- Parameters:
site- the site to check- Returns:
- true if the active site has an preview url. False if no active site is set or no preview URL is provided.
-
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
-
setCloneContext
void setCloneContext(java.util.Map<java.lang.String,java.lang.String> context)
Set a clone context. Clone context contains site id, catalog id and catalog version. Clone context is used to detect that the new cloned element will be created in a catalog version different from active one.- Parameters:
context- clone context
-
getCloneContext
java.util.Map<java.lang.String,java.lang.String> getCloneContext()
Returns clone context.- Returns:
- the clone context object
-
setOriginalItemContext
void setOriginalItemContext(java.util.Map<java.lang.String,java.lang.Object> context)
Set an original item context. The original item context contains cmsItem uid, catalog id and catalog version. The original item context is used to detect that the item is being modified by the facade layer and that theRelatedPageRejectionServiceshould not save this item part of its processing.- Parameters:
context- original item context
-
getOriginalItemContext
java.util.Map<java.lang.String,java.lang.Object> getOriginalItemContext()
Returns the original item context.- Returns:
- the original item context object
-
setRestoreContext
void setRestoreContext(java.util.Map<java.lang.String,java.lang.Object> context)
Set a restore context in the current session. The restore context contains information about whether to override while restore or not.- Parameters:
context- restore context
-
getRestoreContext
java.util.Map<java.lang.String,java.lang.Object> getRestoreContext()
Returns restore context.- Returns:
- the restore context object
-
setTypeContext
void setTypeContext(java.util.Map<java.lang.String,java.lang.Object> context)
Set a type context in the current session. The type context contains information about read only mode for attributes.- Parameters:
context-
-
getTypeContext
java.util.Map<java.lang.String,java.lang.Object> getTypeContext()
Returns type context.- Returns:
- the type context object.
-
-