Class DeploymentServiceImpl
- java.lang.Object
-
- org.craftercms.studio.impl.v1.service.deployment.DeploymentServiceImpl
-
- All Implemented Interfaces:
DeploymentService
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class DeploymentServiceImpl extends Object implements DeploymentService, org.springframework.context.ApplicationContextAware
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DeploymentServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addScheduledItem(String site, String environment, ZonedDateTime launchDate, String path, String packageId, List<ContentItemTO> scheduledItems, DmContentItemComparator comparator, DmContentItemComparator subComparator, List<String> displayPatterns)
add a scheduled item created from the given node to the scheduled items list if the item is not a component or a static assetprotected void
addToScheduledDateList(String site, String environment, ZonedDateTime launchDate, String path, String packageId, List<ContentItemTO> scheduledItems, DmContentItemComparator comparator, DmContentItemComparator subComparator, List<String> displayPatterns)
add the given node to the scheduled items listvoid
bulkGoLive(String site, String environment, String path, String comment)
Start executing bulk publish for given site, path on given environmentvoid
cancelWorkflow(String site, String path)
void
cancelWorkflowBulk(String site, Set<String> paths)
protected ContentItemTO
createDateItem(String name, ContentItemTO itemToAdd, DmContentItemComparator comparator, String timeZone)
void
delete(String site, List<String> paths, String approver, ZonedDateTime scheduledDate, String submissionComment)
Delete contentvoid
deleteDeploymentDataForSite(String site)
void
deploy(String site, String environment, List<String> paths, ZonedDateTime scheduledDate, String approver, String submissionComment, boolean scheduleDateNow)
@javax.validation.Valid boolean
enablePublishing(String site, boolean enabled)
Enable/Disable publishing for given siteprotected Set<String>
getAllPublishedEnvironments(String site)
@Valid List<ContentItemTO>
getScheduledItems(String site, String sort, boolean ascending, String subSort, boolean subAscending, String filterType)
@Valid List<PublishRequest>
getScheduledItems(String site, String filterType)
protected List<ContentItemTO>
getScheduledItems(String site, DmContentItemComparator comparator, DmContentItemComparator subComparator, String filterType)
SecurityService
getSecurityService()
void
publishCommits(String site, String environment, List<String> commitIds, String comment)
Publish given commit IDs on given environment for given sitevoid
publishItems(String site, String environment, ZonedDateTime schedule, List<String> paths, String submissionComment)
Publish items in given environment for given sitevoid
resetStagingEnvironment(String siteId)
Reset staging environment to live for given siteprotected void
sendContentApprovalEmail(List<PublishRequest> itemList, boolean scheduleDateNow)
void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
void
setAuditServiceInternal(AuditServiceInternal auditServiceInternal)
void
setContentRepository(ContentRepository contentRepository)
void
setContentRepositoryV2(ContentRepository contentRepositoryV2)
void
setContentService(ContentService contentService)
void
setDependencyService(DependencyService dependencyService)
void
setDmFilterWrapper(DmFilterWrapper dmFilterWrapper)
void
setDmPublishService(DmPublishService dmPublishService)
void
setItemServiceInternal(ItemServiceInternal itemServiceInternal)
void
setNotificationService(NotificationService notificationService)
void
setPublishingManager(PublishingManager publishingManager)
void
setPublishRequestDAO(PublishRequestDAO publishRequestDAO)
void
setPublishRequestMapper(PublishRequestMapper publishRequestMapper)
void
setRetryingDatabaseOperationFacade(RetryingDatabaseOperationFacade retryingDatabaseOperationFacade)
void
setSecurityService(SecurityService securityService)
void
setServicesConfig(ServicesConfig servicesConfig)
void
setSiteService(SiteService siteService)
void
setStudioConfiguration(StudioConfiguration studioConfiguration)
void
setUserServiceInternal(UserServiceInternal userServiceInternal)
void
setWorkflowServiceInternal(WorkflowServiceInternal workflowServiceInternal)
-
-
-
Field Detail
-
servicesConfig
protected ServicesConfig servicesConfig
-
contentService
protected ContentService contentService
-
dependencyService
protected DependencyService dependencyService
-
dmFilterWrapper
protected DmFilterWrapper dmFilterWrapper
-
siteService
protected SiteService siteService
-
contentRepository
protected ContentRepository contentRepository
-
dmPublishService
protected DmPublishService dmPublishService
-
securityService
protected SecurityService securityService
-
notificationService
protected NotificationService notificationService
-
studioConfiguration
protected StudioConfiguration studioConfiguration
-
publishRequestMapper
protected PublishRequestMapper publishRequestMapper
-
auditServiceInternal
protected AuditServiceInternal auditServiceInternal
-
contentRepositoryV2
protected ContentRepository contentRepositoryV2
-
itemServiceInternal
protected ItemServiceInternal itemServiceInternal
-
workflowServiceInternal
protected WorkflowServiceInternal workflowServiceInternal
-
userServiceInternal
protected UserServiceInternal userServiceInternal
-
publishingManager
protected PublishingManager publishingManager
-
publishRequestDAO
protected PublishRequestDAO publishRequestDAO
-
retryingDatabaseOperationFacade
protected RetryingDatabaseOperationFacade retryingDatabaseOperationFacade
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext
-
-
Method Detail
-
deploy
@Valid public void deploy(String site, String environment, List<String> paths, ZonedDateTime scheduledDate, String approver, String submissionComment, boolean scheduleDateNow) throws DeploymentException, ServiceLayerException, UserNotFoundException
- Specified by:
deploy
in interfaceDeploymentService
- Throws:
DeploymentException
ServiceLayerException
UserNotFoundException
-
sendContentApprovalEmail
protected void sendContentApprovalEmail(List<PublishRequest> itemList, boolean scheduleDateNow) throws ServiceLayerException, UserNotFoundException
-
delete
@Valid public void delete(String site, List<String> paths, String approver, ZonedDateTime scheduledDate, String submissionComment) throws DeploymentException, ServiceLayerException, UserNotFoundException
Description copied from interface:DeploymentService
Delete content- Specified by:
delete
in interfaceDeploymentService
- Parameters:
site
- site identifierpaths
- list of paths to deleteapprover
- user that approved deletionscheduledDate
- scheduled date to execute deletionsubmissionComment
- submission comment- Throws:
DeploymentException
- general deployment errorSiteNotFoundException
- if site does not existServiceLayerException
UserNotFoundException
-
deleteDeploymentDataForSite
@Valid public void deleteDeploymentDataForSite(String site)
- Specified by:
deleteDeploymentDataForSite
in interfaceDeploymentService
-
getScheduledItems
@Valid public @Valid List<PublishRequest> getScheduledItems(String site, String filterType)
- Specified by:
getScheduledItems
in interfaceDeploymentService
-
cancelWorkflow
@Valid public void cancelWorkflow(String site, String path) throws DeploymentException
- Specified by:
cancelWorkflow
in interfaceDeploymentService
- Throws:
DeploymentException
-
cancelWorkflowBulk
@Valid public void cancelWorkflowBulk(String site, Set<String> paths)
- Specified by:
cancelWorkflowBulk
in interfaceDeploymentService
-
getScheduledItems
@Valid public @Valid List<ContentItemTO> getScheduledItems(String site, String sort, boolean ascending, String subSort, boolean subAscending, String filterType) throws ServiceLayerException
- Specified by:
getScheduledItems
in interfaceDeploymentService
- Throws:
ServiceLayerException
-
getScheduledItems
protected List<ContentItemTO> getScheduledItems(String site, DmContentItemComparator comparator, DmContentItemComparator subComparator, String filterType)
-
addScheduledItem
protected void addScheduledItem(String site, String environment, ZonedDateTime launchDate, String path, String packageId, List<ContentItemTO> scheduledItems, DmContentItemComparator comparator, DmContentItemComparator subComparator, List<String> displayPatterns)
add a scheduled item created from the given node to the scheduled items list if the item is not a component or a static asset- Parameters:
site
-launchDate
-scheduledItems
-comparator
-displayPatterns
-
-
addToScheduledDateList
protected void addToScheduledDateList(String site, String environment, ZonedDateTime launchDate, String path, String packageId, List<ContentItemTO> scheduledItems, DmContentItemComparator comparator, DmContentItemComparator subComparator, List<String> displayPatterns) throws ServiceLayerException
add the given node to the scheduled items list- Parameters:
site
-launchDate
-scheduledItems
-comparator
-subComparator
-displayPatterns
-- Throws:
ServiceLayerException
-
createDateItem
protected ContentItemTO createDateItem(String name, ContentItemTO itemToAdd, DmContentItemComparator comparator, String timeZone)
-
bulkGoLive
@Valid public void bulkGoLive(String site, String environment, String path, String comment) throws ServiceLayerException
Description copied from interface:DeploymentService
Start executing bulk publish for given site, path on given environment- Specified by:
bulkGoLive
in interfaceDeploymentService
- Parameters:
site
- site identifierenvironment
- environment to publish topath
- base path for bulk publishcomment
- submission comment- Throws:
ServiceLayerException
- exception is case of en error
-
enablePublishing
@Valid public @javax.validation.Valid boolean enablePublishing(String site, boolean enabled) throws SiteNotFoundException, AuthenticationException
Description copied from interface:DeploymentService
Enable/Disable publishing for given site- Specified by:
enablePublishing
in interfaceDeploymentService
- Parameters:
site
- site idenabled
- true to enable publishing, false to disable publishing- Throws:
SiteNotFoundException
AuthenticationException
-
publishCommits
@Valid public void publishCommits(String site, String environment, List<String> commitIds, String comment) throws SiteNotFoundException, EnvironmentNotFoundException, CommitNotFoundException
Description copied from interface:DeploymentService
Publish given commit IDs on given environment for given site- Specified by:
publishCommits
in interfaceDeploymentService
- Parameters:
site
- site id to use for publishingenvironment
- environment to use for publishingcommitIds
- commit IDs to publish- Throws:
SiteNotFoundException
EnvironmentNotFoundException
CommitNotFoundException
-
publishItems
public void publishItems(String site, String environment, ZonedDateTime schedule, List<String> paths, String submissionComment) throws ServiceLayerException, DeploymentException, UserNotFoundException
Description copied from interface:DeploymentService
Publish items in given environment for given site- Specified by:
publishItems
in interfaceDeploymentService
- Parameters:
site
- site id to use for publishingenvironment
- environment to use for publishingpaths
- item paths to publish- Throws:
SiteNotFoundException
EnvironmentNotFoundException
ServiceLayerException
DeploymentException
UserNotFoundException
-
resetStagingEnvironment
public void resetStagingEnvironment(String siteId) throws ServiceLayerException, org.craftercms.commons.crypto.CryptoException
Description copied from interface:DeploymentService
Reset staging environment to live for given site- Specified by:
resetStagingEnvironment
in interfaceDeploymentService
- Parameters:
siteId
- site id to use for resetting- Throws:
ServiceLayerException
org.craftercms.commons.crypto.CryptoException
-
setApplicationContext
public void setApplicationContext(@NonNull org.springframework.context.ApplicationContext applicationContext)
- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
-
setServicesConfig
public void setServicesConfig(ServicesConfig servicesConfig)
-
setContentService
public void setContentService(ContentService contentService)
-
setDependencyService
public void setDependencyService(DependencyService dependencyService)
-
setDmFilterWrapper
public void setDmFilterWrapper(DmFilterWrapper dmFilterWrapper)
-
setSiteService
public void setSiteService(SiteService siteService)
-
setContentRepository
public void setContentRepository(ContentRepository contentRepository)
-
setDmPublishService
public void setDmPublishService(DmPublishService dmPublishService)
-
getSecurityService
public SecurityService getSecurityService()
-
setSecurityService
public void setSecurityService(SecurityService securityService)
-
setNotificationService
public void setNotificationService(NotificationService notificationService)
-
setStudioConfiguration
public void setStudioConfiguration(StudioConfiguration studioConfiguration)
-
setPublishRequestMapper
public void setPublishRequestMapper(PublishRequestMapper publishRequestMapper)
-
setAuditServiceInternal
public void setAuditServiceInternal(AuditServiceInternal auditServiceInternal)
-
setContentRepositoryV2
public void setContentRepositoryV2(ContentRepository contentRepositoryV2)
-
setItemServiceInternal
public void setItemServiceInternal(ItemServiceInternal itemServiceInternal)
-
setWorkflowServiceInternal
public void setWorkflowServiceInternal(WorkflowServiceInternal workflowServiceInternal)
-
setUserServiceInternal
public void setUserServiceInternal(UserServiceInternal userServiceInternal)
-
setPublishingManager
public void setPublishingManager(PublishingManager publishingManager)
-
setPublishRequestDAO
public void setPublishRequestDAO(PublishRequestDAO publishRequestDAO)
-
setRetryingDatabaseOperationFacade
public void setRetryingDatabaseOperationFacade(RetryingDatabaseOperationFacade retryingDatabaseOperationFacade)
-
-