[Erp5-report] r26039 - in /erp5/trunk/bt5/erp5_base: ActionTemplateItem/portal_types/Person...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Mar 16 09:59:30 CET 2009


Author: kazuhiko
Date: Mon Mar 16 09:59:30 2009
New Revision: 26039

URL: http://svn.erp5.org?rev=26039&view=rev
Log:
2009-03-16 Kazuhiko
* remove ooo_import action in Person Module that is replaced by erp5_ooo_import business template with more generic and better import function.

Removed:
    erp5/trunk/bt5/erp5_base/ActionTemplateItem/portal_types/Person%20Module/ooo_import.xml
    erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getCategoriesFullPath.xml
    erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getModulePortalTypeSortedPropertyList.xml
    erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getSpreadsheetColumnNameList.xml
    erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_importObjectFromOOo.xml
    erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_importObjectFromOOoActivity.xml
    erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_importObjectFromOOoFastInput/
    erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_importObjectFromOOoFastInput.xml
Modified:
    erp5/trunk/bt5/erp5_base/bt/change_log
    erp5/trunk/bt5/erp5_base/bt/revision
    erp5/trunk/bt5/erp5_base/bt/template_action_path_list

Removed: erp5/trunk/bt5/erp5_base/ActionTemplateItem/portal_types/Person%20Module/ooo_import.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/ActionTemplateItem/portal_types/Person%2520Module/ooo_import.xml?rev=26038&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_base/ActionTemplateItem/portal_types/Person%20Module/ooo_import.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/ActionTemplateItem/portal_types/Person%20Module/ooo_import.xml (removed)
@@ -1,77 +1,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <tuple>
-        <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
-        <tuple/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>action</string> </key>
-            <value>
-              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
-            </value>
-        </item>
-        <item>
-            <key> <string>category</string> </key>
-            <value> <string>object_exchange</string> </value>
-        </item>
-        <item>
-            <key> <string>condition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>description</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>icon</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>ooo_import</string> </value>
-        </item>
-        <item>
-            <key> <string>permissions</string> </key>
-            <value>
-              <tuple>
-                <string>Modify portal content</string>
-              </tuple>
-            </value>
-        </item>
-        <item>
-            <key> <string>priority</string> </key>
-            <value> <float>22.0</float> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string>Import Persons from OpenOffice Calc</string> </value>
-        </item>
-        <item>
-            <key> <string>visible</string> </key>
-            <value> <int>1</int> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-  <record id="2" aka="AAAAAAAAAAI=">
-    <pickle>
-      <tuple>
-        <global name="Expression" module="Products.CMFCore.Expression"/>
-        <tuple/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>text</string> </key>
-            <value> <string>string:${object_url}/ERP5Site_importObjectFromOOoFastInput</string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>

