Class SitesServiceImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.site.SitesServiceImpl
- All Implemented Interfaces:
SitesService
-
Constructor Summary
ConstructorsConstructorDescriptionSitesServiceImpl(SitesService sitesServiceInternal, PublishingProgressServiceInternal publishingProgressServiceInternal, ContentRepository contentRepository) -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckSiteState(String siteId, String state) booleancheckSiteUuid(String siteId, String siteUuid) Checks if the currently existent site with the given ID also has the same siteUuid.voiddeleteSite(String siteId) Delete a site from the systemvoidduplicate(String sourceSiteId, String siteId, String siteName, String description, String sandboxBranch, boolean readOnlyBlobStores) Duplicate a sitevoidenablePublishing(String siteId, boolean enabled) Enables/disables publishing for the given sitebooleanCheck if site already existsList<org.craftercms.commons.plugin.model.PluginDescriptor> Get list of available blueprintsorg.craftercms.commons.plugin.model.PluginDescriptorGet the blueprint descriptor from the global repogetBlueprintLocation(String blueprintId) Get blueprint locationgetLastCommitId(String siteId) Get the last commit id for the given sitegetPublishingStatus(String siteId) Get publishing status for siteGet a site object from DBorg.craftercms.commons.plugin.model.PluginDescriptorGet the blueprint descriptor from a site repogetSitesByState(String state) Get the sites matching a given statevoidunlockSite(String siteId) Unlock a site which is locked with state `LOCKED`voidupdateLastCommitId(String siteId, String commitId) Update a site's last commit idvoidupdateSite(String siteId, String name, String description) Updates the name and description for the given siteMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.craftercms.studio.api.v2.service.site.SitesService
checkSiteExists
-
Constructor Details
-
SitesServiceImpl
@ConstructorProperties({"sitesServiceInternal","publishingProgressServiceInternal","contentRepository"}) public SitesServiceImpl(SitesService sitesServiceInternal, PublishingProgressServiceInternal publishingProgressServiceInternal, ContentRepository contentRepository)
-
-
Method Details
-
getAvailableBlueprints
Description copied from interface:SitesServiceGet list of available blueprints- Specified by:
getAvailableBlueprintsin interfaceSitesService- Returns:
- list of blueprints
-
getBlueprintDescriptor
Description copied from interface:SitesServiceGet the blueprint descriptor from the global repo- Specified by:
getBlueprintDescriptorin interfaceSitesService- Parameters:
id- the id of the blueprint- Returns:
- the descriptor object or null if not found
-
getBlueprintLocation
Description copied from interface:SitesServiceGet blueprint location- Specified by:
getBlueprintLocationin interfaceSitesService- Parameters:
blueprintId- blueprint id- Returns:
- blueprint location
-
getSiteBlueprintDescriptor
Description copied from interface:SitesServiceGet the blueprint descriptor from a site repo- Specified by:
getSiteBlueprintDescriptorin interfaceSitesService- Parameters:
id- the id of the site- Returns:
- the blueprint object or null if not found
-
updateSite
public void updateSite(String siteId, String name, String description) throws SiteNotFoundException, SiteAlreadyExistsException, InvalidParametersException Description copied from interface:SitesServiceUpdates the name and description for the given site- Specified by:
updateSitein interfaceSitesService- Parameters:
siteId- the id of the sitename- the name of the sitedescription- the description of the site- Throws:
SiteNotFoundException- if the site doesn't existSiteAlreadyExistsExceptionInvalidParametersException
-
unlockSite
Description copied from interface:SitesServiceUnlock a site which is locked with state `LOCKED`- Specified by:
unlockSitein interfaceSitesService- Parameters:
siteId- the id of the site- Throws:
SiteNotFoundException- if the site doesn't existInvalidSiteStateException- if the site is not in LOCKED state
-
deleteSite
Description copied from interface:SitesServiceDelete a site from the system- Specified by:
deleteSitein interfaceSitesService- Parameters:
siteId- the site id- Throws:
ServiceLayerException
-
exists
Description copied from interface:SitesServiceCheck if site already exists- Specified by:
existsin interfaceSitesService- Parameters:
siteId- site ID- Returns:
- true if site exists, false otherwise
-
getPublishingStatus
Description copied from interface:SitesServiceGet publishing status for site- Specified by:
getPublishingStatusin interfaceSitesService- Parameters:
siteId- site identifier- Returns:
- publishing status
- Throws:
SiteNotFoundException
-
enablePublishing
Description copied from interface:SitesServiceEnables/disables publishing for the given site- Specified by:
enablePublishingin interfaceSitesService- Parameters:
siteId- the site idenabled- true to enable publishing, false to disable
-
checkSiteState
public void checkSiteState(String siteId, String state) throws InvalidSiteStateException, SiteNotFoundException - Specified by:
checkSiteStatein interfaceSitesService- Throws:
InvalidSiteStateExceptionSiteNotFoundException
-
getSite
Description copied from interface:SitesServiceGet a site object from DB- Specified by:
getSitein interfaceSitesService- Parameters:
siteId- site id- Returns:
- site object
- Throws:
SiteNotFoundException
-
updateLastCommitId
Description copied from interface:SitesServiceUpdate a site's last commit id- Specified by:
updateLastCommitIdin interfaceSitesService- Parameters:
siteId- site idcommitId- commit id
-
getLastCommitId
Description copied from interface:SitesServiceGet the last commit id for the given site- Specified by:
getLastCommitIdin interfaceSitesService- Parameters:
siteId- site id- Returns:
- the last commit id
-
checkSiteUuid
Description copied from interface:SitesServiceChecks if the currently existent site with the given ID also has the same siteUuid.- Specified by:
checkSiteUuidin interfaceSitesService- Parameters:
siteId- ID of the site to testsiteUuid- site UUID- Returns:
- true if the site UUID file exists and contains the same siteUUID value, false otherwise
-
duplicate
public void duplicate(String sourceSiteId, String siteId, String siteName, String description, String sandboxBranch, boolean readOnlyBlobStores) throws ServiceLayerException Description copied from interface:SitesServiceDuplicate a site- Specified by:
duplicatein interfaceSitesService- Parameters:
sourceSiteId- the id of the site to duplicatesiteId- the id of the new sitesiteName- the name of the new sitedescription- the description of the new sitesandboxBranch- the sandbox branch to usereadOnlyBlobStores- whether the blob stores should be read only. Notice that this value is overridden (forced to false) if serverless delivery is enabled- Throws:
ServiceLayerException- if there is an error duplicating the site
-
getSitesByState
Description copied from interface:SitesServiceGet the sites matching a given state- Specified by:
getSitesByStatein interfaceSitesService- Parameters:
state- the state to match. SeeSite.State- Returns:
- the list of sites matching the given state
-