Diff for /ECHO_content/VLPExtension.py between versions 1.40 and 1.41

version 1.40, 2005/02/28 14:09:55 version 1.41, 2005/02/28 20:02:08
Line 338  def manage_addVLP_encyc(self, id,title,l Line 338  def manage_addVLP_encyc(self, id,title,l
     if RESPONSE is not None:      if RESPONSE is not None:
         RESPONSE.redirect('manage_main')          RESPONSE.redirect('manage_main')
           
   class VLP_subcollection(ECHO_collection):
       """ subcollection of elements"""
   
       meta_type="VLP_subcollection"
       def generateSubCollectionFromDB(self):
           """erzeuge subcollection"""
           for item in self.ZSQLSimpleSearch("select * from vl_literature where volumeid like '%s'"%self.id):
               manage_addECHO_link(self,item.reference,item.titlerefdisplay,item.titlerefdisplay)
   
       def index_html(self):
           """erzeuge darstellung"""
           pt=zptFile(self, 'vlp/collection_template.zpt')
           return pt()
   
   
   def manage_addVLP_subCollection(self,id,title,label,RESPONSE=None):
   
       self._setObject(id,VLP_subcollection(id,title,label))
   
       if RESPONSE is not None:
           RESPONSE.redirect('manage_main')
   
   
 class VLP_collection(ECHO_collection):  class VLP_collection(ECHO_collection):
     """VLP spezifische Erweiterung der Collection"""      """VLP spezifische Erweiterung der Collection"""
   
       
     meta_type="VLP_collection"      meta_type="VLP_collection"
     manage_options=ECHO_collection.manage_options+(      manage_options=ECHO_collection.manage_options+(
         {'label':'Change Path','action':'VLP_path_configForm'},          {'label':'Change Path','action':'VLP_path_configForm'},
Line 349  class VLP_collection(ECHO_collection): Line 372  class VLP_collection(ECHO_collection):
         {'label':'Update Metadata','action':'updateCollectionMD'},          {'label':'Update Metadata','action':'updateCollectionMD'},
         )          )
   
   
       def generateSubCollections(self):
           """erzeuge subcollectionen"""
           founds=self.ZSQLSimpleSearch("select * from vl_literature where referencetype in ('(Book)','(Collection)','(Journal)','(Library)')")
           
           self.REQUEST.RESPONSE.write("<html><body>\n")
           for found in founds:
               
               foundCol=self.ZopeFind(self,obj_ids=[found.reference])
               if foundCol:
                   self.manage_delObjects([foundCol[0][0]])
               
               manage_addVLP_subCollection(self,found.reference,found.titlerefdisplay,found.titlerefdisplay)
               #getattr(self,found.reference).generateSubCollectionFromDB()
   
               self.REQUEST.RESPONSE.write("<p>%s</p>\n"%found.reference)
   
           
     def VLP_path_configForm(self):      def VLP_path_configForm(self):
         """change pt"""          """change pt"""
         path=PageTemplateFile(os.path.join(package_home(globals()),'vlp','ChangeVLPPath.zpt')).__of__(self)          path=PageTemplateFile(os.path.join(package_home(globals()),'vlp','ChangeVLPPath.zpt')).__of__(self)
Line 582  class VLP_resource(ECHO_resource,Cacheab Line 623  class VLP_resource(ECHO_resource,Cacheab
     def dir2index(self):      def dir2index(self):
         """dir to index"""          """dir to index"""
   
       excludeNames=['Icon']
       
         def calculateName(str):          def calculateName(str):
         name=os.path.splitext(str[1:])[0]          name=os.path.splitext(str[1:])[0]
             ret="%s: %s"%(str[0],name)              ret="%s: %s"%(str[0],name)
Line 596  class VLP_resource(ECHO_resource,Cacheab Line 639  class VLP_resource(ECHO_resource,Cacheab
         temp=[]          temp=[]
     ret.sort()      ret.sort()
         for x in ret:          for x in ret:
             if not (x[0]=="."):              if (not (x[0]==".")) and (not x in excludeNames):
                                   
                 temp.append((calculateName(x),os.path.splitext(x)[0]))                  temp.append((calculateName(x),os.path.splitext(x)[0]))
         return temp          return temp

Removed from v.1.40  
changed lines
  Added in v.1.41


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