Diff for /zogiLib/zogiLib.py between versions 1.34 and 1.35

version 1.34, 2004/07/21 17:44:51 version 1.35, 2004/07/22 17:19:22
Line 388  class zogiLib(Folder): Line 388  class zogiLib(Folder):
             {'label':'Main Config','action':'changeZogiLibForm'},              {'label':'Main Config','action':'changeZogiLibForm'},
             )              )
   
     def __init__(self, id, title, digilibBaseURL,localFileBase, version="book", basePath="", dlTarget=None, dlServerURL=None):      def __init__(self, id, title, dlServerURL,localFileBase, version="book", basePath="", dlTarget=None):
         """init"""          """init"""
   
         self.id=id          self.id=id
         self.title=title          self.title=title
         self.digilibBaseURL=digilibBaseURL  
         self.dlServerURL = dlServerURL          self.dlServerURL = dlServerURL
         if digilibBaseURL and not dlServerURL:  
             self.dlServerURL = re.sub("/servlet/Scaler\?","",self.digilibBaseURL)  
   
         self.localFileBase=localFileBase          self.localFileBase=localFileBase
         self.basePath=basePath          self.basePath=basePath
Line 566  class zogiLib(Folder): Line 563  class zogiLib(Folder):
         # if not explicitly defined take normal request          # if not explicitly defined take normal request
         if not requestString:          if not requestString:
             requestString = self.getAllDLParams()              requestString = self.getAllDLParams()
         url = self.digilibBaseURL+requestString          url = self.dlServerURL+'/servlet/Scaler?'+requestString
         # construct bottom and side insets          # construct bottom and side insets
         b_par = ""          b_par = ""
         s_par = ""          s_par = ""
Line 635  class zogiLib(Folder): Line 632  class zogiLib(Folder):
     def optionwindow(self):      def optionwindow(self):
         """showoptions"""          """showoptions"""
     self.checkQuery()      self.checkQuery()
           if self.REQUEST.has_key('frametarget'):
               self.dlTarget = self.REQUEST['frametarget']
           print "current dltarget: ", self.dlTarget
     bt = self.REQUEST.SESSION['browserType']      bt = self.REQUEST.SESSION['browserType']
         if bt['staticHTML']:          if bt['staticHTML']:
             pt=PageTemplateFile(os.path.join(package_home(globals()), 'zpt/optionwindow_static.zpt')).__of__(self)              pt=PageTemplateFile(os.path.join(package_home(globals()), 'zpt/optionwindow_static.zpt')).__of__(self)
Line 1094  class zogiLib(Folder): Line 1094  class zogiLib(Folder):
         pt=PageTemplateFile(os.path.join(package_home(globals()), 'zpt/changeZogiLibForm.zpt')).__of__(self)          pt=PageTemplateFile(os.path.join(package_home(globals()), 'zpt/changeZogiLibForm.zpt')).__of__(self)
         return pt()          return pt()
           
     def changeZogiLib(self,title,digilibBaseURL, localFileBase, version, basePath, dlTarget, RESPONSE=None):      def changeZogiLib(self,title,dlServerURL, localFileBase, version, basePath, dlTarget, RESPONSE=None):
         """change it"""          """change it"""
         self.title=title          self.title=title
         self.digilibBaseURL=digilibBaseURL          self.dlServerURL=dlServerURL
         self.localFileBase=localFileBase          self.localFileBase=localFileBase
         self.basePath = basePath          self.basePath = basePath
         self.layout=version          self.layout=version
Line 1110  class zogiLib(Folder): Line 1110  class zogiLib(Folder):
             RESPONSE.redirect('manage_main')              RESPONSE.redirect('manage_main')
   
                       
   
       ##
       ## odd stuff
       ##
   
       def repairZogilib(self, obj=None):
           """change stuff that broke on upgrading"""
   
           msg = ""
   
           if not obj:
               obj = self.getPhysicalRoot()
   
           print "starting in ", obj
           
           entries=obj.ZopeFind(obj,obj_metatypes=['zogiLib'],search_sub=1)
   
           for entry in entries:
               print "  found ", entry
               if hasattr(entry[1], 'digilibBaseUrl'):
                   msg += "  fixing "+entry[0]+"/n"
                   entry[1].dlServerURL = re.sub('/servlet/Scaler?','',entry[1].digilibBaseUrl)
                   del entry[1].digilibBaseUrl
                   
           return msg+"\n\nfixed all zogilib instances in: "+obj.title
   
             
 def manage_addZogiLibForm(self):  def manage_addZogiLibForm(self):
     """interface for adding zogilib"""      """interface for adding zogilib"""
     pt=PageTemplateFile(os.path.join(package_home(globals()), 'zpt/addZogiLibForm')).__of__(self)      pt=PageTemplateFile(os.path.join(package_home(globals()), 'zpt/addZogiLibForm')).__of__(self)
     return pt()      return pt()
   
 def manage_addZogiLib(self,id,title,digilibBaseURL, localFileBase,version="book",basePath="",dlTarget="digilib",RESPONSE=None):  def manage_addZogiLib(self,id,title,dlServerURL, localFileBase,version="book",basePath="",dlTarget="digilib",RESPONSE=None):
     """add dgilib"""      """add dgilib"""
     newObj=zogiLib(id,title,digilibBaseURL, localFileBase, version, basePath, dlTarget)      newObj=zogiLib(id,title,dlServerURL, localFileBase, version, basePath, dlTarget)
     self.Destination()._setObject(id,newObj)      self.Destination()._setObject(id,newObj)
     if RESPONSE is not None:      if RESPONSE is not None:
         RESPONSE.redirect('manage_main')          RESPONSE.redirect('manage_main')
Line 1159  def manage_addZogiLibPageTemplate(self, Line 1186  def manage_addZogiLibPageTemplate(self,
     u = "%s/%s" % (u, urllib.quote(id))      u = "%s/%s" % (u, urllib.quote(id))
     REQUEST.RESPONSE.redirect(u+'/manage_main')      REQUEST.RESPONSE.redirect(u+'/manage_main')
     return ''      return ''
   

Removed from v.1.34  
changed lines
  Added in v.1.35


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