Class ContentZoneServiceImpl
java.lang.Object
com.broadleafcommerce.advancedcms.service.ContentZoneServiceImpl
- All Implemented Interfaces:
ContentZoneService
@Repository("blContentZoneService")
public class ContentZoneServiceImpl
extends Object
implements ContentZoneService
- Author:
- Andre Azzolini (apazzolini)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected javax.cache.CacheManagerprotected static final Stringprotected ContentItemServiceprotected ContentTargeterServiceprotected ContentZoneDaoprotected ContentZoneServiceExtensionManagerprotected static final Stringprotected org.broadleafcommerce.common.dao.GenericEntityDaoprotected OverrideContentServiceprotected ContentZoneQueryExtensionHandlerprotected org.broadleafcommerce.common.cache.StatisticsServiceprotected static final Stringprotected javax.cache.Cacheprotected org.broadleafcommerce.cms.structure.service.StructuredContentService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddMasterStructuredContentDTOsToCache(ContentItemDTO contentItemDto, ContentItem item, boolean secure) protected voidaddStructuredContentDTOsToCache(ContentItemDTO contentItemDto, ContentItem item, boolean secure) protected StringbuildCacheKey(ContentItem contentItem) Build the cache key using sandbox original item id.protected StringbuildCacheKey(ContentItemDTO contentItemDto, ContentItem item) Build the cache key using the current item's id.protected voidbuildCiDtos(ContentItemDTO ciDto, boolean secure, ContentItem ci, Object translationBase) protected voidbuildCiMasterDtos(ContentItemDTO ciDto, boolean secure, ContentItem ci, Object translationBase) protected StringbuildMapKey(ContentItemDTO contentItemDto, boolean secure, org.broadleafcommerce.common.web.BroadleafRequestContext context) protected StringbuildMasterMapKey(ContentItemDTO contentItemDto, boolean secure, org.broadleafcommerce.common.web.BroadleafRequestContext context) protected ContentItemDTOcreateContentItemDto(ContentItem contentItem) Creates theContentItemDTOgiven a contentItem.findAllContentZonesUsingDefinition(ContentZoneDefinition contentZoneDefinition) findContentItemDTOForZoneName(String name, boolean secure) Returns theContentItemDTOassociated with the given zone namefindContentItemDTOForZoneName(String name, boolean secure, Map<String, Object> args) Returns theContentItemDTOassociated with the given zone name and extra arguments.findContentZoneByName(String name) Returns theContentZoneassociated with the given nameprotected StringgetCacheKey(String cacheKey, org.broadleafcommerce.common.extension.ResultType resultType) protected org.broadleafcommerce.common.extension.ResultTypegetResultType(Object object) protected org.broadleafcommerce.common.structure.dto.StructuredContentDTOgetStructuredContentDTO(boolean secure, Object translationBase, org.broadleafcommerce.cms.structure.domain.StructuredContent sc) protected javax.cache.Cacheprotected booleanisMasterContentData(org.broadleafcommerce.cms.structure.domain.StructuredContent sc) protected ContentItemprotected List<org.broadleafcommerce.common.structure.dto.StructuredContentDTO>lookupStructuredContentDTOsFromCache(ContentItemDTO contentItemDto, ContentItem item, boolean secure) saveContentZone(ContentZone contentZone) Saves the givenContentZoneand returns the saved versionprotected voidsortDTOsByPriority(List<org.broadleafcommerce.common.structure.dto.StructuredContentDTO> dtos)
-
Field Details
-
FOREIGN_LOOKUP
- See Also:
-
STRUCTURED_CONTENT_MAP_CACHE_HIT_RATE
- See Also:
-
CAHCE_KEY_LOCALE
- See Also:
-
contentZoneDao
-
overrideContentService
-
contentTargeterService
-
contentItemService
-
extensionManager
-
queryExtensionManager
-
genericDao
protected org.broadleafcommerce.common.dao.GenericEntityDao genericDao -
structuredContentService
protected org.broadleafcommerce.cms.structure.service.StructuredContentService structuredContentService -
statisticsService
protected org.broadleafcommerce.common.cache.StatisticsService statisticsService -
cacheManager
protected javax.cache.CacheManager cacheManager -
structuredContentMapCache
protected javax.cache.Cache structuredContentMapCache
-
-
Constructor Details
-
ContentZoneServiceImpl
public ContentZoneServiceImpl()
-
-
Method Details
-
findContentZoneByName
Description copied from interface:ContentZoneServiceReturns theContentZoneassociated with the given name- Specified by:
findContentZoneByNamein interfaceContentZoneService- Returns:
- the
ContentZone
-
saveContentZone
Description copied from interface:ContentZoneServiceSaves the givenContentZoneand returns the saved version- Specified by:
saveContentZonein interfaceContentZoneService- Returns:
- the saved
ContentZone
-
findContentItemDTOForZoneName
Description copied from interface:ContentZoneServiceReturns theContentItemDTOassociated with the given zone name- Specified by:
findContentItemDTOForZoneNamein interfaceContentZoneServicesecure- Some ContentItems contain HTML with URLs that must be modified based on HTTP or HTTPS- Returns:
- the
ContentItemDTO
-
buildCacheKey
Build the cache key using the current item's id.- Parameters:
contentItemDto-- Returns:
- cache key
-
buildCacheKey
Build the cache key using sandbox original item id. If null, revert to the current content item's id.- Parameters:
contentItem-- Returns:
- cache key
-
getCacheKey
-
getResultType
-
buildMasterMapKey
protected String buildMasterMapKey(ContentItemDTO contentItemDto, boolean secure, org.broadleafcommerce.common.web.BroadleafRequestContext context) -
buildMapKey
protected String buildMapKey(ContentItemDTO contentItemDto, boolean secure, org.broadleafcommerce.common.web.BroadleafRequestContext context) -
lookupStructuredContentDTOsFromCache
protected List<org.broadleafcommerce.common.structure.dto.StructuredContentDTO> lookupStructuredContentDTOsFromCache(ContentItemDTO contentItemDto, ContentItem item, boolean secure) -
addStructuredContentDTOsToCache
protected void addStructuredContentDTOsToCache(ContentItemDTO contentItemDto, ContentItem item, boolean secure) -
addMasterStructuredContentDTOsToCache
protected void addMasterStructuredContentDTOsToCache(ContentItemDTO contentItemDto, ContentItem item, boolean secure) -
getStructuredContentMapCache
protected javax.cache.Cache getStructuredContentMapCache() -
findContentItemDTOForZoneName
public ContentItemDTO findContentItemDTOForZoneName(String name, boolean secure, Map<String, Object> args) Description copied from interface:ContentZoneServiceReturns theContentItemDTOassociated with the given zone name and extra arguments.- Specified by:
findContentItemDTOForZoneNamein interfaceContentZoneServicesecure- Some ContentItems contain HTML with URLs that must be modified based on HTTP or HTTPSargs- - additional arguments that an implementation might want to use to more specifically find a ContentItem- Returns:
- the
ContentItemDTO
-
isMasterContentData
protected boolean isMasterContentData(org.broadleafcommerce.cms.structure.domain.StructuredContent sc) -
buildCiDtos
protected void buildCiDtos(ContentItemDTO ciDto, boolean secure, ContentItem ci, Object translationBase) -
buildCiMasterDtos
protected void buildCiMasterDtos(ContentItemDTO ciDto, boolean secure, ContentItem ci, Object translationBase) -
getStructuredContentDTO
protected org.broadleafcommerce.common.structure.dto.StructuredContentDTO getStructuredContentDTO(boolean secure, Object translationBase, org.broadleafcommerce.cms.structure.domain.StructuredContent sc) -
sortDTOsByPriority
protected void sortDTOsByPriority(List<org.broadleafcommerce.common.structure.dto.StructuredContentDTO> dtos) -
lookupContentItemForZone
-
createContentItemDto
Creates theContentItemDTOgiven a contentItem. -
findContentZoneDefinitionsAllowingWidget
- Specified by:
findContentZoneDefinitionsAllowingWidgetin interfaceContentZoneService- Returns:
- a list of
ContentZoneDefinitions that allow the given Widget
-
findAllContentZonesUsingDefinition
public List<ContentZone> findAllContentZonesUsingDefinition(ContentZoneDefinition contentZoneDefinition) - Specified by:
findAllContentZonesUsingDefinitionin interfaceContentZoneService- Returns:
- a list of
ContentZones that are using the given ContentZoneDefinition
-
findContentZoneDefinitionById
- Specified by:
findContentZoneDefinitionByIdin interfaceContentZoneService- Returns:
- the
ContentZoneDefinitionmatching the given id
-
findContentZoneById
- Specified by:
findContentZoneByIdin interfaceContentZoneService- Returns:
- the
ContentZonematching the given id
-