Class WorkflowServiceImpl
- java.lang.Object
-
- org.craftercms.studio.impl.v2.service.workflow.WorkflowServiceImpl
-
- All Implemented Interfaces:
WorkflowService,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class WorkflowServiceImpl extends Object implements WorkflowService, org.springframework.context.ApplicationContextAware
-
-
Constructor Summary
Constructors Constructor Description WorkflowServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapprove(String siteId, List<String> paths, List<String> optionalDependencies, String publishingTarget, ZonedDateTime schedule, String comment)Approve request for publishvoiddelete(String siteId, List<String> paths, List<String> optionalDependencies, String comment)Delete content itemsList<SandboxItem>getItemStates(String siteId, String path, Long states, int offset, int limit)Get item states for given filters by path regex and states maskintgetItemStatesTotal(String siteId, String path, Long states)Get total number of item states records for given filters by path regex and states maskList<SandboxItem>getWorkflowAffectedPaths(String siteId, String path)Get workflow affected paths if content is editedvoidpublish(String siteId, List<String> paths, List<String> optionalDependencies, String publishingTarget, ZonedDateTime schedule, String comment)Direct publish contentvoidreject(String siteId, List<String> paths, String comment)Reject request for publishvoidrequestPublish(String siteId, List<String> paths, List<String> optionalDependencies, String publishingTarget, ZonedDateTime schedule, String comment, boolean sendEmailNotifications)Request approval for content to be publishedvoidsetActivityStreamServiceInternal(ActivityStreamServiceInternal activityStreamServiceInternal)voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)voidsetAuditServiceInternal(AuditServiceInternal auditServiceInternal)voidsetContentServiceInternal(ContentServiceInternal contentServiceInternal)voidsetDependencyService(DependencyService dependencyService)voidsetDependencyServiceInternal(DependencyServiceInternal dependencyServiceInternal)voidsetDeploymentService(DeploymentService deploymentService)voidsetItemServiceInternal(ItemServiceInternal itemServiceInternal)voidsetNotificationService(NotificationService notificationService)voidsetPublishServiceInternal(PublishServiceInternal publishServiceInternal)voidsetSecurityService(SecurityService securityService)voidsetServicesConfig(ServicesConfig servicesConfig)voidsetSiteService(SiteService siteService)voidsetStudioConfiguration(StudioConfiguration studioConfiguration)voidsetUserServiceInternal(UserServiceInternal userServiceInternal)voidsetWorkflowServiceInternal(WorkflowServiceInternal workflowServiceInternal)voidupdateItemStates(String siteId, List<String> paths, boolean clearSystemProcessing, boolean clearUserLocked, Boolean live, Boolean staged, Boolean isNew, Boolean modified)Update item state flags for given itemsvoidupdateItemStatesByQuery(String siteId, String path, Long states, boolean clearSystemProcessing, boolean clearUserLocked, Boolean live, Boolean staged, Boolean isNew, Boolean modified)Update item state flags for given path query
-
-
-
Method Detail
-
getItemStatesTotal
public int getItemStatesTotal(String siteId, String path, Long states) throws SiteNotFoundException
Description copied from interface:WorkflowServiceGet total number of item states records for given filters by path regex and states mask- Specified by:
getItemStatesTotalin interfaceWorkflowService- Parameters:
siteId- site identifierpath- path regex to filter itemsstates- states mask to filter items by state- Returns:
- number of records
- Throws:
SiteNotFoundException
-
getItemStates
public List<SandboxItem> getItemStates(String siteId, String path, Long states, int offset, int limit) throws SiteNotFoundException
Description copied from interface:WorkflowServiceGet item states for given filters by path regex and states mask- Specified by:
getItemStatesin interfaceWorkflowService- Parameters:
siteId- site identifierpath- path regex to filter itemsstates- states mask to filter items by stateoffset- offset for the first record in result setlimit- number of item states records to return- Returns:
- list of sandbox items
- Throws:
SiteNotFoundException
-
updateItemStates
public void updateItemStates(String siteId, List<String> paths, boolean clearSystemProcessing, boolean clearUserLocked, Boolean live, Boolean staged, Boolean isNew, Boolean modified) throws SiteNotFoundException
Description copied from interface:WorkflowServiceUpdate item state flags for given items- Specified by:
updateItemStatesin interfaceWorkflowService- Parameters:
siteId- site identifierpaths- item pathsclearSystemProcessing- if true clear system processing flag, otherwise ignoreclearUserLocked- if true clear user locked flag, otherwise ignorelive- if true set live flag, otherwise reset itstaged- if true set staged flag, otherwise reset itisNew- value to set the 'new' flag to, or null if the flag should not changemodified- value to set the 'modified' flag to, or null if the flag should not change- Throws:
SiteNotFoundException
-
updateItemStatesByQuery
public void updateItemStatesByQuery(String siteId, String path, Long states, boolean clearSystemProcessing, boolean clearUserLocked, Boolean live, Boolean staged, Boolean isNew, Boolean modified) throws SiteNotFoundException
Description copied from interface:WorkflowServiceUpdate item state flags for given path query- Specified by:
updateItemStatesByQueryin interfaceWorkflowService- Parameters:
siteId- site identifierpath- path regex to identify itemsclearSystemProcessing- if true clear system processing flag, otherwise ignoreclearUserLocked- if true clear user locked flag, otherwise ignorelive- if true set live flag, otherwise reset itstaged- if true set staged flag, otherwise reset itisNew- value to set the 'new' flag to, or null if the flag should not changemodified- value to set the 'modified' flag to, or null if the flag should not change- Throws:
SiteNotFoundException
-
getWorkflowAffectedPaths
public List<SandboxItem> getWorkflowAffectedPaths(String siteId, String path) throws UserNotFoundException, ServiceLayerException
Description copied from interface:WorkflowServiceGet workflow affected paths if content is edited- Specified by:
getWorkflowAffectedPathsin interfaceWorkflowService- Parameters:
siteId- site identifierpath- path of the content to be edited- Returns:
- List of sandbox items that will be taken out of workflow after edit
- Throws:
UserNotFoundExceptionServiceLayerException
-
requestPublish
public void requestPublish(String siteId, List<String> paths, List<String> optionalDependencies, String publishingTarget, ZonedDateTime schedule, String comment, boolean sendEmailNotifications) throws ServiceLayerException, UserNotFoundException, DeploymentException
Description copied from interface:WorkflowServiceRequest approval for content to be published- Specified by:
requestPublishin interfaceWorkflowService- Parameters:
siteId- site identifierpaths- list of paths for content itemsoptionalDependencies- list of paths soft dependenciespublishingTarget- publishing targetschedule- schedule when to publish contentcomment- submission commentsendEmailNotifications- if true send email notifications- Throws:
ServiceLayerExceptionUserNotFoundExceptionDeploymentException
-
publish
public void publish(String siteId, List<String> paths, List<String> optionalDependencies, String publishingTarget, ZonedDateTime schedule, String comment) throws ServiceLayerException, UserNotFoundException, DeploymentException
Description copied from interface:WorkflowServiceDirect publish content- Specified by:
publishin interfaceWorkflowService- Parameters:
siteId- site identifierpaths- list of paths for content items to publishoptionalDependencies- list of paths soft dependenciespublishingTarget- publishing targetschedule- schedule when to publish contentcomment- publishing comment- Throws:
ServiceLayerExceptionUserNotFoundExceptionDeploymentException
-
approve
public void approve(String siteId, List<String> paths, List<String> optionalDependencies, String publishingTarget, ZonedDateTime schedule, String comment) throws UserNotFoundException, ServiceLayerException, DeploymentException
Description copied from interface:WorkflowServiceApprove request for publish- Specified by:
approvein interfaceWorkflowService- Parameters:
siteId- site identifierpaths- list of paths for content item that author requested publishoptionalDependencies- list of paths soft dependenciespublishingTarget- publishing targetschedule- schedule when to publish contentcomment- approval comment- Throws:
UserNotFoundExceptionServiceLayerExceptionDeploymentException
-
reject
public void reject(String siteId, List<String> paths, String comment) throws ServiceLayerException, DeploymentException, UserNotFoundException
Description copied from interface:WorkflowServiceReject request for publish- Specified by:
rejectin interfaceWorkflowService- Parameters:
siteId- site identifierpaths- list of paths for content items that author requested publishcomment- rejection comment- Throws:
ServiceLayerExceptionDeploymentExceptionUserNotFoundException
-
delete
public void delete(String siteId, List<String> paths, List<String> optionalDependencies, String comment) throws DeploymentException, ServiceLayerException, UserNotFoundException
Description copied from interface:WorkflowServiceDelete content items- Specified by:
deletein interfaceWorkflowService- Parameters:
siteId- site identifierpaths- list of paths for content items to be deletedoptionalDependencies- list of paths soft dependenciescomment- deletion comment- Throws:
DeploymentExceptionServiceLayerExceptionUserNotFoundException
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
setItemServiceInternal
public void setItemServiceInternal(ItemServiceInternal itemServiceInternal)
-
setContentServiceInternal
public void setContentServiceInternal(ContentServiceInternal contentServiceInternal)
-
setDependencyServiceInternal
public void setDependencyServiceInternal(DependencyServiceInternal dependencyServiceInternal)
-
setSiteService
public void setSiteService(SiteService siteService)
-
setAuditServiceInternal
public void setAuditServiceInternal(AuditServiceInternal auditServiceInternal)
-
setSecurityService
public void setSecurityService(SecurityService securityService)
-
setWorkflowServiceInternal
public void setWorkflowServiceInternal(WorkflowServiceInternal workflowServiceInternal)
-
setUserServiceInternal
public void setUserServiceInternal(UserServiceInternal userServiceInternal)
-
setDeploymentService
public void setDeploymentService(DeploymentService deploymentService)
-
setNotificationService
public void setNotificationService(NotificationService notificationService)
-
setDependencyService
public void setDependencyService(DependencyService dependencyService)
-
setPublishServiceInternal
public void setPublishServiceInternal(PublishServiceInternal publishServiceInternal)
-
setServicesConfig
public void setServicesConfig(ServicesConfig servicesConfig)
-
setStudioConfiguration
public void setStudioConfiguration(StudioConfiguration studioConfiguration)
-
setActivityStreamServiceInternal
public void setActivityStreamServiceInternal(ActivityStreamServiceInternal activityStreamServiceInternal)
-
-