Updated workflow content indexer
authorThierry Florac <thierry.florac@onf.fr>
Tue, 27 Jun 2017 13:34:29 +0200
changeset 11 2dfb793b4e0f
parent 10 78a475f0423e
child 12 7e02b1d62ed6
Updated workflow content indexer
src/pyams_content_es/component/workflow.py
--- a/src/pyams_content_es/component/workflow.py	Tue Jun 27 13:33:54 2017 +0200
+++ b/src/pyams_content_es/component/workflow.py	Tue Jun 27 13:34:29 2017 +0200
@@ -17,7 +17,9 @@
 
 # import interfaces
 from pyams_content_es.interfaces import IDocumentIndexInfo
-from pyams_workflow.interfaces import IWorkflowState, IWorkflowPublicationSupport, IWorkflowInfo
+from pyams_workflow.interfaces import IWorkflowState, IWorkflowPublicationSupport, IWorkflowInfo, \
+    IWorkflowPublicationInfo
+from zope.dublincore.interfaces import IZopeDublinCore
 
 # import packages
 from pyams_utils.adapter import adapter_config
@@ -26,7 +28,13 @@
 @adapter_config(name='workflow', context=IWorkflowPublicationSupport, provides=IDocumentIndexInfo)
 def WorkflowManagedContentIndexInfo(content):
     """Workflow managed content index info"""
+    dc_info = IZopeDublinCore(content)
     workflow_state = IWorkflowState(content)
+    workflow_info = IWorkflowPublicationInfo(content)
     return {'workflow': {'name': IWorkflowInfo(content).name,
                          'status': workflow_state.state,
-                         'date': workflow_state.state_date}}
+                         'date': workflow_state.state_date,
+                         'created_date': dc_info.created,
+                         'modified_date': dc_info.modified,
+                         'publication_date': workflow_info.publication_date,
+                         'first_publication_date': workflow_info.first_publication_date}}