Removed: erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getCategoriesFullPath.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getCategoriesFullPath.xml?rev=26038&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getCategoriesFullPath.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getCategoriesFullPath.xml (removed)
@@ -1,170 +1,0 @@
-<?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 encoding="cdata"><![CDATA[
-
-# get a dict like {\'religion\': \'MRD\', \'gender\': \'M\'} and returns {\'religion\': \'MSM/MRD\', gender: \'male\'} so that \n
-# we can call an edit(category_dict) directly on the object it browse recursively the subcategories of the \n
-# category (key in the dict) and find a matching reference or title.\n
-# Christophe Dumez <christophe at nexedi.com>\n
-\n
-#def getMatchingCategoryUsingCodification(root_category, codification):\n
-#  sub_cat_list = root_category.objectValues()\n
-#  for sub_cat in sub_cat_list:\n
-#    if sub_cat.getCodification() == codification:\n
-#      return sub_cat\n
-#    matching_cat = getMatchingCategoryUsingCodification(sub_cat, codification)\n
-#    if matching_cat is not None:\n
-#      return matching_cat\n
-\n
-result_dict = {}\n
-for category_name in category_dict.keys():\n
-  subcat_code = category_dict[category_name]\n
-  category_object = context.getPortalObject().portal_categories[category_name]\n
-  result_list = context.portal_catalog(portal_type=\'Category\', reference=\'=\'+str(subcat_code), relative_url=category_name+\'%\')\n
-  if len(result_list) != 0:\n
-    result_cat_fullpath = \'/\'.join(result_list[0].getRelativeUrl().split(\'/\')[1:])\n
-    result_dict[category_name]=result_cat_fullpath\n
-  else:\n
-    result_list = context.portal_catalog(portal_type=\'Category\', title=\'=\'+str(subcat_code), relative_url=category_name+\'%\')\n
-    if len(result_list) != 0:\n
-      result_cat_fullpath = \'/\'.join(result_list[0].getRelativeUrl().split(\'/\')[1:])\n
-      result_dict[category_name]=result_cat_fullpath\n
-  #result_cat = getMatchingCategoryUsingCodification(root_category=category_object, codification=subcat_code)\n
-  #if result_cat is not None:\n
-  #  result_cat_fullpath = \'/\'.join(result_cat.getPath().split(\'/\')[4:])\n
-  #  result_dict[category_name]=result_cat_fullpath\n
-\n
-return result_dict\n
-
-
-]]></string> </value>
-        </item>
-        <item>
-            <key> <string>_code</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>_params</string> </key>
-            <value> <string>category_dict</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>1</int> </value>
-                    </item>
-                    <item>
-                        <key> <string>co_varnames</string> </key>
-                        <value>
-                          <tuple>
-                            <string>category_dict</string>
-                            <string>result_dict</string>
-                            <string>_getiter_</string>
-                            <string>_getattr_</string>
-                            <string>category_name</string>
-                            <string>_getitem_</string>
-                            <string>subcat_code</string>
-                            <string>context</string>
-                            <string>category_object</string>
-                            <string>str</string>
-                            <string>result_list</string>
-                            <string>len</string>
-                            <string>result_cat_fullpath</string>
-                            <string>_write_</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>ERP5Site_getCategoriesFullPath</string> </value>
-        </item>
-        <item>
-            <key> <string>warnings</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>

Removed: erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getModulePortalTypeSortedPropertyList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getModulePortalTypeSortedPropertyList.xml?rev=26038&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getModulePortalTypeSortedPropertyList.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getModulePortalTypeSortedPropertyList.xml (removed)
@@ -1,140 +1,0 @@
-<?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>module = context\n
-\n
-property_list = []\n
-\n
-for portal_type in module.allowedContentTypes():\n
-  #for property in portal_type.getInstancePropertyMap():\n
-    #property_string = "%s.%s" % (portal_type.id, property[\'id\'])\n
-    #property_list.append(property_string)\n
-  for property in portal_type.getInstancePropertyAndBaseCategoryList():\n
-    property_list.append((portal_type.id, property))\n
-\n
-property_list.sort()\n
-return [(\'-- Ignore this Property --\', \'\')] + map(lambda x: (x[1], \'%s.%s\' % (x[0], x[1])), property_list)\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>context</string>
-                            <string>module</string>
-                            <string>property_list</string>
-                            <string>_getiter_</string>
-                            <string>_getattr_</string>
-                            <string>portal_type</string>
-                            <string>property</string>
-                            <string>map</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>ERP5Site_getModulePortalTypeSortedPropertyList</string> </value>
-        </item>
-        <item>
-            <key> <string>warnings</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>

Removed: erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getSpreadsheetColumnNameList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getSpreadsheetColumnNameList.xml?rev=26038&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getSpreadsheetColumnNameList.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getSpreadsheetColumnNameList.xml (removed)
@@ -1,172 +1,0 @@
-<?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>from Products.ERP5Type.Document import newTempBase\n
-from string import zfill\n
-\n
-portal_object = context.getPortalObject()\n
-num = 0\n
-listbox_lines = []\n
-\n
-request = context.REQUEST\n
-\n
-# Get spreadsheet data\n
-try:\n
-  spreadsheets = request[\'ooo_import_spreadsheet_data\']\n
-except:\n
-  return []\n
-\n
-for spreadsheet in spreadsheets.keys():\n
-  # Get the first line\n
-  column_name_list = spreadsheets[spreadsheet][0]\n
-  for column in column_name_list:\n
-    safe_id = context.Base_getSafeIdFromString(spreadsheet + column)\n
-    num += 1\n
-    int_len = 3\n
-    o = newTempBase(portal_object, safe_id)\n
-    o.setUid(  \'new_%s\' % zfill(num, int_len)) # XXX There is a security issue here\n
-    o.edit(uid=\'new_%s\' % zfill(num, int_len)) # XXX There is a security issue here\n
-    o.edit( id                 = safe_id\n
-          , spreadsheet_name   = spreadsheet\n
-          , spreadsheet_column = column\n
-          )\n
-    listbox_lines.append(o)\n
-  \n
-return listbox_lines\n
-</string> </value>
-        </item>
-        <item>
-            <key> <string>_code</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>_params</string> </key>
-            <value> <string>**kw</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>kw</string>
-                            <string>Products.ERP5Type.Document</string>
-                            <string>newTempBase</string>
-                            <string>string</string>
-                            <string>zfill</string>
-                            <string>_getattr_</string>
-                            <string>context</string>
-                            <string>portal_object</string>
-                            <string>num</string>
-                            <string>listbox_lines</string>
-                            <string>request</string>
-                            <string>_getitem_</string>
-                            <string>spreadsheets</string>
-                            <string>_getiter_</string>
-                            <string>spreadsheet</string>
-                            <string>column_name_list</string>
-                            <string>column</string>
-                            <string>safe_id</string>
-                            <string>_inplacevar_</string>
-                            <string>int_len</string>
-                            <string>o</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>ERP5Site_getSpreadsheetColumnNameList</string> </value>
-        </item>
-        <item>
-            <key> <string>warnings</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>

Removed: erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_importObjectFromOOo.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_importObjectFromOOo.xml?rev=26038&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_importObjectFromOOo.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_importObjectFromOOo.xml (removed)
@@ -1,287 +1,0 @@
-<?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 is an alpha version of what should be a generic OpenOffice importer,\n
-    which is a collection of scripts and UI to import lots of objects to ERP5\n
-    from a spreadsheet. The idea is to let the user map each spreadsheet column with\n
-    one portal type property.\n
-\n
-  Other files related to this feature:\n
-    * openoffice-erp5-objects-template.sxc           -- A template that describe persons to help you create your own data source\n
-    * ERP5Site_importObjectFromOOoFastInput          -- The UI\n
-    * ERP5Site_getSpreadsheetColumnNameList          -- Utility script\n
-    * ERP5Site_getModulePortalTypeSortedPropertyList -- Utility script\n
-    * ERP5Site_importObjectFromOOoActivity           -- Activating Import Script\n
-"""\n
-\n
-request  = context.REQUEST\n
-\n
-def getRequestKeys(rq):\n
-  return map(lambda x: x[0], rq.items())\n
-\n
-def getRequestValues(rq):\n
-  return map(lambda x: x[1], rq.items())\n
-\n
-def getSpreadsheet():\n
-  from Products.ERP5OOo.OOoUtils import OOoParser, CorruptedOOoFile\n
-  OOoParser = OOoParser()\n
-  # Extract tables from the speadsheet file\n
-  import_file = kw[\'import_file\']\n
-  OOoParser.openFile(import_file)\n
-  return OOoParser.getSpreadsheetsMapping()\n
-\n
-\n
-# if listbox is empty, then we are in the first step\n
-listbox = []\n
-if kw.has_key(\'listbox\') and kw[\'listbox\'] not in (\'\', None):\n
-  listbox = kw[\'listbox\']\n
-\n
-\n
-# First step\n
-if len(listbox) == 0:\n
-  spreadsheets = getSpreadsheet()\n
-  # Put the result of OOo parsing in the request\n
-  request.set(\'ooo_import_spreadsheet_data\', spreadsheets)\n
-  # Set a flag in the request to differentiate the two steps\n
-  request.set(\'OOOIMPORT_STEP_TWO\', True)\n
-  request.set(\'my_import_file\', None)\n
-\n
-# Second Step\n
-else:\n
-  # Re-upload the OOo file\n
-  spreadsheets = getSpreadsheet()\n
-\n
-  # Build the data mapping\n
-  mapping = {}\n
-  request.set(\'ooo_import_spreadsheet_data\', spreadsheets)\n
-\n
-  listbox_ordered_lines = context.ERP5Site_getSpreadsheetColumnNameList()\n
-  for line in listbox_ordered_lines:\n
-    listbox_id = line.getUid()[4:]\n
-    portal_type_property = None\n
-    if same_type(listbox, dict):\n
-      portal_type_property = listbox[listbox_id][\'portal_type_property_list\']\n
-    else:\n
-      for listbox_dict in listbox:\n
-        if listbox_dict[\'listbox_key\'] == listbox_id:\n
-          portal_type_property = listbox_dict[\'portal_type_property_list\']\n
-          break\n
-    if portal_type_property not in (\'\', None):\n
-      spreadsheet_name = getattr(line, \'spreadsheet_name\')\n
-      column_name      = getattr(line, \'spreadsheet_column\')\n
-      map_item = { \'portal_type\': portal_type_property.split(\'.\')[0]\n
-                 , \'property\'   : portal_type_property.split(\'.\')[1]\n
-                 }\n
-      if spreadsheet_name not in mapping:\n
-        mapping[spreadsheet_name] = {}\n
-      mapping[spreadsheet_name][column_name] = map_item\n
-\n
-  # Convert each spreadsheet\n
-  for (sheet_name, sheet_data) in spreadsheets.items():\n
-\n
-    # The ERP5 module where all lines of the current spreadsheet will be generated\n
-    sheet_module = context\n
-\n
-    # Build a data structure to associate column index with column title\n
-    column_index = {}\n
-    for column_id in xrange(len(sheet_data[0])):\n
-      column_index[column_id] = sheet_data[0][column_id]\n
-\n
-    # Build a data structure to associate column index with object property and portal type\n
-    column_mapping = {}\n
-    for (column_name, property_dict) in mapping.get(sheet_name, {}).items():\n
-      for (column_id, column_title) in column_index.items():\n
-        if column_name == column_title:\n
-          column_mapping[column_id] = property_dict\n
-          break\n
-\n
-    # Create a dict to describe each line in property\n
-    object_list = {}\n
-    for line in sheet_data[1:]:\n
-      new_object_property_dict = {}\n
-      for line_property_index in xrange(len(line)):\n
-        if line_property_index in column_mapping:\n
-          property_module = sheet_module\n
-          property_module_url = property_module.getRelativeUrl()\n
-          property_pt     = column_mapping[line_property_index][\'portal_type\']\n
-          property_id     = column_mapping[line_property_index][\'property\']\n
-          property_value  = line[line_property_index]\n
-\n
-          if not property_value in (\'\', None):\n
-            if not object_list.has_key(property_module_url):\n
-              object_list[property_module_url] = {}\n
-            if not object_list[property_module_url].has_key(property_pt):\n
-              object_list[property_module_url][property_pt] = []\n
-  \n
-            # Create a new property value\n
-            new_object_property_dict[property_id] = property_value\n
-\n
-      if new_object_property_dict:\n
-        object_list[property_module_url][property_pt].append(new_object_property_dict)\n
-\n
-  context.activate(tag="object_OOo_import", priority=1, activity="SQLQueue").ERP5Site_importObjectFromOOoActivity(object_list=object_list)\n
-\n
-  return request.RESPONSE.redirect(context.absolute_url() + \'/view?portal_status_message=OpenOffice+document+importing.\')\n
-\n
-return context.ERP5Site_importObjectFromOOoFastInput(REQUEST=request)\n
-</string> </value>
-        </item>
-        <item>
-            <key> <string>_code</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>_params</string> </key>
-            <value> <string>**kw</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>kw</string>
-                            <string>_getattr_</string>
-                            <string>context</string>
-                            <string>request</string>
-                            <string>getRequestKeys</string>
-                            <string>getRequestValues</string>
-                            <string>getSpreadsheet</string>
-                            <string>listbox</string>
-                            <string>_getitem_</string>
-                            <string>None</string>
-                            <string>len</string>
-                            <string>spreadsheets</string>
-                            <string>True</string>
-                            <string>mapping</string>
-                            <string>listbox_ordered_lines</string>
-                            <string>_getiter_</string>
-                            <string>line</string>
-                            <string>listbox_id</string>
-                            <string>portal_type_property</string>
-                            <string>same_type</string>
-                            <string>dict</string>
-                            <string>listbox_dict</string>
-                            <string>getattr</string>
-                            <string>spreadsheet_name</string>
-                            <string>column_name</string>
-                            <string>map_item</string>
-                            <string>_write_</string>
-                            <string>sheet_name</string>
-                            <string>sheet_data</string>
-                            <string>sheet_module</string>
-                            <string>column_index</string>
-                            <string>xrange</string>
-                            <string>column_id</string>
-                            <string>column_mapping</string>
-                            <string>property_dict</string>
-                            <string>column_title</string>
-                            <string>object_list</string>
-                            <string>new_object_property_dict</string>
-                            <string>line_property_index</string>
-                            <string>property_module</string>
-                            <string>property_module_url</string>
-                            <string>property_pt</string>
-                            <string>property_id</string>
-                            <string>property_value</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>ERP5Site_importObjectFromOOo</string> </value>
-        </item>
-        <item>
-            <key> <string>warnings</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>

Removed: erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_importObjectFromOOoActivity.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_importObjectFromOOoActivity.xml?rev=26038&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_importObjectFromOOoActivity.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_importObjectFromOOoActivity.xml (removed)
@@ -1,173 +1,0 @@
-<?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># Create new ERP5 objects In Activity from OOo document\n
-from Products.ERP5Type.Log import log\n
-log(\'object_list\',object_list)\n
-log(\'kw\',kw)\n
-for (module_url, per_portal_type_data) in object_list.items():\n
-  for (portal_type, new_object_list) in per_portal_type_data.items():\n
-    for new_object_property_dict in new_object_list:\n
-      #get portal type objects\n
-      ptype_object = None\n
-      module = context.getPortalObject().restrictedTraverse(module_url)\n
-      for allowed_ptype in module.allowedContentTypes():\n
-        ptype_name = \'\'.join(allowed_ptype.id.split(\' \'))\n
-        if ptype_name == portal_type:\n
-          ptype_object = allowed_ptype\n
-          break\n
-      if ptype_object is None:\n
-        raise \'Portal type %s not found in allowed content types\' % portal_type\n
-      category_list = ptype_object.getInstanceBaseCategoryList()\n
-      new_object = module.newContent( portal_type       = portal_type\n
-                                    , immediate_reindex = 1\n
-                                    )\n
-      new_object_category_dict = {}\n
-      for prop_key in new_object_property_dict.keys():\n
-        if prop_key in category_list:\n
-          new_object_category_dict[prop_key] = new_object_property_dict[prop_key]\n
-          del new_object_property_dict[prop_key]\n
-      new_object.edit(**new_object_property_dict)\n
-      # Match the categories\n
-      new_object_category_dict = context.ERP5Site_getCategoriesFullPath(category_dict = new_object_category_dict)\n
-      new_object.edit(**new_object_category_dict)\n
-</string> </value>
-        </item>
-        <item>
-            <key> <string>_code</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>_params</string> </key>
-            <value> <string>object_list, **kw</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>1</int> </value>
-                    </item>
-                    <item>
-                        <key> <string>co_varnames</string> </key>
-                        <value>
-                          <tuple>
-                            <string>object_list</string>
-                            <string>kw</string>
-                            <string>Products.ERP5Type.Log</string>
-                            <string>log</string>
-                            <string>_getiter_</string>
-                            <string>_getattr_</string>
-                            <string>module_url</string>
-                            <string>per_portal_type_data</string>
-                            <string>portal_type</string>
-                            <string>new_object_list</string>
-                            <string>new_object_property_dict</string>
-                            <string>None</string>
-                            <string>ptype_object</string>
-                            <string>context</string>
-                            <string>module</string>
-                            <string>allowed_ptype</string>
-                            <string>ptype_name</string>
-                            <string>category_list</string>
-                            <string>new_object</string>
-                            <string>new_object_category_dict</string>
-                            <string>prop_key</string>
-                            <string>_getitem_</string>
-                            <string>_write_</string>
-                            <string>_apply_</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>ERP5Site_importObjectFromOOoActivity</string> </value>
-        </item>
-        <item>
-            <key> <string>warnings</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>

Removed: erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_importObjectFromOOoFastInput.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_importObjectFromOOoFastInput.xml?rev=26038&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_importObjectFromOOoFastInput.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_importObjectFromOOoFastInput.xml (removed)
@@ -1,133 +1,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <tuple>
-        <global name="ERP5Form" module="Products.ERP5Form.Form"/>
-        <tuple/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <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/>
-                        </value>
-                    </item>
-                  </dictionary>
-                </state>
-              </object>
-            </value>
-        </item>
-        <item>
-            <key> <string>_objects</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-        <item>
-            <key> <string>action</string> </key>
-            <value> <string>ERP5Site_importObjectFromOOo</string> </value>
-        </item>
-        <item>
-            <key> <string>encoding</string> </key>
-            <value> <string>UTF-8</string> </value>
-        </item>
-        <item>
-            <key> <string>enctype</string> </key>
-            <value> <string>multipart/form-data</string> </value>
-        </item>
-        <item>
-            <key> <string>group_list</string> </key>
-            <value>
-              <list>
-                <string>left</string>
-                <string>bottom</string>
-                <string>hidden</string>
-              </list>
-            </value>
-        </item>
-        <item>
-            <key> <string>groups</string> </key>
-            <value>
-              <dictionary>
-                <item>
-                    <key> <string>bottom</string> </key>
-                    <value>
-                      <list>
-                        <string>listbox</string>
-                      </list>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>hidden</string> </key>
-                    <value>
-                      <list>
-                        <string>listbox_portal_type_property_list</string>
-                      </list>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>left</string> </key>
-                    <value>
-                      <list>
-                        <string>my_import_file</string>
-                        <string>openoffice_template</string>
-                        <string>warning</string>
-                      </list>
-                    </value>
-                </item>
-              </dictionary>
-            </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>ERP5Site_importObjectFromOOoFastInput</string> </value>
-        </item>
-        <item>
-            <key> <string>method</string> </key>
-            <value> <string>POST</string> </value>
-        </item>
-        <item>
-            <key> <string>name</string> </key>
-            <value> <string>ERP5Site_importObjectFromOOoFastInput</string> </value>
-        </item>
-        <item>
-            <key> <string>pt</string> </key>
-            <value> <string>form_view_dialog</string> </value>
-        </item>
-        <item>
-            <key> <string>row_length</string> </key>
-            <value> <int>4</int> </value>
-        </item>
-        <item>
-            <key> <string>stored_encoding</string> </key>
-            <value> <string>UTF-8</string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string>Import OpenOffice Document</string> </value>
-        </item>
-        <item>
-            <key> <string>unicode_mode</string> </key>
-            <value> <int>0</int> </value>
-        </item>
-        <item>
-            <key> <string>update_action</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>

Modified: erp5/trunk/bt5/erp5_base/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/bt/change_log?rev=26039&r1=26038&r2=26039&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_base/bt/change_log [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/bt/change_log [utf8] Mon Mar 16 09:59:30 2009
@@ -1,3 +1,6 @@
+2009-03-16 Kazuhiko
+* remove ooo_import action in Person Module that is replaced by erp5_ooo_import business template with more generic and better import function.
+
 2009-02-25 ivan
 * Add portal_introspections tool
 * Add portal_web_services tool

Modified: erp5/trunk/bt5/erp5_base/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/bt/revision?rev=26039&r1=26038&r2=26039&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_base/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/bt/revision [utf8] Mon Mar 16 09:59:30 2009
@@ -1,1 +1,1 @@
-551
+554

Modified: erp5/trunk/bt5/erp5_base/bt/template_action_path_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/bt/template_action_path_list?rev=26039&r1=26038&r2=26039&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_base/bt/template_action_path_list [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/bt/template_action_path_list [utf8] Mon Mar 16 09:59:30 2009
@@ -56,7 +56,6 @@
 Organisation | jump_to_persons
 Organisation | view
 Parent Explanation Movement Group | view
-Person Module | ooo_import
 Person Module | view
 Person | assignment
 Person | create_new_file




More information about the Erp5-report mailing list