public class SiteItemServiceImpl extends Object implements SiteItemService
SiteItemService
.Modifier and Type | Field and Description |
---|---|
protected List<org.craftercms.core.service.ItemFilter> |
defaultFilters |
protected List<org.apache.commons.collections4.Predicate<org.craftercms.core.service.Item>> |
defaultPredicates |
protected List<org.craftercms.core.processors.ItemProcessor> |
defaultProcessors |
protected org.craftercms.commons.converters.Converter<org.dom4j.Element,Object> |
modelFieldConverter |
protected Comparator<SiteItem> |
sortComparator |
protected org.craftercms.core.service.ContentStoreService |
storeService |
Constructor and Description |
---|
SiteItemServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected SiteItem |
createItemWrapper(org.craftercms.core.service.Item item) |
org.craftercms.core.service.Content |
getRawContent(String url)
Returns the raw content of a site item.
|
protected SiteContext |
getSiteContext() |
SiteItem |
getSiteItem(String url)
Returns the site item for the given URL
|
SiteItem |
getSiteItem(String url,
org.craftercms.core.processors.ItemProcessor processor)
Returns the site item for the given URL
|
SiteItem |
getSiteItem(String url,
org.craftercms.core.processors.ItemProcessor processor,
org.apache.commons.collections4.Predicate<org.craftercms.core.service.Item> predicate)
Returns the site item for the given URL
|
SiteItem |
getSiteTree(String url,
int depth)
Returns the site tree for the given URL.
|
SiteItem |
getSiteTree(String url,
int depth,
org.craftercms.core.service.ItemFilter filter,
org.craftercms.core.processors.ItemProcessor processor)
Returns the site tree for the given URL.
|
SiteItem |
getSiteTree(String url,
int depth,
String includeByNameRegex,
String excludeByNameRegex)
Deprecated.
|
SiteItem |
getSiteTree(String url,
int depth,
String includeByNameRegex,
String excludeByNameRegex,
Map<String,String> nodeXPathAndExpectedValuePairs)
Deprecated.
|
SiteItem |
getSiteTree(String url,
int depth,
String includeByNameRegex,
String excludeByNameRegex,
String[]... nodeXPathAndExpectedValuePairs)
Deprecated.
|
void |
setDefaultFilters(List<org.craftercms.core.service.ItemFilter> defaultFilters) |
void |
setDefaultPredicates(List<org.apache.commons.collections4.Predicate<org.craftercms.core.service.Item>> defaultPredicates) |
void |
setDefaultProcessors(List<org.craftercms.core.processors.ItemProcessor> defaultProcessors) |
void |
setModelFieldConverter(org.craftercms.commons.converters.Converter<org.dom4j.Element,Object> modelFieldConverter) |
void |
setSortComparator(Comparator<SiteItem> sortComparator) |
void |
setStoreService(org.craftercms.core.service.ContentStoreService storeService) |
protected org.craftercms.core.service.ContentStoreService storeService
protected List<org.apache.commons.collections4.Predicate<org.craftercms.core.service.Item>> defaultPredicates
protected List<org.craftercms.core.service.ItemFilter> defaultFilters
protected List<org.craftercms.core.processors.ItemProcessor> defaultProcessors
protected org.craftercms.commons.converters.Converter<org.dom4j.Element,Object> modelFieldConverter
protected Comparator<SiteItem> sortComparator
public void setStoreService(org.craftercms.core.service.ContentStoreService storeService)
public void setDefaultPredicates(List<org.apache.commons.collections4.Predicate<org.craftercms.core.service.Item>> defaultPredicates)
public void setDefaultFilters(List<org.craftercms.core.service.ItemFilter> defaultFilters)
public void setDefaultProcessors(List<org.craftercms.core.processors.ItemProcessor> defaultProcessors)
public void setModelFieldConverter(org.craftercms.commons.converters.Converter<org.dom4j.Element,Object> modelFieldConverter)
public void setSortComparator(Comparator<SiteItem> sortComparator)
public org.craftercms.core.service.Content getRawContent(String url)
SiteItemService
getRawContent
in interface SiteItemService
url
- the URL of the itempublic SiteItem getSiteItem(String url)
SiteItemService
getSiteItem
in interface SiteItemService
url
- the URL of the itempublic SiteItem getSiteItem(String url, org.craftercms.core.processors.ItemProcessor processor)
SiteItemService
getSiteItem
in interface SiteItemService
url
- the URL of the itemprocessor
- a processor for the itempublic SiteItem getSiteItem(String url, org.craftercms.core.processors.ItemProcessor processor, org.apache.commons.collections4.Predicate<org.craftercms.core.service.Item> predicate)
SiteItemService
getSiteItem
in interface SiteItemService
url
- the URL of the itemprocessor
- a processor for the itempredicate
- a predicate used to check if the item should be returned or notpublic SiteItem getSiteTree(String url, int depth)
SiteItemService
getSiteTree
in interface SiteItemService
url
- the URL of the folderdepth
- the depth of the returned treepublic SiteItem getSiteTree(String url, int depth, org.craftercms.core.service.ItemFilter filter, org.craftercms.core.processors.ItemProcessor processor)
SiteItemService
getSiteTree
in interface SiteItemService
url
- the URL of the folderdepth
- the depth of the returned treefilter
- a filter for the tree itemsprocessor
- a processor for the tree items@Deprecated public SiteItem getSiteTree(String url, int depth, String includeByNameRegex, String excludeByNameRegex)
SiteItemService
getSiteTree
in interface SiteItemService
url
- the URL of the folderdepth
- the depth of the returned treeincludeByNameRegex
- a name regex for items to includeexcludeByNameRegex
- a name regex for items to exclude@Deprecated public SiteItem getSiteTree(String url, int depth, String includeByNameRegex, String excludeByNameRegex, String[]... nodeXPathAndExpectedValuePairs)
SiteItemService
getSiteTree
in interface SiteItemService
url
- the URL of the folderdepth
- the depth of the returned treeincludeByNameRegex
- a name regex for items to includeexcludeByNameRegex
- a name regex for items to excludenodeXPathAndExpectedValuePairs
- an X * 2 matrix where the first column is a node XPath and the
second column is a expected value for that node. This XPath/value
pairs are used to filter out items.@Deprecated public SiteItem getSiteTree(String url, int depth, String includeByNameRegex, String excludeByNameRegex, Map<String,String> nodeXPathAndExpectedValuePairs)
SiteItemService
getSiteTree
in interface SiteItemService
url
- the URL of the folderdepth
- the depth of the returned treeincludeByNameRegex
- a name regex for items to includeexcludeByNameRegex
- a name regex for items to excludenodeXPathAndExpectedValuePairs
- a map where each key is a node XPath and each value is a expected value
for that node. This XPath/value pairs are used to filter out items.protected SiteContext getSiteContext()
protected SiteItem createItemWrapper(org.craftercms.core.service.Item item)
Copyright © 2020 CrafterCMS. All rights reserved.