[Erp5-report] r22541 - in /erp5/trunk/bt5/erp5_rss_style: SkinTemplateItem/portal_skins/ Sk...
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Jul 18 08:45:08 CEST 2008
Author: ivan
Date: Fri Jul 18 08:45:07 2008
New Revision: 22541
URL: http://svn.erp5.org?rev=22541&view=rev
Log:
Refactored erp5_rss_style bt5 by zstoinov.
- Add dedicated form_render in RSS (rss_view) which can be used to hard code that a form must be rendered in RSS
- Make it possible to really render *any* existing form in RSS by setting dynamically in URL 'portal_skin=RSS '
- Use proper html_quote function
Added:
erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_core/
erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_core.xml
erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_core/rss_view.xml
erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Base_getRSSTitle.xml
erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/ListBox_asHTML.xml
erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/form_list.xml
erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/form_view.xml
erp5/trunk/bt5/erp5_rss_style/bt/template_catalog_datetime_key_list
erp5/trunk/bt5/erp5_rss_style/bt/template_catalog_local_role_key_list
erp5/trunk/bt5/erp5_rss_style/bt/template_catalog_role_key_list
erp5/trunk/bt5/erp5_rss_style/bt/template_catalog_scriptable_key_list
erp5/trunk/bt5/erp5_rss_style/bt/template_tool_id_list
Modified:
erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style.xml
erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Base_getRSSAuthor.xml
erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Base_getRSSDescription.xml
erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Folder_viewContentListAsRSS.xml
erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Folder_viewContentListAsRSS/listbox.xml
erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Listbox_asRSS.xml
erp5/trunk/bt5/erp5_rss_style/bt/change_log
erp5/trunk/bt5/erp5_rss_style/bt/revision
erp5/trunk/bt5/erp5_rss_style/bt/template_skin_id_list
Added: erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_core.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_core.xml?rev=22541&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_core.xml (added)
+++ erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_core.xml Fri Jul 18 08:45:07 2008
@@ -1,0 +1,41 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="Folder" module="OFS.Folder"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>__ac_local_roles__</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_objects</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_owner</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>erp5_rss_core</string> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string></string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Added: erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_core/rss_view.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_core/rss_view.xml?rev=22541&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_core/rss_view.xml (added)
+++ erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_core/rss_view.xml Fri Jul 18 08:45:07 2008
@@ -1,0 +1,94 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>__ac_local_roles__</string> </key>
+ <value>
+ <none/>
+ </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_subpath</string> </key>
+ <value> <string>traverse_subpath</string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>_text</string> </key>
+ <value> <string encoding="cdata"><![CDATA[
+
+<?xml version="1.0"?>\n
+<rss version="2.0" metal:define-macro="master"\n
+ xmlns:tal="http://xml.zope.org/namespaces/tal" \n
+ xmlns:metal="http://xml.zope.org/namespaces/metal"\n
+ xmlns:dc="http://purl.org/dc/elements/1.1/" \n
+ xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">\n
+ <tal:block tal:define="dummy python: request.RESPONSE.setHeader(\'Content-Type\', \'application/rss+xml;; charset=utf-8\');\n
+ rss_string string:RSS;\n
+ dummy python: context.getPortalObject().portal_skins.changeSkin(rss_string);\n
+ dummy python: request.set(\'portal_skin\', rss_string);">\n
+ <tal:block tal:define="listbox_fields python: [field for field in form.get_fields() if (field.meta_type == \'ListBox\' or field.meta_type == \'ProxyField\' and field.getRecursiveTemplateField().meta_type == \'ListBox\')]" >\n
+\n
+ <channel>\n
+ <title tal:content="here/Title">TITLE</title>\n
+ <link tal:content="here/absolute_url">URL</link>\n
+ <description tal:content="python: here.getProperty(\'description\')">DESCRIPTION</description>\n
+ <tal:block tal:repeat="listbox_field listbox_fields">\n
+ <tal:block tal:content="structure python: listbox_field.render()" />\n
+ </tal:block>\n
+ </channel>\n
+\n
+ </tal:block>\n
+ </tal:block>\n
+</rss>
+
+]]></string> </value>
+ </item>
+ <item>
+ <key> <string>content_type</string> </key>
+ <value> <string>text/xml; charset=utf-8</string> </value>
+ </item>
+ <item>
+ <key> <string>expand</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>rss_view</string> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string></string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style.xml?rev=22541&r1=22540&r2=22541&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style.xml (original)
+++ erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style.xml Fri Jul 18 08:45:07 2008
@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
- <tuple>
- <string>OFS.Folder</string>
- <string>Folder</string>
- </tuple>
- <none/>
+ <global name="Folder" module="OFS.Folder"/>
+ <tuple/>
</tuple>
</pickle>
<pickle>
@@ -19,9 +16,40 @@
</value>
</item>
<item>
+ <key> <string>_local_properties</string> </key>
+ <value>
+ <tuple>
+ <dictionary>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>business_template_registered_skin_selections</string> </value>
+ </item>
+ <item>
+ <key> <string>type</string> </key>
+ <value> <string>tokens</string> </value>
+ </item>
+ </dictionary>
+ </tuple>
+ </value>
+ </item>
+ <item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_owner</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>business_template_registered_skin_selections</string> </key>
+ <value>
+ <tuple>
+ <string>RSS</string>
+ </tuple>
</value>
</item>
<item>
Modified: erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Base_getRSSAuthor.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Base_getRSSAuthor.xml?rev=22541&r1=22540&r2=22541&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Base_getRSSAuthor.xml (original)
+++ erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Base_getRSSAuthor.xml Fri Jul 18 08:45:07 2008
@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
- <tuple>
- <string>Products.PythonScripts.PythonScript</string>
- <string>PythonScript</string>
- </tuple>
- <none/>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ <tuple/>
</tuple>
</pickle>
<pickle>
@@ -119,7 +116,7 @@
<value>
<tuple>
<string>_getattr_</string>
-<string>context</string>
+ <string>context</string>
</tuple>
</value>
</item>
Modified: erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Base_getRSSDescription.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Base_getRSSDescription.xml?rev=22541&r1=22540&r2=22541&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Base_getRSSDescription.xml (original)
+++ erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Base_getRSSDescription.xml Fri Jul 18 08:45:07 2008
@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
- <tuple>
- <string>Products.PythonScripts.PythonScript</string>
- <string>PythonScript</string>
- </tuple>
- <none/>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ <tuple/>
</tuple>
</pickle>
<pickle>
@@ -68,21 +65,14 @@
</item>
<item>
<key> <string>_body</string> </key>
- <value> <string encoding="cdata"><![CDATA[
-
+ <value> <string>"""\n
+ Pre-process a description before putting it into RSS feed.\n
"""\n
- Pre-process a description before putting it into RSS feed.\n
- We html-quote all < and > because they\'d break the reader\n
- (the > char is often found in mail messages).\n
-"""\n
+from Products.PythonScripts.standard import html_quote\n
\n
description = context.getDescription()\n
-description = description.replace(\'>\', \'>\')\n
-description = description.replace(\'<\', \'<\')\n
-return description\n
-
-
-]]></string> </value>
+return html_quote(description)\n
+</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
@@ -124,8 +114,10 @@
<key> <string>co_varnames</string> </key>
<value>
<tuple>
+ <string>Products.PythonScripts.standard</string>
+ <string>html_quote</string>
<string>_getattr_</string>
-<string>context</string>
+ <string>context</string>
<string>description</string>
</tuple>
</value>
Added: erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Base_getRSSTitle.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Base_getRSSTitle.xml?rev=22541&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Base_getRSSTitle.xml (added)
+++ erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Base_getRSSTitle.xml Fri Jul 18 08:45:07 2008
@@ -1,0 +1,149 @@
+<?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>Python_magic</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>Script_magic</string> </key>
+ <value> <int>3</int> </value>
+ </item>
+ <item>
+ <key> <string>__ac_local_roles__</string> </key>
+ <value>
+ <none/>
+ </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
+ Pre-process a title before putting it into RSS feed.\n
+"""\n
+from Products.PythonScripts.standard import html_quote\n
+\n
+title = context.Title()\n
+return html_quote(title)\n
+</string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_filepath</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.PythonScripts.standard</string>
+ <string>html_quote</string>
+ <string>_getattr_</string>
+ <string>context</string>
+ <string>title</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_getRSSTitle</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Folder_viewContentListAsRSS.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Folder_viewContentListAsRSS.xml?rev=22541&r1=22540&r2=22541&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Folder_viewContentListAsRSS.xml (original)
+++ erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Folder_viewContentListAsRSS.xml Fri Jul 18 08:45:07 2008
@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
- <tuple>
- <string>Products.ERP5Form.Form</string>
- <string>ERP5Form</string>
- </tuple>
- <none/>
+ <global name="ERP5Form" module="Products.ERP5Form.Form"/>
+ <tuple/>
</tuple>
</pickle>
<pickle>
@@ -50,6 +47,16 @@
<value> <string></string> </value>
</item>
<item>
+ <key> <string>description</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>edit_order</string> </key>
+ <value>
+ <list/>
+ </value>
+ </item>
+ <item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
@@ -74,7 +81,7 @@
<value>
<dictionary>
<item>
- <key> <string>bottom</string> </key>
+ <key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
@@ -82,19 +89,19 @@
</value>
</item>
<item>
- <key> <string>center</string> </key>
+ <key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
- <key> <string>hidden</string> </key>
+ <key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
- <key> <string>left</string> </key>
+ <key> <string>left</string> </key>
<value>
<list>
<string>listbox_link</string>
@@ -102,7 +109,7 @@
</value>
</item>
<item>
- <key> <string>right</string> </key>
+ <key> <string>right</string> </key>
<value>
<list/>
</value>
@@ -124,7 +131,7 @@
</item>
<item>
<key> <string>pt</string> </key>
- <value> <string>template_rss_style</string> </value>
+ <value> <string>rss_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
Modified: erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Folder_viewContentListAsRSS/listbox.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Folder_viewContentListAsRSS/listbox.xml?rev=22541&r1=22540&r2=22541&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Folder_viewContentListAsRSS/listbox.xml (original)
+++ erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Folder_viewContentListAsRSS/listbox.xml Fri Jul 18 08:45:07 2008
@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
- <tuple>
- <string>Products.ERP5Form.ListBox</string>
- <string>ListBox</string>
- </tuple>
- <none/>
+ <global name="ListBox" module="Products.ERP5Form.ListBox"/>
+ <tuple/>
</tuple>
</pickle>
<pickle>
@@ -322,32 +319,36 @@
<value> <string></string> </value>
</item>
<item>
+ <key> <string>anchor</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
<key> <string>columns</string> </key>
<value>
<list>
<tuple>
+ <string>Base_getRSSTitle</string>
<string>title</string>
- <string>rss_title</string>
</tuple>
<tuple>
<string>creation_date</string>
- <string>rss_pubDate</string>
+ <string>pubDate</string>
</tuple>
<tuple>
<string>Base_getRSSAuthor</string>
- <string>rss_author</string>
+ <string>author</string>
</tuple>
<tuple>
<string>link</string>
- <string>rss_link</string>
+ <string>link</string>
</tuple>
<tuple>
<string>Base_getRSSDescription</string>
- <string>rss_description</string>
+ <string>description</string>
</tuple>
<tuple>
<string>absolute_url</string>
- <string>rss_guid</string>
+ <string>guid</string>
</tuple>
</list>
</value>
@@ -435,7 +436,7 @@
</item>
<item>
<key> <string>page_template</string> </key>
- <value> <string>Listbox_viewAsRSS</string> </value>
+ <value> <string></string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
@@ -536,11 +537,8 @@
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
- <tuple>
- <string>Products.Formulator.MethodField</string>
- <string>Method</string>
- </tuple>
- <none/>
+ <global name="Method" module="Products.Formulator.MethodField"/>
+ <tuple/>
</tuple>
</pickle>
<pickle>
Added: erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/ListBox_asHTML.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/ListBox_asHTML.xml?rev=22541&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/ListBox_asHTML.xml (added)
+++ erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/ListBox_asHTML.xml Fri Jul 18 08:45:07 2008
@@ -1,0 +1,209 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>_Access_contents_information_Permission</string> </key>
+ <value>
+ <list>
+ <string>Manager</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>_Change_bindings_Permission</string> </key>
+ <value>
+ <list>
+ <string>Manager</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>_Change_cache_settings_Permission</string> </key>
+ <value>
+ <list>
+ <string>Manager</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>_Change_permissions_Permission</string> </key>
+ <value>
+ <list>
+ <string>Manager</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>_Copy_or_Move_Permission</string> </key>
+ <value>
+ <list>
+ <string>Manager</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>_Delete_objects_Permission</string> </key>
+ <value>
+ <list>
+ <string>Manager</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>_FTP_access_Permission</string> </key>
+ <value>
+ <list>
+ <string>Manager</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>_Manage_WebDAV_Locks_Permission</string> </key>
+ <value>
+ <list>
+ <string>Manager</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>_Manage_properties_Permission</string> </key>
+ <value>
+ <list>
+ <string>Manager</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>_Take_ownership_Permission</string> </key>
+ <value>
+ <list>
+ <string>Manager</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>_Undo_changes_Permission</string> </key>
+ <value>
+ <list>
+ <string>Manager</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>_View_Permission</string> </key>
+ <value>
+ <list>
+ <string>Manager</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>_View_management_screens_Permission</string> </key>
+ <value>
+ <list>
+ <string>Manager</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>_WebDAV_Lock_items_Permission</string> </key>
+ <value>
+ <list>
+ <string>Manager</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>_WebDAV_Unlock_items_Permission</string> </key>
+ <value>
+ <list>
+ <string>Manager</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>_WebDAV_access_Permission</string> </key>
+ <value>
+ <list>
+ <string>Manager</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>__ac_local_roles__</string> </key>
+ <value>
+ <none/>
+ </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_subpath</string> </key>
+ <value> <string>traverse_subpath</string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>_text</string> </key>
+ <value> <string encoding="cdata"><![CDATA[
+
+<tal:block \n
+ xmlns:tal="http://xml.zope.org/namespaces/tal"\n
+ xmlns:i18n="http://xml.zope.org/namespaces/i18n"\n
+ tal:define="line_list here/query;\n
+ label_list here/getLabelValueList;\n
+ real_context here/getContext;\n
+ feed_data python: real_context.Listbox_asRSS(label_list, line_list);">\n
+ <item tal:repeat="item_info feed_data/listItemInfos" >\n
+ <tal:block tal:replace="structure item_info"/>\n
+ </item>\n
+</tal:block>
+
+]]></string> </value>
+ </item>
+ <item>
+ <key> <string>content_type</string> </key>
+ <value> <string>text/xml; charset=utf-8</string> </value>
+ </item>
+ <item>
+ <key> <string>expand</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>ListBox_asHTML</string> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string></string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Listbox_asRSS.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Listbox_asRSS.xml?rev=22541&r1=22540&r2=22541&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Listbox_asRSS.xml (original)
+++ erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Listbox_asRSS.xml Fri Jul 18 08:45:07 2008
@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
- <tuple>
- <string>Products.PythonScripts.PythonScript</string>
- <string>PythonScript</string>
- </tuple>
- <none/>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ <tuple/>
</tuple>
</pickle>
<pickle>
@@ -72,9 +69,8 @@
"""\n
A script for exporting listbox\'s contents as RSS feed.\n
- It is called by Listbox_viewAsRSS listbox renderer, which queries the listbox\n
- and passes on column labels and listbox renderer lines. Returns a dict containing\n
- channel information (channel = context in which the form was called) and a list\n
+ It is called by Listbox_asHTML(in RSS skin) listbox renderer, which queries the listbox\n
+ and passes on column labels and listbox renderer lines. Returns a list\n
of items as a piece of xml (because we have to manipulate tag names).\n
\n
The implementation is based on RSS 2.0 specification, in a somewhat simplified way \n
@@ -84,13 +80,15 @@
\n
USAGE:\n
The RSS skin is to be used to render a custom rss listbox, which must have columns\n
- with titles beginning with "rss_". It is highly recommended to have the following:\n
- - rss_title\n
- - rss_author\n
- - rss_description\n
- - rss_pubDate\n
- - rss_link\n
- - rss_guid (which should be an absolute url of the document)\n
+ with following titles:\n
+ - title\n
+ - author\n
+ - description\n
+ - category\n
+ - comments\n
+ - pubDate\n
+ - link\n
+ - guid (which should be an absolute url of the document)\n
The way an object is presented should be defined in the listbox - the RSS skin passes on\n
what is in the listbox, as is. So you can produce your own description, author information\n
or publication date. A partial exception to this rule is dates - RSS protocol requires\n
@@ -99,53 +97,70 @@
publication date is entirely up to you.\n
"""\n
\n
-allowed_field_list = (\'title\', \'link\', \'description\', \'author\', \'category\', \'comments\', \'guid\', \'pubDate\')\n
-\n
from Products.CMFCore.utils import getToolByName\n
+from Products.PythonScripts.standard import html_quote\n
+\n
+items = []\n
+feed_data = {}\n
request = context.REQUEST\n
\n
-channel = context\n
-feed_data = {}\n
-\n
-# channel information\n
-feed_data[\'channel_info\'] = { \'title\': channel.Title(),\n
- \'description\': channel.getProperty(\'description\'), # so that it works for portal object too\n
- \'url\': channel.absolute_url() + \'/view\' }\n
+# required channel elements for RSS 2.0 specification\n
+required_field_list = (\'title\', \'description\', \'link\',)\n
+\n
+# required + optional channel elements\n
+allowed_field_list = (\'title\', \'description\', \'link\', \'author\', \n
+ \'category\', \'comments\', \'guid\', \'pubdate\',)\n
\n
# figure out which column is which, by using column titles\n
rss_column_mapping = {}\n
for index, column_item in enumerate(label_list):\n
column_header = column_item[1]\n
- if column_header.startswith(\'rss_\'):\n
- field_name = column_header[4:]\n
- if field_name in allowed_field_list:\n
- rss_column_mapping[field_name] = index\n
-\n
-items = []\n
+ if column_header.lower() in allowed_field_list:\n
+ rss_column_mapping[column_header.lower()] = index\n
\n
for line in line_list:\n
+ rss_item_dict = {}\n
column_item_list = line.getValueList()\n
- rss_item_dict = {}\n
for header, index in rss_column_mapping.items():\n
value_tuple = column_item_list[index]\n
# the [0] is a raw value, the [1] is rendered; we want strings rendered (as unicode),\n
# but other stuff (like int or DateTime) we want as they are\n
if hasattr(value_tuple[0], \'lower\'):\n
- value = value_tuple[1]\n
+ value = html_quote(value_tuple[1])\n
else:\n
value = value_tuple[0]\n
- # format dates\n
if hasattr(value, \'rfc822\'):\n
+ # format dates\n
value = value.rfc822()\n
rss_item_dict[header] = value\n
# build xml from dict (we have to do it here because we need to manipulate tag names\n
rss_item_string = \'\'\n
- for k, v in rss_item_dict.items():\n
- rss_item_string += (\'<%s>%s</%s>\\n\' % (k,v or \'\',k))\n
+ for key, value in rss_item_dict.items():\n
+ if key == \'pubdate\':\n
+ # pubDate should be returned unconditionally as \'pubDate\'\n
+ key = \'pubDate\'\n
+ rss_item_string += (\'\\t\\t\\t<%s>%s</%s>\\n\' % (key,value or \'\',key))\n
+\n
+ # if required fields not present in listbox columns as label we \n
+ # added theirs appropriate xml dynamically\n
+ for required_field in required_field_list:\n
+ if required_field not in rss_item_dict.keys():\n
+ field_data = \'\'\n
+ if required_field == \'title\':\n
+ if hasattr(line.getBrain(), \'Title\'):\n
+ field_data = html_quote(unicode(line.getBrain().Title(), \'utf-8\') or \'\')\n
+ rss_item_string += (\'\\t\\t\\t<%s>%s</%s>\\n\' % (required_field, field_data, required_field))\n
+ elif required_field == \'link\':\n
+ if hasattr(line.getBrain(), \'absolute_url\'):\n
+ field_data = unicode(line.getBrain().absolute_url(), \'utf-8\' ) or \'\'\n
+ rss_item_string += (\'\\t\\t\\t<%s>%s/view</%s>\\n\' % (required_field, field_data, required_field))\n
+ elif required_field == \'description\':\n
+ if hasattr(line.getBrain(), \'getDescription\'):\n
+ field_data = html_quote(unicode(line.getBrain().getDescription(), \'utf-8\' ) or \'\')\n
+ rss_item_string += (\'\\t\\t\\t<%s>%s</%s>\\n\' % (required_field, field_data,required_field))\n
items.append(rss_item_string)\n
\n
feed_data[\'listItemInfos\'] = tuple(items)\n
-\n
return feed_data\n
@@ -193,15 +208,17 @@
<tuple>
<string>label_list</string>
<string>line_list</string>
- <string>allowed_field_list</string>
<string>Products.CMFCore.utils</string>
<string>getToolByName</string>
+ <string>Products.PythonScripts.standard</string>
+ <string>html_quote</string>
+ <string>items</string>
+ <string>feed_data</string>
<string>_getattr_</string>
<string>context</string>
<string>request</string>
- <string>channel</string>
- <string>feed_data</string>
- <string>_write_</string>
+ <string>required_field_list</string>
+ <string>allowed_field_list</string>
<string>rss_column_mapping</string>
<string>_getiter_</string>
<string>enumerate</string>
@@ -209,18 +226,20 @@
<string>column_item</string>
<string>_getitem_</string>
<string>column_header</string>
- <string>field_name</string>
- <string>items</string>
+ <string>_write_</string>
<string>line</string>
+ <string>rss_item_dict</string>
<string>column_item_list</string>
- <string>rss_item_dict</string>
<string>header</string>
<string>value_tuple</string>
<string>hasattr</string>
<string>value</string>
<string>rss_item_string</string>
- <string>k</string>
- <string>v</string>
+ <string>key</string>
+ <string>_inplacevar_</string>
+ <string>required_field</string>
+ <string>field_data</string>
+ <string>unicode</string>
<string>tuple</string>
</tuple>
</value>
Added: erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/form_list.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/form_list.xml?rev=22541&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/form_list.xml (added)
+++ erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/form_list.xml Fri Jul 18 08:45:07 2008
@@ -1,0 +1,78 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>__ac_local_roles__</string> </key>
+ <value>
+ <none/>
+ </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_subpath</string> </key>
+ <value> <string>traverse_subpath</string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>_text</string> </key>
+ <value> <string encoding="cdata"><![CDATA[
+
+<?xml version="1.0"?>\n
+<tal:block \n
+ xmlns:tal="http://xml.zope.org/namespaces/tal" \n
+ xmlns:metal="http://xml.zope.org/namespaces/metal"\n
+ metal:use-macro="here/rss_view/macros/master" >\n
+</tal:block>\n
+ \n
+
+
+]]></string> </value>
+ </item>
+ <item>
+ <key> <string>content_type</string> </key>
+ <value> <string>text/xml; charset=utf-8</string> </value>
+ </item>
+ <item>
+ <key> <string>expand</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>form_list</string> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string></string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Added: erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/form_view.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/form_view.xml?rev=22541&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/form_view.xml (added)
+++ erp5/trunk/bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/form_view.xml Fri Jul 18 08:45:07 2008
@@ -1,0 +1,77 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>__ac_local_roles__</string> </key>
+ <value>
+ <none/>
+ </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_subpath</string> </key>
+ <value> <string>traverse_subpath</string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>_text</string> </key>
+ <value> <string encoding="cdata"><![CDATA[
+
+<?xml version="1.0"?>\n
+<tal:block \n
+ xmlns:tal="http://xml.zope.org/namespaces/tal" \n
+ xmlns:metal="http://xml.zope.org/namespaces/metal"\n
+ metal:use-macro="here/rss_view/macros/master" >\n
+</tal:block>\n
+
+
+]]></string> </value>
+ </item>
+ <item>
+ <key> <string>content_type</string> </key>
+ <value> <string>text/xml; charset=utf-8</string> </value>
+ </item>
+ <item>
+ <key> <string>expand</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>form_view</string> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string></string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_rss_style/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/bt/change_log?rev=22541&r1=22540&r2=22541&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_rss_style/bt/change_log (original)
+++ erp5/trunk/bt5/erp5_rss_style/bt/change_log Fri Jul 18 08:45:07 2008
@@ -1,5 +1,8 @@
+2008-07-14 zstoinov
+* Make RSS skin more generic
+
2007-08-29
-Release-ready.
+* Release-ready.
2007-08-13
-First working version.
+* First working version.
Modified: erp5/trunk/bt5/erp5_rss_style/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/bt/revision?rev=22541&r1=22540&r2=22541&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_rss_style/bt/revision (original)
+++ erp5/trunk/bt5/erp5_rss_style/bt/revision Fri Jul 18 08:45:07 2008
@@ -1,1 +1,1 @@
-12
+16
Added: erp5/trunk/bt5/erp5_rss_style/bt/template_catalog_datetime_key_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/bt/template_catalog_datetime_key_list?rev=22541&view=auto
==============================================================================
(empty)
Added: erp5/trunk/bt5/erp5_rss_style/bt/template_catalog_local_role_key_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/bt/template_catalog_local_role_key_list?rev=22541&view=auto
==============================================================================
(empty)
Added: erp5/trunk/bt5/erp5_rss_style/bt/template_catalog_role_key_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/bt/template_catalog_role_key_list?rev=22541&view=auto
==============================================================================
(empty)
Added: erp5/trunk/bt5/erp5_rss_style/bt/template_catalog_scriptable_key_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/bt/template_catalog_scriptable_key_list?rev=22541&view=auto
==============================================================================
(empty)
Modified: erp5/trunk/bt5/erp5_rss_style/bt/template_skin_id_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/bt/template_skin_id_list?rev=22541&r1=22540&r2=22541&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_rss_style/bt/template_skin_id_list (original)
+++ erp5/trunk/bt5/erp5_rss_style/bt/template_skin_id_list Fri Jul 18 08:45:07 2008
@@ -1,1 +1,2 @@
+erp5_rss_core
erp5_rss_style
Added: erp5/trunk/bt5/erp5_rss_style/bt/template_tool_id_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_rss_style/bt/template_tool_id_list?rev=22541&view=auto
==============================================================================
(empty)
More information about the Erp5-report
mailing list