Class SiteItemServiceImpl

java.lang.Object
org.craftercms.engine.service.impl.SiteItemServiceImpl
All Implemented Interfaces:
SiteItemService

public class SiteItemServiceImpl extends Object implements SiteItemService
Default implementation of SiteItemService.
Author:
Alfonso Vásquez
  • 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

      protected List<org.craftercms.core.service.ItemFilter> defaultFilters
    • defaultProcessors

      protected List<org.craftercms.core.processors.ItemProcessor> defaultProcessors
    • modelFieldConverter

      protected org.craftercms.commons.converters.Converter<org.dom4j.Element,Object> modelFieldConverter
    • sortComparator

      protected Comparator<SiteItem> 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

      public void setDefaultFilters(List<org.craftercms.core.service.ItemFilter> defaultFilters)
    • 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

      public void setSortComparator(Comparator<SiteItem> sortComparator)
    • getRawContent

      public org.craftercms.core.service.Content getRawContent(String url)
      Description copied from interface: SiteItemService
      Returns the raw content of a site item.
      Specified by:
      getRawContent in interface SiteItemService
      Parameters:
      url - the URL of the item
    • getSiteItem

      public SiteItem getSiteItem(SiteItem parent, org.dom4j.Element element)
      Description copied from interface: SiteItemService
      Returns the site item for the given XML element
      Specified by:
      getSiteItem in interface SiteItemService
      element - the XML element
      Returns:
      the site item
    • getSiteItem

      public SiteItem getSiteItem(String url)
      Description copied from interface: SiteItemService
      Returns the site item for the given URL
      Specified by:
      getSiteItem in interface SiteItemService
      Parameters:
      url - the URL of the item
    • getSiteItem

      public SiteItem getSiteItem(String url, org.craftercms.core.processors.ItemProcessor processor)
      Description copied from interface: SiteItemService
      Returns the site item for the given URL
      Specified by:
      getSiteItem in interface SiteItemService
      Parameters:
      url - the URL of the item
      processor - 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 interface SiteItemService
      Parameters:
      url - the URL of the item
      processor - a processor for the item
      predicate - a predicate used to check if the item should be returned or not
    • getSiteTree

      public SiteItem getSiteTree(String url, int depth)
      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 interface SiteItemService
      Parameters:
      url - the URL of the folder
      depth - 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 interface SiteItemService
      Parameters:
      url - the URL of the folder
      depth - the depth of the returned tree
      filter - a filter for the tree items
      processor - 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 interface SiteItemService
      Parameters:
      url - the URL of the folder
      depth - the depth of the returned tree
      includeByNameRegex - a name regex for items to include
      excludeByNameRegex - 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 interface SiteItemService
      Parameters:
      url - the URL of the folder
      depth - the depth of the returned tree
      includeByNameRegex - a name regex for items to include
      excludeByNameRegex - a name regex for items to exclude
      nodeXPathAndExpectedValuePairs - 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 interface SiteItemService
      Parameters:
      url - the URL of the folder
      depth - the depth of the returned tree
      includeByNameRegex - a name regex for items to include
      excludeByNameRegex - a name regex for items to exclude
      nodeXPathAndExpectedValuePairs - 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

      protected SiteContext getSiteContext()
    • createItemWrapper

      protected SiteItem createItemWrapper(org.craftercms.core.service.Item item)