Commit 0f555fe0 authored by Bartek Górny's avatar Bartek Górny

fixed webdav listing problem (thx Ivan); added PUT method which does ingestion

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11402 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 772a708d
...@@ -177,9 +177,11 @@ class DMSFile(XMLObject,File): ...@@ -177,9 +177,11 @@ class DMSFile(XMLObject,File):
''' '''
try: try:
return len(self.data) return len(self.data)
except AttributeError: except (AttributeError, TypeError):
return 0 return 0
getcontentlength=get_size
security.declareProtected(Permissions.View,'hasFile') security.declareProtected(Permissions.View,'hasFile')
def hasFile(self): def hasFile(self):
""" """
...@@ -274,9 +276,14 @@ class DMSFile(XMLObject,File): ...@@ -274,9 +276,14 @@ class DMSFile(XMLObject,File):
ref=self.getReference() ref=self.getReference()
return [o for o in di.keys() if o.getReference()!=ref] # every object has its own reference in SearchableText return [o for o in di.keys() if o.getReference()!=ref] # every object has its own reference in SearchableText
security.declareProtected(Permissions.ModifyPortalContent,'PUT')
def PUT(self,REQUEST,RESPONSE):
CMFFile.PUT(self,REQUEST,RESPONSE)
self.DMS_ingestFile(fname=self.getId())
# BG copied from File in case # BG copied from File in case
index_html = CMFFile.index_html index_html = CMFFile.index_html
PUT = CMFFile.PUT #PUT = CMFFile.PUT
security.declareProtected('FTP access', 'manage_FTPget', 'manage_FTPstat', 'manage_FTPlist') security.declareProtected('FTP access', 'manage_FTPget', 'manage_FTPstat', 'manage_FTPlist')
manage_FTPget = CMFFile.manage_FTPget manage_FTPget = CMFFile.manage_FTPget
manage_FTPlist = CMFFile.manage_FTPlist manage_FTPlist = CMFFile.manage_FTPlist
......
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