[Erp5-report] r32170 fabien - /erp5/trunk/products/ERP5/Document/WebSection.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Feb 2 13:43:22 CET 2010


Author: fabien
Date: Tue Feb  2 13:43:21 2010
New Revision: 32170

URL: http://svn.erp5.org?rev=32170&view=rev
Log:
add view parameter :
 If view is True, the url returned point to html content and can be opened in
 a browser (ie. + '/view' for ooo documents), if not the url returned point to
 the file. (in case of html document like Web Page, the url to the document is
 always returned)

Modified:
    erp5/trunk/products/ERP5/Document/WebSection.py

Modified: erp5/trunk/products/ERP5/Document/WebSection.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/WebSection.py?rev=32170&r1=32169&r2=32170&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/WebSection.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/WebSection.py [utf8] Tue Feb  2 13:43:21 2010
@@ -276,11 +276,14 @@
       return result
 
     security.declareProtected(Permissions.View, 'getPermanentURL')
-    def getPermanentURL(self, document):
+    def getPermanentURL(self, document, view=True):
       """
         Return a permanent URL of document in the context
         of the current section.
 
+        If view is True, the url returned point to html content and can be
+        opened in a browser (ie. + '/view' for ooo documents)
+
         This method must be implemented through a
         portal type dependent script:
           WebSection_getPermanentURL
@@ -294,7 +297,8 @@
           pass
 
       result = self._getTypeBasedMethod('getPermanentURL',
-                     fallback_script_id='WebSection_getPermanentURL')(document)
+                     fallback_script_id='WebSection_getPermanentURL')(document,
+                         view=view)
 
       if cache is not None:
         cache[key] = result




More information about the Erp5-report mailing list