Diff for /ECHO_content/ECHO_collection.py between versions 1.73 and 1.76

version 1.73, 2004/05/10 08:44:19 version 1.76, 2004/05/10 14:18:33
Line 112  def sendFile(self, filename, type): Line 112  def sendFile(self, filename, type):
         break          break
     if object:      if object:
     # if the object exists then send it      # if the object exists then send it
     object()      return object.index_html(self.REQUEST.REQUEST, self.REQUEST.RESPONSE)
     else:      else:
     # send a local file with the given content-type      # send a local file with the given content-type
     fn = os.path.join(package_home(globals()), filename)      fn = os.path.join(package_home(globals()), filename)
Line 539  class ECHO_resource(Folder): Line 539  class ECHO_resource(Folder):
     def changeECHO_resource_metadata(self,RESPONSE=None):      def changeECHO_resource_metadata(self,RESPONSE=None):
         """change metadata"""          """change metadata"""
         tags=self.findTagsFromMapping(self.contentType)          tags=self.findTagsFromMapping(self.contentType)
         OSAS_meta={}          self.OSAS_meta={}
         for field in tags[1]:          for field in tags[1]:
             try:              try:
                 self.metaDataHash[self.getFieldTag(tags,field)]=self.REQUEST.form[self.getFieldTag(tags,field)]                  self.metaDataHash[self.getFieldTag(tags,field)]=self.REQUEST.form[self.getFieldTag(tags,field)]
Line 547  class ECHO_resource(Folder): Line 547  class ECHO_resource(Folder):
             except:              except:
                 """nothing"""                  """nothing"""
   
         return urllib.urlopen('http://localhost:8080/echo_nav/storage/downloadExternalXML?index_meta_url=%s&xml_url=%s'%(self.absolute_url()+'/newMetaXML',self.metalink)).read()          return urllib.urlopen('http://xserve02.mpiwg-berlin.mpg.de:18880/echo_nav/storage/downloadExternalXML?index_meta_url=%s&xml_url=%s'%(self.metalink,self.absolute_url()+'/newMetaXML')).read()
                   
         if RESPONSE is not None:          if RESPONSE is not None:
             RESPONSE.redirect('manage_main')              RESPONSE.redirect('manage_main')
   
   
     def newMetaXML(self):      def newMetaXML(self):
           """new index.meta"""
         self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml')          self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml')
         return writeMetadata(self.metalink,self.OSAS_meta)          return writeMetadata(self.metalink,self.OSAS_meta)
   
Line 989  class ECHO_collection(Folder, Persistent Line 990  class ECHO_collection(Folder, Persistent
         return ret          return ret
   
     def createJSAreas(self):      def createJSAreas(self):
         """CreateJava"""          """new version of createJavaScript"""
         dynamical="\n"          dynamical="\n"
         for ob in self.getGraphicCoords():          for ob in self.getGraphicCoords():
         if ob[5] == "area":           if ob[5] == "area": 
Line 998  class ECHO_collection(Folder, Persistent Line 999  class ECHO_collection(Folder, Persistent
             dynamical+="""addArea('%s', 'overview', %s, 'arrow');\n"""%(ob[1],ob[0])              dynamical+="""addArea('%s', 'overview', %s, 'arrow');\n"""%(ob[1],ob[0])
         return dynamical          return dynamical
           
       def createMapHead(self):
           """generate divs"""
           pt=PageTemplateFile(os.path.join(package_home(globals()), 'zpt/ECHO_content_map_frag_js')).__of__(self)
           return pt()
           
       def createMapLink(self, ob, text=None):
       """generate map link"""
       id = ob[1]
       link = ob[1]
       if text == None:
           text = ob[2]
       tag = '<a id="a.%s" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" href="%s" target="_blank"'%(id,id,id,link)
       if ob[3].contentType == 'text-popup':
           tag += ' title="%s"'%ob[3].description
       tag += ">" + text + "</a>"
       return tag
   
       def createMapAux(self, ob, arrowsrc="http://nausikaa2.rz-berlin.mpg.de/digitallibrary/servlet/Scaler/?dw=15&fn=icons/pfeil"):
       """generate map link image, text and other stuff"""
       id = ob[1]
       link = ob[1]
       vtype = ob[5]
       ctype = ob[3].contentType
       
       tag = '<a id="b.%s" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" href="%s" target="_blank">'%(id,id,id,link)
       if vtype == "view point":
           rot = ob[4][4]
           tag += '<img id="i.%s" src="%s&rot=%s" border="1" style="position:absolute; top:-100px; left:-100px; border-style:none" />'%(id,arrowsrc,rot)
       else:
           tag += '<span id="i.%s" style="position:absolute; top:-100px; left:-100px; border-style:none"'%(id)
           if ctype == "text-popup":
           desc = ob[3].description
           tag += ' title="%s"'%desc
           tag += ' />'
       tag += '</a>'
       return tag
   
       
     security.declarePublic('getCreditObject')      security.declarePublic('getCreditObject')
     def getCreditObject(self,name):      def getCreditObject(self,name):
         """credit id to credititem"""          """credit id to credititem"""
Line 1211  class ECHO_collection(Folder, Persistent Line 1250  class ECHO_collection(Folder, Persistent
   
     def area_img(self):      def area_img(self):
         """area image"""          """area image"""
         sendFile(self, 'images/red.gif', 'image/gif')          return sendFile(self, 'images/red.gif', 'image/gif')
         return   
   
     def hl_lib_js(self):      def hl_lib_js(self):
         """javascript"""          """javascript"""
Line 1224  class ECHO_collection(Folder, Persistent Line 1262  class ECHO_collection(Folder, Persistent
         sendFile(self, 'js/js_lib.js', 'text/plain')          sendFile(self, 'js/js_lib.js', 'text/plain')
         return           return 
   
           
     def getGraphicCoords(self):      def getGraphicCoords(self):
         """Give list of coordinates"""          """Give list of coordinates"""
         subColTypes=['ECHO_collection','ECHO_resource']          subColTypes=['ECHO_collection','ECHO_resource']

Removed from v.1.73  
changed lines
  Added in v.1.76


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