--- versionedFile/extVersionedFile.py 2006/10/04 07:35:27 1.1 +++ versionedFile/extVersionedFile.py 2007/06/25 11:05:03 1.5 @@ -1,3 +1,8 @@ +"""actual version of the versioned file folder with external filestorage, +using the ExtFile Product, this version replaces externaVersionedFile.py +DW 11.10.2006 +""" + from OFS.Folder import Folder from OFS.Image import File from OFS.Image import cookId @@ -17,14 +22,14 @@ try: except: print "no images" - from threading import Thread import shutil import tempfile import os.path import urllib - import time +import logging + try: from Products.ECHO_content.ECHO_collection import ECHO_basis except: @@ -71,7 +76,7 @@ class generateDownloadZip: savePath=os.path.join(tmpPath,lastV.title) fh=file(savePath,"w") - fh.write(lastV.data) + fh.write(lastV.getData()) fh.close() self.response+="

2. step: creating the downloadable file

" @@ -421,7 +426,7 @@ class extVersionedFileFolder(Folder,ECHO def header_html(self): - """zusätzlicher header""" + """zusaetzlicher header""" ext=self.ZopeFind(self,obj_ids=["header.html"]) if ext: return ext[0][1]() @@ -472,7 +477,8 @@ class extVersionedFileFolder(Folder,ECHO ob.title=id file2=file - obj=ob.manage_addextVersionedFileObject(id,vC,author,file2,content_type=content_type) + logging.info("ADD: %s"%repr(ob)) + obj=ob.manage_addVersionedFileObject(id,vC,author,file2,content_type=content_type) self.REQUEST.SESSION['objID']=ob.getId() self.REQUEST.SESSION['objID_parent']=None @@ -861,7 +867,7 @@ class extVersionedFile(CatalogAware,Fold def diff(self,data): """differenz between lastversion and data""" d=Differ() - tmp=self.getLastVersion().data + tmp=self.getLastVersion().getData() #print "XX",data,tmp try: l=list(d.compare(data.splitlines(1),tmp.splitlines(1))) @@ -880,10 +886,10 @@ class extVersionedFile(CatalogAware,Fold security.declarePublic('index_html') def index_html(self): """main view""" - lastVersion=self.getLastVersion() + #lastVersion=self.getLastVersion() #return "File:"+self.title+" Version:%i"%lastVersion.versionNumber," modified:",lastVersion.bobobase_modification_time()," size:",lastVersion.getSize(),"modified by:",lastVersion.lastEditor() - return "File: %s Version:%i modified:%s size:%s modified by:%s"%(self.title,lastVersion.versionNumber,lastVersion.getTime(),lastVersion.getSize(),lastVersion.lastEditor()) - + #return "File: %s Version:%i modified:%s size:%s modified by:%s"%(self.title,lastVersion.versionNumber,lastVersion.getTime(),lastVersion.getSize(),lastVersion.lastEditor()) + return self.history() security.declarePublic('getVersion')