version 1.10, 2007/09/14 12:06:55
|
version 1.11, 2007/09/14 14:58:28
|
Line 217 class extVersionedFileFolder(Folder,ECHO
|
Line 217 class extVersionedFileFolder(Folder,ECHO
|
|
|
for (vfn, vf) in vff.getVersionedFiles(): |
for (vfn, vf) in vff.getVersionedFiles(): |
if vf.meta_type == 'versionedFile': |
if vf.meta_type == 'versionedFile': |
|
logging.error("importvff: importing %s of type %s!"%(vfn,vf.meta_type)) |
title = vf.title |
title = vf.title |
author = vf.author |
fob = vf.getLastVersion() |
vc = getattr(vf.comment, "") |
author = fob.getLastEditor() |
|
vc = fob.getVersionComment() |
# save file to filesystem |
# save file to filesystem |
savePath=os.path.join(tmpPath,title) |
savePath=os.path.join(tmpPath,title) |
fh=file(savePath,"w") |
fh=file(savePath,"w") |
fh.write(lastV.getData()) |
data = vf.getLastVersion().data |
|
if isinstance(data, str): |
|
# simple data object |
|
fh.write(data) |
|
else: |
|
# chained data objects |
|
while data is not None: |
|
fh.write(data.data) |
|
data = data.next |
fh.close() |
fh.close() |
# and read in again |
# and read in again |
fh = file(savePath) |
fh = file(savePath) |
|
logging.error("importvff: comment=%s author=%s!"%(vc,author)) |
self.addFile(vC=vc, file=fh, author=author) |
self.addFile(vC=vc, file=fh, author=author) |
|
# copy more fields |
|
newfob = getattr(self, vfn).getContentObject() |
|
newfob.vComment = fob.vComment |
|
newfob.time = fob.time |
|
logging.error("importvff: vc=%s time=%s of %s!"%(fob.vComment,fob.time,fob.getId())) |
|
|
else: |
else: |
logging.error("importvff: unable to import %s of type %s!"%(vfn,vf.meta_type)) |
logging.error("importvff: unable to import %s of type %s!"%(vfn,vf.meta_type)) |
Line 492 class extVersionedFileFolder(Folder,ECHO
|
Line 508 class extVersionedFileFolder(Folder,ECHO
|
else: |
else: |
id=newName |
id=newName |
|
|
if not vC: |
if vC is None: |
vC=self.REQUEST.form['vC'] |
vC=self.REQUEST.form['vC'] |
|
|
# get new extVersionedFile |
# get new extVersionedFile |