[Erp5-report] r36878 mayoro - in /erp5/trunk/bt5/erp5_egov: SkinTemplateItem/portal_skins/e...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jul 5 20:43:46 CEST 2010


Author: mayoro
Date: Mon Jul  5 20:43:45 2010
New Revision: 36878

URL: http://svn.erp5.org?rev=36878&view=rev
Log:
2010-07-05 mayoro
* remove proxy role manager for  Script PDFType_viewDefaultForm to avoid displaying tab meta data
* clean history displaying, remove duplicate lines for actions like approve and approve actions

Added:
    erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/Document_getPropertyDictFromContent.xml
Modified:
    erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/PDFType_viewDefaultForm.xml
    erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov_widget_library/EGov_getWorkflowHistoryItemList.xml
    erp5/trunk/bt5/erp5_egov/bt/change_log
    erp5/trunk/bt5/erp5_egov/bt/revision

Added: erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/Document_getPropertyDictFromContent.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/Document_getPropertyDictFromContent.xml?rev=36878&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/Document_getPropertyDictFromContent.xml (added)
+++ erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/Document_getPropertyDictFromContent.xml [utf8] Mon Jul  5 20:43:45 2010
@@ -0,0 +1,199 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </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>"""\n
+This script analyzes the document content (text_content) to find properties that might\n
+be somehow encoded in the text. It is called by Document.getPropertyDictFromContent\n
+method.\n
+\n
+To use, write your own method (probably External Method, since it is most likely\n
+to use re) that would analyze text content of the doc\n
+and return a dictionary of properties.\n
+"""\n
+\n
+information = context.getContentInformation()\n
+\n
+result = {}\n
+property_id_list = context.propertyIds()\n
+for k, v in information.items():  \n
+  key = k.lower()\n
+  if v:\n
+    if isinstance(v, unicode): v = v.encode(\'utf-8\')\n
+    if key in property_id_list:\n
+      if key == \'reference\':\n
+        pass # XXX - We can not trust reference on getContentInformation\n
+      else:\n
+        result[key] = v\n
+    elif key == \'author\':\n
+      p = context.portal_catalog.getResultValue(title = v)\n
+      if p is not None:\n
+        result[\'contributor\'] = p.getRelativeUrl()\n
+    elif key == \'keywords\':\n
+      result[\'subject_list\'] = v.split()\n
+\n
+object = object or context\n
+\n
+#try:\n
+#  content = content or context.asText()\n
+#except AttributeError:\n
+#  return result\n
+\n
+ptype = ptype or context.getPortalType()\n
+\n
+# Erase titles which are meaningless\n
+title = result.get(\'title\', None)\n
+if title:\n
+  if title.startswith(\'Microsoft Word\'):\n
+    # Probably a file generated from MS Word\n
+    del result[\'title\']\n
+  elif title==context.getId() and not context.title:\n
+    # this is not a true title, but just an id.\n
+    del result[\'title\']\n
+\n
+return result\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>object=None, content=None, ptype=None</string> </value>
+        </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <tuple>
+                <string>Manager</string>
+              </tuple>
+            </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>3</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>object</string>
+                            <string>content</string>
+                            <string>ptype</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>information</string>
+                            <string>result</string>
+                            <string>property_id_list</string>
+                            <string>_getiter_</string>
+                            <string>k</string>
+                            <string>v</string>
+                            <string>key</string>
+                            <string>isinstance</string>
+                            <string>unicode</string>
+                            <string>_write_</string>
+                            <string>p</string>
+                            <string>None</string>
+                            <string>title</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <none/>
+                <none/>
+                <none/>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Document_getPropertyDictFromContent</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/PDFType_viewDefaultForm.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/PDFType_viewDefaultForm.xml?rev=36878&r1=36877&r2=36878&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/PDFType_viewDefaultForm.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/PDFType_viewDefaultForm.xml [utf8] Mon Jul  5 20:43:45 2010
@@ -69,9 +69,7 @@
         <item>
             <key> <string>_proxy_roles</string> </key>
             <value>
-              <tuple>
-                <string>Manager</string>
-              </tuple>
+              <tuple/>
             </value>
         </item>
         <item>

Modified: erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov_widget_library/EGov_getWorkflowHistoryItemList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov_widget_library/EGov_getWorkflowHistoryItemList.xml?rev=36878&r1=36877&r2=36878&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov_widget_library/EGov_getWorkflowHistoryItemList.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov_widget_library/EGov_getWorkflowHistoryItemList.xml [utf8] Mon Jul  5 20:43:45 2010
@@ -96,6 +96,7 @@ next_serial = None\n
 previous_obj = None\n
 \n
 for workflow_item in workflow_item_list:\n
+  same_action = 0\n
   # XXX removing str method generate a strange bug\n
   o = newTempBase(portal_object, str(i))\n
   i += 1\n
@@ -132,7 +133,12 @@ for workflow_item in workflow_item_list:
     if value is marker:\n
       value = \'Does not exist\'\n
     o.setProperty(key, value)\n
- \n
+  \n
+  if getattr(previous_obj, \'state\', None) is not None:\n
+    if previous_obj.state ==  o.state:\n
+      same_action = 1\n
+\n
+\n
   # record current serial as "next serial" for the previous revision\n
   if next_serial is not None:\n
     previous_obj.setProperty(\'next_serial\', o.serial)\n
@@ -143,11 +149,13 @@ for workflow_item in workflow_item_list:
     group = person.Person_getPrimaryGroup()\n
   except AttributeError:\n
     group = None\n
-  if group and my_group : \n
-    if group.startswith(my_group) or action_name in [\'pending_action\', \'submit_draft_action\']:\n
+\n
+  if not same_action:\n
+    if group and my_group : \n
+      if group.startswith(my_group) or action_name in [\'pending\', \'submit_draft\']:\n
+        result.append(o)\n
+    elif action_name in [\'pending\', \'submit_draft\']:\n
       result.append(o)\n
-  elif action_name in [\'pending_action\', \'submit_draft_action\']:\n
-    result.append(o)\n
 return result\n
 </string> </value>
         </item>
@@ -238,6 +246,7 @@ return result\n
                             <string>next_serial</string>
                             <string>previous_obj</string>
                             <string>workflow_item</string>
+                            <string>same_action</string>
                             <string>str</string>
                             <string>o</string>
                             <string>_inplacevar_</string>

Modified: erp5/trunk/bt5/erp5_egov/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_egov/bt/change_log?rev=36878&r1=36877&r2=36878&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_egov/bt/change_log [utf8] (original)
+++ erp5/trunk/bt5/erp5_egov/bt/change_log [utf8] Mon Jul  5 20:43:45 2010
@@ -1,3 +1,7 @@
+2010-07-05 mayoro
+* remove proxy role manager for  Script PDFType_viewDefaultForm to avoid displaying tab meta data
+* clean history displaying, remove duplicate lines for actions like approve and approve actions
+
 2010-07-03 mayoro
 * Add publication of web pages in SetUpEGovInstance
 

Modified: erp5/trunk/bt5/erp5_egov/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_egov/bt/revision?rev=36878&r1=36877&r2=36878&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_egov/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_egov/bt/revision [utf8] Mon Jul  5 20:43:45 2010
@@ -1 +1 @@
-679
\ No newline at end of file
+680
\ No newline at end of file




More information about the Erp5-report mailing list