Package org.ametys.odf.workflow
Class ProgramWorkflowTasksComponent
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.workflow.WorkflowTasksComponent
-
- org.ametys.odf.workflow.AbstractOdfWorkflowTasksComponent
-
- org.ametys.odf.workflow.ProgramWorkflowTasksComponent
-
- All Implemented Interfaces:
Component
,Configurable
,LogEnabled
,Serviceable
,ThreadSafe
public class ProgramWorkflowTasksComponent extends AbstractOdfWorkflowTasksComponent
Workflow tasks component forProgram
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ametys.cms.workflow.WorkflowTasksComponent
WorkflowTasksComponent.LastModifiedDateComparator, WorkflowTasksComponent.Task, WorkflowTasksComponent.TaskStep
-
-
Field Summary
Fields Modifier and Type Field Description protected CompareVersionHelper
_compareVersionHelper
The helper for comparing versionsprotected Map<String,Collection<String>>
_importantAttributes
The (defined in configuration) important attributes by taskprotected JSONUtils
_jsonUtils
The JSON utilprotected Map<String,Boolean>
_showChanges
Map of show changes indexed by task idprotected Map<String,Boolean>
_showImportantChanges
Map of show important changes indexed by task idstatic String
ROLE
The avalon role.-
Fields inherited from class org.ametys.cms.workflow.WorkflowTasksComponent
_allowUserQuery, _contentHelper, _contentTypesHelper, _cTypeEP, _languagesManager, _objectResolver, _rightManager, _tasks, _userManager, _workflowProvider
-
-
Constructor Summary
Constructors Constructor Description ProgramWorkflowTasksComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_configureAdditional(WorkflowTasksComponent.Task task, Configuration taskConf)
Configure additional configurationprotected void
_configureChanges(Configuration taskConfiguration)
Configures the changes to SAXprotected List<Map<String,Object>>
_getAttributeChanges(WorkflowTasksComponent.Task task, List<ContentComparatorChange> changes)
Gets the attribute changes (as JSON) of the given content which changed since the last validationprotected <C extends Content & VersionAwareAmetysObject>
Optional<String>_getBaseVersion(C versionable)
Gets the base version of comparison.protected <C extends Content & VersionAwareAmetysObject>
List<ContentComparatorChange>_getChanges(C content)
Gets the changesprotected <C extends Content & VersionAwareAmetysObject>
String_getTargetVersion(C versionable)
Gets the source version of comparison.protected boolean
_isImportant(WorkflowTasksComponent.Task task, ModelItem changedModelItem)
Determines if a change is importantprotected void
_saxAdditionalData(ContentHandler ch, Content content, WorkflowTasksComponent.Task task)
SAX additional dataprotected void
_saxAttributeChanges(ContentHandler ch, Content content, WorkflowTasksComponent.Task task, List<ContentComparatorChange> changes)
SAX attributes of the given content which changed since the last validationprivate Map<String,Object>
_toJson(ModelItem modelItem, boolean isImportant)
protected Expression
getContentTypeExpression()
Get the content type expression concerned by this componentvoid
service(ServiceManager manager)
boolean
showChanges(WorkflowTasksComponent.Task task)
Determines if changes have to be shown for the given taskboolean
showImportantChanges(WorkflowTasksComponent.Task task)
Determines if important changes have to be shown for the given task-
Methods inherited from class org.ametys.odf.workflow.AbstractOdfWorkflowTasksComponent
_getContentsAndExpressions
-
Methods inherited from class org.ametys.cms.workflow.WorkflowTasksComponent
_configureStep, _configureStepIds, _configureTasks, _getContents, _getCorrespondingWorkflows, _getTaskContents, _getTaskContents, _saxAdditionalAttributes, _saxAdditionalAttributes, _saxContent, _saxContentCurrentState, _saxTask, _testContent, allowUserQuery, configure, getContents, getTasks, toSAX, toSAX
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_jsonUtils
protected JSONUtils _jsonUtils
The JSON util
-
_compareVersionHelper
protected CompareVersionHelper _compareVersionHelper
The helper for comparing versions
-
_showChanges
protected Map<String,Boolean> _showChanges
Map of show changes indexed by task id
-
_showImportantChanges
protected Map<String,Boolean> _showImportantChanges
Map of show important changes indexed by task id
-
_importantAttributes
protected Map<String,Collection<String>> _importantAttributes
The (defined in configuration) important attributes by task
-
-
Constructor Detail
-
ProgramWorkflowTasksComponent
public ProgramWorkflowTasksComponent()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classWorkflowTasksComponent
- Throws:
ServiceException
-
_configureAdditional
protected void _configureAdditional(WorkflowTasksComponent.Task task, Configuration taskConf) throws ConfigurationException
Description copied from class:WorkflowTasksComponent
Configure additional configuration- Overrides:
_configureAdditional
in classWorkflowTasksComponent
- Parameters:
task
- task the current tasktaskConf
- the task configuration.- Throws:
ConfigurationException
- if a configuration error occurs.
-
showChanges
public boolean showChanges(WorkflowTasksComponent.Task task)
Determines if changes have to be shown for the given task- Parameters:
task
- the task- Returns:
true
if changes are configured to be SAXed
-
showImportantChanges
public boolean showImportantChanges(WorkflowTasksComponent.Task task)
Determines if important changes have to be shown for the given task- Parameters:
task
- the task- Returns:
true
if changes are configured to be SAXed
-
_configureChanges
protected void _configureChanges(Configuration taskConfiguration) throws ConfigurationException
Configures the changes to SAX- Parameters:
taskConfiguration
- The task configuration- Throws:
ConfigurationException
- If the configuration is invalid.
-
getContentTypeExpression
protected Expression getContentTypeExpression()
Description copied from class:AbstractOdfWorkflowTasksComponent
Get the content type expression concerned by this component- Specified by:
getContentTypeExpression
in classAbstractOdfWorkflowTasksComponent
- Returns:
- the content type expression
-
_saxAdditionalData
protected void _saxAdditionalData(ContentHandler ch, Content content, WorkflowTasksComponent.Task task) throws SAXException
Description copied from class:WorkflowTasksComponent
SAX additional data- Overrides:
_saxAdditionalData
in classWorkflowTasksComponent
- Parameters:
ch
- the content handler.content
- the contenttask
- the task- Throws:
SAXException
- If an error occurred
-
_getChanges
protected <C extends Content & VersionAwareAmetysObject> List<ContentComparatorChange> _getChanges(C content) throws AmetysRepositoryException, IOException
Gets the changes- Type Parameters:
C
- The type of theVersionAwareAmetysObject
Content
- Parameters:
content
- The content- Returns:
- The changes
- Throws:
AmetysRepositoryException
- repository exceptionIOException
- IO exception
-
_getTargetVersion
protected <C extends Content & VersionAwareAmetysObject> String _getTargetVersion(C versionable)
Gets the source version of comparison. By default, it is the current one.- Type Parameters:
C
- The type of theVersionAwareAmetysObject
Content
- Parameters:
versionable
- TheContent
- Returns:
- the source version
-
_getBaseVersion
protected <C extends Content & VersionAwareAmetysObject> Optional<String> _getBaseVersion(C versionable)
Gets the base version of comparison. By default, it is the last validated one.- Type Parameters:
C
- The type of theVersionAwareAmetysObject
Content
- Parameters:
versionable
- TheContent
- Returns:
- the target version
-
_saxAttributeChanges
protected void _saxAttributeChanges(ContentHandler ch, Content content, WorkflowTasksComponent.Task task, List<ContentComparatorChange> changes) throws SAXException
SAX attributes of the given content which changed since the last validation- Parameters:
ch
- The content handlercontent
- The contenttask
- the current taskchanges
- The changes- Throws:
SAXException
- If an error occurred
-
_getAttributeChanges
protected List<Map<String,Object>> _getAttributeChanges(WorkflowTasksComponent.Task task, List<ContentComparatorChange> changes)
Gets the attribute changes (as JSON) of the given content which changed since the last validation- Parameters:
task
- the current taskchanges
- The changes- Returns:
- The changes as JSON
-
_isImportant
protected boolean _isImportant(WorkflowTasksComponent.Task task, ModelItem changedModelItem)
Determines if a change is important- Parameters:
task
- the current taskchangedModelItem
- The changedModelItem
- Returns:
true
if the change is important
-
-