[Erp5-report] r26774 - in /erp5/trunk/bt5/erp5_dms: PathTemplateItem/ PathTemplateItem/port...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon May 4 11:33:21 CEST 2009


Author: jp
Date: Mon May  4 11:33:21 2009
New Revision: 26774

URL: http://svn.erp5.org?rev=26774&view=rev
Log:
Make sure external source crawling system is part of core DMS.

Added:
    erp5/trunk/bt5/erp5_dms/PathTemplateItem/
    erp5/trunk/bt5/erp5_dms/PathTemplateItem/portal_alarms/
    erp5/trunk/bt5/erp5_dms/PathTemplateItem/portal_alarms/document_update_content_alarm.xml
    erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Alarm_senseDocumentToUpdate.xml
Modified:
    erp5/trunk/bt5/erp5_dms/bt/revision
    erp5/trunk/bt5/erp5_dms/bt/template_base_category_list
    erp5/trunk/bt5/erp5_dms/bt/template_path_list

Added: erp5/trunk/bt5/erp5_dms/PathTemplateItem/portal_alarms/document_update_content_alarm.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/PathTemplateItem/portal_alarms/document_update_content_alarm.xml?rev=26774&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_dms/PathTemplateItem/portal_alarms/document_update_content_alarm.xml (added)
+++ erp5/trunk/bt5/erp5_dms/PathTemplateItem/portal_alarms/document_update_content_alarm.xml [utf8] Mon May  4 11:33:21 2009
@@ -1,0 +1,200 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="Alarm" module="Products.ERP5Type.Document.Alarm"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_count</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_folder_handler</string> </key>
+            <value> <string>CMFBTreeFolderHandler</string> </value>
+        </item>
+        <item>
+            <key> <string>_mt_index</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_tree</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>active_sense_method_id</string> </key>
+            <value> <string>Alarm_senseDocumentToUpdate</string> </value>
+        </item>
+        <item>
+            <key> <string>alarm_date</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global id="1.1" name="DateTime" module="DateTime.DateTime"/>
+                </klass>
+                <tuple>
+                  <none/>
+                </tuple>
+                <state>
+                  <tuple>
+                    <float>1181318754.93</float>
+                    <string>GMT+2</string>
+                  </tuple>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>Selects documents to update from external_source_module and updates their contents by calling the updateContentFromURL method.</string> </value>
+        </item>
+        <item>
+            <key> <string>enabled</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>document_update_content_alarm</string> </value>
+        </item>
+        <item>
+            <key> <string>periodicity_hour</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>periodicity_hour_frequency</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+        <item>
+            <key> <string>periodicity_minute</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>periodicity_minute_frequency</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>periodicity_month</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>periodicity_month_day</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>periodicity_start_date</string> </key>
+            <value>
+              <object>
+                <klass> <reference id="1.1"/> </klass>
+                <tuple>
+                  <none/>
+                </tuple>
+                <state>
+                  <tuple>
+                    <float>1148508000.0</float>
+                    <string>GMT+2</string>
+                  </tuple>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>periodicity_stop_date</string> </key>
+            <value>
+              <object>
+                <klass> <reference id="1.1"/> </klass>
+                <tuple>
+                  <none/>
+                </tuple>
+                <state>
+                  <tuple>
+                    <float>32516114400.0</float>
+                    <string>GMT+2</string>
+                  </tuple>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>periodicity_week</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Alarm</string> </value>
+        </item>
+        <item>
+            <key> <string>sense_method_id</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Document Update Content Alarm</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>BTrees.Length</string>
+          <string>Length</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle> <int>0</int> </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>BTrees.OOBTree</string>
+          <string>OOBTree</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <none/>
+    </pickle>
+  </record>
+  <record id="4" aka="AAAAAAAAAAQ=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>BTrees.OOBTree</string>
+          <string>OOBTree</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <none/>
+    </pickle>
+  </record>
+</ZopeData>

