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,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 of
CMSAdminItemService- 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.admin.impl.AbstractCMSAdminService
ACTIVECATALOGVERSION, ACTIVESITE, CLONE_CONTEXT, ORIGINAL_ITEM_CONTEXT, RESTORE_CONTEXT, TYPE_CONTEXTFields 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 TypeMethodDescription<T extends CMSItemModel>
TcreateItem(Class<T> modelClass) Will create a new instance of the given modelClass and set its uidfindByItemData(CMSItemData itemData) Finds theCMSItemModeluniquely identified by its uid and the catalogVersion defined by theCMSItemDatafindByTypeCodeAndName(CatalogVersionModel catalogVersion, String typeCode, String name) Count the number of CMS Items on a given catalog, typeCode and name.Finds theCMSItemModeluniquely identified by its uid and the catalogVersion currently in sessionfindByUid(String uid, CatalogVersionModel catalogVersion) Finds theCMSItemModeluniquely identified by its uid and catalogVersionprotected Stringprotected CatalogVersionServiceprotected CMSItemDaoprotected PersistentKeyGeneratorvoidsetCatalogVersionService(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, 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, writeReplace
-
Constructor Details
-
DefaultCMSAdminItemService
public DefaultCMSAdminItemService()
-
-
Method Details
-
findByUid
public CMSItemModel findByUid(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
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
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
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, String typeCode, 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
-
setCmsItemDao
- Parameters:
cmsItemDao- the cmsItemDao to set
-
getCmsItemDao
- Returns:
- the cmsItemDao
-
setComponentUidGenerator
- Parameters:
componentUidGenerator- the componentUidGenerator to set
-
getComponentUidGenerator
- Returns:
- the componentUidGenerator
-
getCatalogVersionService
-
setCatalogVersionService
-