public class DefaultCMSItemFacade extends java.lang.Object implements CMSItemFacade
CMSItemFacade.| Modifier and Type | Field and Description |
|---|---|
protected java.lang.ThreadLocal<java.util.Map<java.lang.String,java.lang.Object>> |
convertedItem
Thread safe temporary storage of a convertedItem just before explicitly rollbacking the transaction in dryRun mode
|
| Constructor and Description |
|---|
DefaultCMSItemFacade() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
convertAndPopulate(CMSItemModel itemModel)
Converts and populates Map to return to the frontend.
|
protected ItemModel |
convertAndPopulate(java.util.Map<java.lang.String,java.lang.Object> itemMap)
Converts and populates model to save
|
protected CMSItemNotFoundException |
createCMSItemNotFoundException(java.lang.String uuid)
Creates a new
CMSItemNotFoundException. |
java.util.Map<java.lang.String,java.lang.Object> |
createItem(java.util.Map<java.lang.String,java.lang.Object> itemMap)
Create CMS Items given the attribute value map.
|
protected TypePermissionException |
createTypePermissionException(java.lang.String permissionName,
java.lang.String itemType)
Creates a new
TypePermissionException with a localized error message |
void |
deleteCMSItemByUuid(java.lang.String uuid)
Deletes one single CMSItem by its uuid (Universal Unique Identifier)
|
SearchResult<java.util.Map<java.lang.String,java.lang.Object>> |
findCMSItems(CMSItemSearchData cmsItemSearchData,
PageableData pageableData)
A paged Search for CMSItems in a given catalogversion.
|
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
findCMSItems(java.util.List<java.lang.String> uuids)
A Search for CMSItems by their universally unique identifiers
|
protected CatalogVersionService |
getCatalogVersionService() |
protected CMSAdminSiteService |
getCmsAdminSiteService() |
java.util.Map<java.lang.String,java.lang.Object> |
getCMSItemByUuid(java.lang.String uuid)
Get one single CMSItem by its uuid (Universal Unique Identifier) For more information about Unique Identifiers,
see
UniqueItemIdentifierService |
protected java.util.Map<java.lang.String,java.lang.Object> |
getCMSItemByUuid(java.lang.String uuid,
boolean throwException)
Get one single CMSItem by its uuid (Universal Unique Identifier)
For more information about Unique Identifiers, see UniqueItemIdentifierService |
protected CMSItemConverter |
getCmsItemConverter() |
protected Converter<CMSItemSearchData,CMSItemSearchData> |
getCmsItemSearchDataConverter() |
protected Validator |
getCmsItemSearchDataValidator() |
protected CMSItemSearchService |
getCmsItemSearchService() |
protected FacadeValidationService |
getFacadeValidationService() |
protected ItemDataPopulatorProvider |
getItemDataPopulatorProvider() |
protected ItemTypePopulatorProvider |
getItemTypePopulatorProvider() |
protected ModelService |
getModelService() |
protected OriginalClonedItemProvider |
getOriginalClonedItemProvider() |
protected PermissionCRUDService |
getPermissionCRUDService() |
SessionSearchRestrictionsDisabler |
getSessionSearchRestrictionsDisabler() |
protected PlatformTransactionManager |
getTransactionManager() |
protected TypeService |
getTypeService() |
protected UniqueItemIdentifierService |
getUniqueItemIdentifierService() |
protected ValidationErrorsProvider |
getValidationErrorsProvider() |
protected void |
initialUpdateValidation(java.lang.String uuid,
java.util.Map<java.lang.String,java.lang.Object> itemMap)
Checks if an item exists.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
saveItem(java.util.Map<java.lang.String,java.lang.Object> itemMap,
java.util.function.Predicate<java.lang.String> typePermissionPredicate,
java.lang.String permissionName)
Saves Item using a local transaction.
|
protected void |
setCatalogInSession(java.util.Map<java.lang.String,java.lang.Object> source)
Sets the catalogVersion in the current session.
|
void |
setCatalogVersionService(CatalogVersionService catalogVersionService) |
protected void |
setCloneContext(java.util.Map<java.lang.String,java.lang.Object> source)
Sets the clone context in the current session.
|
void |
setCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService) |
void |
setCmsItemConverter(CMSItemConverter cmsItemConverter) |
void |
setCmsItemSearchDataConverter(Converter<CMSItemSearchData,CMSItemSearchData> cmsItemSearchDataConverter) |
void |
setCmsItemSearchDataValidator(Validator cmsItemSearchDataValidator) |
void |
setCmsItemSearchService(CMSItemSearchService cmsItemSearchService) |
void |
setFacadeValidationService(FacadeValidationService facadeValidationService) |
void |
setItemDataPopulatorProvider(ItemDataPopulatorProvider itemDataPopulatorProvider) |
void |
setItemTypePopulatorProvider(ItemTypePopulatorProvider itemTypePopulatorProvider) |
void |
setModelService(ModelService modelService) |
void |
setOriginalClonedItemProvider(OriginalClonedItemProvider originalClonedItemProvider) |
void |
setPermissionCRUDService(PermissionCRUDService permissionCRUDService) |
protected void |
setRestoreContext(java.util.Map<java.lang.String,java.lang.Object> source)
Sets the restore context in the current session.
|
void |
setSessionSearchRestrictionsDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionsDisabler) |
void |
setTransactionManager(PlatformTransactionManager transactionManager) |
void |
setTypeService(TypeService typeService) |
void |
setUniqueItemIdentifierService(UniqueItemIdentifierService uniqueItemIdentifierService) |
void |
setValidationErrorsProvider(ValidationErrorsProvider validationErrorsProvider) |
protected void |
transformValidationException(ModelSavingException error)
Parses the ModelSavingException and transforms it into validation error(s).
|
java.util.Map<java.lang.String,java.lang.Object> |
updateItem(java.lang.String uuid,
java.util.Map<java.lang.String,java.lang.Object> itemMap)
Updates a CMS Item given the attribute value map and its uuid.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
validateItem(java.util.Map<java.lang.String,java.lang.Object> itemMap)
Validates and convert the item for the sole purpose of validation.
|
java.util.Map<java.lang.String,java.lang.Object> |
validateItemForCreate(java.util.Map<java.lang.String,java.lang.Object> itemMap)
Validates CMS Items given the attribute value map.
|
java.util.Map<java.lang.String,java.lang.Object> |
validateItemForUpdate(java.lang.String uuid,
java.util.Map<java.lang.String,java.lang.Object> itemMap)
Validates a CMS Item given the attribute value map and its uuid.
|
protected java.lang.ThreadLocal<java.util.Map<java.lang.String,java.lang.Object>> convertedItem
public SearchResult<java.util.Map<java.lang.String,java.lang.Object>> findCMSItems(CMSItemSearchData cmsItemSearchData, PageableData pageableData)
CMSItemFacadefindCMSItems in interface CMSItemFacadecmsItemSearchData - The catalog and filter informationpageableData - The paging informationpublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> findCMSItems(java.util.List<java.lang.String> uuids)
throws CMSItemNotFoundException
CMSItemFacadefindCMSItems in interface CMSItemFacadeuuids - The list of uuids of the CMSItems to look forCMSItemNotFoundException - if the item is not foundpublic java.util.Map<java.lang.String,java.lang.Object> getCMSItemByUuid(java.lang.String uuid)
throws CMSItemNotFoundException
UniqueItemIdentifierServicegetCMSItemByUuid in interface CMSItemFacadeuuid - - the universal unique identifierMap<String, Object> representation of the CMS ItemTypePermissionException - when user does not have permission to read an instance of the given item type.CMSItemNotFoundException - when a CMS Item can not be found for a given uuid.protected java.util.Map<java.lang.String,java.lang.Object> getCMSItemByUuid(java.lang.String uuid,
boolean throwException)
UniqueItemIdentifierServiceuuid - the universal unique identifierthrowException - determines if an exception is thrown or not if an item is not found for the given uuidNULL when user does not have READ permission for the type of the CMS Item and
throwException is FALSECMSItemNotFoundException - when a CMS Item can not be found for a given uuiTypePermissionException - when user does not have READ permission for the type of the CMS Item.public java.util.Map<java.lang.String,java.lang.Object> createItem(java.util.Map<java.lang.String,java.lang.Object> itemMap)
throws CMSItemNotFoundException
createItem in interface CMSItemFacadeitemMap - - the Map<String, Object> that contains the attributes values for the new CMSItem.TypePermissionException - when user does not have permission to create an instance of the given item type.CMSItemNotFoundException - when a CMS Item can not be found for a given uuid.public java.util.Map<java.lang.String,java.lang.Object> updateItem(java.lang.String uuid,
java.util.Map<java.lang.String,java.lang.Object> itemMap)
throws CMSItemNotFoundException
UniqueItemIdentifierServiceupdateItem in interface CMSItemFacadeuuid - - the universal unique identifieritemMap - - the Map<String, Object> that contains the attributes values for the new CMSItem.TypePermissionException - when user does not have permission to update an instance of the given item type.CMSItemNotFoundException - when a CMS Item can not be found for a given uuid.protected void initialUpdateValidation(java.lang.String uuid,
java.util.Map<java.lang.String,java.lang.Object> itemMap)
throws CMSItemNotFoundException
uuid - the item unique identifieritemMap - the itemMap representation of the item model.CMSItemNotFoundException - when the item does not exist.protected java.util.Map<java.lang.String,java.lang.Object> saveItem(java.util.Map<java.lang.String,java.lang.Object> itemMap,
java.util.function.Predicate<java.lang.String> typePermissionPredicate,
java.lang.String permissionName)
itemMap - the itemMap to be savedtypePermissionPredicate - the predicate to evaluate the type permissions for the current userpermissionName - the operation user wants to perform on the item; possible values can be found in
PermissionsConstantsCMSItemNotFoundException - when an item for a given uid does not existprotected void transformValidationException(ModelSavingException error)
error - the ModelSavingExceptionprotected ItemModel convertAndPopulate(java.util.Map<java.lang.String,java.lang.Object> itemMap)
itemMap - the Map representing the ItemModel to be converted and savedprotected java.util.Map<java.lang.String,java.lang.Object> convertAndPopulate(CMSItemModel itemModel)
itemModel - the itemModel to be converted to the Map.public void deleteCMSItemByUuid(java.lang.String uuid)
throws CMSItemNotFoundException
deleteCMSItemByUuid in interface CMSItemFacadeuuid - - the universal unique identifierTypePermissionException - when user does not have permission to remove an instance of the given item type.CMSItemNotFoundException - when a CMS Item can not be found for a given uuid.public java.util.Map<java.lang.String,java.lang.Object> validateItemForUpdate(java.lang.String uuid,
java.util.Map<java.lang.String,java.lang.Object> itemMap)
throws CMSItemNotFoundException
CMSItemFacadeUniqueItemIdentifierServicevalidateItemForUpdate in interface CMSItemFacadeuuid - - the universal unique identifieritemMap - - the Map<String, Object> that contains the attributes values for the new CMSItem.CMSItemNotFoundException - when a CMS Item can not be found for a given uuid.public java.util.Map<java.lang.String,java.lang.Object> validateItemForCreate(java.util.Map<java.lang.String,java.lang.Object> itemMap)
throws CMSItemNotFoundException
CMSItemFacadevalidateItemForCreate in interface CMSItemFacadeitemMap - - the Map<String, Object> that contains the attributes values for the new CMSItem.CMSItemNotFoundException - when a CMS Item can not be found for a given uuid.protected java.util.Map<java.lang.String,java.lang.Object> validateItem(java.util.Map<java.lang.String,java.lang.Object> itemMap)
itemMap - the item model representation as a mapCMSItemNotFoundException - when any item in its map does not exist.protected CMSItemNotFoundException createCMSItemNotFoundException(java.lang.String uuid)
CMSItemNotFoundException.uuid - The string representing the UUID of the item not found.protected TypePermissionException createTypePermissionException(java.lang.String permissionName, java.lang.String itemType)
TypePermissionException with a localized error messagepermissionName - The permission name defined by PermissionsConstantsitemType - The type code of the itemTypePermissionExceptionprotected CMSItemConverter getCmsItemConverter()
public void setCmsItemConverter(CMSItemConverter cmsItemConverter)
protected ModelService getModelService()
public void setModelService(ModelService modelService)
protected UniqueItemIdentifierService getUniqueItemIdentifierService()
public void setUniqueItemIdentifierService(UniqueItemIdentifierService uniqueItemIdentifierService)
protected void setCatalogInSession(java.util.Map<java.lang.String,java.lang.Object> source)
throws CMSItemNotFoundException
source - CMSItemNotFoundExceptionprotected void setCloneContext(java.util.Map<java.lang.String,java.lang.Object> source)
source - protected void setRestoreContext(java.util.Map<java.lang.String,java.lang.Object> source)
source - protected ItemTypePopulatorProvider getItemTypePopulatorProvider()
public void setItemTypePopulatorProvider(ItemTypePopulatorProvider itemTypePopulatorProvider)
protected CMSItemSearchService getCmsItemSearchService()
public void setCmsItemSearchService(CMSItemSearchService cmsItemSearchService)
protected Validator getCmsItemSearchDataValidator()
public void setCmsItemSearchDataValidator(Validator cmsItemSearchDataValidator)
protected FacadeValidationService getFacadeValidationService()
public void setFacadeValidationService(FacadeValidationService facadeValidationService)
protected Converter<CMSItemSearchData,CMSItemSearchData> getCmsItemSearchDataConverter()
public void setCmsItemSearchDataConverter(Converter<CMSItemSearchData,CMSItemSearchData> cmsItemSearchDataConverter)
protected ValidationErrorsProvider getValidationErrorsProvider()
public void setValidationErrorsProvider(ValidationErrorsProvider validationErrorsProvider)
protected PlatformTransactionManager getTransactionManager()
public void setTransactionManager(PlatformTransactionManager transactionManager)
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
protected CatalogVersionService getCatalogVersionService()
public void setCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService)
protected CMSAdminSiteService getCmsAdminSiteService()
protected TypeService getTypeService()
public void setTypeService(TypeService typeService)
public SessionSearchRestrictionsDisabler getSessionSearchRestrictionsDisabler()
public void setSessionSearchRestrictionsDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionsDisabler)
protected OriginalClonedItemProvider getOriginalClonedItemProvider()
public void setOriginalClonedItemProvider(OriginalClonedItemProvider originalClonedItemProvider)
protected ItemDataPopulatorProvider getItemDataPopulatorProvider()
public void setItemDataPopulatorProvider(ItemDataPopulatorProvider itemDataPopulatorProvider)
protected PermissionCRUDService getPermissionCRUDService()
public void setPermissionCRUDService(PermissionCRUDService permissionCRUDService)
Copyright © 2018 SAP SE. All Rights Reserved.