Commit 19938528 authored by Nicolas Delaby's avatar Nicolas Delaby

Change id generation of Documentsftech from catalog with

uid + Standard File Name
It enables displaying extension of document in webdav browser and associate
viewer program to document nicer.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37017 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 59aa416a
......@@ -424,7 +424,9 @@ class ContributionTool(BaseTool):
return result
# Return an object listed by listDAVObjects
uid = str(id).split('-')[-1]
# ids are concatenation of uid + '-' + standard file name of documents
# get the uid
uid = str(id).split('-', 1)[0]
object = self.getPortalObject().portal_catalog.unrestrictedGetResultValue(uid=uid)
if object is not None:
return object.getObject() # Make sure this does not break security. XXX
......@@ -451,12 +453,8 @@ class ContributionTool(BaseTool):
def wrapper(o_list):
for o in o_list:
o = o.getObject()
reference = o.getReference()
if reference:
id = '%s-%s' % (reference, o.getUid())
else:
id = '%s' % o.getUid()
yield o.getObject().asContext(id=id)
id = '%s-%s' % (o.getUid(), o.getStandardFileName(),)
yield o.asContext(id=id)
return wrapper(object_list)
......
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