@Service(value="blStructuredContentService") public class StructuredContentServiceImpl extends AbstractContentService implements StructuredContentService
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
AND |
protected java.util.List<ArchivedStructuredContentPublisher> |
archivedStructuredContentListeners |
protected boolean |
automaticallyApproveAndPromoteStructuredContent |
protected java.util.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(java.lang.String key,
java.util.List<StructuredContentDTO> scDTOList) |
protected void |
buildFieldValues(StructuredContent sc,
StructuredContentDTO scDTO,
boolean secure) |
protected java.util.List<ItemCriteriaDTO> |
buildItemCriteriaDTOList(StructuredContent sc) |
protected java.lang.String |
buildNameKey(SandBox currentSandbox,
Locale locale,
java.lang.String contentType,
java.lang.String contentName) |
protected java.lang.String |
buildNameKey(StructuredContent sc) |
protected java.lang.String |
buildRuleExpression(StructuredContent sc) |
protected StructuredContentDTO |
buildStructuredContentDTO(StructuredContent sc,
boolean secure)
Converts a StructuredContent into a StructuredContentDTO.
|
protected java.util.List<StructuredContentDTO> |
buildStructuredContentDTOList(java.util.List<StructuredContent> structuredContentList,
boolean secure)
Converts a list of structured content items to a list of structured content DTOs.
Internally calls buildStructuredContentDTO(...). |
protected java.lang.String |
buildTypeKey(SandBox currentSandbox,
Locale locale,
java.lang.String contentType) |
protected java.lang.String |
buildTypeKey(StructuredContent sc) |
protected boolean |
checkForProductionSandbox(SandBox dest) |
protected boolean |
checkForSandboxMatch(SandBox src,
SandBox dest) |
java.lang.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 java.util.List<StructuredContentDTO> |
evaluateAndPriortizeContent(java.util.List<StructuredContentDTO> structuredContentList,
int count,
java.util.Map<java.lang.String,java.lang.Object> ruleDTOs) |
java.util.List<StructuredContent> |
findAllContentItems()
Finds all content items regardless of the
Sandbox they are a member of |
java.util.List<StructuredContent> |
findContentItems(SandBox sandbox,
org.hibernate.Criteria c)
This method is intended to be called solely from the CMS admin.
|
java.util.Map<java.lang.String,StructuredContentField> |
findFieldsByContentId(java.lang.Long contentId)
Returns the fields associated with the passed in contentId.
|
protected Locale |
findLanguageOnlyLocale(Locale locale) |
StructuredContent |
findStructuredContentById(java.lang.Long contentId)
Returns the StructuredContent item associated with the passed in id.
|
StructuredContentType |
findStructuredContentTypeById(java.lang.Long id)
Returns the
StructuredContentType associated with the passed in id. |
StructuredContentType |
findStructuredContentTypeByName(java.lang.String name)
Returns the
StructuredContentType associated with the passed in
String value. |
java.util.List<ArchivedStructuredContentPublisher> |
getArchivedStructuredContentListeners() |
java.util.List<StructuredContentRuleProcessor> |
getContentRuleProcessors() |
protected SandBox |
getProductionSandBox(SandBox currentSandBox) |
protected net.sf.ehcache.Cache |
getStructuredContentCache() |
protected java.util.List<StructuredContentDTO> |
getStructuredContentListFromCache(java.lang.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) |
java.util.List<StructuredContentDTO> |
lookupStructuredContentItemsByName(SandBox sandBox,
java.lang.String contentName,
Locale locale,
java.lang.Integer count,
java.util.Map<java.lang.String,java.lang.Object> ruleDTOs,
boolean secure)
This method returns content by name only.
|
java.util.List<StructuredContentDTO> |
lookupStructuredContentItemsByName(SandBox sandBox,
StructuredContentType contentType,
java.lang.String contentName,
Locale locale,
java.lang.Integer count,
java.util.Map<java.lang.String,java.lang.Object> ruleDTOs,
boolean secure)
This method returns content by name and type.
|
java.util.List<StructuredContentDTO> |
lookupStructuredContentItemsByType(SandBox sandBox,
StructuredContentType contentType,
Locale locale,
java.lang.Integer count,
java.util.Map<java.lang.String,java.lang.Object> ruleDTOs,
boolean secure)
This method returns content
Returns active content items for the passed in sandbox that match the passed in type. |
protected java.util.List<StructuredContentDTO> |
mergeContent(java.util.List<StructuredContentDTO> productionList,
java.util.List<StructuredContent> sandboxList,
boolean secure) |
protected boolean |
processContentRules(StructuredContentDTO sc,
java.util.Map<java.lang.String,java.lang.Object> ruleDTOs) |
protected void |
productionItemArchived(StructuredContent sc) |
void |
removeItemFromCache(java.lang.String nameKey,
java.lang.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.
|
java.util.List<StructuredContentType> |
retrieveAllStructuredContentTypes() |
StructuredContentType |
saveStructuredContentType(StructuredContentType type)
Saves the given type and returns the merged instance
|
void |
setArchivedStructuredContentListeners(java.util.List<ArchivedStructuredContentPublisher> archivedStructuredContentListeners) |
void |
setAutomaticallyApproveAndPromoteStructuredContent(boolean automaticallyApproveAndPromoteStructuredContent) |
void |
setContentRuleProcessors(java.util.List<StructuredContentRuleProcessor> contentRuleProcessors) |
StructuredContent |
updateStructuredContent(StructuredContent content,
SandBox destSandbox)
This method is intended to be called from within the CMS
admin only.
|
countItems, findItemsprotected static final org.apache.commons.logging.Log LOG
protected static java.lang.String AND
protected StructuredContentDao structuredContentDao
protected SandBoxItemDao sandBoxItemDao
protected SandBoxDao sandBoxDao
protected StaticAssetService staticAssetService
protected LocaleService localeService
protected java.util.List<StructuredContentRuleProcessor> contentRuleProcessors
@Value(value="${automatically.approve.structured.content}")
protected boolean automaticallyApproveAndPromoteStructuredContent
protected net.sf.ehcache.Cache structuredContentCache
protected java.util.List<ArchivedStructuredContentPublisher> archivedStructuredContentListeners
public StructuredContent findStructuredContentById(java.lang.Long contentId)
StructuredContentServicefindStructuredContentById in interface StructuredContentServicecontentId - - The id of the content item.public StructuredContentType findStructuredContentTypeById(java.lang.Long id)
StructuredContentServiceStructuredContentType associated with the passed in id.findStructuredContentTypeById in interface StructuredContentServiceid - - The id of the content type.StructuredContentType.public StructuredContentType findStructuredContentTypeByName(java.lang.String name)
StructuredContentServiceStructuredContentType associated with the passed in
String value.findStructuredContentTypeByName in interface StructuredContentServicename - - The name of the content type.StructuredContentType.public java.util.List<StructuredContentType> retrieveAllStructuredContentTypes()
retrieveAllStructuredContentTypes in interface StructuredContentServiceStructuredContentTypespublic java.util.Map<java.lang.String,StructuredContentField> findFieldsByContentId(java.lang.Long contentId)
StructuredContentServicefindFieldsByContentId in interface StructuredContentServicecontentId - - The id of the content.public java.util.List<StructuredContent> findContentItems(SandBox sandbox, org.hibernate.Criteria c)
StructuredContentServiceSandBoxType of
production is passed in, only those items in that SandBox are returned.
findContentItems in interface StructuredContentServicesandbox - - 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 java.util.List<StructuredContent> findAllContentItems()
StructuredContentServiceSandbox they are a member offindAllContentItems in interface StructuredContentServicepublic java.lang.Long countContentItems(SandBox sandbox, org.hibernate.Criteria c)
StructuredContentServicefindContentItems.countContentItems in interface StructuredContentServicepublic StructuredContent addStructuredContent(StructuredContent content, SandBox destinationSandbox)
StructuredContentServiceaddStructuredContent in interface StructuredContentServicepublic StructuredContent updateStructuredContent(StructuredContent content, SandBox destSandbox)
StructuredContentServiceupdateStructuredContent in interface StructuredContentServicepublic StructuredContentType saveStructuredContentType(StructuredContentType type)
saveStructuredContentType in interface StructuredContentServiceprotected boolean checkForProductionSandbox(SandBox dest)
public void deleteStructuredContent(StructuredContent content, SandBox destinationSandbox)
StructuredContentServicedeleteStructuredContent in interface StructuredContentServiceprotected java.lang.String buildRuleExpression(StructuredContent sc)
protected java.util.List<ItemCriteriaDTO> buildItemCriteriaDTOList(StructuredContent sc)
protected void buildFieldValues(StructuredContent sc, StructuredContentDTO scDTO, boolean secure)
protected java.util.List<StructuredContentDTO> buildStructuredContentDTOList(java.util.List<StructuredContent> structuredContentList, boolean secure)
structuredContentList - secure - protected StructuredContentDTO buildStructuredContentDTO(StructuredContent sc, boolean secure)
sc - secure - protected java.util.List<StructuredContentDTO> mergeContent(java.util.List<StructuredContentDTO> productionList, java.util.List<StructuredContent> sandboxList, boolean secure)
protected java.util.List<StructuredContentDTO> evaluateAndPriortizeContent(java.util.List<StructuredContentDTO> structuredContentList, int count, java.util.Map<java.lang.String,java.lang.Object> ruleDTOs)
protected boolean processContentRules(StructuredContentDTO sc, java.util.Map<java.lang.String,java.lang.Object> ruleDTOs)
public java.util.List<StructuredContentDTO> lookupStructuredContentItemsByType(SandBox sandBox, StructuredContentType contentType, Locale locale, java.lang.Integer count, java.util.Map<java.lang.String,java.lang.Object> ruleDTOs, boolean secure)
StructuredContentServiceSandBoxType of
production is passed in, only those items in that SandBox are returned.
lookupStructuredContentItemsByType in interface StructuredContentServicesandBox - - 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 httpsDisplayContentTagpublic java.util.List<StructuredContentDTO> lookupStructuredContentItemsByName(SandBox sandBox, StructuredContentType contentType, java.lang.String contentName, Locale locale, java.lang.Integer count, java.util.Map<java.lang.String,java.lang.Object> ruleDTOs, boolean secure)
StructuredContentServiceSandBoxType of
production is passed in, only those items in that SandBox are returned.
lookupStructuredContentItemsByName in interface StructuredContentServicesandBox - - 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 httpsDisplayContentTagpublic java.util.List<StructuredContentDTO> lookupStructuredContentItemsByName(SandBox sandBox, java.lang.String contentName, Locale locale, java.lang.Integer count, java.util.Map<java.lang.String,java.lang.Object> ruleDTOs, boolean secure)
StructuredContentServiceSandBoxType of
production is passed in, only those items in that SandBox are returned.
lookupStructuredContentItemsByName in interface StructuredContentServicesandBox - - 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 httpsDisplayContentTagprotected boolean isProductionSandBox(SandBox dest)
protected void productionItemArchived(StructuredContent sc)
public void itemPromoted(SandBoxItem sandBoxItem, SandBox destinationSandBox)
itemPromoted in interface SandBoxItemListenerpublic void itemRejected(SandBoxItem sandBoxItem, SandBox destinationSandBox)
itemRejected in interface SandBoxItemListenerpublic void itemReverted(SandBoxItem sandBoxItem)
itemReverted in interface SandBoxItemListenerpublic java.util.List<StructuredContentRuleProcessor> getContentRuleProcessors()
public void setContentRuleProcessors(java.util.List<StructuredContentRuleProcessor> contentRuleProcessors)
protected net.sf.ehcache.Cache getStructuredContentCache()
protected java.lang.String buildNameKey(StructuredContent sc)
protected java.lang.String buildTypeKey(StructuredContent sc)
protected java.lang.String buildNameKey(SandBox currentSandbox, Locale locale, java.lang.String contentType, java.lang.String contentName)
protected java.lang.String buildTypeKey(SandBox currentSandbox, Locale locale, java.lang.String contentType)
protected void addStructuredContentListToCache(java.lang.String key,
java.util.List<StructuredContentDTO> scDTOList)
protected java.util.List<StructuredContentDTO> getStructuredContentListFromCache(java.lang.String key)
public void removeStructuredContentFromCache(StructuredContent sc)
sc - public void removeItemFromCache(java.lang.String nameKey,
java.lang.String typeKey)
removeItemFromCache in interface StructuredContentServicenameKey - typeKey - - key for a type of content itempublic java.util.List<ArchivedStructuredContentPublisher> getArchivedStructuredContentListeners()
public void setArchivedStructuredContentListeners(java.util.List<ArchivedStructuredContentPublisher> archivedStructuredContentListeners)
public boolean isAutomaticallyApproveAndPromoteStructuredContent()
isAutomaticallyApproveAndPromoteStructuredContent in interface StructuredContentServicepublic void setAutomaticallyApproveAndPromoteStructuredContent(boolean automaticallyApproveAndPromoteStructuredContent)
setAutomaticallyApproveAndPromoteStructuredContent in interface StructuredContentServiceCopyright © 2018. All Rights Reserved.