@Service(value="blPageService") public class PageServiceImpl extends AbstractContentService implements PageService, SandBoxItemListener
Modifier and Type | Field and Description |
---|---|
protected List<ArchivedPagePublisher> |
archivedPageListeners |
protected boolean |
automaticallyApproveAndPromotePages |
protected LocaleService |
localeService |
protected net.sf.ehcache.Cache |
pageCache |
protected PageDao |
pageDao |
protected 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 PageDTO |
buildPageDTOInternal(Page page,
boolean secure) |
protected List<PageDTO> |
buildPageDTOList(List<Page> pageList,
boolean secure)
Converts a list of pages to a list of pageDTOs.
Internally calls buildPageDTO(...). |
protected String |
buildRuleExpression(Page page) |
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(List<PageDTO> pageDTOList,
Map<String,Object> ruleDTOs) |
Page |
findPageById(Long pageId)
Returns the page with the passed in id.
|
PageDTO |
findPageByURI(SandBox currentSandbox,
Locale locale,
String uri,
Map<String,Object> ruleDTOs,
boolean secure)
Retrieve the page if one is available for the passed in uri.
|
Map<String,PageField> |
findPageFieldsByPageId(Long pageId)
Returns the page-fields associated with the passed in page-id.
|
List<Page> |
findPages(SandBox sandbox,
org.hibernate.Criteria c) |
PageTemplate |
findPageTemplateById(Long id)
Returns the page template with the passed in id.
|
List<ArchivedPagePublisher> |
getArchivedPageListeners() |
boolean |
isAutomaticallyApproveAndPromotePages() |
void |
itemPromoted(SandBoxItem sandBoxItem,
SandBox destinationSandBox) |
void |
itemRejected(SandBoxItem sandBoxItem,
SandBox destinationSandBox) |
void |
itemReverted(SandBoxItem sandBoxItem) |
protected List<PageDTO> |
mergePages(List<PageDTO> productionPageList,
List<Page> sandboxPageList,
boolean secure) |
protected boolean |
passesPageRules(PageDTO page,
Map<String,Object> ruleDTOs) |
protected void |
productionItemArchived(Page page) |
void |
removePageFromCache(Page p)
Call to evict an item from the cache.
|
void |
removePageFromCache(String baseKey)
Call to evict both secure and non-secure pages matching
the passed in key.
|
void |
setArchivedPageListeners(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, findItems
protected PageDao pageDao
protected SandBoxItemDao sandBoxItemDao
protected SandBoxDao sandBoxDao
protected List<PageRuleProcessor> pageRuleProcessors
protected LocaleService localeService
protected StaticAssetService staticAssetService
@Value(value="${automatically.approve.pages}") protected boolean automaticallyApproveAndPromotePages
protected net.sf.ehcache.Cache pageCache
protected List<ArchivedPagePublisher> archivedPageListeners
public Page findPageById(Long pageId)
findPageById
in interface PageService
pageId
- - The id of the page.public PageTemplate findPageTemplateById(Long id)
PageService
findPageTemplateById
in interface PageService
id
- - the id of the page templatepublic Map<String,PageField> findPageFieldsByPageId(Long pageId)
findPageFieldsByPageId
in interface PageService
pageId
- - The id of the page.public Page addPage(Page page, SandBox destinationSandbox)
addPage
in interface PageService
public Page updatePage(Page page, SandBox destSandbox)
updatePage
in interface PageService
public void deletePage(Page page, SandBox destinationSandbox)
deletePage
in interface PageService
page
- destinationSandbox
- protected List<PageDTO> buildPageDTOList(List<Page> pageList, boolean secure)
pageList
- secure
- protected List<PageDTO> mergePages(List<PageDTO> productionPageList, List<Page> sandboxPageList, boolean secure)
protected PageDTO evaluatePageRules(List<PageDTO> pageDTOList, Map<String,Object> ruleDTOs)
public PageDTO findPageByURI(SandBox currentSandbox, Locale locale, String uri, Map<String,Object> ruleDTOs, boolean secure)
findPageByURI
in interface PageService
currentSandbox
- - 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 List<Page> findPages(SandBox sandbox, org.hibernate.Criteria c)
findPages
in interface PageService
public Long countPages(SandBox sandbox, org.hibernate.Criteria c)
countPages
in interface PageService
protected void productionItemArchived(Page page)
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 void removePageFromCache(Page p)
p
- public void removePageFromCache(String baseKey)
removePageFromCache
in interface PageService
baseKey
- public List<ArchivedPagePublisher> getArchivedPageListeners()
getArchivedPageListeners
in interface PageService
public void setArchivedPageListeners(List<ArchivedPagePublisher> archivedPageListeners)
setArchivedPageListeners
in interface PageService
public boolean isAutomaticallyApproveAndPromotePages()
isAutomaticallyApproveAndPromotePages
in interface PageService
public void setAutomaticallyApproveAndPromotePages(boolean automaticallyApproveAndPromotePages)
setAutomaticallyApproveAndPromotePages
in interface PageService
Copyright © 2013. All rights reserved.