Diff for /versionedFile/versionedFile.py between versions 1.55 and 1.57

version 1.55, 2005/12/08 17:12:21 version 1.57, 2006/05/10 16:58:49
Line 518  class versionedFileObject(File): Line 518  class versionedFileObject(File):
     manage_editForm._setName('manage_editForm')      manage_editForm._setName('manage_editForm')
   
   
     security.declarePublic('getVComment')      security.declarePublic('getTitle')
   
       def getTitle(self):
           """get title"""
           return self.title
   
       security.declarePublic('getVComment')
     def getVComment(self):      def getVComment(self):
         """get the comment of this file"""          """get the comment of this file"""
         if not hasattr(self,'vComment') or (not self.vComment) or (self.vComment.lstrip()==""):          if not hasattr(self,'vComment') or (not self.vComment) or (self.vComment.lstrip()==""):
Line 597  class versionedFileObject(File): Line 602  class versionedFileObject(File):
   
         #self.REQUEST.close()          #self.REQUEST.close()
           
       security.declareProtected('AUTHENTICATED_USER','downloadLocked')    
     def downloadLocked(self):      def downloadLocked(self):
         """download and lock"""          """download and lock"""
                   
                   
         if self.REQUEST['AUTHENTICATED_USER']=='Anonymous User':          if repr(self.REQUEST['AUTHENTICATED_USER'])=='Anonymous User':
             return "please login first"              return "please login first"
         if not self.aq_parent.lockedBy=="":          if not self.aq_parent.lockedBy=="":
             return "cannot be locked because is already locked by %s"%self.lockedBy              return "cannot be locked because is already locked by %s"%self.lockedBy
Line 693  class versionedFile(CatalogAware,Folder) Line 699  class versionedFile(CatalogAware,Folder)
   
     default_catalog='fileCatalog'      default_catalog='fileCatalog'
           
       def getTitle(self):
           """get title"""
           return self.title
       
     def PrincipiaSearchSource(self):      def PrincipiaSearchSource(self):
            """Return cataloguable key for ourselves."""             """Return cataloguable key for ourselves."""
            return str(self)             return str(self)
Line 826  class versionedFile(CatalogAware,Folder) Line 836  class versionedFile(CatalogAware,Folder)
         #return "File:"+self.title+"  Version:%i"%lastVersion.versionNumber," modified:",lastVersion.bobobase_modification_time()," size:",lastVersion.getSize(),"modified by:",lastVersion.lastEditor()          #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())
     security= ClassSecurityInfo()                                 security= ClassSecurityInfo()                           
   
        
     security.declarePublic('getVersion')                                                    security.declarePublic('getVersion')                                              
     def getVersion(self):      def getVersion(self):
         tmp=0          tmp=0
Line 869  class versionedFile(CatalogAware,Folder) Line 881  class versionedFile(CatalogAware,Folder)
         """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=''
             RESPONSE.redirect(self.REQUEST['URL2'])              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'])
                   
Line 964  class versionedFile(CatalogAware,Folder) Line 976  class versionedFile(CatalogAware,Folder)
         #self.getLastVersion().content_type="application/octet-stream"          #self.getLastVersion().content_type="application/octet-stream"
         self.REQUEST.RESPONSE.redirect(self.REQUEST['URL1']+'/'+self.getId()+'/'+self.getLastVersion().getId())          self.REQUEST.RESPONSE.redirect(self.REQUEST['URL1']+'/'+self.getId()+'/'+self.getLastVersion().getId())
           
       security.declareProtected('AUTHENTICATED_USER','downloadLocked')    
     def downloadLocked(self):      def downloadLocked(self):
         """download and lock"""          """download and lock"""
         if self.REQUEST['AUTHENTICATED_USER']=='Anonymous User':  
           if repr(self.REQUEST['AUTHENTICATED_USER'])=='Anonymous User':
             return "please login first"              return "please login first"
         if not self.lockedBy=="":          if not self.lockedBy=="":
             return "cannot be locked because is already locked by %s"%self.lockedBy              return "cannot be locked because is already locked by %s"%self.lockedBy

Removed from v.1.55  
changed lines
  Added in v.1.57


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