public interface StructuredContentService
StructuredContent items.| Modifier and Type | Method and Description |
|---|---|
void |
addStructuredContentListToCache(String key,
List<StructuredContentDTO> scDTOList) |
List<StructuredContentDTO> |
buildStructuredContentDTOList(List<StructuredContent> structuredContentList,
boolean secure) |
String |
buildTypeKey(SandBox currentSandbox,
Long site,
Locale locale,
String contentType) |
List<StructuredContentDTO> |
convertToDtos(List<StructuredContent> scs,
boolean isSecure)
Converts a list of StructuredContent objects into their corresponding
StructuredContentDTOs. |
Long |
countContentItems(org.hibernate.Criteria c)
Follows the same rules as
findContentItems. |
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(org.hibernate.Criteria criteria)
This method is intended to be called solely from the CMS admin.
|
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. |
net.sf.ehcache.Cache |
getStructuredContentCache() |
List<StructuredContentDTO> |
getStructuredContentListFromCache(String key) |
List<StructuredContentDTO> |
hydrateForeignLookups(List<StructuredContentDTO> dtos)
StructuredContentDTO objects are sometimes cached in the StructuredContentService. |
List<StructuredContentDTO> |
lookupStructuredContentItemsByName(String contentName,
Locale locale,
Integer count,
Map<String,Object> ruleDTOs,
boolean secure)
This method returns content by name only.
|
List<StructuredContentDTO> |
lookupStructuredContentItemsByName(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(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. |
void |
removeItemFromCache(String nameKey,
String typeKey) |
void |
removeStructuredContentFromCache(SandBox sandBox,
StructuredContent sc) |
List<StructuredContentType> |
retrieveAllStructuredContentTypes() |
StructuredContentType |
saveStructuredContentType(StructuredContentType type)
Saves the given type and returns the merged instance
|
StructuredContent findStructuredContentById(Long contentId)
contentId - - The id of the content item.StructuredContentType findStructuredContentTypeById(Long id)
StructuredContentType associated with the passed in id.id - - The id of the content type.StructuredContentType.StructuredContentType findStructuredContentTypeByName(String name)
StructuredContentType associated with the passed in
String value.name - - The name of the content type.StructuredContentType.List<StructuredContentType> retrieveAllStructuredContentTypes()
StructuredContentTypesList<StructuredContent> findContentItems(org.hibernate.Criteria criteria)
SandBoxType of
production is passed in, only those items in that SandBox are returned.
sandbox - - the sandbox to find structured content items (null indicates items that are in production for
sites that are single tenant.criteria - - the criteria used to search for contentList<StructuredContent> findAllContentItems()
Sandbox they are a member ofLong countContentItems(org.hibernate.Criteria c)
findContentItems.StructuredContentType saveStructuredContentType(StructuredContentType type)
List<StructuredContentDTO> lookupStructuredContentItemsByType(StructuredContentType contentType, Locale locale, Integer count, Map<String,Object> ruleDTOs, boolean secure)
SandBoxType of
production is passed in, only those items in that SandBox are returned.
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 httpsDisplayContentTagList<StructuredContentDTO> lookupStructuredContentItemsByName(String contentName, Locale locale, Integer count, Map<String,Object> ruleDTOs, boolean secure)
SandBoxType of
production is passed in, only those items in that SandBox are returned.
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 httpsDisplayContentTagList<StructuredContentDTO> lookupStructuredContentItemsByName(StructuredContentType contentType, String contentName, Locale locale, Integer count, Map<String,Object> ruleDTOs, boolean secure)
SandBoxType of
production is passed in, only those items in that SandBox are returned.
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 httpsDisplayContentTagList<StructuredContentDTO> buildStructuredContentDTOList(List<StructuredContent> structuredContentList, boolean secure)
List<StructuredContentDTO> evaluateAndPriortizeContent(List<StructuredContentDTO> structuredContentList, int count, Map<String,Object> ruleDTOs)
void removeStructuredContentFromCache(SandBox sandBox, StructuredContent sc)
net.sf.ehcache.Cache getStructuredContentCache()
void addStructuredContentListToCache(String key, List<StructuredContentDTO> scDTOList)
String buildTypeKey(SandBox currentSandbox, Long site, Locale locale, String contentType)
List<StructuredContentDTO> getStructuredContentListFromCache(String key)
List<StructuredContentDTO> hydrateForeignLookups(List<StructuredContentDTO> dtos)
StructuredContentDTO objects are sometimes cached in the StructuredContentService. Furthermore, this cached
version contains information about the kind of value the DTO might hold. In the cases where the value is a foreign
key lookup, we want to get the object that it represents and set that as the internal value. However, since these
DTOs are not Hibernate entities and are possibly stored in a cache, we need to load the target object on each request
to avoid lazy initialization exceptions. This method performs that hydration.dtos - List<StructuredContentDTO> convertToDtos(List<StructuredContent> scs, boolean isSecure)
StructuredContentDTOs. This method
will utilize a cache in production mode, and it will additionally hydrate the returned StructuredContentDTO
objects via the hydrateForeignLookups(List) method.scs - StructuredContentDTOsCopyright © 2015. All Rights Reserved.