Interface StudioBlobStoreAdapter
- All Superinterfaces:
org.craftercms.commons.file.blob.BlobStore,ContentRepository,ContentRepository,StudioBlobStore
- All Known Implementing Classes:
StudioAwsS3BlobStore
Base class for all implementations of
StudioBlobStore- Since:
- 3.1.6
- Author:
- joseross
-
Field Summary
Fields inherited from interface org.craftercms.commons.file.blob.BlobStore
CONFIG_KEY_CONFIGURATION, CONFIG_KEY_ID, CONFIG_KEY_MAPPING, CONFIG_KEY_MAPPING_PREFIX, CONFIG_KEY_MAPPING_PUBLISHING_TARGET, CONFIG_KEY_MAPPING_STORE_TARGET, CONFIG_KEY_PATTERN, CONFIG_KEY_READ_ONLY, CONFIG_KEY_STORE, CONFIG_KEY_TYPE -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanaddRemote(String siteId, String remoteName, String remoteUrl, String authenticationType, String remoteUsername, String remotePassword, String remoteToken, String remotePrivateKey) Add remote repository for site content repositorydefault booleancommitIdExists(String site, String commitId) Check if given commit id existsdefault booleancommitIdExists(String site, GitRepositories repoType, String commitId) Check if given commit id (or revision string) existsdefault booleancreateSiteCloneRemote(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) Create new site as a clone from remote repositorydefault booleancreateSiteFromBlueprint(String blueprintLocation, String siteId, String sandboxBranch, Map<String, String> params, String creator) Create a new site based on a blueprintdefault StringcreateVersion(String site, String path, boolean majorVersion) create a versiondefault StringcreateVersion(String site, String path, String comment, boolean majorVersion) create a versiondefault booleandeleteSite(String siteId) Deletes an existing site.default voidforAllSitePaths(String siteId, org.springframework.util.function.ThrowingConsumer<String> directoryProcessor, org.springframework.util.function.ThrowingConsumer<String> fileProcessor) Execute consumers for all site paths for the given sitegetCommitIdsBetween(String siteId, String commitFrom, String commitTo) Get the commits between two commit ids.default Optional<org.springframework.core.io.Resource> getContentByCommitId(String site, String path, String commitId) return a specific version of the contentdefault RepositoryItem[]getContentChildren(String site, String path) get immediate children for pathdefault List<ItemVersion> getContentItemHistory(String site, String path) default VersionTO[]getContentVersionHistory(String site, String path) get the version history for an itemgetIntroducedCommits(String site, String baseCommit, String commitId) Get the new commits introduced bycommitIdintobaseCommit.
This method assumes that baseCommit is an ancestor of commitId's first parent.default org.craftercms.core.service.Itemdefault DetailedItem.EnvironmentgetItemEnvironmentProperties(String siteId, GitRepositories repo, String environment, String path) Get environment properties for itemdefault StringgetLastEditCommitId(String siteId, String path) default List<RepoOperation> getOperationsFromDelta(String site, String commitIdFrom, String commitIdTo) Get a list of operations since the commit ID provided (compare that commit to HEAD)default StringgetPreviousCommitId(String siteId, String commitId) Get the previous commit id from repository for given a site id and a commit iddefault List<PublishingHistoryItem> getPublishingHistory(String siteId, String environment, String path, String publisher, ZonedDateTime fromDate, ZonedDateTime toDate, int limit) Get publishing historydefault StringgetRepoFirstCommitId(String site) Get first id from repository for given sitedefault StringgetRepoLastCommitId(String site) Get last commit id from repository for given site.getSubtreeItems(String site, String path, GitRepositories repoType, String branch) List subtree items for give site and pathdefault voidgitGCRepositories(String siteId) Performs a git gc on all repositories for the given sitedefault voidinitialPublish(String site, String sandboxBranch, String environment, String author, String comment) Initial publish to specified environment.default booleanCheck if content at given path is folderdefault voiditemUnlock(String site, String path) unlock an itemdefault List<RemoteRepositoryInfoTO> listRemote(String siteId, String sandboxBranch) List remote repositories for given sitedefault voidlock an item NOTE: site will be removed from this interfacedefault voidlockItemForPublishing(String site, String path) lock an item NOTE: site will be removed from this interfacedefault booleanpublishedRepositoryExists(String siteId) Check if published repository exists for given site.default booleanpullFromRemote(String siteId, String remoteName, String remoteBranch) Pull from remote repositorydefault booleanpushToRemote(String siteId, String remoteName, String remoteBranch) Push content to remote repositorydefault booleanremoveRemote(String siteId, String remoteName) Remove remote with given name for sitedefault voidRemove all remotes for given sitedefault booleanrepositoryExists(String site) Check if repository exists for given sitedefault voidresetStagingRepository(String siteId) Reset staging repository to live for given sitedefault StringrevertContent(String site, String path, String version, boolean major, String comment) revert a version (create a new version based on an old version)default voidunLockItem(String site, String path) unlock an item for publishing NOTE: site will be removed from this interfacedefault voidunLockItemForPublishing(String site, String path) unlock an item for publishing NOTE: site will be removed from this interfaceMethods inherited from interface org.craftercms.commons.file.blob.BlobStore
getId, getResource, init, isCompatibleMethods inherited from interface org.craftercms.studio.api.v1.repository.ContentRepository
contentExists, copyContent, createFolder, deleteContent, getContent, getContent, moveContent, moveContent, shallowContentExists, writeContentMethods inherited from interface org.craftercms.studio.api.v2.repository.ContentRepository
cancelPublishAll, checkContentExists, completePublishAll, contentExists, duplicateSite, getContentSize, getGlobalRepoLastCommitId, getItemPaths, getSubtreeItems, initialPublish, preparePublishAll, publish, publishAll, shallowContentExistsMethods inherited from interface org.craftercms.studio.api.v2.repository.blob.StudioBlobStore
copyBlobs, getReference, isReadOnly
-
Method Details
-
getContentChildren
Description copied from interface:ContentRepositoryget immediate children for path- Specified by:
getContentChildrenin interfaceContentRepository- Parameters:
site- site id where the operation will be executedpath- path to content- Returns:
- a list of children
-
getContentVersionHistory
Description copied from interface:ContentRepositoryget the version history for an item- Specified by:
getContentVersionHistoryin interfaceContentRepository- Parameters:
site- - the project IDpath- - the path of the item- Returns:
- a list of versions
-
getContentItemHistory
- Specified by:
getContentItemHistoryin interfaceContentRepository
-
getCommitIdsBetween
Description copied from interface:ContentRepositoryGet the commits between two commit ids. This method must start in the commitTo and go back until it finds commitFrom. The actual result must be equivalent togit log --first-parent --reverse commitFrom..commitTo- Specified by:
getCommitIdsBetweenin interfaceContentRepository- Parameters:
siteId- site idcommitFrom- the older commit idcommitTo- the newer commit id- Returns:
- list of commit ids between commitFrom (not included) and commitTo (inclusive)
-
getIntroducedCommits
Description copied from interface:ContentRepositoryGet the new commits introduced bycommitIdintobaseCommit.
This method assumes that baseCommit is an ancestor of commitId's first parent. Result will be equivalent togit log baseCommit..commitId- Specified by:
getIntroducedCommitsin interfaceContentRepository- Parameters:
site- site idbaseCommit- the commit id to compare againstcommitId- the commit id to compare
-
createVersion
Description copied from interface:ContentRepositorycreate a version- Specified by:
createVersionin interfaceContentRepository- Parameters:
site- site id where the operation will be executedpath- location of contentmajorVersion- true if major- Returns:
- the created version ID or null on failure
-
createVersion
Description copied from interface:ContentRepositorycreate a version- Specified by:
createVersionin interfaceContentRepository- Parameters:
site- site id where the operation will be executedpath- location of contentcomment- version history commentmajorVersion- 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:ContentRepositoryrevert a version (create a new version based on an old version)- Specified by:
revertContentin interfaceContentRepository- Parameters:
site- site id where the operation will be executedpath- - the path of the item to "revert"version- - old version ID to base to version onmajor- flag if it is major versioncomment- 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:ContentRepositoryreturn a specific version of the content- Specified by:
getContentByCommitIdin interfaceContentRepository- Parameters:
site- site id where the operation will be executedpath- path of the contentcommitId- version to return- Returns:
- the resource if available
-
lockItem
Description copied from interface:ContentRepositorylock an item NOTE: site will be removed from this interface- Specified by:
lockItemin interfaceContentRepository- Parameters:
site- site id where the operation will be executedpath- path of the item
-
lockItemForPublishing
Description copied from interface:ContentRepositorylock an item NOTE: site will be removed from this interface- Specified by:
lockItemForPublishingin interfaceContentRepository- Parameters:
site- site id where the operation will be executedpath- path of the item
-
unLockItem
Description copied from interface:ContentRepositoryunlock an item for publishing NOTE: site will be removed from this interface- Specified by:
unLockItemin interfaceContentRepository- Parameters:
site- site id where the operation will be executedpath- path of the item
-
unLockItemForPublishing
Description copied from interface:ContentRepositoryunlock an item for publishing NOTE: site will be removed from this interface- Specified by:
unLockItemForPublishingin interfaceContentRepository- Parameters:
site- site id where the operation will be executedpath- path of the item
-
isFolder
Description copied from interface:ContentRepositoryCheck if content at given path is folder- Specified by:
isFolderin interfaceContentRepository- Parameters:
siteId- site identifierpath- 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:ContentRepositoryCreate a new site based on a blueprint- Specified by:
createSiteFromBlueprintin interfaceContentRepository- Parameters:
blueprintLocation- blueprint locationsiteId- site identifiersandboxBranch- sandbox branch nameparams- site parameterscreator- site creator- Returns:
- true if successful, false otherwise
-
deleteSite
Description copied from interface:ContentRepositoryDeletes an existing site.- Specified by:
deleteSitein interfaceContentRepository- Specified by:
deleteSitein interfaceContentRepository- 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:ContentRepositoryInitial publish to specified environment.- Specified by:
initialPublishin interfaceContentRepository- Parameters:
site- site identifiersandboxBranch- sandbox branch nameenvironment- environment to publishauthor- authorcomment- comment
-
getRepoLastCommitId
Description copied from interface:ContentRepositoryGet last commit id from repository for given site.- Specified by:
getRepoLastCommitIdin interfaceContentRepository- Specified by:
getRepoLastCommitIdin interfaceContentRepository- Parameters:
site- site id- Returns:
- last commit id (current HEAD)
-
getRepoFirstCommitId
Description copied from interface:ContentRepositoryGet first id from repository for given site- Specified by:
getRepoFirstCommitIdin interfaceContentRepository- Specified by:
getRepoFirstCommitIdin interfaceContentRepository- Parameters:
site- site id- Returns:
- first commit id
-
commitIdExists
Description copied from interface:ContentRepositoryCheck if given commit id exists- Specified by:
commitIdExistsin interfaceContentRepository- Parameters:
site- site idcommitId- commit id to check- Returns:
- true if it exists in site repository, otherwise false
-
commitIdExists
Description copied from interface:ContentRepositoryCheck if given commit id (or revision string) exists- Specified by:
commitIdExistsin interfaceContentRepository- Parameters:
site- site idrepoType- repository typecommitId- commit id or revision 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:ContentRepositoryCreate new site as a clone from remote repository- Specified by:
createSiteCloneRemotein interfaceContentRepository- Parameters:
siteId- site identifiersandboxBranch- sandbox branch nameremoteName- remote nameremoteUrl- remote repository urlremoteBranch- remote branch namesingleBranch- flag to signal if clone single branch or full repositoryauthenticationType- type of authentication to use to connect remote repositoryremoteUsername- remote usernameremotePassword- remote passwordremoteToken- remote tokenremotePrivateKey- remote private keyparams- site parameterscreateAsOrphan- create as orphancreator- 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:ContentRepositoryAdd remote repository for site content repository- Specified by:
addRemotein interfaceContentRepository- Parameters:
siteId- site identifierremoteName- remote nameremoteUrl- remote urlauthenticationType- authentication typeremoteUsername- remote usernameremotePassword- remote passwordremoteToken- remote tokenremotePrivateKey- remote private key- Returns:
- true if operation was successful
-
removeRemote
Description copied from interface:ContentRepositoryRemove remote with given name for site- Specified by:
removeRemotein interfaceContentRepository- Parameters:
siteId- site identifierremoteName- remote name- Returns:
- true if operation was successful
-
removeRemoteRepositoriesForSite
Description copied from interface:ContentRepositoryRemove all remotes for given site- Specified by:
removeRemoteRepositoriesForSitein interfaceContentRepository- Parameters:
siteId- site identifier
-
listRemote
Description copied from interface:ContentRepositoryList remote repositories for given site- Specified by:
listRemotein interfaceContentRepository- Parameters:
siteId- site identifiersandboxBranch- sandbox branch name- Returns:
- list of names of remote repositories
-
pushToRemote
Description copied from interface:ContentRepositoryPush content to remote repository- Specified by:
pushToRemotein interfaceContentRepository- Parameters:
siteId- site identifierremoteName- remote nameremoteBranch- remote branch- Returns:
- true if operation was successful
-
pullFromRemote
Description copied from interface:ContentRepositoryPull from remote repository- Specified by:
pullFromRemotein interfaceContentRepository- Parameters:
siteId- site identifierremoteName- remote nameremoteBranch- remote branch- Returns:
- true if operation was successful
-
resetStagingRepository
Description copied from interface:ContentRepositoryReset staging repository to live for given site- Specified by:
resetStagingRepositoryin interfaceContentRepository- Parameters:
siteId- site identifier to use for resetting
-
gitGCRepositories
Description copied from interface:ContentRepositoryPerforms a git gc on all repositories for the given site- Specified by:
gitGCRepositoriesin interfaceContentRepository- Parameters:
siteId- site identifier, or null for global repository
-
repositoryExists
Description copied from interface:ContentRepositoryCheck if repository exists for given site- Specified by:
repositoryExistsin interfaceContentRepository- Parameters:
site- site id- Returns:
- true if repository exists, otherwise false
-
getSubtreeItems
default List<String> getSubtreeItems(String site, String path, GitRepositories repoType, String branch) Description copied from interface:ContentRepositoryList subtree items for give site and path- Specified by:
getSubtreeItemsin interfaceContentRepository- Parameters:
site- site identifierpath- path for subtree rootrepoType- repository typebranch- A git object references expression (e.g.: HEAD, branch name, commit id)- Returns:
- list of item paths contained in the subtree
-
getOperationsFromDelta
default List<RepoOperation> getOperationsFromDelta(String site, String commitIdFrom, String commitIdTo) Description copied from interface:ContentRepositoryGet a list of operations since the commit ID provided (compare that commit to HEAD)- Specified by:
getOperationsFromDeltain interfaceContentRepository- Parameters:
site- site to usecommitIdFrom- commit ID to start atcommitIdTo- commit ID to end at- Returns:
- commit ID of current HEAD, updated operationsSinceCommit
-
getPublishingHistory
default List<PublishingHistoryItem> getPublishingHistory(String siteId, String environment, String path, String publisher, ZonedDateTime fromDate, ZonedDateTime toDate, int limit) Description copied from interface:ContentRepositoryGet publishing history- Specified by:
getPublishingHistoryin interfaceContentRepository- Parameters:
siteId- site identifierenvironment- environmentpath- path regular expression to use as filterpublisher- user to filter byfromDate- lower boundary for published datetoDate- upper boundary for published datelimit- number of records to return- Returns:
- publishing history
-
getItem
- Specified by:
getItemin interfaceContentRepository
-
getLastEditCommitId
- Specified by:
getLastEditCommitIdin interfaceContentRepository
-
forAllSitePaths
default void forAllSitePaths(String siteId, org.springframework.util.function.ThrowingConsumer<String> directoryProcessor, org.springframework.util.function.ThrowingConsumer<String> fileProcessor) Description copied from interface:ContentRepositoryExecute consumers for all site paths for the given site- Specified by:
forAllSitePathsin interfaceContentRepository- Parameters:
siteId- the site iddirectoryProcessor- the consumer to process the directory pathsfileProcessor- the consumer to process the file paths
-
getItemEnvironmentProperties
default DetailedItem.Environment getItemEnvironmentProperties(String siteId, GitRepositories repo, String environment, String path) Description copied from interface:ContentRepositoryGet environment properties for item- Specified by:
getItemEnvironmentPropertiesin interfaceContentRepository- Parameters:
siteId- site identifierrepo- repository typeenvironment- branchpath- path of the item- Returns:
- environment properties
-
getPreviousCommitId
Description copied from interface:ContentRepositoryGet the previous commit id from repository for given a site id and a commit id- Specified by:
getPreviousCommitIdin interfaceContentRepository- Parameters:
siteId- site identifiercommitId- commit Id- Returns:
-
itemUnlock
Description copied from interface:ContentRepositoryunlock an item- Specified by:
itemUnlockin interfaceContentRepository- Parameters:
site- site id where the operation will be executedpath- path of the item
-
publishedRepositoryExists
Description copied from interface:ContentRepositoryCheck if published repository exists for given site.- Specified by:
publishedRepositoryExistsin interfaceContentRepository- Parameters:
siteId- site identifier- Returns:
- true if PUBLISHED repository exists, otherwise false
-