Interface CMSAdminItemService
-
- All Known Implementing Classes:
DefaultCMSAdminItemService
public interface CMSAdminItemServiceThe Interface CMSAdminItemService provides methods forCMSItemModel.- Spring Bean ID:
- cmsAdminItemService
-
-
Method Summary
All Methods Instance Methods Abstract 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 up what is necessary for the savejava.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 catalogVersion
-
-
-
Method Detail
-
findByUid
CMSItemModel findByUid(java.lang.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
CMSItemModel findByUid(java.lang.String uid) throws CMSItemNotFoundException
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
java.util.Optional<CMSItemModel> findByItemData(CMSItemData itemData)
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
<T extends CMSItemModel> T createItem(java.lang.Class<T> modelClass)
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, java.lang.String typeCode, java.lang.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.
-
-