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, SiteService siteService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkSiteState
(String siteId, String state) Check if current site state is matches the given statevoid
clearPublishingLock
(String siteId) Clear publishing lock for sitevoid
duplicate
(String sourceSiteId, String siteId, String siteName, String description, String sandboxBranch, boolean readOnlyBlobStores) Duplicate a siteList<org.craftercms.commons.plugin.model.PluginDescriptor>
Get list of available blueprintsorg.craftercms.commons.plugin.model.PluginDescriptor
Get the blueprint descriptor from the global repogetBlueprintLocation
(String blueprintId) Get blueprint locationgetPublishingStatus
(String siteId) Get publishing status for siteorg.craftercms.commons.plugin.model.PluginDescriptor
Get the blueprint descriptor from a site repogetSitesByState
(String state) Get the sites matching a given statevoid
updateSite
(String siteId, String name, String description) Updates the name and description for the given site
-
Constructor Details
-
SitesServiceImpl
@ConstructorProperties({"sitesServiceInternal","publishingProgressServiceInternal","contentRepository","siteService"}) public SitesServiceImpl(SitesService sitesServiceInternal, PublishingProgressServiceInternal publishingProgressServiceInternal, ContentRepository contentRepository, SiteService siteService)
-
-
Method Details
-
getAvailableBlueprints
Description copied from interface:SitesService
Get list of available blueprints- Specified by:
getAvailableBlueprints
in interfaceSitesService
- Returns:
- list of blueprints
-
getBlueprintDescriptor
Description copied from interface:SitesService
Get the blueprint descriptor from the global repo- Specified by:
getBlueprintDescriptor
in interfaceSitesService
- Parameters:
id
- the id of the blueprint- Returns:
- the descriptor object or null if not found
-
getBlueprintLocation
Description copied from interface:SitesService
Get blueprint location- Specified by:
getBlueprintLocation
in interfaceSitesService
- Parameters:
blueprintId
- blueprint id- Returns:
- blueprint location
-
getSiteBlueprintDescriptor
Description copied from interface:SitesService
Get the blueprint descriptor from a site repo- Specified by:
getSiteBlueprintDescriptor
in 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:SitesService
Updates the name and description for the given site- Specified by:
updateSite
in 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 existSiteAlreadyExistsException
InvalidParametersException
-
getPublishingStatus
Description copied from interface:SitesService
Get publishing status for site- Specified by:
getPublishingStatus
in interfaceSitesService
- Parameters:
siteId
- site identifier- Returns:
- publishing status
- Throws:
SiteNotFoundException
-
clearPublishingLock
Description copied from interface:SitesService
Clear publishing lock for site- Specified by:
clearPublishingLock
in interfaceSitesService
- Parameters:
siteId
- site identifier- Throws:
SiteNotFoundException
-
checkSiteState
public void checkSiteState(String siteId, String state) throws InvalidSiteStateException, SiteNotFoundException Description copied from interface:SitesService
Check if current site state is matches the given state- Specified by:
checkSiteState
in interfaceSitesService
- Parameters:
siteId
- site idstate
- desired state- Throws:
InvalidSiteStateException
- if the site state doesn't match the given stateSiteNotFoundException
- if the site doesn't exist
-
duplicate
public void duplicate(String sourceSiteId, String siteId, String siteName, String description, String sandboxBranch, boolean readOnlyBlobStores) throws ServiceLayerException Description copied from interface:SitesService
Duplicate a site- Specified by:
duplicate
in 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- Throws:
ServiceLayerException
- if there is an error duplicating the site
-
getSitesByState
Description copied from interface:SitesService
Get the sites matching a given state- Specified by:
getSitesByState
in interfaceSitesService
- Parameters:
state
- the state to match. SeeSite.State
- Returns:
- the list of sites matching the given state
-