Class DefaultCMSAdminSiteService
- 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.DefaultCMSAdminSiteService
-
- All Implemented Interfaces:
CMSAdminSiteService
,java.io.Serializable
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.InitializingBean
public class DefaultCMSAdminSiteService extends AbstractCMSAdminService implements CMSAdminSiteService
Default implementation of the site service.- See Also:
- Serialized Form
-
-
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_CONTEXT
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManager
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant
-
-
Constructor Summary
Constructors Constructor Description DefaultCMSAdminSiteService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 AbstractPageprotected CatalogVersionService
getCatalogVersionService()
java.util.Map<java.lang.String,java.lang.String>
getCloneContext()
Returns clone context.protected CMSSiteDao
getCmsSiteDao()
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.CMSSiteModel
getSiteForId(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.protected TypeService
getTypeService()
boolean
hasActiveCatalogVersion()
checks if the current user has set an active catalog versionboolean
hasActiveSite()
checks if the current user has set an active siteboolean
hasPreviewURL()
check if the active site has a preview urlboolean
hasPreviewURL(CMSSiteModel site)
check if the given site has a preview urlvoid
setActiveCatalogVersion(CatalogVersionModel catalogVersion)
Set a catalog version as active.void
setActiveCatalogVersion(java.lang.String catalogId, java.lang.String versionId)
Set a catalog version (via catalog id and version id) as active.void
setActiveSite(CMSSiteModel site)
Sets a site as active (the site the current user is working on)void
setActiveSiteForId(java.lang.String id)
Sets a site as active (the site the current user is working on)void
setCatalogVersionService(CatalogVersionService catalogVersionService)
void
setCloneContext(java.util.Map<java.lang.String,java.lang.String> context)
Set a clone context.void
setCmsSiteDao(CMSSiteDao cmsSiteDao)
void
setOriginalItemContext(java.util.Map<java.lang.String,java.lang.Object> context)
Set an original item context.void
setRestoreContext(java.util.Map<java.lang.String,java.lang.Object> context)
Set a restore context in the current session.void
setTypeContext(java.util.Map<java.lang.String,java.lang.Object> context)
Set a type context in the current session.void
setTypeService(TypeService typeService)
-
Methods inherited from class de.hybris.platform.cms2.servicelayer.services.admin.impl.AbstractCMSAdminService
getActiveCatalogVersion, getActiveSite, getBaseSiteService, getUserService, setBaseSiteService, setUserService
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManager
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.cms2.servicelayer.services.admin.CMSAdminSiteService
getActiveCatalogVersion, getActiveSite
-
-
-
-
Method Detail
-
getSites
public java.util.Collection<CMSSiteModel> getSites()
Description copied from interface:CMSAdminSiteService
Get all sites which are defined in the CMS- Specified by:
getSites
in interfaceCMSAdminSiteService
- Returns:
- collection of all sites
-
hasActiveSite
public boolean hasActiveSite()
Description copied from interface:CMSAdminSiteService
checks if the current user has set an active site- Specified by:
hasActiveSite
in interfaceCMSAdminSiteService
- Returns:
- true if there is an active site, otherwise false
-
setActiveSite
public void setActiveSite(CMSSiteModel site)
Description copied from interface:CMSAdminSiteService
Sets a site as active (the site the current user is working on)- Specified by:
setActiveSite
in interfaceCMSAdminSiteService
- Parameters:
site
- the cms site model
-
hasActiveCatalogVersion
public boolean hasActiveCatalogVersion()
Description copied from interface:CMSAdminSiteService
checks if the current user has set an active catalog version- Specified by:
hasActiveCatalogVersion
in interfaceCMSAdminSiteService
- Returns:
- true if there is an active catalog version, otherwise false
-
setActiveCatalogVersion
public void setActiveCatalogVersion(java.lang.String catalogId, java.lang.String versionId) throws CMSItemNotFoundException
Description copied from interface:CMSAdminSiteService
Set a catalog version (via catalog id and version id) as active. The current user will work on that catalog version- Specified by:
setActiveCatalogVersion
in interfaceCMSAdminSiteService
- Parameters:
catalogId
- the catalog idversionId
- the version id- Throws:
CMSItemNotFoundException
- if no catalog version with the given parameters is found
-
hasPreviewURL
public boolean hasPreviewURL()
Description copied from interface:CMSAdminSiteService
check if the active site has a preview url- Specified by:
hasPreviewURL
in interfaceCMSAdminSiteService
- Returns:
- true if the active site has an preview url. False if no active site is set or no preview URL is provided.
-
hasPreviewURL
public boolean hasPreviewURL(CMSSiteModel site)
Description copied from interface:CMSAdminSiteService
check if the given site has a preview url- Specified by:
hasPreviewURL
in interfaceCMSAdminSiteService
- 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.
-
setActiveCatalogVersion
public void setActiveCatalogVersion(CatalogVersionModel catalogVersion)
Description copied from interface:CMSAdminSiteService
Set a catalog version as active. The current user will work on that catalog version- Specified by:
setActiveCatalogVersion
in interfaceCMSAdminSiteService
- Parameters:
catalogVersion
- the catalog version model
-
getAllPageTypes
public java.util.Collection<ComposedTypeModel> getAllPageTypes()
Description copied from interface:CMSAdminSiteService
returns all composed type which extend the AbstractPage- Specified by:
getAllPageTypes
in interfaceCMSAdminSiteService
- Returns:
- all page types
-
getCmsSiteDao
protected CMSSiteDao getCmsSiteDao()
-
setCmsSiteDao
public void setCmsSiteDao(CMSSiteDao cmsSiteDao)
-
getCatalogVersionService
protected CatalogVersionService getCatalogVersionService()
-
setCatalogVersionService
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
-
getTypeService
protected TypeService getTypeService()
-
setTypeService
public void setTypeService(TypeService typeService)
-
getAllCatalogs
public java.util.Collection<CatalogModel> getAllCatalogs(CMSSiteModel site)
Description copied from interface:CMSAdminSiteService
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:
getAllCatalogs
in interfaceCMSAdminSiteService
- Parameters:
site
- the CMS site- Returns:
- all content, product and classification system catalogs associated with the site
-
getSiteForId
public CMSSiteModel getSiteForId(java.lang.String id) throws AmbiguousIdentifierException, UnknownIdentifierException
Description copied from interface:CMSAdminSiteService
Returns a site with the given ID- Specified by:
getSiteForId
in interfaceCMSAdminSiteService
- 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
public void setActiveSiteForId(java.lang.String id) throws AmbiguousIdentifierException, UnknownIdentifierException
Description copied from interface:CMSAdminSiteService
Sets a site as active (the site the current user is working on)- Specified by:
setActiveSiteForId
in interfaceCMSAdminSiteService
- 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
-
setCloneContext
public void setCloneContext(java.util.Map<java.lang.String,java.lang.String> context)
Description copied from interface:CMSAdminSiteService
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.- Specified by:
setCloneContext
in interfaceCMSAdminSiteService
- Parameters:
context
- clone context
-
getCloneContext
public java.util.Map<java.lang.String,java.lang.String> getCloneContext()
Description copied from interface:CMSAdminSiteService
Returns clone context.- Specified by:
getCloneContext
in interfaceCMSAdminSiteService
- Returns:
- the clone context object
-
setOriginalItemContext
public void setOriginalItemContext(java.util.Map<java.lang.String,java.lang.Object> context)
Description copied from interface:CMSAdminSiteService
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 theRelatedPageRejectionService
should not save this item part of its processing.- Specified by:
setOriginalItemContext
in interfaceCMSAdminSiteService
- Parameters:
context
- original item context
-
getOriginalItemContext
public java.util.Map<java.lang.String,java.lang.Object> getOriginalItemContext()
Description copied from interface:CMSAdminSiteService
Returns the original item context.- Specified by:
getOriginalItemContext
in interfaceCMSAdminSiteService
- Returns:
- the original item context object
-
setRestoreContext
public void setRestoreContext(java.util.Map<java.lang.String,java.lang.Object> context)
Description copied from interface:CMSAdminSiteService
Set a restore context in the current session. The restore context contains information about whether to override while restore or not.- Specified by:
setRestoreContext
in interfaceCMSAdminSiteService
- Parameters:
context
- restore context
-
getRestoreContext
public java.util.Map<java.lang.String,java.lang.Object> getRestoreContext()
Description copied from interface:CMSAdminSiteService
Returns restore context.- Specified by:
getRestoreContext
in interfaceCMSAdminSiteService
- Returns:
- the restore context object
-
setTypeContext
public void setTypeContext(java.util.Map<java.lang.String,java.lang.Object> context)
Description copied from interface:CMSAdminSiteService
Set a type context in the current session. The type context contains information about read only mode for attributes.- Specified by:
setTypeContext
in interfaceCMSAdminSiteService
-
getTypeContext
public java.util.Map<java.lang.String,java.lang.Object> getTypeContext()
Description copied from interface:CMSAdminSiteService
Returns type context.- Specified by:
getTypeContext
in interfaceCMSAdminSiteService
- Returns:
- the type context object.
-
-