version 1.12, 2007/09/14 15:08:02
|
version 1.17, 2007/11/23 18:51:39
|
Line 555 class extVersionedFileFolder(Folder,ECHO
|
Line 555 class extVersionedFileFolder(Folder,ECHO
|
"""fix last version number of all files""" |
"""fix last version number of all files""" |
for (id,vf) in self.getVersionedFiles(): |
for (id,vf) in self.getVersionedFiles(): |
vf.fixVersionNumbers() |
vf.fixVersionNumbers() |
|
# recursively |
|
for (id,vf) in self.objectItems(self.meta_type): |
|
vf.fixVersionNumbers() |
|
|
|
|
manage_addextVersionedFileFolderForm=DTMLFile('dtml/extfolderAdd', globals()) |
manage_addextVersionedFileFolderForm=DTMLFile('dtml/extfolderAdd', globals()) |
Line 770 class extVersionedFile(CatalogAware,Fold
|
Line 773 class extVersionedFile(CatalogAware,Fold
|
meta_type = 'extVersionedFile' |
meta_type = 'extVersionedFile' |
# meta_type of contained objects |
# meta_type of contained objects |
content_meta_type = ['extVersionedFileObject'] |
content_meta_type = ['extVersionedFileObject'] |
|
# default catalog for extVersionedFile objects |
default_catalog = 'fileCatalog' |
default_catalog = 'fileCatalog' |
|
|
|
manage_options = Folder.manage_options+({'label':'Main Config','action':'changeVersionedFileForm'},) |
|
|
|
|
security=ClassSecurityInfo() |
security=ClassSecurityInfo() |
|
|
def __init__(self, id, title, lockedBy,author): |
def __init__(self, id, title, lockedBy,author): |
Line 918 class extVersionedFile(CatalogAware,Fold
|
Line 925 class extVersionedFile(CatalogAware,Fold
|
|
|
def getContentObject(self): |
def getContentObject(self): |
"""returns the last version object""" |
"""returns the last version object""" |
if not self.lastVersionId: |
if not hasattr(self, 'lastVersionId'): |
|
# find last version and save it |
lv = self.findLastVersion() |
lv = self.findLastVersion() |
if lv is None: |
if lv is None: |
return None |
return None |
Line 1120 class extVersionedFile(CatalogAware,Fold
|
Line 1128 class extVersionedFile(CatalogAware,Fold
|
return ob |
return ob |
|
|
|
|
|
changeVersionedFileForm = PageTemplateFile('zpt/changeVersionedFile', globals()) |
|
|
|
def manage_changeVersionedFile(self,title,vC,author,comment,RESPONSE=None): |
|
"""Change VersionedFile metadata""" |
|
self.title = title |
|
self.author = author |
|
cob = self.getContentObject() |
|
if cob: |
|
if vC: |
|
cob.vComment=vC |
|
|
|
if comment=='': |
|
cob.versionComment=None |
|
else: |
|
cob.versionComment=comment |
|
|
|
if RESPONSE: |
|
RESPONSE.redirect('manage_main') |
|
|
|
|
def download(self): |
def download(self): |
"""download and lock""" |
"""download""" |
self.REQUEST.RESPONSE.setHeader("Content-Disposition","""attachement; filename=%s"""%self.getContentObject().getId()) |
self.REQUEST.RESPONSE.setHeader("Content-Disposition","""attachement; filename=%s"""%self.getContentObject().getId()) |
self.REQUEST.RESPONSE.setHeader("Content-Type","application/octet-stream") |
self.REQUEST.RESPONSE.setHeader("Content-Type","application/octet-stream") |
self.content_type="application/octet-stream" |
self.content_type="application/octet-stream" |
self.REQUEST.RESPONSE.redirect(self.REQUEST['URL1']+'/'+self.getId()+'/'+self.getContentObject().getId()) |
self.REQUEST.RESPONSE.redirect(self.REQUEST['URL1']+'/'+self.getId()+'/'+self.getContentObject().getId()) |
|
|
|
|
security.declareProtected('AUTHENTICATED_USER','downloadLocked') |
security.declareProtected('AUTHENTICATED_USER','downloadLocked') |
def downloadLocked(self): |
def downloadLocked(self): |
"""download and lock""" |
"""download and lock""" |