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): ...@@ -424,7 +424,9 @@ class ContributionTool(BaseTool):
return result return result
# Return an object listed by listDAVObjects # 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) object = self.getPortalObject().portal_catalog.unrestrictedGetResultValue(uid=uid)
if object is not None: if object is not None:
return object.getObject() # Make sure this does not break security. XXX return object.getObject() # Make sure this does not break security. XXX
...@@ -451,12 +453,8 @@ class ContributionTool(BaseTool): ...@@ -451,12 +453,8 @@ class ContributionTool(BaseTool):
def wrapper(o_list): def wrapper(o_list):
for o in o_list: for o in o_list:
o = o.getObject() o = o.getObject()
reference = o.getReference() id = '%s-%s' % (o.getUid(), o.getStandardFileName(),)
if reference: yield o.asContext(id=id)
id = '%s-%s' % (reference, o.getUid())
else:
id = '%s' % o.getUid()
yield o.getObject().asContext(id=id)
return wrapper(object_list) 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