Class SitesServiceInternalImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.site.internal.SitesServiceInternalImpl
- All Implemented Interfaces:
SitesService,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class SitesServiceInternalImpl
extends Object
implements SitesService, org.springframework.context.ApplicationContextAware
-
Constructor Summary
ConstructorsConstructorDescriptionSitesServiceInternalImpl(org.craftercms.commons.plugin.PluginDescriptorReader descriptorReader, ContentRepository contentRepository, StudioBlobAwareContentRepository blobAwareRepository, StudioConfiguration studioConfiguration, SiteFeedMapper siteFeedMapper, SiteDAO siteDao, RetryingDatabaseOperationFacade retryingDatabaseOperationFacade, SiteService siteServiceV1, Deployer deployer, ConfigurationService configurationService, SecurityService securityService, AuditServiceInternal auditServiceInternal) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddSiteUuidFile(String site, String siteUuid) Add a file containing the site uuid in the site folderprotected voidauditSiteDuplicate(String sourceSiteId, String siteId, String siteName) Creates an audit log entry for the site duplication operation, including the source site as audit paramsvoidcheckSiteState(String siteId, String requiredState) Check if current site state is matches the given statevoidclearPublishingLock(String siteId) Clear publishing lock for siteprotected voiddoDuplicate(String sourceSiteId, String siteId, String siteName, String description, String sandboxBranch, boolean readOnlyBlobStores) voidduplicate(String sourceSiteId, String siteId, String siteName, String description, String sandboxBranch, boolean readOnlyBlobStores) Duplicate a 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 locationprotected PathgetBlueprintPath(RepositoryItem folder) protected RepositoryItem[]getPublishingStatus(String siteId) Get publishing status for siteorg.craftercms.commons.plugin.model.PluginDescriptorGet the blueprint descriptor from a site repogetSitesByState(String state) Get the sites matching a given stateprotected org.craftercms.commons.plugin.model.PluginDescriptorprotected org.craftercms.commons.plugin.model.PluginDescriptorloadDescriptor(RepositoryItem folder) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidunlockSite(String siteId) Unlock a site which is locked with state `LOCKED`voidupdateSite(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
-
SitesServiceInternalImpl
@ConstructorProperties({"descriptorReader","contentRepository","blobAwareRepository","studioConfiguration","siteFeedMapper","siteDao","retryingDatabaseOperationFacade","siteServiceV1","deployer","configurationService","securityService","auditServiceInternal"}) public SitesServiceInternalImpl(org.craftercms.commons.plugin.PluginDescriptorReader descriptorReader, ContentRepository contentRepository, StudioBlobAwareContentRepository blobAwareRepository, StudioConfiguration studioConfiguration, SiteFeedMapper siteFeedMapper, SiteDAO siteDao, RetryingDatabaseOperationFacade retryingDatabaseOperationFacade, SiteService siteServiceV1, Deployer deployer, ConfigurationService configurationService, SecurityService securityService, AuditServiceInternal auditServiceInternal)
-
-
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
-
getBlueprintsFolders
-
getBlueprintPath
-
loadDescriptor
-
loadDescriptor
protected org.craftercms.commons.plugin.model.PluginDescriptor loadDescriptor(RepositoryItem folder) -
updateSite
public void updateSite(String siteId, String name, String description) throws SiteNotFoundException, SiteAlreadyExistsException 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 existSiteAlreadyExistsException
-
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
-
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
-
clearPublishingLock
Description copied from interface:SitesServiceClear publishing lock for site- Specified by:
clearPublishingLockin interfaceSitesService- Parameters:
siteId- site identifier
-
checkSiteState
public void checkSiteState(String siteId, String requiredState) throws InvalidSiteStateException, SiteNotFoundException Description copied from interface:SitesServiceCheck if current site state is matches the given state- Specified by:
checkSiteStatein interfaceSitesService- Parameters:
siteId- site idrequiredState- 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: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
-
doDuplicate
protected void doDuplicate(String sourceSiteId, String siteId, String siteName, String description, String sandboxBranch, boolean readOnlyBlobStores) throws ServiceLayerException - Throws:
ServiceLayerException
-
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
-
auditSiteDuplicate
Creates an audit log entry for the site duplication operation, including the source site as audit params- Parameters:
sourceSiteId- the source site idsiteId- the new site idsiteName- the new site name
-
addSiteUuidFile
Add a file containing the site uuid in the site folder- Parameters:
site- site idsiteUuid- site uuid- Throws:
IOException- if the file cannot be written
-
setApplicationContext
public void setApplicationContext(@NonNull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-