Package org.ametys.odf.workflow.task
Class AbstractOdfWorkflowTasksWithChangesComponent
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.cms.workflow.WorkflowTasksComponent
org.ametys.odf.workflow.task.AbstractOdfWorkflowTasksComponent
org.ametys.odf.workflow.task.AbstractOdfWorkflowTasksWithChangesComponent
- All Implemented Interfaces:
Component,Configurable,LogEnabled,Serviceable,ThreadSafe
- Direct Known Subclasses:
ProgramWorkflowTasksComponent,SubProgramWorkflowTasksComponent
public abstract class AbstractOdfWorkflowTasksWithChangesComponent
extends AbstractOdfWorkflowTasksComponent
Override
AbstractOdfWorkflowTasksComponent to add the change informations-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.cms.workflow.WorkflowTasksComponent
WorkflowTasksComponent.LastModifiedDateComparator, WorkflowTasksComponent.Task, WorkflowTasksComponent.TaskStep -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CompareVersionHelperThe helper for comparing versionsprotected Map<String, Collection<String>> The (defined in configuration) important attributes by taskprotected JSONUtilsThe JSON utilMap of show changes indexed by task idMap of show important changes indexed by task idFields inherited from class org.ametys.odf.workflow.task.AbstractOdfWorkflowTasksComponent
_catalogsManagerFields inherited from class org.ametys.cms.workflow.WorkflowTasksComponent
_allowUserQuery, _contentHelper, _contentTypesHelper, _cTypeEP, _languagesManager, _objectResolver, _rightManager, _tasks, _userManager, _workflowProvider, ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void_configureAdditional(WorkflowTasksComponent.Task task, Configuration taskConf) Configure additional configurationprotected void_configureChanges(Configuration taskConfiguration) Configures the changes to SAX_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>
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 validationvoidservice(ServiceManager manager) booleanDetermines if changes have to be shown for the given taskbooleanDetermines if important changes have to be shown for the given taskMethods inherited from class org.ametys.odf.workflow.task.AbstractOdfWorkflowTasksComponent
_getContentsAndExpressions, getContentTypeExpressionMethods 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, toSAXMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_jsonUtils
The JSON util -
_compareVersionHelper
The helper for comparing versions -
_showChanges
Map of show changes indexed by task id -
_showImportantChanges
Map of show important changes indexed by task id -
_importantAttributes
The (defined in configuration) important attributes by task
-
-
Constructor Details
-
AbstractOdfWorkflowTasksWithChangesComponent
-
-
Method Details
-
service
- 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
Determines if changes have to be shown for the given task- Parameters:
task- the task- Returns:
trueif changes are configured to be SAXed
-
showImportantChanges
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
Configures the changes to SAX- Parameters:
taskConfiguration- The task configuration- Throws:
ConfigurationException- If the configuration is invalid.
-
_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 Gets the changes- Type Parameters:
C- The type of theVersionAwareAmetysObjectContent- Parameters:
content- The content- Returns:
- The changes
- Throws:
AmetysRepositoryException- repository exception
-
_getTargetVersion
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
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
Determines if a change is important- Parameters:
task- the current taskchangedModelItem- The changedModelItem- Returns:
trueif the change is important
-