@Service(value="blPageService") public class PageServiceImpl extends AbstractContentService implements PageService, SandBoxItemListener
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
AND |
protected java.util.List<ArchivedPagePublisher> |
archivedPageListeners |
protected boolean |
automaticallyApproveAndPromotePages |
protected java.util.List<PageDTO> |
EMPTY_PAGE_DTO |
protected LocaleService |
localeService |
protected static org.apache.commons.logging.Log |
LOG |
protected PageDTO |
NULL_PAGE |
protected net.sf.ehcache.Cache |
pageCache |
protected PageDao |
pageDao |
protected java.util.List<PageRuleProcessor> |
pageRuleProcessors |
protected SandBoxDao |
sandBoxDao |
protected SandBoxItemDao |
sandBoxItemDao |
protected StaticAssetService |
staticAssetService |
| Constructor and Description |
|---|
PageServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
Page |
addPage(Page page,
SandBox destinationSandbox)
This method is intended to be called from within the CMS
admin only.
|
protected void |
addPageListToCache(java.util.List<PageDTO> pageList,
java.lang.String key) |
protected java.util.List<ItemCriteriaDTO> |
buildItemCriteriaDTOList(Page page) |
protected java.lang.String |
buildKey(Page page) |
protected java.lang.String |
buildKey(SandBox currentSandbox,
Locale locale,
java.lang.String uri) |
protected PageDTO |
buildPageDTOInternal(Page page,
boolean secure) |
protected java.util.List<PageDTO> |
buildPageDTOList(java.util.List<Page> pageList,
boolean secure)
Converts a list of pages to a list of pageDTOs.
Internally calls buildPageDTO(...). |
protected java.lang.String |
buildRuleExpression(Page page) |
protected boolean |
checkForSandboxMatch(SandBox src,
SandBox dest) |
java.lang.Long |
countPages(SandBox sandbox,
org.hibernate.Criteria c) |
void |
deletePage(Page page,
SandBox destinationSandbox)
If deleting and item where page.originalPageId != null
then the item is deleted from the database.
|
protected PageDTO |
evaluatePageRules(java.util.List<PageDTO> pageDTOList,
Locale locale,
java.util.Map<java.lang.String,java.lang.Object> ruleDTOs) |
protected Locale |
findLanguageOnlyLocale(Locale locale) |
Page |
findPageById(java.lang.Long pageId)
Returns the page with the passed in id.
|
PageDTO |
findPageByURI(SandBox currentSandbox,
Locale locale,
java.lang.String uri,
java.util.Map<java.lang.String,java.lang.Object> ruleDTOs,
boolean secure)
Retrieve the page if one is available for the passed in uri.
|
java.util.Map<java.lang.String,PageField> |
findPageFieldsByPageId(java.lang.Long pageId)
Returns the page-fields associated with the passed in page-id.
|
java.util.List<Page> |
findPages(SandBox sandbox,
org.hibernate.Criteria c) |
PageTemplate |
findPageTemplateById(java.lang.Long id)
Returns the page template with the passed in id.
|
java.util.List<ArchivedPagePublisher> |
getArchivedPageListeners() |
protected net.sf.ehcache.Cache |
getPageCache() |
protected java.util.List<PageDTO> |
getPageListFromCache(java.lang.String key) |
boolean |
isAutomaticallyApproveAndPromotePages() |
protected boolean |
isProductionSandBox(SandBox dest) |
void |
itemPromoted(SandBoxItem sandBoxItem,
SandBox destinationSandBox) |
void |
itemRejected(SandBoxItem sandBoxItem,
SandBox destinationSandBox) |
void |
itemReverted(SandBoxItem sandBoxItem) |
protected java.util.List<PageDTO> |
mergePages(java.util.List<PageDTO> productionPageList,
java.util.List<Page> sandboxPageList,
boolean secure) |
protected boolean |
passesPageRules(PageDTO page,
java.util.Map<java.lang.String,java.lang.Object> ruleDTOs) |
protected void |
productionItemArchived(Page page) |
java.util.List<Page> |
readAllPages()
Returns all pages, regardless of any sandbox they are apart of
|
java.util.List<PageTemplate> |
readAllPageTemplates()
Returns all page templates, regardless of any sandbox they are apart of
|
void |
removePageFromCache(Page p)
Call to evict an item from the cache.
|
void |
removePageFromCache(java.lang.String baseKey)
Call to evict both secure and non-secure pages matching
the passed in key.
|
PageTemplate |
savePageTemplate(PageTemplate template)
Saves the given
PageTemplate |
void |
setArchivedPageListeners(java.util.List<ArchivedPagePublisher> archivedPageListeners) |
void |
setAutomaticallyApproveAndPromotePages(boolean automaticallyApproveAndPromotePages) |
Page |
updatePage(Page page,
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 PageDao pageDao
protected SandBoxItemDao sandBoxItemDao
protected SandBoxDao sandBoxDao
protected java.util.List<PageRuleProcessor> pageRuleProcessors
protected LocaleService localeService
protected StaticAssetService staticAssetService
@Value(value="${automatically.approve.pages}")
protected boolean automaticallyApproveAndPromotePages
protected net.sf.ehcache.Cache pageCache
protected java.util.List<ArchivedPagePublisher> archivedPageListeners
protected final PageDTO NULL_PAGE
protected final java.util.List<PageDTO> EMPTY_PAGE_DTO
public Page findPageById(java.lang.Long pageId)
findPageById in interface PageServicepageId - - The id of the page.public PageTemplate findPageTemplateById(java.lang.Long id)
PageServicefindPageTemplateById in interface PageServiceid - - the id of the page template@Transactional(value="blTransactionManager") public PageTemplate savePageTemplate(PageTemplate template)
PageServicePageTemplatesavePageTemplate in interface PageServicetemplate - the PageTemplate to savePageTemplatepublic java.util.Map<java.lang.String,PageField> findPageFieldsByPageId(java.lang.Long pageId)
findPageFieldsByPageId in interface PageServicepageId - - The id of the page.public Page addPage(Page page, SandBox destinationSandbox)
addPage in interface PageServicepublic Page updatePage(Page page, SandBox destSandbox)
updatePage in interface PageServiceprotected boolean isProductionSandBox(SandBox dest)
public void deletePage(Page page, SandBox destinationSandbox)
deletePage in interface PageServicepage - destinationSandbox - protected java.util.List<PageDTO> buildPageDTOList(java.util.List<Page> pageList, boolean secure)
pageList - secure - protected java.lang.String buildRuleExpression(Page page)
protected java.util.List<ItemCriteriaDTO> buildItemCriteriaDTOList(Page page)
protected java.util.List<PageDTO> mergePages(java.util.List<PageDTO> productionPageList, java.util.List<Page> sandboxPageList, boolean secure)
protected PageDTO evaluatePageRules(java.util.List<PageDTO> pageDTOList, Locale locale, java.util.Map<java.lang.String,java.lang.Object> ruleDTOs)
protected boolean passesPageRules(PageDTO page, java.util.Map<java.lang.String,java.lang.Object> ruleDTOs)
public PageDTO findPageByURI(SandBox currentSandbox, Locale locale, java.lang.String uri, java.util.Map<java.lang.String,java.lang.Object> ruleDTOs, boolean secure)
findPageByURI in interface PageServicecurrentSandbox - - current sandboxlocale - - current localeuri - - the URI to return a page forruleDTOs - - ruleDTOs that are used as the data to process page rulessecure - - set to true if current request is over HTTPSpublic java.util.List<Page> findPages(SandBox sandbox, org.hibernate.Criteria c)
findPages in interface PageServicepublic java.util.List<Page> readAllPages()
PageServicereadAllPages in interface PageServicePages configured in the systempublic java.util.List<PageTemplate> readAllPageTemplates()
PageServicereadAllPageTemplates in interface PageServicePageTemplates configured in the systempublic java.lang.Long countPages(SandBox sandbox, org.hibernate.Criteria c)
countPages in interface PageServiceprotected void productionItemArchived(Page page)
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 SandBoxItemListenerprotected net.sf.ehcache.Cache getPageCache()
protected java.lang.String buildKey(SandBox currentSandbox, Locale locale, java.lang.String uri)
protected java.lang.String buildKey(Page page)
protected void addPageListToCache(java.util.List<PageDTO> pageList, java.lang.String key)
protected java.util.List<PageDTO> getPageListFromCache(java.lang.String key)
public void removePageFromCache(Page p)
p - public void removePageFromCache(java.lang.String baseKey)
removePageFromCache in interface PageServicebaseKey - public java.util.List<ArchivedPagePublisher> getArchivedPageListeners()
getArchivedPageListeners in interface PageServicepublic void setArchivedPageListeners(java.util.List<ArchivedPagePublisher> archivedPageListeners)
setArchivedPageListeners in interface PageServicepublic boolean isAutomaticallyApproveAndPromotePages()
isAutomaticallyApproveAndPromotePages in interface PageServicepublic void setAutomaticallyApproveAndPromotePages(boolean automaticallyApproveAndPromotePages)
setAutomaticallyApproveAndPromotePages in interface PageServiceCopyright © 2018. All Rights Reserved.