Diff for /MPIWGWeb/MPIWGStaff.py between versions 1.10.2.77 and 1.10.2.81

version 1.10.2.77, 2012/01/02 17:14:44 version 1.10.2.81, 2012/01/09 13:14:46
Line 26  import email Line 26  import email
 import re  import re
 from OFS.Cache import Cacheable  from OFS.Cache import Cacheable
 import urllib2  import urllib2
   import transaction
 from MPIWGHelper import *  from MPIWGHelper import *
 #ersetzt logging  #ersetzt logging
 def logger(txt,method,txt2):  def logger(txt,method,txt2):
Line 34  def logger(txt,method,txt2): Line 34  def logger(txt,method,txt2):
     logging.info(txt+ txt2)      logging.info(txt+ txt2)
   
 departmentList="Renn\nRheinberger\nDaston\nKlein\nSibum\nIT\nInstitut\nBibliothek"  departmentList="Renn\nRheinberger\nDaston\nKlein\nSibum\nIT\nInstitut\nBibliothek"
 coneService="http://127.0.0.1:8280/MetaDataManagerRestlet/cone/"  coneService="http://127.0.0.1:8280/MetaDataManagerRestlet/cone/" # kann in MPIWGRoot konfiguriert werden.
   
   
   
Line 99  class MPIWGStaff(CatalogAware,ZSQLExtend Line 99  class MPIWGStaff(CatalogAware,ZSQLExtend
                   
     def getKeyUTF8(self):      def getKeyUTF8(self):
         """get db_key utf8"""          """get db_key utf8"""
           logging.debug("KEY - MPIWGStaff:"+self.getKey())
           logging.debug("KEY - MPIWGStaff:"+utf8ify(self.getKey()))
           
         return utf8ify(self.getKey())          return utf8ify(self.getKey())
           
     def setKey(self,key):      def setKey(self,key):
Line 321  class MPIWGStaff(CatalogAware,ZSQLExtend Line 324  class MPIWGStaff(CatalogAware,ZSQLExtend
   
     def getConeUrl(self):      def getConeUrl(self):
         """gibt coneURL zurueck"""          """gibt coneURL zurueck"""
           
           self.coneService=getattr(self, "coneServiceURL",coneService)
           logging.debug("coneservice:"+self.coneService)
         if self._v_cone==None:          if self._v_cone==None:
             try:                try:  
                 cone = urllib2.urlopen(coneService+self.getPersonID())                                cone = urllib2.urlopen(self.coneService+self.getPersonID())              
                 self._v_cone=cone.read()                  self._v_cone=cone.read()
             except:              except:
                 return None                  return None
Line 352  class MPIWGStaff(CatalogAware,ZSQLExtend Line 358  class MPIWGStaff(CatalogAware,ZSQLExtend
   
         return pt()          return pt()
   
     def harvest_page(self):      def harvest_page(self,mode="normal"):
         """harvest"""          """harvest"""
          
         if not self.isPublished():          if not self.isPublished():
             return ""              return 
         st = getattr(self.en.staff.members,self.getId()).index_html()          st = getattr(self.en.staff.members,self.getId()).index_html(mode)
     return st          
           templates = self.en.getHarvestCache()
           #templates = getattr(self,'getHarvestCache',self.en.getHarvestCache)()
           rendered = st
           templates[self.absolute_url()]=rendered
           transaction.commit()
           return rendered
                   
           
     def index_html(self):      
       def index_html(self,mode="normal"):
         """show homepage"""          """show homepage"""
           
         bound_names={}          bound_names={}
Line 391  class MPIWGStaff(CatalogAware,ZSQLExtend Line 405  class MPIWGStaff(CatalogAware,ZSQLExtend
             pt = getattr(self, "index.html")              pt = getattr(self, "index.html")
         # else use template          # else use template
         else:          else:
               if mode=="slim":
                   pt = getTemplate(self, "members_main_slim")
               else:
             pt = getTemplate(self, "members_main")              pt = getTemplate(self, "members_main")
         # Execute the template in a new security context.          # Execute the template in a new security context.
         security.addContext(self)          security.addContext(self)

Removed from v.1.10.2.77  
changed lines
  Added in v.1.10.2.81


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