Class SiteItemServiceImpl
java.lang.Object
org.craftercms.engine.service.impl.SiteItemServiceImpl
- All Implemented Interfaces:
SiteItemService
Default implementation of
SiteItemService
.- Author:
- Alfonso Vásquez
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<org.craftercms.core.service.ItemFilter>
protected List<org.apache.commons.collections4.Predicate<org.craftercms.core.service.Item>>
protected List<org.craftercms.core.processors.ItemProcessor>
protected org.craftercms.commons.converters.Converter<org.dom4j.Element,
Object> protected Comparator<SiteItem>
protected org.craftercms.core.service.ContentStoreService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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
getSiteItem
(String url) Returns the site item for the given URLgetSiteItem
(String url, org.craftercms.core.processors.ItemProcessor processor) Returns the site item for the given URLgetSiteItem
(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 URLgetSiteItem
(SiteItem parent, org.dom4j.Element element) Returns the site item for the given XML elementgetSiteTree
(String url, int depth) Returns the site tree for the given URL.getSiteTree
(String url, int depth, String includeByNameRegex, String excludeByNameRegex) Deprecated.getSiteTree
(String url, int depth, String includeByNameRegex, String excludeByNameRegex, String[]... nodeXPathAndExpectedValuePairs) Deprecated.getSiteTree
(String url, int depth, String includeByNameRegex, String excludeByNameRegex, Map<String, String> nodeXPathAndExpectedValuePairs) Deprecated.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.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)
-
Field Details
-
storeService
protected org.craftercms.core.service.ContentStoreService storeService -
defaultPredicates
protected List<org.apache.commons.collections4.Predicate<org.craftercms.core.service.Item>> defaultPredicates -
defaultFilters
-
defaultProcessors
-
modelFieldConverter
-
sortComparator
-
-
Constructor Details
-
SiteItemServiceImpl
public SiteItemServiceImpl()
-
-
Method Details
-
setStoreService
public void setStoreService(org.craftercms.core.service.ContentStoreService storeService) -
setDefaultPredicates
public void setDefaultPredicates(List<org.apache.commons.collections4.Predicate<org.craftercms.core.service.Item>> defaultPredicates) -
setDefaultFilters
-
setDefaultProcessors
public void setDefaultProcessors(List<org.craftercms.core.processors.ItemProcessor> defaultProcessors) -
setModelFieldConverter
public void setModelFieldConverter(org.craftercms.commons.converters.Converter<org.dom4j.Element, Object> modelFieldConverter) -
setSortComparator
-
getRawContent
Description copied from interface:SiteItemService
Returns the raw content of a site item.- Specified by:
getRawContent
in interfaceSiteItemService
- Parameters:
url
- the URL of the item
-
getSiteItem
Description copied from interface:SiteItemService
Returns the site item for the given XML element- Specified by:
getSiteItem
in interfaceSiteItemService
element
- the XML element- Returns:
- the site item
-
getSiteItem
Description copied from interface:SiteItemService
Returns the site item for the given URL- Specified by:
getSiteItem
in interfaceSiteItemService
- Parameters:
url
- the URL of the item
-
getSiteItem
Description copied from interface:SiteItemService
Returns the site item for the given URL- Specified by:
getSiteItem
in interfaceSiteItemService
- Parameters:
url
- the URL of the itemprocessor
- a processor for the item
-
getSiteItem
public SiteItem getSiteItem(String url, org.craftercms.core.processors.ItemProcessor processor, org.apache.commons.collections4.Predicate<org.craftercms.core.service.Item> predicate) Description copied from interface:SiteItemService
Returns the site item for the given URL- Specified by:
getSiteItem
in interfaceSiteItemService
- Parameters:
url
- the URL of the itemprocessor
- a processor for the itempredicate
- a predicate used to check if the item should be returned or not
-
getSiteTree
Description copied from interface:SiteItemService
Returns the site tree for the given URL. The item is expected to be a folder.- Specified by:
getSiteTree
in interfaceSiteItemService
- Parameters:
url
- the URL of the folderdepth
- the depth of the returned tree
-
getSiteTree
public SiteItem getSiteTree(String url, int depth, org.craftercms.core.service.ItemFilter filter, org.craftercms.core.processors.ItemProcessor processor) Description copied from interface:SiteItemService
Returns the site tree for the given URL. The item is expected to be a folder.- Specified by:
getSiteTree
in interfaceSiteItemService
- Parameters:
url
- the URL of the folderdepth
- the depth of the returned treefilter
- a filter for the tree itemsprocessor
- a processor for the tree items
-
getSiteTree
@Deprecated public SiteItem getSiteTree(String url, int depth, String includeByNameRegex, String excludeByNameRegex) Deprecated.Description copied from interface:SiteItemService
Returns the site tree for the given URL. The item is expected to be a folder.- Specified by:
getSiteTree
in interfaceSiteItemService
- Parameters:
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
-
getSiteTree
@Deprecated public SiteItem getSiteTree(String url, int depth, String includeByNameRegex, String excludeByNameRegex, String[]... nodeXPathAndExpectedValuePairs) Deprecated.Description copied from interface:SiteItemService
Returns the site tree for the given URL. The item is expected to be a folder.- Specified by:
getSiteTree
in interfaceSiteItemService
- Parameters:
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.
-
getSiteTree
@Deprecated public SiteItem getSiteTree(String url, int depth, String includeByNameRegex, String excludeByNameRegex, Map<String, String> nodeXPathAndExpectedValuePairs) Deprecated.Description copied from interface:SiteItemService
Returns the site tree for the given URL. The item is expected to be a folder.- Specified by:
getSiteTree
in interfaceSiteItemService
- Parameters:
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.
-
getSiteContext
-
createItemWrapper
-