Commit 383e087f authored by Jean-Paul Smets's avatar Jean-Paul Smets

Updated contribution scripts. Initial support for iframe rendering for external HTML content.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13642 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 21bdbed3
...@@ -45,6 +45,12 @@ ...@@ -45,6 +45,12 @@
<tuple/> <tuple/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>action</string> </key> <key> <string>action</string> </key>
<value> <string>Base_edit</string> </value> <value> <string>Base_edit</string> </value>
...@@ -76,7 +82,8 @@ ...@@ -76,7 +82,8 @@
<key> <string>bottom (Content)</string> </key> <key> <string>bottom (Content)</string> </key>
<value> <value>
<list> <list>
<string>my_text_content</string> <string>iframe_content</string>
<string>text_content</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_text_content</string> </value> <value> <string>text_content</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -136,7 +136,9 @@ ...@@ -136,7 +136,9 @@
</item> </item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -148,7 +150,9 @@ ...@@ -148,7 +150,9 @@
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
...@@ -283,4 +287,42 @@ ...@@ -283,4 +287,42 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/asStrippedHTML</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>not:here/isExternalDocument</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -74,7 +74,8 @@ ...@@ -74,7 +74,8 @@
<key> <string>bottom</string> </key> <key> <string>bottom</string> </key>
<value> <value>
<list> <list>
<string>my_text_content</string> <string>iframe_content</string>
<string>text_content</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_text_content</string> </value> <value> <string>text_content</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -136,7 +136,9 @@ ...@@ -136,7 +136,9 @@
</item> </item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -148,7 +150,9 @@ ...@@ -148,7 +150,9 @@
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
...@@ -283,4 +287,42 @@ ...@@ -283,4 +287,42 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/asStrippedHTML</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>not:here/getUrlString</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -87,9 +87,16 @@ if contribute_portal_type:\n ...@@ -87,9 +87,16 @@ if contribute_portal_type:\n
if contribute_file is not None:\n if contribute_file is not None:\n
kw[\'file\'] = contribute_file\n kw[\'file\'] = contribute_file\n
\n \n
kw[\'discover_metadata\'] = 0 # We want to discover metadata synchronously\n
\n
#try:\n #try:\n
if 1:\n if 1:\n
new_content = context.portal_contributions.newContent(**kw)\n new_content = context.portal_contributions.newContent(**kw)\n
if hasattr(contribute_file, \'filename\'):\n
file_name = contribute_file.filename\n
else:\n
file_name = None\n
new_content.discoverMetadata(file_name=file_name) # Consider putting an exception handler\n
msg = context.Base_translateString(\'Document successfully created\')\n msg = context.Base_translateString(\'Document successfully created\')\n
target = new_content\n target = new_content\n
editable_mode = 1\n editable_mode = 1\n
...@@ -115,6 +122,12 @@ return target.Base_redirect(\'view\', keep_items=dict(portal_status_message=msg, ...@@ -115,6 +122,12 @@ return target.Base_redirect(\'view\', keep_items=dict(portal_status_message=msg,
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>contribute_file=None, contribute_classification=None, contribute_source_project=None, contribute_portal_type=None, **kw</string> </value> <value> <string>contribute_file=None, contribute_classification=None, contribute_source_project=None, contribute_portal_type=None, **kw</string> </value>
...@@ -154,6 +167,8 @@ return target.Base_redirect(\'view\', keep_items=dict(portal_status_message=msg, ...@@ -154,6 +167,8 @@ return target.Base_redirect(\'view\', keep_items=dict(portal_status_message=msg,
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>new_content</string> <string>new_content</string>
<string>hasattr</string>
<string>file_name</string>
<string>msg</string> <string>msg</string>
<string>target</string> <string>target</string>
<string>editable_mode</string> <string>editable_mode</string>
......
...@@ -84,9 +84,12 @@ if link_description:\n ...@@ -84,9 +84,12 @@ if link_description:\n
if link_url:\n if link_url:\n
kw[\'url\'] = link_url\n kw[\'url\'] = link_url\n
\n \n
kw[\'discover_metadata\'] = 0 # We want to discover metadata synchronously\n
\n
#try:\n #try:\n
if 1:\n if 1:\n
new_content = context.portal_contributions.newContent(**kw)\n new_content = context.portal_contributions.newContent(**kw)\n
new_content.discoverMetadata() # Consider putting an exception handler\n
msg = context.Base_translateString(\'Document successfully created\')\n msg = context.Base_translateString(\'Document successfully created\')\n
target = new_content\n target = new_content\n
editable_mode = 1\n editable_mode = 1\n
......
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
id = \'content\',\n id = \'content\',\n
title = \'Offline Content:\',\n title = \'Offline Content:\',\n
),\n ),\n
]">\n ]">\n
\n \n
<div class="filebox" id="administration" tal:attributes="id file_group/id">\n <div class="filebox" id="administration" tal:attributes="id file_group/id">\n
<ul>\n <ul>\n
......
543 544
\ No newline at end of file \ 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