Diff for /MPIWGWeb/MPIWGProjects.py between versions 1.47.2.105 and 1.47.2.107

version 1.47.2.105, 2008/09/08 10:33:30 version 1.47.2.107, 2008/10/23 07:53:50
Line 20  from OFS.SimpleItem import SimpleItem Line 20  from OFS.SimpleItem import SimpleItem
 from OFS.Folder import Folder  from OFS.Folder import Folder
 from OFS.Image import Image  from OFS.Image import Image
 from AccessControl import ClassSecurityInfo  from AccessControl import ClassSecurityInfo
   from AccessControl import getSecurityManager
 from bibliography import *  from bibliography import *
 import time  import time
   from OFS.Cache import Cacheable
 #import xml.dom.minidom  #import xml.dom.minidom
 import sys  import sys
 #from Ft.Xml.XPath import Evaluate  #from Ft.Xml.XPath import Evaluate
Line 111  class MPIWGProject_image(Image): Line 113  class MPIWGProject_image(Image):
         if RESPONSE:          if RESPONSE:
             RESPONSE.redirect("../manageImages")              RESPONSE.redirect("../manageImages")
   
 class MPIWGProject(CatalogAware,Folder):  class MPIWGProject(CatalogAware,Folder,Cacheable):
     """Class for Projects"""      """Class for Projects"""
   
   
Line 752  class MPIWGProject(CatalogAware,Folder): Line 754  class MPIWGProject(CatalogAware,Folder):
                     
     def index_html(self,request=True,context=None):      def index_html(self,request=True,context=None):
         """show homepage"""          """show homepage"""
       
           bound_names={}
            
           if not context:
               context=self
           if request:
               if self.REQUEST.has_key('date') and self.REQUEST.SESSION.get('MPI_redirected',None)==None:
                   self.REQUEST.SESSION['MPI_redirected']=1
                   self.REQUEST.RESPONSE.redirect(self.checkDate(self.REQUEST['date'])+"?date="+self.REQUEST['date'])
               else:
                   self.REQUEST.SESSION['MPI_redirected']=None
           
           #ext=self.ZopeFind(self.aq_parent,obj_ids=["project_main"])
         
      
           request2=getattr(self,'REQUEST',None)
           
           if request2 is not None:
               response = request2.response
               if not response.headers.has_key('content-type'):
                   response.setHeader('content-type', 'text/html')
   
           security = getSecurityManager()
           bound_names['user'] = security.getUser()
   
         
           # Retrieve the value from the cache.
           keyset = None
           if self.ZCacheable_isCachingEnabled():
               
               # Prepare a cache key.
               keyset = {'here': self, 'params':request2['QUERY_STRING']}
                         
               result = self.ZCacheable_get(keywords=keyset)
              
               if result is not None:
                   # Got a cached value.
                   return result
           
           pt = getTemplate(self, "project_main")
            # Execute the template in a new security context.
           security.addContext(self)
   
           try:
               result = pt.pt_render(extra_context=bound_names)
               if keyset is not None:
                   # Store the result in the cache.
                   self.ZCacheable_set(result, keywords=keyset)
                  
               return result
           finally:
               security.removeContext(self)
          
   
         
       def index_html_old(self,request=True,context=None):
           """show homepage"""
         if not context:          if not context:
             context=self              context=self
         if request:          if request:
Line 913  class MPIWGProject(CatalogAware,Folder): Line 972  class MPIWGProject(CatalogAware,Folder):
             return self.preview(newcontent)              return self.preview(newcontent)
   
         self.copyObjectToArchive()          self.copyObjectToArchive()
           self.ZCacheable_invalidate()
         self.WEB_project_description=newcontent[0:]          self.WEB_project_description=newcontent[0:]
                 
         self.REQUEST.RESPONSE.redirect("./index.html")          self.REQUEST.RESPONSE.redirect("./index.html")
Line 1122  class MPIWGProject(CatalogAware,Folder): Line 1182  class MPIWGProject(CatalogAware,Folder):
             lastname=self.myCapitalize(lastname).encode('utf-8')              lastname=self.myCapitalize(lastname).encode('utf-8')
             logging.info("Search: %s %s %s"%(name,repr(firstname),repr(lastname)))              logging.info("Search: %s %s %s"%(name,repr(firstname),repr(lastname)))
             try:              try:
                 cataloggedNames=self.MembersCatalog({'firstName':firstname,'lastName':lastname})                  cataloggedNames=self.MembersCatalog(firstName=firstname,lastName=lastname)
             except:              except:
                 cataloggedNames=[]                  cataloggedNames=[]
                 logging.error("ERROR: identifyNames %s %s"%sys.exc_info()[0:2])                  logging.error("ERROR: identifyNames %s %s"%sys.exc_info()[0:2])
Line 1145  class MPIWGProject(CatalogAware,Folder): Line 1205  class MPIWGProject(CatalogAware,Folder):
         """edit the project and archive the old version"""          """edit the project and archive the old version"""
                   
         self.copyObjectToArchive() # archive the object          self.copyObjectToArchive() # archive the object
           self.ZCacheable_invalidate()
   
         for x in definedFields:          for x in definedFields:
             if self.REQUEST.has_key(x):              if self.REQUEST.has_key(x):

Removed from v.1.47.2.105  
changed lines
  Added in v.1.47.2.107


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