Class DefaultCMSWorkflowAttachmentService
java.lang.Object
de.hybris.platform.cmsfacades.workflow.service.impl.DefaultCMSWorkflowAttachmentService
- All Implemented Interfaces:
CMSWorkflowAttachmentService
public class DefaultCMSWorkflowAttachmentService
extends Object
implements CMSWorkflowAttachmentService
Default implementation of
CMSWorkflowAttachmentService-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CMSWorkflowParticipantServiceprotected CMSWorkflowServicebooleanisWorkflowAttachedItems(List<? extends CMSItemModel> cmsItemModels) Determines if at least one of the item models is an attachment to an active workflow.voidsetCmsWorkflowParticipantService(CMSWorkflowParticipantService cmsWorkflowParticipantService) voidsetCmsWorkflowService(CMSWorkflowService cmsWorkflowService) <T extends CMSItemModel>
booleanvalidateAttachmentAndParticipant(javax.servlet.http.HttpServletResponse response, T cmsItem) Validates that the current user is a workflow participant to an active workflow that contains the given item.booleanvalidateAttachmentsAndParticipant(javax.servlet.http.HttpServletResponse response, List<? extends CMSItemModel> cmsItems) Validates that the current user is a workflow participant to all active workflows that contain all given items.
-
Constructor Details
-
DefaultCMSWorkflowAttachmentService
public DefaultCMSWorkflowAttachmentService()
-
-
Method Details
-
isWorkflowAttachedItems
Description copied from interface:CMSWorkflowAttachmentServiceDetermines if at least one of the item models is an attachment to an active workflow.- Specified by:
isWorkflowAttachedItemsin interfaceCMSWorkflowAttachmentService- Parameters:
cmsItemModels- - the CMS item models- Returns:
TRUEwhen at least one of the items is an attachment in a workflow that is still in progress;FALSEotherwise.
-
validateAttachmentsAndParticipant
public boolean validateAttachmentsAndParticipant(javax.servlet.http.HttpServletResponse response, List<? extends CMSItemModel> cmsItems) throws IOException Description copied from interface:CMSWorkflowAttachmentServiceValidates that the current user is a workflow participant to all active workflows that contain all given items. In the case that at least one of the given item is attached to a workflow that is still in progress and the current session user is not a participant in that workflow, an error in the HTTP response with the statusHttpStatus.CONFLICTis returned.- Specified by:
validateAttachmentsAndParticipantin interfaceCMSWorkflowAttachmentService- Parameters:
response- - the HTTP servlet response containing the error message if the items are attached to an active workflowcmsItems- - the CMS item models- Returns:
TRUEwhen the items are not attached to any workflow or when the current user is a participant to all active workflows containing the given items as attachments;FALSEotherwise.- Throws:
IOException- when an error occurs while raising the error
-
validateAttachmentAndParticipant
public <T extends CMSItemModel> boolean validateAttachmentAndParticipant(javax.servlet.http.HttpServletResponse response, T cmsItem) throws IOException Description copied from interface:CMSWorkflowAttachmentServiceValidates that the current user is a workflow participant to an active workflow that contains the given item. In the case that the given item is attached to a workflow that is still in progress and the current session user is not a participant in that workflow, an error in the HTTP response with the statusHttpStatus.CONFLICTis returned.- Specified by:
validateAttachmentAndParticipantin interfaceCMSWorkflowAttachmentService- Parameters:
response- - the HTTP servlet response containing the error message if the items are attached to an active workflowcmsItem- - the CMS item model- Returns:
TRUEwhen the item is not attached to any workflow or when the current user is a participant to the active workflow containing the given item as attachment;FALSEotherwise.- Throws:
IOException- when an error occurs while raising the error
-
getCmsWorkflowService
-
setCmsWorkflowService
-
getCmsWorkflowParticipantService
-
setCmsWorkflowParticipantService
public void setCmsWorkflowParticipantService(CMSWorkflowParticipantService cmsWorkflowParticipantService)
-