Diff for /versionedFile/extVersionedFile.py between versions 1.21 and 1.26

version 1.21, 2008/06/26 18:01:05 version 1.26, 2008/08/19 14:43:25
Line 514  class extVersionedFileFolder(Folder,ECHO Line 514  class extVersionedFileFolder(Folder,ECHO
                   
         # get new extVersionedFile          # get new extVersionedFile
         vf = self._newVersionedFile(id,title=id)          vf = self._newVersionedFile(id,title=id)
         logging.debug("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)
         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)
Line 613  class extVersionedFileObject(ExtFile): Line 613  class extVersionedFileObject(ExtFile):
         self.time = time          self.time = time
         self.author = author          self.author = author
   
       security.declareProtected('manage','changeObject')
       def changeObject(self,**args):
           """modify any of the objects attributes"""
           for arg in args:
               if hasattr(self, arg):
                   logging.debug("changeObject %s: %s=%s"%(repr(self),arg,args[arg]))
                   setattr(self, arg, args[arg])
   
     security.declarePublic('getTitle')      security.declarePublic('getTitle')
     def getTitle(self):      def getTitle(self):
Line 685  class extVersionedFileObject(ExtFile): Line 692  class extVersionedFileObject(ExtFile):
     #self.REQUEST.RESPONSE.setHeader("Content-Length","str(len(txt)+1000)")      #self.REQUEST.RESPONSE.setHeader("Content-Length","str(len(txt)+1000)")
                   
         self.content_type="application/octet-stream"          self.content_type="application/octet-stream"
         self.REQUEST.RESPONSE.redirect(self.absolute_url())          return self.getData()
           #self.REQUEST.RESPONSE.redirect(self.absolute_url())
         #txt=urllib.urlopen(self.absolute_url()).read()          #txt=urllib.urlopen(self.absolute_url()).read()
         #self.REQUEST.RESPONSE.write(txt)          #self.REQUEST.RESPONSE.write(txt)
           
Line 790  class extVersionedFile(CatalogAware,Fold Line 798  class extVersionedFile(CatalogAware,Fold
         self.id=id          self.id=id
         self.title=title          self.title=title
         self.lockedBy=lockedBy          self.lockedBy=lockedBy
           if self.lockedBy is None:
               self.lockedBy = ''
         self.author=author          self.author=author
         self.lastVersionNumber=0          self.lastVersionNumber=0
         self.lastVersionId=None          self.lastVersionId=None
Line 889  class extVersionedFile(CatalogAware,Fold Line 899  class extVersionedFile(CatalogAware,Fold
           
     def getLockedBy(self):      def getLockedBy(self):
         """get locked by"""          """get locked by"""
           if self.lockedBy is None:
               self.lockedBy = ''
         return str(self.lockedBy)          return str(self.lockedBy)
           
     def getLastVersionNumber(self):      def getLastVersionNumber(self):
Line 1179  class extVersionedFile(CatalogAware,Fold Line 1191  class extVersionedFile(CatalogAware,Fold
                   
     def download(self):      def download(self):
         """download"""          """download"""
         self.REQUEST.RESPONSE.setHeader("Content-Disposition","""attachement; filename=%s"""%self.getContentObject().getId())      
         self.REQUEST.RESPONSE.setHeader("Content-Type","application/octet-stream")          txt=self.REQUEST['URL1']+'/'+self.getId()+'/'+self.getContentObject().getId()+'/download'
         self.content_type="application/octet-stream"          
         self.REQUEST.RESPONSE.redirect(self.REQUEST['URL1']+'/'+self.getId()+'/'+self.getContentObject().getId())          self.REQUEST.RESPONSE.redirect(txt)
   
           
     security.declareProtected('AUTHENTICATED_USER','downloadLocked')          security.declareProtected('AUTHENTICATED_USER','downloadLocked')    

Removed from v.1.21  
changed lines
  Added in v.1.26


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>