[Erp5-report] r18386 - in /experimental/bt5/erp5_core_experimental: SkinTemplateItem/portal...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Dec 18 12:23:09 CET 2007


Author: luke
Date: Tue Dec 18 12:23:09 2007
New Revision: 18386

URL: http://svn.erp5.org?rev=18386&view=rev
Log:
- introduced quite generic fetcher of last transition information for object, with optional workflow_id

Added:
    experimental/bt5/erp5_core_experimental/SkinTemplateItem/portal_skins/erp5_core_experimental/Base_getLastTransitionInfo.xml
Modified:
    experimental/bt5/erp5_core_experimental/bt/maintainer_list
    experimental/bt5/erp5_core_experimental/bt/revision

Added: experimental/bt5/erp5_core_experimental/SkinTemplateItem/portal_skins/erp5_core_experimental/Base_getLastTransitionInfo.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_core_experimental/SkinTemplateItem/portal_skins/erp5_core_experimental/Base_getLastTransitionInfo.xml?rev=18386&view=auto
==============================================================================
--- experimental/bt5/erp5_core_experimental/SkinTemplateItem/portal_skins/erp5_core_experimental/Base_getLastTransitionInfo.xml (added)
+++ experimental/bt5/erp5_core_experimental/SkinTemplateItem/portal_skins/erp5_core_experimental/Base_getLastTransitionInfo.xml Tue Dec 18 12:23:09 2007
@@ -1,0 +1,179 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.PythonScripts.PythonScript</string>
+          <string>PythonScript</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Python_magic</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string encoding="cdata"><![CDATA[
+
+# Get full information about last transition\n
+# workflow_id is optional, so this script might use less hardcoded values\n
+# Examples usage:\n
+# 1. Get last actor of confirmation:\n
+# object.Base_getLastTransitionInfo(transition_id=\'confirm\').getProperty(\'actor\')\n
+# 2. Get last validation time:\n
+# object.Base_getLastTransitionInfo(transition_id=\'validate\').getProperty(\'time\')\n
+# Author: \xc5\x81ukasz Nowak <lukasz.nowak at ventis.com.pl>\n
+\n
+if workflow_id is not None:\n
+  workflow_id_list = [workflow_id,]\n
+else:\n
+  workflow_id_list = [q.id for q in context.portal_workflow.getWorkflowsFor(ob=context)]\n
+\n
+for workflow_id in workflow_id_list:\n
+  workflow_item_list = context.Base_getWorkflowHistoryItemList(workflow_id, display=0)\n
+  workflow_item_list.reverse()\n
+  for workflow_item in workflow_item_list:\n
+    if workflow_item.getProperty(\'action\') == transition_id:\n
+      return workflow_item\n
+return None\n
+
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>transition_id, workflow_id = None</string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>2</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>transition_id</string>
+                            <string>workflow_id</string>
+                            <string>None</string>
+                            <string>workflow_id_list</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>_getiter_</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>q</string>
+                            <string>workflow_item_list</string>
+                            <string>workflow_item</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <none/>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Base_getLastTransitionInfo</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: experimental/bt5/erp5_core_experimental/bt/maintainer_list
URL: http://svn.erp5.org/experimental/bt5/erp5_core_experimental/bt/maintainer_list?rev=18386&r1=18385&r2=18386&view=diff
==============================================================================
--- experimental/bt5/erp5_core_experimental/bt/maintainer_list (original)
+++ experimental/bt5/erp5_core_experimental/bt/maintainer_list Tue Dec 18 12:23:09 2007
@@ -1,1 +1,2 @@
-bartek
+bartek
+shufla

Modified: experimental/bt5/erp5_core_experimental/bt/revision
URL: http://svn.erp5.org/experimental/bt5/erp5_core_experimental/bt/revision?rev=18386&r1=18385&r2=18386&view=diff
==============================================================================
--- experimental/bt5/erp5_core_experimental/bt/revision (original)
+++ experimental/bt5/erp5_core_experimental/bt/revision Tue Dec 18 12:23:09 2007
@@ -1,1 +1,1 @@
-2
+3




More information about the Erp5-report mailing list