[Erp5-report] r34087 ivan - in /erp5/trunk/bt5/erp5_web: SkinTemplateItem/portal_skins/erp5...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 25 10:40:55 CET 2010


Author: ivan
Date: Thu Mar 25 10:40:54 2010
New Revision: 34087

URL: http://svn.erp5.org?rev=34087&view=rev
Log:
Move getting title of a published in web ERP5 object in a separate script so other parts of ERP5 Web (KM) can reuse it.
Add note for further API  improvements (possible).

Added:
    erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_getTitle.xml
Modified:
    erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getBreadcrumbItemList.xml
    erp5/trunk/bt5/erp5_web/bt/revision

Added: erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_getTitle.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_getTitle.xml?rev=34087&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_getTitle.xml (added)
+++ erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_getTitle.xml [utf8] Thu Mar 25 10:40:54 2010
@@ -1,0 +1,143 @@
+<?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 part of ERP5 Web.\n
+ It is used to get title of an object published in an ERP5 based Web Site and is used\n
+ for building ERP5 Web UI.\n
+\n
+ Title can be acquired from following sources (their priority may depend):\n
+ - translated_short_title\n
+ - short_title\n
+ - translated_title_or_id\n
+ - title_or_id\n
+ - title\n
+ - auto generated\n
+\n
+  XXX: move this script as an API of ERP5Type?\n
+"""\n
+\n
+return context.getProperty(\'translated_short_title\', None) or \\\n
+       context.getProperty(\'short_title\', None) or \\\n
+       context.getProperty(\'translated_title_or_id\', None) or \\\n
+       context.getProperty(\'title_or_id\', None) or \\\n
+       context.title\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>_getattr_</string>
+                            <string>context</string>
+                            <string>None</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>Base_getTitle</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getBreadcrumbItemList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getBreadcrumbItemList.xml?rev=34087&r1=34086&r2=34087&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getBreadcrumbItemList.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getBreadcrumbItemList.xml [utf8] Thu Mar 25 10:40:54 2010
@@ -120,9 +120,7 @@
     if i == 0:\n
       title = context.Base_translateString(\'Home\')\n
     else:\n
-      title = crumb.getProperty(\'translated_short_title\', None) or\\\n
-              crumb.getProperty(\'translated_title_or_id\', None) or\\\n
-              crumb.title\n
+      title = crumb.Base_getTitle()\n
     crumb_list.append((title, crumb))\n
   except Unauthorized:\n
     # We should ignore any item in the chain which raises \n

Modified: erp5/trunk/bt5/erp5_web/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/bt/revision?rev=34087&r1=34086&r2=34087&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_web/bt/revision [utf8] Thu Mar 25 10:40:54 2010
@@ -1,1 +1,1 @@
-916
+918




More information about the Erp5-report mailing list