Class DefaultCMSAdminItemService
- 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.DefaultCMSAdminItemService
-
- All Implemented Interfaces:
CMSAdminItemService,java.io.Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
public class DefaultCMSAdminItemService extends AbstractCMSAdminService implements CMSAdminItemService
Default implementation ofCMSAdminItemService- 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 DefaultCMSAdminItemService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends CMSItemModel>
TcreateItem(java.lang.Class<T> modelClass)Will create a new instance of the given modelClass and set its uidjava.util.Optional<CMSItemModel>findByItemData(CMSItemData itemData)Finds theCMSItemModeluniquely identified by its uid and the catalogVersion defined by theCMSItemDataSearchResult<CMSItemModel>findByTypeCodeAndName(CatalogVersionModel catalogVersion, java.lang.String typeCode, java.lang.String name)Count the number of CMS Items on a given catalog, typeCode and name.CMSItemModelfindByUid(java.lang.String uid)Finds theCMSItemModeluniquely identified by its uid and the catalogVersion currently in sessionCMSItemModelfindByUid(java.lang.String uid, CatalogVersionModel catalogVersion)Finds theCMSItemModeluniquely identified by its uid and catalogVersionprotected java.lang.StringgenerateCmsComponentUid()protected CatalogVersionServicegetCatalogVersionService()protected CMSItemDaogetCmsItemDao()protected PersistentKeyGeneratorgetComponentUidGenerator()voidsetCatalogVersionService(CatalogVersionService catalogVersionService)voidsetCmsItemDao(CMSItemDao cmsItemDao)voidsetComponentUidGenerator(PersistentKeyGenerator componentUidGenerator)-
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
-
-
-
-
Method Detail
-
findByUid
public CMSItemModel findByUid(java.lang.String uid, CatalogVersionModel catalogVersion) throws CMSItemNotFoundException
Finds theCMSItemModeluniquely identified by its uid and catalogVersion- Specified by:
findByUidin interfaceCMSAdminItemService- Parameters:
uid- theCMSItemModeluidcatalogVersion- theCatalogVersionModelto which the item belongs to- Returns:
- the concrete class instance of
CMSItemModel - Throws:
CMSItemNotFoundException- when the cms item is not found
-
findByUid
public CMSItemModel findByUid(java.lang.String uid) throws CMSItemNotFoundException
Finds theCMSItemModeluniquely identified by its uid and the catalogVersion currently in session- Specified by:
findByUidin interfaceCMSAdminItemService- Parameters:
uid- theCMSItemModeluid- Returns:
- the concrete class instance of
CMSItemModel - Throws:
CMSItemNotFoundException- when the cms item is not found
-
findByItemData
public java.util.Optional<CMSItemModel> findByItemData(CMSItemData itemData)
Description copied from interface:CMSAdminItemServiceFinds theCMSItemModeluniquely identified by its uid and the catalogVersion defined by theCMSItemData- Specified by:
findByItemDatain interfaceCMSAdminItemService- Parameters:
itemData- theCMSItemDatacontaining the uid and catalogVersion- Returns:
- an
Optionalcontaining the concrete class instance ofCMSItemModel, otherwiseOptional#empty()
-
createItem
public <T extends CMSItemModel> T createItem(java.lang.Class<T> modelClass)
Will create a new instance of the given modelClass and set its uid- Specified by:
createItemin interfaceCMSAdminItemService- Parameters:
modelClass- a class (extendingItemModel) to instantiate- Returns:
- a new item model
-
findByTypeCodeAndName
public SearchResult<CMSItemModel> findByTypeCodeAndName(CatalogVersionModel catalogVersion, java.lang.String typeCode, java.lang.String name)
Description copied from interface:CMSAdminItemServiceCount the number of CMS Items on a given catalog, typeCode and name.- Specified by:
findByTypeCodeAndNamein interfaceCMSAdminItemService- Parameters:
catalogVersion- the catalogVersion to count the cms items fromtypeCode- the type code we want to count from.name- the name of the cms item, never null.- Returns:
- the number of cms items with the same name for a given catalog version adn type code.
-
generateCmsComponentUid
protected java.lang.String generateCmsComponentUid()
-
setCmsItemDao
public void setCmsItemDao(CMSItemDao cmsItemDao)
- Parameters:
cmsItemDao- the cmsItemDao to set
-
getCmsItemDao
protected CMSItemDao getCmsItemDao()
- Returns:
- the cmsItemDao
-
setComponentUidGenerator
public void setComponentUidGenerator(PersistentKeyGenerator componentUidGenerator)
- Parameters:
componentUidGenerator- the componentUidGenerator to set
-
getComponentUidGenerator
protected PersistentKeyGenerator getComponentUidGenerator()
- Returns:
- the componentUidGenerator
-
getCatalogVersionService
protected CatalogVersionService getCatalogVersionService()
-
setCatalogVersionService
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
-
-