Interface ContentServiceInternal

All Known Implementing Classes:
ContentServiceInternalImpl

public interface ContentServiceInternal
  • Method Details

    • contentExists

      boolean contentExists(String siteId, String path)
      Check the existent of a content path
      Parameters:
      siteId - site identifier
      path - content path
      Returns:
      true if the content exists, false otherwise
    • shallowContentExists

      boolean shallowContentExists(String site, String path) throws SiteNotFoundException
      This is a faster, but less accurate, version of contentExists. This prioritizes performance over checking the actual underlying repository if the content is actually in the store or we simply hold a reference to the object in the actual store.
      Returns:
      true if site has content object at path
      Throws:
      SiteNotFoundException
    • getSubtreeItems

      List<String> getSubtreeItems(String siteId, String path)
      Get subtree items for given path.
      Parameters:
      siteId - site identifier
      path - path to get subtree items for
      Returns:
      list of paths of subtree items
    • getSubtreeItems

      List<String> getSubtreeItems(String siteId, List<String> path)
      Get subtree items for given paths.
      Parameters:
      siteId - site identifier
      path - list of paths to get subtree items for
      Returns:
      list of paths of subtree items
    • getChildrenByPath

      GetChildrenResult getChildrenByPath(String siteId, String path, String locale, String keyword, List<String> systemTypes, List<String> excludes, String sortStrategy, String order, int offset, int limit) throws ServiceLayerException, UserNotFoundException
      Get list of children for given path
      Parameters:
      siteId - site identifier
      path - item path to children for
      locale - filter children by locale
      keyword - filter children by keyword
      systemTypes - filter children by type
      excludes - exclude items by path
      sortStrategy - sort order
      order - ascending or descending
      offset - offset of the first child in the result
      limit - number of children to return
      Returns:
      list of children
      Throws:
      ServiceLayerException
      UserNotFoundException
    • getChildrenByPaths

      Get children for paths bulk. This method will return children for a list of paths. Result items will also include a SandboxItem object for the item itself.
      Parameters:
      siteId - the site id
      paths - paths to get children for. Notice that this parameter is redundant with the pathParams. This list of paths is used to validate permissions.
      pathParams - Map of extra parameters for each path
      Returns:
      object containing a list of GetChildrenByPathsBulkResult.ChildrenByPathResult
      Throws:
      ServiceLayerException - general service error
      UserNotFoundException - user not found (when calculating available actions)
    • getItem

      org.craftercms.core.service.Item getItem(String siteId, String path, boolean flatten)
    • getContentSize

      long getContentSize(String siteId, String path)
      Get content size
      Parameters:
      siteId - site identifier
      path - content path
      Returns:
      size in bytes
    • getItemByPath

      DetailedItem getItemByPath(String siteId, String path, boolean preferContent) throws ServiceLayerException, UserNotFoundException
      Get detailed for given path
      Parameters:
      siteId - site identifier
      path - item for path
      preferContent - if true return content item if available
      Returns:
      detailed item
      Throws:
      ServiceLayerException
      UserNotFoundException
    • getSandboxItemsByPath

      List<SandboxItem> getSandboxItemsByPath(String siteId, Collection<String> paths, boolean preferContent) throws ServiceLayerException, UserNotFoundException
      Get sandbox items for given list of paths
      Parameters:
      siteId - site identifier
      paths - list of paths to get sandbox items
      preferContent - if true return content items if available
      Returns:
      list of sandbox items
      Throws:
      ServiceLayerException
      UserNotFoundException
    • getSandboxItemsById

      List<SandboxItem> getSandboxItemsById(String siteId, List<Long> ids, List<org.craftercms.commons.rest.parameters.SortField> sortFields, boolean preferContent) throws ServiceLayerException, UserNotFoundException
      Get sandbox items for given list of paths
      Parameters:
      siteId - site identifier
      ids - list of ids to get sandbox items
      sortFields -
      preferContent - if true return content items if available
      Returns:
      list of sandbox items
      Throws:
      ServiceLayerException
      UserNotFoundException
    • isEditable

      boolean isEditable(String itemPath, String itemMimeType)
      Check if item is editable
      Parameters:
      itemPath - item path
      itemMimeType - item mime type
      Returns:
      true if item is editable
    • itemLockByPath

      void itemLockByPath(String siteId, String path)
      Lock item by path for given site
      Parameters:
      siteId - site identifier
      path - item path to lock
    • itemUnlockByPath

      void itemUnlockByPath(String siteId, String path)
      Unlock item by path for given site
      Parameters:
      siteId - site identifier
      path - item path
    • getContentByCommitId

      Optional<org.springframework.core.io.Resource> getContentByCommitId(String siteId, String path, String commitId) throws ContentNotFoundException
      Get content for commit id
      Parameters:
      siteId - site identifier
      path - path of the content
      commitId - commit id of the content version
      Returns:
      the resource if available
      Throws:
      ContentNotFoundException
    • getItemsByStates

      List<DetailedItem> getItemsByStates(String siteId, long statesBitMap, List<String> systemTypes, List<org.craftercms.commons.rest.parameters.SortField> sortFields, int offset, int limit) throws UserNotFoundException, ServiceLayerException
      Get a list of items by state and system types.
      Parameters:
      siteId - site identifier
      statesBitMap - mask of the states to filter by
      systemTypes - list of system types to filter by
      sortFields - list of sort fields
      offset - number of items to skip
      limit - number of items to return
      Returns:
      list of items
      Throws:
      UserNotFoundException
      ServiceLayerException
    • getContentVersionHistory

      List<ItemVersion> getContentVersionHistory(String siteId, String path) throws ServiceLayerException
      Get the version history for a given content item.
      Parameters:
      siteId - the site id
      path - the content path
      Returns:
      the list of versions
      Throws:
      ServiceLayerException - if an error occurs while create the list of ItemVersions