Commit 208f3e0b authored by Ivan Tyagov's avatar Ivan Tyagov

Move getting title of a published in web ERP5 object in a separate script so...

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).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34087 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 88f2d10e
<?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>
......@@ -120,9 +120,7 @@ for i in xrange(0, len(chain_list)):\n
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
......
916
\ No newline at end of file
918
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment