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 void
approve(String siteId, List<String> paths, List<String> optionalDependencies, String publishingTarget, ZonedDateTime schedule, String comment)
Approve request for publishvoid
delete(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 maskint
getItemStatesTotal(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 editedvoid
publish(String siteId, List<String> paths, List<String> optionalDependencies, String publishingTarget, ZonedDateTime schedule, String comment)
Direct publish contentvoid
reject(String siteId, List<String> paths, String comment)
Reject request for publishvoid
requestPublish(String siteId, List<String> paths, List<String> optionalDependencies, String publishingTarget, ZonedDateTime schedule, String comment, boolean sendEmailNotifications)
Request approval for content to be publishedvoid
setActivityStreamServiceInternal(ActivityStreamServiceInternal activityStreamServiceInternal)
void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
void
setAuditServiceInternal(AuditServiceInternal auditServiceInternal)
void
setContentServiceInternal(ContentServiceInternal contentServiceInternal)
void
setDependencyService(DependencyService dependencyService)
void
setDependencyServiceInternal(DependencyServiceInternal dependencyServiceInternal)
void
setDeploymentService(DeploymentService deploymentService)
void
setItemServiceInternal(ItemServiceInternal itemServiceInternal)
void
setNotificationService(NotificationService notificationService)
void
setPublishServiceInternal(PublishServiceInternal publishServiceInternal)
void
setSecurityService(SecurityService securityService)
void
setServicesConfig(ServicesConfig servicesConfig)
void
setSiteService(SiteService siteService)
void
setStudioConfiguration(StudioConfiguration studioConfiguration)
void
setUserServiceInternal(UserServiceInternal userServiceInternal)
void
setWorkflowServiceInternal(WorkflowServiceInternal workflowServiceInternal)
void
updateItemStates(String siteId, List<String> paths, boolean clearSystemProcessing, boolean clearUserLocked, Boolean live, Boolean staged, Boolean isNew, Boolean modified)
Update item state flags for given itemsvoid
updateItemStatesByQuery(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:WorkflowService
Get total number of item states records for given filters by path regex and states mask- Specified by:
getItemStatesTotal
in 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:WorkflowService
Get item states for given filters by path regex and states mask- Specified by:
getItemStates
in 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:WorkflowService
Update item state flags for given items- Specified by:
updateItemStates
in 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:WorkflowService
Update item state flags for given path query- Specified by:
updateItemStatesByQuery
in 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:WorkflowService
Get workflow affected paths if content is edited- Specified by:
getWorkflowAffectedPaths
in 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:
UserNotFoundException
ServiceLayerException
-
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:WorkflowService
Request approval for content to be published- Specified by:
requestPublish
in 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:
ServiceLayerException
UserNotFoundException
DeploymentException
-
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:WorkflowService
Direct publish content- Specified by:
publish
in 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:
ServiceLayerException
UserNotFoundException
DeploymentException
-
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:WorkflowService
Approve request for publish- Specified by:
approve
in 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:
UserNotFoundException
ServiceLayerException
DeploymentException
-
reject
public void reject(String siteId, List<String> paths, String comment) throws ServiceLayerException, DeploymentException, UserNotFoundException
Description copied from interface:WorkflowService
Reject request for publish- Specified by:
reject
in interfaceWorkflowService
- Parameters:
siteId
- site identifierpaths
- list of paths for content items that author requested publishcomment
- rejection comment- Throws:
ServiceLayerException
DeploymentException
UserNotFoundException
-
delete
public void delete(String siteId, List<String> paths, List<String> optionalDependencies, String comment) throws DeploymentException, ServiceLayerException, UserNotFoundException
Description copied from interface:WorkflowService
Delete content items- Specified by:
delete
in interfaceWorkflowService
- Parameters:
siteId
- site identifierpaths
- list of paths for content items to be deletedoptionalDependencies
- list of paths soft dependenciescomment
- deletion comment- Throws:
DeploymentException
ServiceLayerException
UserNotFoundException
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
- Specified by:
setApplicationContext
in 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)
-
-