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 @@
<tuple/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
......@@ -76,7 +82,8 @@
<key> <string>bottom (Content)</string> </key>
<value>
<list>
<string>my_text_content</string>
<string>iframe_content</string>
<string>text_content</string>
</list>
</value>
</item>
......
......@@ -14,7 +14,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_text_content</string> </value>
<value> <string>text_content</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -136,7 +136,9 @@
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -148,7 +150,9 @@
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>external_validator</string> </key>
......@@ -283,4 +287,42 @@
</dictionary>
</pickle>
</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>
......@@ -74,7 +74,8 @@
<key> <string>bottom</string> </key>
<value>
<list>
<string>my_text_content</string>
<string>iframe_content</string>
<string>text_content</string>
</list>
</value>
</item>
......
......@@ -14,7 +14,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_text_content</string> </value>
<value> <string>text_content</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -136,7 +136,9 @@
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -148,7 +150,9 @@
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>external_validator</string> </key>
......@@ -283,4 +287,42 @@
</dictionary>
</pickle>
</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>
......@@ -87,9 +87,16 @@ if contribute_portal_type:\n
if contribute_file is not None:\n
kw[\'file\'] = contribute_file\n
\n
kw[\'discover_metadata\'] = 0 # We want to discover metadata synchronously\n
\n
#try:\n
if 1:\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
target = new_content\n
editable_mode = 1\n
......@@ -115,6 +122,12 @@ return target.Base_redirect(\'view\', keep_items=dict(portal_status_message=msg,
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<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,
<string>_getattr_</string>
<string>context</string>
<string>new_content</string>
<string>hasattr</string>
<string>file_name</string>
<string>msg</string>
<string>target</string>
<string>editable_mode</string>
......
......@@ -84,9 +84,12 @@ if link_description:\n
if link_url:\n
kw[\'url\'] = link_url\n
\n
kw[\'discover_metadata\'] = 0 # We want to discover metadata synchronously\n
\n
#try:\n
if 1:\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
target = new_content\n
editable_mode = 1\n
......
......@@ -153,7 +153,7 @@
id = \'content\',\n
title = \'Offline Content:\',\n
),\n
]">\n
]">\n
\n
<div class="filebox" id="administration" tal:attributes="id file_group/id">\n
<ul>\n
......
543
\ No newline at end of file
544
\ 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