version 1.32, 2009/06/21 11:28:55
|
version 1.34, 2009/08/31 14:07:35
|
Line 530 class extVersionedFileFolder(Folder,ECHO
|
Line 530 class extVersionedFileFolder(Folder,ECHO
|
vf = self._newVersionedFile(id,title=id) |
vf = self._newVersionedFile(id,title=id) |
logging.error("addFile id=%s vf=%s of %s"%(repr(id),repr(vf),repr(self))) |
logging.error("addFile id=%s vf=%s of %s"%(repr(id),repr(vf),repr(self))) |
# add its content (and don't index) |
# add its content (and don't index) |
|
self._setObject(id,vf) |
|
vf=getattr(self,id) |
|
|
obj=vf.addContentObject(id,vC,author=author,file=file,content_type=content_type,from_tmp=isRealFile,index=False) |
obj=vf.addContentObject(id,vC,author=author,file=file,content_type=content_type,from_tmp=isRealFile,index=False) |
# add file to this folder (this should do the indexing) |
# add file to this folder (this should do the indexing) |
self._setObject(id,vf) |
#self._setObject(id,vf) |
|
|
try: |
try: |
self.REQUEST.SESSION['objID']=vf.getId() |
self.REQUEST.SESSION['objID']=vf.getId() |
Line 1116 class extVersionedFile(CatalogAware,Fold
|
Line 1119 class extVersionedFile(CatalogAware,Fold
|
"""unlock""" |
"""unlock""" |
if str(self.lockedBy) in [str(self.REQUEST['AUTHENTICATED_USER'])]: |
if str(self.lockedBy) in [str(self.REQUEST['AUTHENTICATED_USER'])]: |
self.lockedBy='' |
self.lockedBy='' |
self.redirect(RESPONSE,self.REQUEST['HTTP_REFERER'],) |
RESPONSE.redirect(self.REQUEST['HTTP_REFERER']) |
else: |
else: |
return "Sorry, not locked by you! (%s,%s)"%(self.lockedBy,self.REQUEST['AUTHENTICATED_USER']) |
return "Sorry, not locked by you! (%s,%s)"%(self.lockedBy,self.REQUEST['AUTHENTICATED_USER']) |
|
|
|
|
|
|
def _newContentObject(self, id, title='', versionNumber=0, versionComment=None, time=None, author=None): |
def _newContentObject(self, id, title='', versionNumber=0, versionComment=None, time=None, author=None): |
"""factory for content objects. to be overridden in derived classes.""" |
"""factory for content objects. to be overridden in derived classes.""" |
return extVersionedFileObject(id,title,versionNumber=versionNumber,versionComment=versionComment,time=time,author=author) |
return extVersionedFileObject(id,title,versionNumber=versionNumber,versionComment=versionComment,time=time,author=author) |