Commit fd47123a authored by Fabien Morin's avatar Fabien Morin

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)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32170 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fd1e8b66
......@@ -276,11 +276,14 @@ class WebSection(Domain, PermanentURLMixIn):
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 @@ class WebSection(Domain, PermanentURLMixIn):
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
......
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