Added workflow adapters for content links
authorThierry Florac <thierry.florac@onf.fr>
Tue, 16 Jan 2018 14:24:44 +0100
changeset 326 00d381f985c8
parent 325 5e0acd7fc5f5
child 327 f31d61be8b65
Added workflow adapters for content links
src/pyams_content/shared/site/link.py
--- a/src/pyams_content/shared/site/link.py	Tue Jan 16 14:24:17 2018 +0100
+++ b/src/pyams_content/shared/site/link.py	Tue Jan 16 14:24:44 2018 +0100
@@ -17,7 +17,9 @@
 
 # import interfaces
 from pyams_content.shared.site.interfaces import IContentLink
-from pyams_workflow.interfaces import IWorkflow, IWorkflowVersion, IWorkflowVersions, IWorkflowPublicationInfo
+from pyams_sequence.interfaces import ISequentialIdInfo
+from pyams_workflow.interfaces import IWorkflow, IWorkflowVersion, IWorkflowVersions, IWorkflowPublicationInfo, \
+    IWorkflowState
 
 # import packages
 from persistent import Persistent
@@ -56,9 +58,32 @@
         return target
 
 
+@adapter_config(context=IContentLink, provides=IWorkflow)
+def content_link_workflow_info(context):
+    """Content link workflow info"""
+    target = context.get_target()
+    if target is not None:
+        return IWorkflow(target, None)
+
+
+@adapter_config(context=IContentLink, provides=IWorkflowState)
+def content_link_state_info(context):
+    """Content link workflow state info"""
+    target = context.get_target()
+    if target is not None:
+        return IWorkflowState(target, None)
+
+
 @adapter_config(context=IContentLink, provides=IWorkflowPublicationInfo)
 def content_link_publication_info(context):
     """Content link publication info"""
     target = context.get_target()
     if target is not None:
         return IWorkflowPublicationInfo(target, None)
+
+
+@adapter_config(context=IContentLink, provides=ISequentialIdInfo)
+def content_link_sequence_info(context):
+    target = context.get_target()
+    if target is not None:
+        return ISequentialIdInfo(target, None)