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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
approve
(String siteId, List<String> paths, List<String> optionalDependencies, String publishingTarget, ZonedDateTime schedule, String comment) Approve request for publishvoid
Delete content itemsgetItemStates
(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 maskgetWorkflowAffectedPaths
(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 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
-
Constructor Details
-
WorkflowServiceImpl
public WorkflowServiceImpl()
-
-
Method Details
-
getItemStatesTotal
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
-
setContentServiceInternal
-
setDependencyServiceInternal
-
setSiteService
-
setAuditServiceInternal
-
setSecurityService
-
setWorkflowServiceInternal
-
setUserServiceInternal
-
setDeploymentService
-
setNotificationService
-
setDependencyService
-
setPublishServiceInternal
-
setServicesConfig
-
setStudioConfiguration
-
setActivityStreamServiceInternal
public void setActivityStreamServiceInternal(ActivityStreamServiceInternal activityStreamServiceInternal)
-