Interface ItemServiceInternal

All Known Implementing Classes:
ItemServiceInternalImpl

public interface ItemServiceInternal
  • Method Details

    • upsertEntry

      boolean upsertEntry(Item item)
      Insert record for item if it does not exist, otherwise update it
      Parameters:
      item - item to add or update
    • getItem

      DetailedItem getItem(String siteId, long id)
      Get item by given id
      Parameters:
      siteId - site identifier
      id - item id
      Returns:
      item
    • getItem

      Item getItem(String siteId, String path)
      Get item fir given site and path
      Parameters:
      siteId - site identifier
      path - item path
      Returns:
      item
    • getItem

      Item getItem(String siteId, String path, boolean preferContent)
      Get item fir given site and path
      Parameters:
      siteId - site identifier
      path - item path
      preferContent - if true return content item if available
      Returns:
      item
    • getItems

      List<Item> getItems(String siteId, List<String> path)
      Get items for given site and paths
      Parameters:
      siteId - site identifier
      path - item paths
      Returns:
      list of items
    • getItems

      List<Item> getItems(String siteId, List<String> paths, boolean preferContent)
      Get items for given site and paths
      Parameters:
      siteId - site identifier
      paths - item paths
      preferContent - if true return content item if available
      Returns:
      list of items
    • updateItem

      void updateItem(Item item)
      Update item
      Parameters:
      item - item to update
    • deleteItem

      void deleteItem(String siteId, String path)
      Delete item
      Parameters:
      siteId - siteIdentifier
      path - path of item to be deleted
    • setSystemProcessing

      void setSystemProcessing(String siteId, String path, boolean isSystemProcessing)
      Set system processing for item
      Parameters:
      siteId - site identifier
      path - path of the item
      isSystemProcessing - true if item is being processed by system, otherwise false
    • setSystemProcessingBulk

      void setSystemProcessingBulk(String siteId, List<String> paths, boolean isSystemProcessing)
      Set system processing for items
      Parameters:
      siteId - site identifier
      paths - paths of items
      isSystemProcessing - true if item is being processed by system, otherwise false
    • updateStateBits

      void updateStateBits(String siteId, String path, long onStateBitMap, long offStateBitMap)
      Update states to flip on list off states and flip off another list of states for item
      Parameters:
      siteId - site identifier
      path - path of item
      onStateBitMap - states bitmap to flip on
      offStateBitMap - stats bitmap to flip off
    • updateStateBitsBulk

      void updateStateBitsBulk(String siteId, Collection<String> paths, long onStateBitMap, long offStateBitMap)
      Update states to flip on list off states and flip off another list of states for items
      Parameters:
      siteId - site identifier
      paths - list of paths of items
      onStateBitMap - states bitmap to flip on
      offStateBitMap - stats bitmap to flip off
    • instantiateItem

      Item.Builder instantiateItem(String siteName, String path)
    • deleteItemsForSite

      void deleteItemsForSite(long siteId)
      Delete all items for site
      Parameters:
      siteId - site id
    • getBrowserUrl

      String getBrowserUrl(String site, String path)
      Get browser url for given repository item
      Parameters:
      site - site identifier
      path - path of the content
      Returns:
      browser url
    • persistItemAfterCreate

      void persistItemAfterCreate(String siteId, String path, String username, String commitId, boolean unlock, Long parentId) throws ServiceLayerException, UserNotFoundException
      Persist item metadata after create
      Parameters:
      siteId - site identifier
      path - path of the content
      username - user that executed write operation
      commitId - commit id of the write operation
      unlock - Indicates if content needs to be unlocked after write (save & close)
      parentId - id of parent item
      Throws:
      ServiceLayerException
      UserNotFoundException
    • persistItemAfterWrite

      void persistItemAfterWrite(String siteId, String path, String username, String commitId, boolean unlock) throws ServiceLayerException, UserNotFoundException
      Persist item metadata after write
      Parameters:
      siteId - site identifier
      path - path of the content
      username - user that executed write operation
      commitId - commit id of the write operation
      unlock - Indicates if content needs to be unlocked after write (save & close)
      Throws:
      ServiceLayerException
      UserNotFoundException
    • persistItemAfterCreateFolder

      void persistItemAfterCreateFolder(String siteId, String folderPath, String folderName, String username, String commitId, Long parentId) throws ServiceLayerException, UserNotFoundException
      Persist item metadata after create folder
      Parameters:
      siteId - site identifier
      folderPath - folder path
      folderName - folder name
      username - user that executed create folder operation
      commitId - commit id of the create folder operation
      parentId - id of parent item
      Throws:
      ServiceLayerException
      UserNotFoundException
    • persistItemAfterRenameContent

      void persistItemAfterRenameContent(String siteId, String path, String name, String username, String commitId, String contentType) throws ServiceLayerException, UserNotFoundException
      Persist item metadata after rename folder
      Parameters:
      siteId - site identifier
      path - file path
      name - file name
      username - user that executed create folder operation
      commitId - commit id of the create folder operation
      contentType - content type
      Throws:
      ServiceLayerException
      UserNotFoundException
    • moveItem

      void moveItem(String siteId, String oldPath, String newPath, Long parentId, String label)
      Move item
      Parameters:
      siteId - site identifier
      oldPath - old path
      newPath - new path
      parentId - new parent ID
      label - new label
    • isNew

      boolean isNew(String siteId, String path)
      Check if item is new
      Parameters:
      siteId - site identifier
      path - path of the item
      Returns:
      true if NEW flag is set otherwise false
    • countAllContentItems

      int countAllContentItems()
      Count all content items
      Returns:
      number of content items in the system
    • clearPreviousPath

      void clearPreviousPath(String siteId, String path)
      Clear previous path of the content
      Parameters:
      siteId - site identifier
      path - path of the content;
    • convertHistoryItemToDashboardItem

      PublishingDashboardItem convertHistoryItemToDashboardItem(PublishingHistoryItem historyItem)
      Convert Publishing History Item to Publishing Dashboard Item
      Parameters:
      historyItem - publishing history item
      Returns:
      publishing dashboard item
    • getInProgressItems

      List<Item> getInProgressItems(String siteId)
      Get in progress items for given site
      Parameters:
      siteId - site identifier
      Returns:
      list of items
    • isUpdatedOrNew

      boolean isUpdatedOrNew(String site, String path)
      Check if item is update or new
      Parameters:
      site - site identifier
      path - item path
      Returns:
      true if item is new or modified
    • deleteItemForFolder

      void deleteItemForFolder(long siteId, String folderPath)
      Delete items for site and paths
      Parameters:
      siteId - site id
      folderPath - folder path to delete
    • isSystemProcessing

      boolean isSystemProcessing(String site, String path)
      Check if item is in system processing
      Parameters:
      site - site identifier
      path - item path
      Returns:
      true if item is in system processing
    • previousPathExists

      boolean previousPathExists(String siteId, String path)
      Check if path exists as previous path
      Parameters:
      siteId - site identifier
      path - path to check
      Returns:
      true if item exists with previous path as given path
    • updateCommitId

      void updateCommitId(String siteId, String path, String commitId)
      Update commit id for item
      Parameters:
      siteId - site identifier
      path - path of the item
      commitId - commit id
    • getMandatoryParentsForPublishing

      List<String> getMandatoryParentsForPublishing(String siteId, List<String> paths)
      Get mandatory parents for publishing for given site and list of paths
      Parameters:
      siteId - site identifier
      paths - list of paths
      Returns:
      list of mandatory parents paths
    • getExistingRenamedChildrenOfMandatoryParentsForPublishing

      List<String> getExistingRenamedChildrenOfMandatoryParentsForPublishing(String siteId, List<String> parents)
      Get existing renamed children of mandatory parents for publishing
      Parameters:
      siteId - site identifier
      parents - list of parents paths
      Returns:
      list of children paths
    • getChangeSetForSubtree

      List<String> getChangeSetForSubtree(String siteId, String path)
      Get change set for subtree
      Parameters:
      siteId - site identifier
      path - root path of the subtree
      Returns:
      list of items
    • updateLastPublishedOn

      void updateLastPublishedOn(String siteId, String path, ZonedDateTime lastPublishedOn)
      Update last published date for item
      Parameters:
      siteId - site identifier
      path - path of the item
      lastPublishedOn - published date
    • lockItemByPath

      void lockItemByPath(String siteId, String path, String username) throws UserNotFoundException, ServiceLayerException
      Lock item for given lock owner
      Parameters:
      siteId - site identifier
      path - item path
      username - user that owns the lock
      Throws:
      UserNotFoundException
      ServiceLayerException
    • unlockItemByPath

      void unlockItemByPath(String siteId, String path)
      Unlock item
      Parameters:
      siteId - site identifier
      path - item path
    • getItemStatesTotal

      int getItemStatesTotal(String siteId, String path, Long states, List<String> systemTypes)
      Get total number of item states records for given filters by path regex and states mask
      Parameters:
      siteId - site identifier
      path - path regex to filter items
      states - states mask to filter items by state
      Returns:
      number of records
    • getItemStates

      List<Item> getItemStates(String siteId, String path, Long states, List<String> systemTypes, List<org.craftercms.commons.rest.parameters.SortField> sortFields, int offset, int limit)
      Get item states for given filters by path regex and states mask
      Parameters:
      siteId - site identifier
      path - path regex to filter items
      states - states mask to filter items by state
      systemTypes - system types to filter items
      sortFields - sort fields
      offset - offset for the first record in result set
      limit - number of item states records to return
      Returns:
      list of sandbox items
    • updateItemStates

      void updateItemStates(String siteId, List<String> paths, boolean clearSystemProcessing, boolean clearUserLocked, Boolean live, Boolean staged, Boolean isNew, Boolean modified)
      Update item state flags for given items
      Parameters:
      siteId - site identifier
      paths - item paths
      clearSystemProcessing - if true clear system processing flag, otherwise ignore
      clearUserLocked - if true clear user locked flag, otherwise ignore
      live - if true set live flag, otherwise reset it
      staged - if true set staged flag, otherwise reset it
      isNew - value to set the 'new' flag to, or null if the flag should not change
      modified - value to set the 'modified' flag to, or null if the flag should not change
    • updateItemStatesByQuery

      void updateItemStatesByQuery(String siteId, String path, Long states, boolean clearSystemProcessing, boolean clearUserLocked, Boolean live, Boolean staged, Boolean isNew, Boolean modified)
      Update item state flags for given path query
      Parameters:
      siteId - site identifier
      path - path regex to identify items
      clearSystemProcessing - if true clear system processing flag, otherwise ignore
      clearUserLocked - if true clear user locked flag, otherwise ignore
      live - if true set live flag, otherwise reset it
      staged - if true set staged flag, otherwise reset it
      isNew - value to set the 'new' flag to, or null if the flag should not change
      modified - value to set the 'modified' flag to, or null if the flag should not change
    • getSubtreeForDelete

      List<String> getSubtreeForDelete(String siteId, String path)
      Get subtree for delete
      Parameters:
      siteId - site identifier
      path - root path of the subtree
      Returns:
      list of items
    • updateStatesForSite

      void updateStatesForSite(String siteId, long onStateBitMap, long offStateBitMap)
      Update states for all content in the given site
      Parameters:
      siteId - site identifier
      onStateBitMap - states bitmap to flip on
      offStateBitMap - states bitmap to flip off
    • updateNewPageChildren

      void updateNewPageChildren(String site, String path)
      Updates a new page's children (in case the folder existed before the page was created) to point to the new page.
      Parameters:
      site - site identifier
      path - path of the folder where the new index.xml has been added