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_compareVersionHelperThe helper for comparing versionsprotected Map<String,Collection<String>>_importantAttributesThe (defined in configuration) important attributes by taskprotected JSONUtils_jsonUtilsThe JSON utilprotected Map<String,Boolean>_showChangesMap of show changes indexed by task idprotected Map<String,Boolean>_showImportantChangesMap of show important changes indexed by task idstatic StringROLEThe avalon role.-
Fields inherited from class org.ametys.odf.workflow.AbstractOdfWorkflowTasksComponent
_catalogsManager
-
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 ExpressiongetContentTypeExpression()Get the content type expression concerned by this componentvoidservice(ServiceManager manager)booleanshowChanges(WorkflowTasksComponent.Task task)Determines if changes have to be shown for the given taskbooleanshowImportantChanges(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:
servicein interfaceServiceable- Overrides:
servicein classAbstractOdfWorkflowTasksComponent- Throws:
ServiceException
-
_configureAdditional
protected void _configureAdditional(WorkflowTasksComponent.Task task, Configuration taskConf) throws ConfigurationException
Description copied from class:WorkflowTasksComponentConfigure additional configuration- Overrides:
_configureAdditionalin 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:
trueif 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:
trueif 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:AbstractOdfWorkflowTasksComponentGet the content type expression concerned by this component- Specified by:
getContentTypeExpressionin classAbstractOdfWorkflowTasksComponent- Returns:
- the content type expression
-
_saxAdditionalData
protected void _saxAdditionalData(ContentHandler ch, Content content, WorkflowTasksComponent.Task task) throws SAXException
Description copied from class:WorkflowTasksComponentSAX additional data- Overrides:
_saxAdditionalDatain classAbstractOdfWorkflowTasksComponent- 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 theVersionAwareAmetysObjectContent- 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 theVersionAwareAmetysObjectContent- 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 theVersionAwareAmetysObjectContent- 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:
trueif the change is important
-
-