Package org.ametys.cms.workflow
Class ContentHistoryAction
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.acting.AbstractAction
-
- org.apache.cocoon.acting.ServiceableAction
-
- org.ametys.cms.workflow.ContentHistoryAction
-
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
public class ContentHistoryAction extends ServiceableAction
This action returns the workflow history of a content
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ContentHistoryAction.VersionInformation
-
Field Summary
Fields Modifier and Type Field Description private static I18nizableText
__MESSAGE_NO_ACTION
private static I18nizableText
__MESSAGE_NO_STEP
private ContentHelper
_contentHelper
private AmetysObjectResolver
_resolver
private UserHelper
_userHelper
private WorkflowProvider
_workflowProvider
-
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
-
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
-
Constructor Summary
Constructors Constructor Description ContentHistoryAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private List<ContentHistoryAction.VersionInformation>
_computeVersionsBetween(List<ContentHistoryAction.VersionInformation> versionsInformation, Date startDate, Date finishDate)
private List<Map<String,Object>>
_getContentWorkflowHistory(Content content, List<ContentHistoryAction.VersionInformation> versionsInformation, Set<String> validatedVersions)
private String
_getDate(Date startDate, Date finishDate, Date actionFinishDate)
private Map<String,Object>
_getDescription2Json(com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor, int stepId)
private long
_getInitialActionId(WorkflowProvider.AmetysObjectWorkflow workflow, WorkflowAwareContent waContent)
private List<Map<String,Object>>
_getVersionsBetween2Json(List<ContentHistoryAction.VersionInformation> versionsInformation, Date startDate, Date finishDate)
private Map<String,Object>
_getWorkfowAction2Json(UserIdentity caller, Content content, com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor, int actionId)
private boolean
_isValid(com.opensymphony.workflow.spi.Step step)
private List<ContentHistoryAction.VersionInformation>
_resolveVersionInformations(VersionAwareAmetysObject content)
private Map<String,Object>
_step2Json(Content content, com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor, List<ContentHistoryAction.VersionInformation> versionsInformation, Set<String> validatedVersions, com.opensymphony.workflow.spi.Step step, com.opensymphony.workflow.spi.Step previousStep)
Map
act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)
void
service(ServiceManager serviceManager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
__MESSAGE_NO_STEP
private static final I18nizableText __MESSAGE_NO_STEP
-
__MESSAGE_NO_ACTION
private static final I18nizableText __MESSAGE_NO_ACTION
-
_workflowProvider
private WorkflowProvider _workflowProvider
-
_userHelper
private UserHelper _userHelper
-
_resolver
private AmetysObjectResolver _resolver
-
_contentHelper
private ContentHelper _contentHelper
-
-
Constructor Detail
-
ContentHistoryAction
public ContentHistoryAction()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableAction
- Throws:
ServiceException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
- Throws:
Exception
-
_getContentWorkflowHistory
private List<Map<String,Object>> _getContentWorkflowHistory(Content content, List<ContentHistoryAction.VersionInformation> versionsInformation, Set<String> validatedVersions) throws ProcessingException, RepositoryException
-
_getInitialActionId
private long _getInitialActionId(WorkflowProvider.AmetysObjectWorkflow workflow, WorkflowAwareContent waContent)
-
_step2Json
private Map<String,Object> _step2Json(Content content, com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor, List<ContentHistoryAction.VersionInformation> versionsInformation, Set<String> validatedVersions, com.opensymphony.workflow.spi.Step step, com.opensymphony.workflow.spi.Step previousStep) throws RepositoryException
- Throws:
RepositoryException
-
_getDescription2Json
private Map<String,Object> _getDescription2Json(com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor, int stepId)
-
_getWorkfowAction2Json
private Map<String,Object> _getWorkfowAction2Json(UserIdentity caller, Content content, com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor, int actionId)
-
_getVersionsBetween2Json
private List<Map<String,Object>> _getVersionsBetween2Json(List<ContentHistoryAction.VersionInformation> versionsInformation, Date startDate, Date finishDate) throws RepositoryException
- Throws:
RepositoryException
-
_isValid
private boolean _isValid(com.opensymphony.workflow.spi.Step step)
-
_computeVersionsBetween
private List<ContentHistoryAction.VersionInformation> _computeVersionsBetween(List<ContentHistoryAction.VersionInformation> versionsInformation, Date startDate, Date finishDate) throws RepositoryException
- Throws:
RepositoryException
-
_resolveVersionInformations
private List<ContentHistoryAction.VersionInformation> _resolveVersionInformations(VersionAwareAmetysObject content) throws RepositoryException
- Throws:
RepositoryException
-
-