From 5618bc8b743ed9cbd3149075fd434090f4f822b0 Mon Sep 17 00:00:00 2001
From: Jean-Paul Smets <jp@nexedi.com>
Date: Sat, 5 Jan 2008 16:59:29 +0000
Subject: [PATCH] Added shell for baye (DC Workflow)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18601 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/DocumentationHelper.py | 111 +++++++++++++++++++++++-
 1 file changed, 107 insertions(+), 4 deletions(-)

diff --git a/product/ERP5Type/DocumentationHelper.py b/product/ERP5Type/DocumentationHelper.py
index 40d8acd126..31b4b17391 100644
--- a/product/ERP5Type/DocumentationHelper.py
+++ b/product/ERP5Type/DocumentationHelper.py
@@ -349,10 +349,6 @@ class ClassDocumentationHelper(DocumentationHelper):
 class AccessorDocumentationHelper(DocumentationHelper):
   """
   """
-class WorkflowDocumentationHelper(DocumentationHelper):
-  """
-  """
-
 
 class ClassMethodDocumentationHelper(DocumentationHelper):
   """
@@ -498,6 +494,113 @@ class WorkflowMethodDocumentationHelper(DocumentationHelper):
 
 InitializeClass(WorkflowMethodDocumentationHelper)
 
+class DCWorkflowDocumentationHelper(DocumentationHelper):
+  """
+    Provides access to all documentation information
+    of a workflow.
+  """
+
+  security = ClassSecurityInfo()
+  security.declareObjectProtected(Permissions.AccessContentsInformation)
+
+  # API Implementation
+  security.declareProtected( Permissions.AccessContentsInformation, 'getTitle' )
+  def getTitle(self):
+    """
+    Returns the title of the documentation helper
+    """
+    return self.getDocumentedObject().getTitleOrId()
+
+  security.declareProtected( Permissions.AccessContentsInformation, 'getType' )
+  def getType(self):
+    """
+    Returns the type of the documentation helper
+    """
+    return "DC Workflow"
+
+  security.declareProtected( Permissions.AccessContentsInformation, 'getSectionList' )
+  def getSectionList(self):
+    """
+    Returns a list of documentation sections
+    """
+    return map(lamda x: x.__of__(self), [
+      DocumentationSection(
+        id='state',
+        title='Workflow States',
+        class_name='DCWorkflowStateDocumentationHelper',
+        uri_list=self.getStateURIList(),
+      ),
+      DocumentationSection(
+        id='transition',
+        title='Workflow Transitions',
+        class_name='DCWorkflowTransitionDocumentationHelper',
+        uri_list=self.getStateURIList(),
+      ),
+      DocumentationSection(
+        id='variable',
+        title='Workflow Variables',
+        class_name='DCWorkflowVariableDocumentationHelper',
+        uri_list=self.getVariableURIList(),
+      ),
+      DocumentationSection(
+        id='variable',
+        title='Workflow Permissions',
+        class_name='PermissionDocumentationHelper',
+        uri_list=self.getPermissionURIList(),
+      ),
+    ])
+
+  # Specific methods
+  security.declareProtected( Permissions.AccessContentsInformation, 'getDescription' )
+  def getDescription(self):
+    """
+    Returns the title of the documentation helper
+    """
+    raise NotImplemented
+
+  security.declareProtected( Permissions.AccessContentsInformation, 'getVariableURIList' )
+  def getVariableURIList(self):
+    """
+    """
+    raise NotImplemented
+
+  security.declareProtected( Permissions.AccessContentsInformation, 'getStateURIList' )
+  def getStateURIList(self):
+    """
+    """
+    raise NotImplemented
+
+  security.declareProtected( Permissions.AccessContentsInformation, 'getVariableURIList' )
+  def getVariableURIList(self):
+    """
+    """
+    raise NotImplemented
+
+  security.declareProtected( Permissions.AccessContentsInformation, 'getPermissionURIList' )
+  def getPermissionURIList(self):
+    """
+    """
+    raise NotImplemented
+
+  security.declareProtected( Permissions.AccessContentsInformation, 'getGraphImageURL' )
+  def getGraphImageURL(self):
+    """
+      Returns a URL to a graphic representation of the workflow
+    """
+    raise NotImplemented
+
+  security.declareProtected( Permissions.AccessContentsInformation, 'getGraphImageData' )
+  def getGraphImageData(self):
+    """
+      Returns the graphic representation of the workflow as a PNG file
+    """
+    raise NotImplemented
+
+InitializeClass(DCWorkflowDocumentationHelper)
+
+
+#############################################################################
+#############################################################################
 
 if 0:
   if 0:
-- 
2.30.9