Interface CMSAdminItemService
- All Known Implementing Classes:
DefaultCMSAdminItemService
public interface CMSAdminItemService
The Interface CMSAdminItemService provides methods for
CMSItemModel.- Spring Bean ID:
- cmsAdminItemService
-
Method Summary
Modifier and TypeMethodDescription<T extends CMSItemModel>
TcreateItem(Class<T> modelClass) Will create a new instance of the given modelClass and set up what is necessary for the savefindByItemData(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 catalogVersion
-
Method Details
-
findByUid
CMSItemModel findByUid(String uid, CatalogVersionModel catalogVersion) throws CMSItemNotFoundException Finds theCMSItemModeluniquely identified by its uid and catalogVersion- 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- Parameters:
uid- theCMSItemModeluid- Returns:
- the concrete class instance of
CMSItemModel - Throws:
CMSItemNotFoundException- when the cms item is not found
-
findByItemData
Finds theCMSItemModeluniquely identified by its uid and the catalogVersion defined by theCMSItemData- 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 up what is necessary for the save- Parameters:
modelClass- a class (extendingItemModel) to instantiate- Returns:
- a new item model
-
findByTypeCodeAndName
SearchResult<CMSItemModel> findByTypeCodeAndName(CatalogVersionModel catalogVersion, String typeCode, String name) Count the number of CMS Items on a given catalog, typeCode and name.- 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.
-