Added: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Alarm_senseDocumentToUpdate.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Alarm_senseDocumentToUpdate.xml?rev=26774&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Alarm_senseDocumentToUpdate.xml (added)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Alarm_senseDocumentToUpdate.xml [utf8] Mon May  4 11:33:21 2009
@@ -1,0 +1,180 @@
+<?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 selects documents to update.the selection process\n
+is based on calculation of the frequency_index and creation_date_index.\n
+Documents which their frequency_index and creation_date_index are the\n
+same as those calculated, are updated.\n
+"""\n
+from Products.ERP5Type.DateUtils import convertDateToHour\n
+date_dict = {}\n
+\n
+# Shared function\n
+def updateDocumentList(**sql_kw):\n
+  for document in context.portal_catalog(**sql_kw):\n
+    document.getObject().activate().updateContentFromURL()\n
+\n
+#Step1: convert the alarm date into hours\n
+alarm_date = convertDateToHour()\n
+\n
+#Step2: initialize a dictionary with frequencies\n
+for frequency in context.portal_categories.update_frequency.contentValues():\n
+  frequency_reference = frequency.getIntIndex()\n
+  date_dict[frequency_reference] = alarm_date % frequency_reference\n
+\n
+#Step3: update documents\n
+for frequency_reference, creation_date in date_dict.items():\n
+  sql_kw = {\'creation_date_index\':creation_date, \'frequency_index\':frequency_reference, \'limit\':None}\n
+  documents_to_update = len(context.portal_catalog(**sql_kw))\n
+  max_in_activities = 1000 \n
+  offset = 0\n
+  loop = documents_to_update / max_in_activities\n
+  for i in range(loop):\n
+    limit = \'%s,%s\' % (offset, max_in_activities)\n
+    sql_kw[\'limit\'] = limit\n
+    updateDocumentList(**sql_kw)\n
+    offset += max_in_activities\n
+  limit = \'%s,%s\' % (offset, max_in_activities)\n
+  sql_kw[\'limit\'] = limit\n
+  updateDocumentList(**sql_kw)\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></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>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>Products.ERP5Type.DateUtils</string>
+                            <string>convertDateToHour</string>
+                            <string>date_dict</string>
+                            <string>updateDocumentList</string>
+                            <string>alarm_date</string>
+                            <string>_getiter_</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>frequency</string>
+                            <string>frequency_reference</string>
+                            <string>_write_</string>
+                            <string>creation_date</string>
+                            <string>None</string>
+                            <string>sql_kw</string>
+                            <string>len</string>
+                            <string>_apply_</string>
+                            <string>documents_to_update</string>
+                            <string>max_in_activities</string>
+                            <string>offset</string>
+                            <string>loop</string>
+                            <string>range</string>
+                            <string>i</string>
+                            <string>limit</string>
+                            <string>_inplacevar_</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Alarm_senseDocumentToUpdate</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_dms/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/bt/revision?rev=26774&r1=26773&r2=26774&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_dms/bt/revision [utf8] Mon May  4 11:33:21 2009
@@ -1,1 +1,1 @@
-974
+977

Modified: erp5/trunk/bt5/erp5_dms/bt/template_base_category_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/bt/template_base_category_list?rev=26774&r1=26773&r2=26774&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/bt/template_base_category_list [utf8] (original)
+++ erp5/trunk/bt5/erp5_dms/bt/template_base_category_list [utf8] Mon May  4 11:33:21 2009
@@ -1,4 +1,4 @@
 classification
 contributor
 similar
-update_frequency
+update_frequency

Modified: erp5/trunk/bt5/erp5_dms/bt/template_path_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/bt/template_path_list?rev=26774&r1=26773&r2=26774&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/bt/template_path_list [utf8] (original)
+++ erp5/trunk/bt5/erp5_dms/bt/template_path_list [utf8] Mon May  4 11:33:21 2009
@@ -1,0 +1,1 @@
+portal_alarms/document_update_content_alarm




More information about the Erp5-report mailing list