Interface StudioBlobStoreAdapter

    • Method Detail

      • createVersion

        default String createVersion​(String site,
                                     String path,
                                     boolean majorVersion)
        Description copied from interface: ContentRepository
        create a version
        Specified by:
        createVersion in interface ContentRepository
        Parameters:
        site - site id where the operation will be executed
        path - location of content
        majorVersion - true if major
        Returns:
        the created version ID or null on failure
      • createVersion

        default String createVersion​(String site,
                                     String path,
                                     String comment,
                                     boolean majorVersion)
        Description copied from interface: ContentRepository
        create a version
        Specified by:
        createVersion in interface ContentRepository
        Parameters:
        site - site id where the operation will be executed
        path - location of content
        comment - version history comment
        majorVersion - true if major
        Returns:
        the created version ID or null on failure
      • revertContent

        default String revertContent​(String site,
                                     String path,
                                     String version,
                                     boolean major,
                                     String comment)
        Description copied from interface: ContentRepository
        revert a version (create a new version based on an old version)
        Specified by:
        revertContent in interface ContentRepository
        Parameters:
        site - site id where the operation will be executed
        path - - the path of the item to "revert"
        version - - old version ID to base to version on
        major - flag if it is major version
        comment - add comment when committing content
        Returns:
        Commit ID if successful, empty string otherwise
      • getContentByCommitId

        default Optional<org.springframework.core.io.Resource> getContentByCommitId​(String site,
                                                                                    String path,
                                                                                    String commitId)
        Description copied from interface: ContentRepository
        return a specific version of the content
        Specified by:
        getContentByCommitId in interface ContentRepository
        Parameters:
        site - site id where the operation will be executed
        path - path of the content
        commitId - version to return
        Returns:
        the resource if available
      • lockItem

        default void lockItem​(String site,
                              String path)
        Description copied from interface: ContentRepository
        lock an item NOTE: site will be removed from this interface
        Specified by:
        lockItem in interface ContentRepository
        Parameters:
        site - site id where the operation will be executed
        path - path of the item
      • lockItemForPublishing

        default void lockItemForPublishing​(String site,
                                           String path)
        Description copied from interface: ContentRepository
        lock an item NOTE: site will be removed from this interface
        Specified by:
        lockItemForPublishing in interface ContentRepository
        Parameters:
        site - site id where the operation will be executed
        path - path of the item
      • unLockItem

        default void unLockItem​(String site,
                                String path)
        Description copied from interface: ContentRepository
        unlock an item for publishing NOTE: site will be removed from this interface
        Specified by:
        unLockItem in interface ContentRepository
        Parameters:
        site - site id where the operation will be executed
        path - path of the item
      • unLockItemForPublishing

        default void unLockItemForPublishing​(String site,
                                             String path)
        Description copied from interface: ContentRepository
        unlock an item for publishing NOTE: site will be removed from this interface
        Specified by:
        unLockItemForPublishing in interface ContentRepository
        Parameters:
        site - site id where the operation will be executed
        path - path of the item
      • isFolder

        default boolean isFolder​(String siteId,
                                 String path)
        Description copied from interface: ContentRepository
        Check if content at given path is folder
        Specified by:
        isFolder in interface ContentRepository
        Parameters:
        siteId - site identifier
        path - content path
        Returns:
        true if path is folder, otherwise false
      • createSiteFromBlueprint

        default boolean createSiteFromBlueprint​(String blueprintLocation,
                                                String siteId,
                                                String sandboxBranch,
                                                Map<String,​String> params,
                                                String creator)
        Description copied from interface: ContentRepository
        Create a new site based on a blueprint
        Specified by:
        createSiteFromBlueprint in interface ContentRepository
        Parameters:
        blueprintLocation - blueprint location
        siteId - site identifier
        sandboxBranch - sandbox branch name
        params - site parameters
        creator - site creator
        Returns:
        true if successful, false otherwise
      • deleteSite

        default boolean deleteSite​(String siteId)
        Description copied from interface: ContentRepository
        Deletes an existing site.
        Specified by:
        deleteSite in interface ContentRepository
        Parameters:
        siteId - site to delete
        Returns:
        true if successful, false otherwise
      • initialPublish

        default void initialPublish​(String site,
                                    String sandboxBranch,
                                    String environment,
                                    String author,
                                    String comment)
        Description copied from interface: ContentRepository
        Initial publish to specified environment.
        Specified by:
        initialPublish in interface ContentRepository
        Parameters:
        site - site identifier
        sandboxBranch - sandbox branch name
        environment - environment to publish
        author - author
        comment - comment
      • getEditCommitIds

        default List<String> getEditCommitIds​(String site,
                                              String path,
                                              String commitIdFrom,
                                              String commitIdTo)
        Description copied from interface: ContentRepository
        Get a list of commits for updates on a content
        Specified by:
        getEditCommitIds in interface ContentRepository
        Parameters:
        site - site id
        path - path
        commitIdFrom - range from commit id (inclusive)
        commitIdTo - range to commit id (inclusive)
        Returns:
        list of edit commit ids
      • commitIdExists

        default boolean commitIdExists​(String site,
                                       String commitId)
        Description copied from interface: ContentRepository
        Check if given commit id exists
        Specified by:
        commitIdExists in interface ContentRepository
        Parameters:
        site - site id
        commitId - commit id to check
        Returns:
        true if it exists in site repository, otherwise false
      • commitIdExists

        default boolean commitIdExists​(String site,
                                       GitRepositories repoType,
                                       String commitId)
        Description copied from interface: ContentRepository
        Check if given commit id exists
        Specified by:
        commitIdExists in interface ContentRepository
        Parameters:
        site - site id
        repoType - repository type
        commitId - commit id to check
        Returns:
        true if it exists in site repository, otherwise false
      • createSiteCloneRemote

        default boolean createSiteCloneRemote​(String siteId,
                                              String sandboxBranch,
                                              String remoteName,
                                              String remoteUrl,
                                              String remoteBranch,
                                              boolean singleBranch,
                                              String authenticationType,
                                              String remoteUsername,
                                              String remotePassword,
                                              String remoteToken,
                                              String remotePrivateKey,
                                              Map<String,​String> params,
                                              boolean createAsOrphan,
                                              String creator)
        Description copied from interface: ContentRepository
        Create new site as a clone from remote repository
        Specified by:
        createSiteCloneRemote in interface ContentRepository
        Parameters:
        siteId - site identifier
        sandboxBranch - sandbox branch name
        remoteName - remote name
        remoteUrl - remote repository url
        remoteBranch - remote branch name
        singleBranch - flag to signal if clone single branch or full repository
        authenticationType - type of authentication to use to connect remote repository
        remoteUsername - remote username
        remotePassword - remote password
        remoteToken - remote token
        remotePrivateKey - remote private key
        params - site parameters
        createAsOrphan - create as orphan
        creator - site creator
        Returns:
        true if success
      • addRemote

        default boolean addRemote​(String siteId,
                                  String remoteName,
                                  String remoteUrl,
                                  String authenticationType,
                                  String remoteUsername,
                                  String remotePassword,
                                  String remoteToken,
                                  String remotePrivateKey)
        Description copied from interface: ContentRepository
        Add remote repository for site content repository
        Specified by:
        addRemote in interface ContentRepository
        Parameters:
        siteId - site identifier
        remoteName - remote name
        remoteUrl - remote url
        authenticationType - authentication type
        remoteUsername - remote username
        remotePassword - remote password
        remoteToken - remote token
        remotePrivateKey - remote private key
        Returns:
        true if operation was successful
      • removeRemote

        default boolean removeRemote​(String siteId,
                                     String remoteName)
        Description copied from interface: ContentRepository
        Remove remote with given name for site
        Specified by:
        removeRemote in interface ContentRepository
        Parameters:
        siteId - site identifier
        remoteName - remote name
        Returns:
        true if operation was successful
      • pushToRemote

        default boolean pushToRemote​(String siteId,
                                     String remoteName,
                                     String remoteBranch)
        Description copied from interface: ContentRepository
        Push content to remote repository
        Specified by:
        pushToRemote in interface ContentRepository
        Parameters:
        siteId - site identifier
        remoteName - remote name
        remoteBranch - remote branch
        Returns:
        true if operation was successful
      • pullFromRemote

        default boolean pullFromRemote​(String siteId,
                                       String remoteName,
                                       String remoteBranch)
        Description copied from interface: ContentRepository
        Pull from remote repository
        Specified by:
        pullFromRemote in interface ContentRepository
        Parameters:
        siteId - site identifier
        remoteName - remote name
        remoteBranch - remote branch
        Returns:
        true if operation was successful
      • resetStagingRepository

        default void resetStagingRepository​(String siteId)
        Description copied from interface: ContentRepository
        Reset staging repository to live for given site
        Specified by:
        resetStagingRepository in interface ContentRepository
        Parameters:
        siteId - site identifier to use for resetting
      • repositoryExists

        default boolean repositoryExists​(String site)
        Description copied from interface: ContentRepository
        Check if repository exists for given site
        Specified by:
        repositoryExists in interface ContentRepository
        Parameters:
        site - site id
        Returns:
        true if repository exists, otherwise false
      • getSubtreeItems

        default List<String> getSubtreeItems​(String site,
                                             String path)
        Description copied from interface: ContentRepository
        List subtree items for give site and path
        Specified by:
        getSubtreeItems in interface ContentRepository
        Parameters:
        site - site identifier
        path - path for subtree root
        Returns:
        list of item paths contained in the subtree
      • getOperations

        default List<RepoOperation> getOperations​(String site,
                                                  String commitIdFrom,
                                                  String commitIdTo)
        Description copied from interface: ContentRepository
        Get a list of operations since the commit ID provided (compare that commit to HEAD)
        Specified by:
        getOperations in interface ContentRepository
        Parameters:
        site - site to use
        commitIdFrom - commit ID to start at
        commitIdTo - commit ID to end at
        Returns:
        commit ID of current HEAD, updated operationsSinceCommit
      • getOperationsFromDelta

        default List<RepoOperation> getOperationsFromDelta​(String site,
                                                           String commitIdFrom,
                                                           String commitIdTo)
        Description copied from interface: ContentRepository
        Get a list of operations since the commit ID provided (compare that commit to HEAD)
        Specified by:
        getOperationsFromDelta in interface ContentRepository
        Parameters:
        site - site to use
        commitIdFrom - commit ID to start at
        commitIdTo - commit ID to end at
        Returns:
        commit ID of current HEAD, updated operationsSinceCommit
      • insertGitLog

        default void insertGitLog​(String siteId,
                                  String commitId,
                                  int processed)
        Description copied from interface: ContentRepository
        Insert Git Log
        Specified by:
        insertGitLog in interface ContentRepository
        Parameters:
        siteId - site
        commitId - commit ID
        processed - processed
      • insertGitLog

        default void insertGitLog​(String siteId,
                                  String commitId,
                                  int processed,
                                  int audited)
        Description copied from interface: ContentRepository
        Insert Git Log
        Specified by:
        insertGitLog in interface ContentRepository
        Parameters:
        siteId - site
        commitId - commit ID
        processed - processed
        audited - audited
      • getPublishingHistory

        default List<PublishingHistoryItem> getPublishingHistory​(String siteId,
                                                                 String environment,
                                                                 String path,
                                                                 String publisher,
                                                                 ZonedDateTime fromDate,
                                                                 ZonedDateTime toDate,
                                                                 int limit)
        Description copied from interface: ContentRepository
        Get publishing history
        Specified by:
        getPublishingHistory in interface ContentRepository
        Parameters:
        siteId - site identifier
        environment - environment
        path - path regular expression to use as filter
        publisher - user to filter by
        fromDate - lower boundary for published date
        toDate - upper boundary for published date
        limit - number of records to return
        Returns:
        publishing history
      • getChangeSetPathsFromDelta

        default Map<String,​String> getChangeSetPathsFromDelta​(String site,
                                                                    String commitIdFrom,
                                                                    String commitIdTo)
        Description copied from interface: ContentRepository
        Get a list of paths that changed since the commit ID provided to commit ID provided
        Specified by:
        getChangeSetPathsFromDelta in interface ContentRepository
        Parameters:
        site - site to use
        commitIdFrom - commit ID to start at
        commitIdTo - commit ID to end at
        Returns:
        list of paths of files that changed between two commits
      • updateGitlog

        default void updateGitlog​(String siteId,
                                  String lastProcessedCommitId,
                                  int batchSize)
        Description copied from interface: ContentRepository
        Update gitlog table with commit ids from repository
        Specified by:
        updateGitlog in interface ContentRepository
        Parameters:
        siteId - site identifier
        lastProcessedCommitId - last processed commit id
        batchSize - size of a batch to update
      • getUnauditedCommits

        default List<GitLog> getUnauditedCommits​(String siteId,
                                                 int batchSize)
        Description copied from interface: ContentRepository
        Get unaudited commits from database
        Specified by:
        getUnauditedCommits in interface ContentRepository
        Parameters:
        siteId - site identifier
        batchSize - size of a batch to retrieve
        Returns:
        list of gitlog records
      • getUnprocessedCommits

        default List<GitLog> getUnprocessedCommits​(String siteId,
                                                   long marker)
        Description copied from interface: ContentRepository
        Get unprocessed commits from database
        Specified by:
        getUnprocessedCommits in interface ContentRepository
        Parameters:
        siteId - site identifier
        marker - id of last verified commit Id
        Returns:
        list of gitlog records
      • countUnprocessedCommits

        default int countUnprocessedCommits​(String siteId,
                                            long marker)
        Description copied from interface: ContentRepository
        Count unprocessed commits from database
        Specified by:
        countUnprocessedCommits in interface ContentRepository
        Parameters:
        siteId - site identifier
        marker - id of last verified commit Id
        Returns:
        number of unprocessed gitlog records
      • markGitLogProcessedBeforeMarker

        default void markGitLogProcessedBeforeMarker​(String siteId,
                                                     long marker,
                                                     int processed)
        Description copied from interface: ContentRepository
        Mark all git logs as processed if they are inserted before marker
        Specified by:
        markGitLogProcessedBeforeMarker in interface ContentRepository
        Parameters:
        siteId - site identifier
        marker - marker git commit
        processed - value for processed
      • getPreviousCommitId

        default String getPreviousCommitId​(String siteId,
                                           String commitId)
        Description copied from interface: ContentRepository
        Get the previous commit id from repository for given a site id and a commit id
        Specified by:
        getPreviousCommitId in interface ContentRepository
        Parameters:
        siteId - site identifier
        commitId - commit Id
        Returns:
      • itemUnlock

        default void itemUnlock​(String site,
                                String path)
        Description copied from interface: ContentRepository
        unlock an item
        Specified by:
        itemUnlock in interface ContentRepository
        Parameters:
        site - site id where the operation will be executed
        path - path of the item
      • upsertGitLogList

        default void upsertGitLogList​(String siteId,
                                      List<String> commitIds,
                                      boolean processed,
                                      boolean audited)
        Description copied from interface: ContentRepository
        Upsert git logs as processed and audited
        Specified by:
        upsertGitLogList in interface ContentRepository
        Parameters:
        siteId - site identifier
        commitIds - commit ids
        processed - true if already processed
        audited - true if already audited
      • publishedRepositoryExists

        default boolean publishedRepositoryExists​(String siteId)
        Description copied from interface: ContentRepository
        Check if published repository exists for given site.
        Specified by:
        publishedRepositoryExists in interface ContentRepository
        Parameters:
        siteId - site identifier
        Returns:
        true if PUBLISHED repository exists, otherwise false