@Service(value="blStructuredContentService") public class StructuredContentServiceImpl extends AbstractContentService implements StructuredContentService
Modifier and Type | Field and Description |
---|---|
protected static String |
AND |
protected List<ArchivedStructuredContentPublisher> |
archivedStructuredContentListeners |
protected boolean |
automaticallyApproveAndPromoteStructuredContent |
protected List<StructuredContentRuleProcessor> |
contentRuleProcessors |
protected LocaleService |
localeService |
protected static org.apache.commons.logging.Log |
LOG |
protected SandBoxDao |
sandBoxDao |
protected SandBoxItemDao |
sandBoxItemDao |
protected StaticAssetService |
staticAssetService |
protected net.sf.ehcache.Cache |
structuredContentCache |
protected StructuredContentDao |
structuredContentDao |
Constructor and Description |
---|
StructuredContentServiceImpl() |
Modifier and Type | Method and Description |
---|---|
StructuredContent |
addStructuredContent(StructuredContent content,
SandBox destinationSandbox)
This method is intended to be called from within the CMS
admin only.
|
protected void |
addStructuredContentListToCache(String key,
List<StructuredContentDTO> scDTOList) |
protected void |
buildFieldValues(StructuredContent sc,
StructuredContentDTO scDTO,
boolean secure) |
protected List<ItemCriteriaDTO> |
buildItemCriteriaDTOList(StructuredContent sc) |
protected String |
buildNameKey(SandBox currentSandbox,
Locale locale,
String contentType,
String contentName) |
protected String |
buildNameKey(StructuredContent sc) |
protected String |
buildRuleExpression(StructuredContent sc) |
protected StructuredContentDTO |
buildStructuredContentDTO(StructuredContent sc,
boolean secure)
Converts a StructuredContent into a StructuredContentDTO.
|
protected List<StructuredContentDTO> |
buildStructuredContentDTOList(List<StructuredContent> structuredContentList,
boolean secure)
Converts a list of structured content items to a list of structured content DTOs.
Internally calls buildStructuredContentDTO(...). |
protected String |
buildTypeKey(SandBox currentSandbox,
Locale locale,
String contentType) |
protected String |
buildTypeKey(StructuredContent sc) |
protected boolean |
checkForProductionSandbox(SandBox dest) |
protected boolean |
checkForSandboxMatch(SandBox src,
SandBox dest) |
Long |
countContentItems(SandBox sandbox,
org.hibernate.Criteria c)
Follows the same rules as
findContentItems . |
void |
deleteStructuredContent(StructuredContent content,
SandBox destinationSandbox)
If deleting and item where content.originalItemId != null
then the item is deleted from the database.
|
protected List<StructuredContentDTO> |
evaluateAndPriortizeContent(List<StructuredContentDTO> structuredContentList,
int count,
Map<String,Object> ruleDTOs) |
List<StructuredContent> |
findAllContentItems()
Finds all content items regardless of the
Sandbox they are a member of |
List<StructuredContent> |
findContentItems(SandBox sandbox,
org.hibernate.Criteria c)
This method is intended to be called solely from the CMS admin.
|
Map<String,StructuredContentField> |
findFieldsByContentId(Long contentId)
Returns the fields associated with the passed in contentId.
|
protected Locale |
findLanguageOnlyLocale(Locale locale) |
StructuredContent |
findStructuredContentById(Long contentId)
Returns the StructuredContent item associated with the passed in id.
|
StructuredContentType |
findStructuredContentTypeById(Long id)
Returns the
StructuredContentType associated with the passed in id. |
StructuredContentType |
findStructuredContentTypeByName(String name)
Returns the
StructuredContentType associated with the passed in
String value. |
List<ArchivedStructuredContentPublisher> |
getArchivedStructuredContentListeners() |
List<StructuredContentRuleProcessor> |
getContentRuleProcessors() |
protected SandBox |
getProductionSandBox(SandBox currentSandBox) |
protected net.sf.ehcache.Cache |
getStructuredContentCache() |
protected List<StructuredContentDTO> |
getStructuredContentListFromCache(String key) |
boolean |
isAutomaticallyApproveAndPromoteStructuredContent() |
protected boolean |
isProductionSandBox(SandBox dest) |
void |
itemPromoted(SandBoxItem sandBoxItem,
SandBox destinationSandBox) |
void |
itemRejected(SandBoxItem sandBoxItem,
SandBox destinationSandBox) |
void |
itemReverted(SandBoxItem sandBoxItem) |
List<StructuredContentDTO> |
lookupStructuredContentItemsByName(SandBox sandBox,
String contentName,
Locale locale,
Integer count,
Map<String,Object> ruleDTOs,
boolean secure)
This method returns content by name only.
|
List<StructuredContentDTO> |
lookupStructuredContentItemsByName(SandBox sandBox,
StructuredContentType contentType,
String contentName,
Locale locale,
Integer count,
Map<String,Object> ruleDTOs,
boolean secure)
This method returns content by name and type.
|
List<StructuredContentDTO> |
lookupStructuredContentItemsByType(SandBox sandBox,
StructuredContentType contentType,
Locale locale,
Integer count,
Map<String,Object> ruleDTOs,
boolean secure)
This method returns content
Returns active content items for the passed in sandbox that match the passed in type. |
protected List<StructuredContentDTO> |
mergeContent(List<StructuredContentDTO> productionList,
List<StructuredContent> sandboxList,
boolean secure) |
protected boolean |
processContentRules(StructuredContentDTO sc,
Map<String,Object> ruleDTOs) |
protected void |
productionItemArchived(StructuredContent sc) |
void |
removeItemFromCache(String nameKey,
String typeKey)
Call to evict both secure and non-secure SC items matching
the passed in key.
|
void |
removeStructuredContentFromCache(StructuredContent sc)
Call to evict an item from the cache.
|
List<StructuredContentType> |
retrieveAllStructuredContentTypes() |
StructuredContentType |
saveStructuredContentType(StructuredContentType type)
Saves the given type and returns the merged instance
|
void |
setArchivedStructuredContentListeners(List<ArchivedStructuredContentPublisher> archivedStructuredContentListeners) |
void |
setAutomaticallyApproveAndPromoteStructuredContent(boolean automaticallyApproveAndPromoteStructuredContent) |
void |
setContentRuleProcessors(List<StructuredContentRuleProcessor> contentRuleProcessors) |
StructuredContent |
updateStructuredContent(StructuredContent content,
SandBox destSandbox)
This method is intended to be called from within the CMS
admin only.
|
countItems, findItems
protected static final org.apache.commons.logging.Log LOG
protected static String AND
protected StructuredContentDao structuredContentDao
protected SandBoxItemDao sandBoxItemDao
protected SandBoxDao sandBoxDao
protected StaticAssetService staticAssetService
protected LocaleService localeService
protected List<StructuredContentRuleProcessor> contentRuleProcessors
@Value(value="${automatically.approve.structured.content}") protected boolean automaticallyApproveAndPromoteStructuredContent
protected net.sf.ehcache.Cache structuredContentCache
protected List<ArchivedStructuredContentPublisher> archivedStructuredContentListeners
public StructuredContent findStructuredContentById(Long contentId)
StructuredContentService
findStructuredContentById
in interface StructuredContentService
contentId
- - The id of the content item.public StructuredContentType findStructuredContentTypeById(Long id)
StructuredContentService
StructuredContentType
associated with the passed in id.findStructuredContentTypeById
in interface StructuredContentService
id
- - The id of the content type.StructuredContentType
.public StructuredContentType findStructuredContentTypeByName(String name)
StructuredContentService
StructuredContentType
associated with the passed in
String value.findStructuredContentTypeByName
in interface StructuredContentService
name
- - The name of the content type.StructuredContentType
.public List<StructuredContentType> retrieveAllStructuredContentTypes()
retrieveAllStructuredContentTypes
in interface StructuredContentService
StructuredContentType
spublic Map<String,StructuredContentField> findFieldsByContentId(Long contentId)
StructuredContentService
findFieldsByContentId
in interface StructuredContentService
contentId
- - The id of the content.public List<StructuredContent> findContentItems(SandBox sandbox, org.hibernate.Criteria c)
StructuredContentService
SandBoxType
of
production is passed in, only those items in that SandBox are returned.
findContentItems
in interface StructuredContentService
sandbox
- - the sandbox to find structured content items (null indicates items that are in production for
sites that are single tenant.c
- - the criteria used to search for contentpublic List<StructuredContent> findAllContentItems()
StructuredContentService
Sandbox
they are a member offindAllContentItems
in interface StructuredContentService
public Long countContentItems(SandBox sandbox, org.hibernate.Criteria c)
StructuredContentService
findContentItems
.countContentItems
in interface StructuredContentService
public StructuredContent addStructuredContent(StructuredContent content, SandBox destinationSandbox)
StructuredContentService
addStructuredContent
in interface StructuredContentService
public StructuredContent updateStructuredContent(StructuredContent content, SandBox destSandbox)
StructuredContentService
updateStructuredContent
in interface StructuredContentService
public StructuredContentType saveStructuredContentType(StructuredContentType type)
saveStructuredContentType
in interface StructuredContentService
protected boolean checkForProductionSandbox(SandBox dest)
public void deleteStructuredContent(StructuredContent content, SandBox destinationSandbox)
StructuredContentService
deleteStructuredContent
in interface StructuredContentService
protected String buildRuleExpression(StructuredContent sc)
protected List<ItemCriteriaDTO> buildItemCriteriaDTOList(StructuredContent sc)
protected void buildFieldValues(StructuredContent sc, StructuredContentDTO scDTO, boolean secure)
protected List<StructuredContentDTO> buildStructuredContentDTOList(List<StructuredContent> structuredContentList, boolean secure)
structuredContentList
- secure
- protected StructuredContentDTO buildStructuredContentDTO(StructuredContent sc, boolean secure)
sc
- secure
- protected List<StructuredContentDTO> mergeContent(List<StructuredContentDTO> productionList, List<StructuredContent> sandboxList, boolean secure)
protected List<StructuredContentDTO> evaluateAndPriortizeContent(List<StructuredContentDTO> structuredContentList, int count, Map<String,Object> ruleDTOs)
protected boolean processContentRules(StructuredContentDTO sc, Map<String,Object> ruleDTOs)
public List<StructuredContentDTO> lookupStructuredContentItemsByType(SandBox sandBox, StructuredContentType contentType, Locale locale, Integer count, Map<String,Object> ruleDTOs, boolean secure)
StructuredContentService
SandBoxType
of
production is passed in, only those items in that SandBox are returned.
lookupStructuredContentItemsByType
in interface StructuredContentService
sandBox
- - the sandbox to find structured content items (null indicates items that are in production for
sites that are single tenant.contentType
- - the type of content to returncount
- - the max number of content items to returnruleDTOs
- - a Map of objects that will be used in MVEL processing.secure
- - set to true if the request is being served over httpsDisplayContentTag
public List<StructuredContentDTO> lookupStructuredContentItemsByName(SandBox sandBox, StructuredContentType contentType, String contentName, Locale locale, Integer count, Map<String,Object> ruleDTOs, boolean secure)
StructuredContentService
SandBoxType
of
production is passed in, only those items in that SandBox are returned.
lookupStructuredContentItemsByName
in interface StructuredContentService
sandBox
- - the sandbox to find structured content items (null indicates items that are in production for
sites that are single tenant.contentType
- - the type of content to returncontentName
- - the name of content to returncount
- - the max number of content items to returnruleDTOs
- - a Map of objects that will be used in MVEL processing.secure
- - set to true if the request is being served over httpsDisplayContentTag
public List<StructuredContentDTO> lookupStructuredContentItemsByName(SandBox sandBox, String contentName, Locale locale, Integer count, Map<String,Object> ruleDTOs, boolean secure)
StructuredContentService
SandBoxType
of
production is passed in, only those items in that SandBox are returned.
lookupStructuredContentItemsByName
in interface StructuredContentService
sandBox
- - the sandbox to find structured content items (null indicates items that are in production for
sites that are single tenant.contentName
- - the name of content to returncount
- - the max number of content items to returnruleDTOs
- - a Map of objects that will be used in MVEL processing.secure
- - set to true if the request is being served over httpsDisplayContentTag
protected boolean isProductionSandBox(SandBox dest)
protected void productionItemArchived(StructuredContent sc)
public void itemPromoted(SandBoxItem sandBoxItem, SandBox destinationSandBox)
itemPromoted
in interface SandBoxItemListener
public void itemRejected(SandBoxItem sandBoxItem, SandBox destinationSandBox)
itemRejected
in interface SandBoxItemListener
public void itemReverted(SandBoxItem sandBoxItem)
itemReverted
in interface SandBoxItemListener
public List<StructuredContentRuleProcessor> getContentRuleProcessors()
public void setContentRuleProcessors(List<StructuredContentRuleProcessor> contentRuleProcessors)
protected net.sf.ehcache.Cache getStructuredContentCache()
protected String buildNameKey(StructuredContent sc)
protected String buildTypeKey(StructuredContent sc)
protected String buildNameKey(SandBox currentSandbox, Locale locale, String contentType, String contentName)
protected String buildTypeKey(SandBox currentSandbox, Locale locale, String contentType)
protected void addStructuredContentListToCache(String key, List<StructuredContentDTO> scDTOList)
protected List<StructuredContentDTO> getStructuredContentListFromCache(String key)
public void removeStructuredContentFromCache(StructuredContent sc)
sc
- public void removeItemFromCache(String nameKey, String typeKey)
removeItemFromCache
in interface StructuredContentService
nameKey
- typeKey
- - key for a type of content itempublic List<ArchivedStructuredContentPublisher> getArchivedStructuredContentListeners()
public void setArchivedStructuredContentListeners(List<ArchivedStructuredContentPublisher> archivedStructuredContentListeners)
public boolean isAutomaticallyApproveAndPromoteStructuredContent()
isAutomaticallyApproveAndPromoteStructuredContent
in interface StructuredContentService
public void setAutomaticallyApproveAndPromoteStructuredContent(boolean automaticallyApproveAndPromoteStructuredContent)
setAutomaticallyApproveAndPromoteStructuredContent
in interface StructuredContentService
Copyright © 2014. All rights reserved.