[Erp5-report] r13123 - in /erp5/trunk/bt5/erp5_dms: SkinTemplateItem/portal_skins/erp5_dms/...
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Mar 1 12:24:16 CET 2007
Author: bartek
Date: Thu Mar 1 12:24:12 2007
New Revision: 13123
URL: http://svn.erp5.org?rev=13123&view=rev
Log:
On re-upload to not create new object, but increase revision instead.
Added:
erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/OOoDocument_view/my_revision.xml
Modified:
erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_uploadFile.xml
erp5/trunk/bt5/erp5_dms/bt/revision
Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_uploadFile.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_uploadFile.xml?rev=13123&r1=13122&r2=13123&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_uploadFile.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_uploadFile.xml Thu Mar 1 12:24:12 2007
@@ -75,9 +75,7 @@
- determines portal types appropriate for the file type uploaded, and checks if the context portal type\n
is one of those (this is not a complete check, but all we can do at this stage)\n
- checks if context already has some data (we do not allow re-upload of files)\n
-If the context has data, it creates a copy of context (with the same portal type most important properties\n
- copied) and uploads the file into the copy (the rest is handled by portal_contributions)\n
-Otherwise it just uploads the file and calls metadata discovery script.\n
+Otherwise it just uploads the file, bumps up revision number and calls metadata discovery script.\n
\n
"""\n
\n
@@ -101,28 +99,22 @@
mapping = dict(portal_type = current_type, appropriate_type = str(candidate_type_list)))\n
return context.Base_redirect(dialog_id, keep_items = dict(portal_status_message =portal_status_message, cancel_url = kw[\'cancel_url\']), **kw)\n
\n
-if context.hasFile(): # this is a re-upload, we create a \'copy\'\n
- property_list = context.portal_types[current_type].getInstanceBaseCategoryList() # all category memberships\n
- # we copy many things, ingestion script may then overwrite some of these (if allowed)\n
- # we rely on ingestion script to determine coordinates\n
- property_list += [\'title\', \'short_title\', \'index\', \'description\'] # maybe\n
- vals = {}\n
- vals[\'source_reference\'] = file_name\n
- for prop in property_list:\n
- v = context.getProperty(prop)\n
- if v is not None:\n
- vals[prop] = v\n
- # we create new ob by portal_contributions, supplying current properties as input props\n
- ob = context.portal_contributions.newContent(portal_type = current_type, file=file, **vals)\n
- msg = translateString(\'Document already contained file data. A new document was created to which the file was uploaded.\')\n
-else:\n
- ob = context\n
- ob.manage_upload(file)\n
- ob.discoverMetadata(file_name=file_name)\n
- msg = translateString(\'File uploaded.\')\n
+context.manage_upload(file)\n
+context.discoverMetadata(file_name=file_name)\n
+\n
+# increase revision\n
+try:\n
+ current_revision = int(context.getRevision())\n
+except ValueError:\n
+ current_revision = 0\n
+\n
+rev = \'%03d\' % (current_revision + 1)\n
+context.setRevision(rev)\n
+\n
+msg = translateString(\'File uploaded.\')\n
\n
# Return to view mode\n
-return ob.Base_redirect(form_id, keep_items = {\'portal_status_message\' : msg}, **kw)\n
+return context.Base_redirect(form_id, keep_items = {\'portal_status_message\' : msg}, **kw)\n
</string> </value>
</item>
<item>
@@ -182,14 +174,10 @@
<string>str</string>
<string>portal_status_message</string>
<string>_apply_</string>
- <string>property_list</string>
- <string>vals</string>
- <string>_write_</string>
- <string>_getiter_</string>
- <string>prop</string>
- <string>v</string>
- <string>None</string>
- <string>ob</string>
+ <string>int</string>
+ <string>current_revision</string>
+ <string>ValueError</string>
+ <string>rev</string>
<string>msg</string>
</tuple>
</value>
Added: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/OOoDocument_view/my_revision.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/OOoDocument_view/my_revision.xml?rev=13123&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/OOoDocument_view/my_revision.xml (added)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/OOoDocument_view/my_revision.xml Thu Mar 1 12:24:12 2007
@@ -1,0 +1,266 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <tuple>
+ <string>Products.Formulator.StandardFields</string>
+ <string>StringField</string>
+ </tuple>
+ <none/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>my_revision</string> </value>
+ </item>
+ <item>
+ <key> <string>message_values</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>external_validator_failed</string> </key>
+ <value> <string>The input failed the external validator.</string> </value>
+ </item>
+ <item>
+ <key> <string>required_not_found</string> </key>
+ <value> <string>Input is required but no input given.</string> </value>
+ </item>
+ <item>
+ <key> <string>too_long</string> </key>
+ <value> <string>Too much input was given.</string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ <item>
+ <key> <string>overrides</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>alternate_name</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>css_class</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>default</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>description</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>display_maxwidth</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>display_width</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>editable</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>enabled</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>external_validator</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>extra</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>hidden</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>max_length</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>required</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>truncate</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>unicode</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>whitespace_preserve</string> </key>
+ <value> <string></string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ <item>
+ <key> <string>tales</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>alternate_name</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>css_class</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>default</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>description</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>display_maxwidth</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>display_width</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>editable</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>enabled</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>external_validator</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>extra</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>hidden</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>max_length</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>required</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>truncate</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>unicode</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>whitespace_preserve</string> </key>
+ <value> <string></string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ <item>
+ <key> <string>values</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>alternate_name</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>css_class</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>default</string> </key>
+ <value> <string>000</string> </value>
+ </item>
+ <item>
+ <key> <string>description</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>display_maxwidth</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>display_width</string> </key>
+ <value> <int>20</int> </value>
+ </item>
+ <item>
+ <key> <string>editable</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
+ <key> <string>enabled</string> </key>
+ <value> <int>1</int> </value>
+ </item>
+ <item>
+ <key> <string>external_validator</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>extra</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>hidden</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
+ <key> <string>max_length</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>required</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string>Revision</string> </value>
+ </item>
+ <item>
+ <key> <string>truncate</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
+ <key> <string>unicode</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
+ <key> <string>whitespace_preserve</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_dms/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/bt/revision?rev=13123&r1=13122&r2=13123&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/bt/revision (original)
+++ erp5/trunk/bt5/erp5_dms/bt/revision Thu Mar 1 12:24:12 2007
@@ -1,1 +1,1 @@
-550
+553
More information about the Erp5-report
mailing list