Interface ItemServiceInternal

    • Method Detail

      • upsertEntry

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

        void upsertEntries​(String siteId,
                           List<Item> items)
        Insert records for list of item if they do not exist, otherwise update them
        Parameters:
        siteId - site identifier
        items - list of items 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​(long itemId)
        Delete item
        Parameters:
        itemId - item id
      • 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
      • setStateBits

        void setStateBits​(String siteId,
                          String path,
                          long statesBitMask)
        Update states bitmap for item by setting bits to 1
        Parameters:
        siteId - site identifier
        path - path of item
        statesBitMask - bit mask for states to be updated
      • setStateBitsBulk

        void setStateBitsBulk​(String siteId,
                              List<String> paths,
                              long statesBitMask)
        Update states bitmap for list of items by setting bits to 1
        Parameters:
        siteId - site identifier
        paths - paths of items
        statesBitMask - bit mask for states to be updated
      • resetStateBits

        void resetStateBits​(String siteId,
                            String path,
                            long statesBitMask)
        Update states bitmap for item by setting bits to 0
        Parameters:
        siteId - site identifier
        path - path of item
        statesBitMask - bit mask for states to be updated
      • resetStateBitsBulk

        void resetStateBitsBulk​(String siteId,
                                List<String> paths,
                                long statesBitMask)
        Update states bitmap for list of items by setting bits to 0
        Parameters:
        siteId - site identifier
        paths - paths of items
        statesBitMask - bit mask for states to be updated
      • setStateBits

        void setStateBits​(long itemId,
                          long statesBitMask)
        Update states bitmap for item by setting bits to 1
        Parameters:
        itemId - item identifier
        statesBitMask - bit mask for states to be updated
      • resetStateBits

        void resetStateBits​(long itemId,
                            long statesBitMask)
        Update states bitmap for item by setting bits to 0
        Parameters:
        itemId - item identifier
        statesBitMask - bit mask for states to be updated
      • 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
      • updateStateBits

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

        void updateStateBitsBulk​(String siteId,
                                 List<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
      • updateStateBitsBulk

        void updateStateBitsBulk​(List<Long> itemIds,
                                 long onStateBitMap,
                                 long offStateBitMap)
        Update states to flip on list off states and flip off another list of states for items
        Parameters:
        itemIds - list of item ids
        onStateBitMap - states bitmap to flip on
        offStateBitMap - stats bitmap to flip off
      • instantiateItem

        Item instantiateItem​(long siteId,
                             String siteName,
                             String path,
                             String previewUrl,
                             long state,
                             Long ownedBy,
                             String owner,
                             Long createdBy,
                             String creator,
                             ZonedDateTime createdOn,
                             Long lastModifiedBy,
                             String modifier,
                             ZonedDateTime lastModifiedOn,
                             String label,
                             String contentTypeId,
                             String systemType,
                             String mimeType,
                             String localeCode,
                             Long translationSourceId,
                             long size,
                             Long parentId,
                             String commitId)
        Instantiate item by getting it from DB and setting properties to values
        Parameters:
        siteId - site identifier
        siteName - site name
        path - path of the item
        previewUrl - preview URL
        state - state of the item (bitmap)
        ownedBy - owner id
        owner - owner username
        createdBy - creator id
        creator - creator username
        createdOn - created date
        lastModifiedBy - modifier id
        modifier - modifier username
        lastModifiedOn - modified date
        label - label for the item
        contentTypeId - content type id
        systemType - system type
        mimeType - mime type
        localeCode - locale code
        translationSourceId - translation source item id
        size - size of the file
        parentId - parent id
        commitId - commit id
        Returns:
        Item object
      • instantiateItemAfterWrite

        Item instantiateItemAfterWrite​(String siteId,
                                       String path,
                                       String username,
                                       ZonedDateTime lastModifiedOn,
                                       String label,
                                       String contentTypeId,
                                       String localeCode,
                                       String commitId,
                                       long size,
                                       Optional<Boolean> unlock)
                                throws ServiceLayerException,
                                       UserNotFoundException
        Instantiate item after write or update
        Parameters:
        siteId - site identifier
        path - path of the item
        username - username of modifier
        lastModifiedOn - modified date
        label - label for the item
        contentTypeId - content type id
        localeCode - locale code
        commitId - commit id obtained with write operation
        size - file size in bytes
        unlock - Optional unlocking of item, if true unlock, otherwise lock. If not present item will be unlocked
        Returns:
        item object
        Throws:
        ServiceLayerException - General service error
        UserNotFoundException - If given username does not exist
      • deleteItemsForSite

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

        void deleteItemsById​(List<Long> itemIds)
        Delete items by ids
        Parameters:
        itemIds - ids of items to delete
      • deleteItemsForSiteAndPaths

        void deleteItemsForSiteAndPaths​(long siteId,
                                        List<String> paths)
        Delete items for site and paths
        Parameters:
        siteId - site id
        paths - list of item paths to delete
      • getContentDashboardTotal

        int getContentDashboardTotal​(String siteId,
                                     String path,
                                     String modifier,
                                     String contentType,
                                     long state,
                                     ZonedDateTime dateFrom,
                                     ZonedDateTime dateTo)
        Get total number of records for content dashboard
        Parameters:
        siteId - site identifier
        path - path regular expression to apply as filter for result set
        modifier - filter results by user
        contentType - filter results by content type
        state - filter results by state
        dateFrom - lower boundary for modified date
        dateTo - upper boundary for modified date
        Returns:
        total number of records in result set
      • getContentDashboard

        List<ContentDashboardItem> getContentDashboard​(String siteId,
                                                       String path,
                                                       String modifier,
                                                       String contentType,
                                                       long state,
                                                       ZonedDateTime dateFrom,
                                                       ZonedDateTime dateTo,
                                                       String sortBy,
                                                       String order,
                                                       int offset,
                                                       int limit)
        Get result set for content dashboard
        Parameters:
        siteId - site identifier
        path - path regular expression to apply as filter for result set
        modifier - filter results by user
        contentType - filter results by content type
        state - filter results by state
        dateFrom - lower boundary for modified date
        dateTo - upper boundary for modified date
        sortBy - sort results by column
        order - order of results
        offset - offset of the first record in result set
        limit - number of records to return
        Returns:
        list of item metadata records
      • 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
      • moveItem

        void moveItem​(String siteId,
                      String oldPath,
                      String newPath)
        Move item
        Parameters:
        siteId - site identifier
        oldPath - old path
        newPath - new path
      • moveItems

        void moveItems​(String siteId,
                       String oldPath,
                       String newPath,
                       Long parentId)
        Move items
        Parameters:
        siteId - site identifier
        oldPath - old path
        newPath - new path
        parentId - new parent id, if null it will not be updated
      • 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
      • convertItemToContentDashboardItem

        ContentDashboardItem convertItemToContentDashboardItem​(String siteId,
                                                               Item item)
        Convert Item to Content Dashboard Item
        Parameters:
        siteId - site identifier
        item - item
        Returns:
        content dashboard item
      • getInProgressItems

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

        List<Item> getSubmittedItems​(String site)
        Get submitted items for given site
        Parameters:
        site - 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
      • getSameCommitItems

        List<String> getSameCommitItems​(String siteId,
                                        String path)
        Get items edited on same commit id for given item
        Parameters:
        siteId - site identifier
        path - path of content item
        Returns:
        list of items paths
      • 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
      • updateLastPublishedOnBulk

        void updateLastPublishedOnBulk​(String siteId,
                                       List<String> paths,
                                       ZonedDateTime lastPublishedOn)
        Update last published date for item
        Parameters:
        siteId - site identifier
        paths - list of paths
        lastPublishedOn - published date
      • unlockItemByPath

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

        void unlockItemById​(long itemId)
        Unlock item
        Parameters:
        itemId - item identifier
      • getItemStatesTotal

        int getItemStatesTotal​(String siteId,
                               String path,
                               Long states)
        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,
                                 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
        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)
        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
      • updateItemStatesByQuery

        void updateItemStatesByQuery​(String siteId,
                                     String path,
                                     Long states,
                                     boolean clearSystemProcessing,
                                     boolean clearUserLocked,
                                     Boolean live,
                                     Boolean staged)
        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
      • 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