Diff for /ECHO_content/ECHO_collection.py between versions 1.94 and 1.97

version 1.94, 2004/05/28 11:06:32 version 1.97, 2004/06/05 10:04:33
Line 89  def content_html(self,type): Line 89  def content_html(self,type):
         #if templates:          #if templates:
         #    return templates[0][1]()          #    return templates[0][1]()
   
         try:          if hasattr(self,type+"_template"):
             obj=getattr(self,type+"_template")              obj=getattr(self,type+"_template")
             return obj()              return obj()
         except:          else:
             pt=PageTemplateFile('Products/ECHO_content/zpt/ECHO_%s_template_standard.zpt'%type).__of__(self)              pt=PageTemplateFile('Products/ECHO_content/zpt/ECHO_%s_template_standard.zpt'%type).__of__(self)
             pt.content_type="text/html"              pt.content_type="text/html"
             return pt()              return pt()
Line 243  def readMetadata(url): Line 243  def readMetadata(url):
                   
         for node in metacontent:          for node in metacontent:
             try:              try:
               #print urllib.unquote(getText(node.childNodes)),getText(node.childNodes)
             metadict[re.sub('-','_',node.tagName.lower())]=urllib.unquote(getText(node.childNodes))              metadict[re.sub('-','_',node.tagName.lower())]=urllib.unquote(getText(node.childNodes))
             except:              except:
                 """nothing"""                  """nothing"""
Line 444  class ECHO_resource(Folder,Persistent): Line 445  class ECHO_resource(Folder,Persistent):
   
     def getCopyright(self):      def getCopyright(self):
         """gib link auf copyright notiz aus"""          """gib link auf copyright notiz aus"""
         if hasattr(self,'copyrightType'):          if hasattr(self,'copyrightType') and hasattr(self.copyrightTypes,self.copyrightType):
             obj=getattr(self.copyrightTypes,'copyrightType')              obj=getattr(self.copyrightTypes,self.copyrightType)
         else:          else:
             obj=getattr(self.copyrightTypes,'generic')              obj=getattr(self.copyrightTypes,'generic')
   
         label=obj.label          label=obj.label
         link="copyrightTypes/"+obj.getId()+'/copyright.html'          link="copyrightTypes/"+obj.getId()+'/copyright.html'
                   
         return """<a target="_blank" href="%s">c%s</a>"""%(link,label)          return """<a target="_blank" href="%s">%s</a>"""%(link,label)
           
     def getCredits(self):      def getCredits(self):
         """Ausgabe der credits"""          """Ausgabe der credits"""
Line 671  class ECHO_resource(Folder,Persistent): Line 672  class ECHO_resource(Folder,Persistent):
                           
     manage_options = Folder.manage_options+(      manage_options = Folder.manage_options+(
         {'label':'Main Config','action':'ECHO_resource_config_main'},          {'label':'Main Config','action':'ECHO_resource_config_main'},
     {'label':'Change Credits & Copyright','action':'ECHO_resource_config_credits'},      {'label':'Change Partners & Copyright','action':'ECHO_resource_config_credits'},
     {'label':'Change Metadata','action':'ECHO_resource_config_metadata'},      {'label':'Change Metadata','action':'ECHO_resource_config_metadata'},
     {'label':'Change Coords','action':'ECHO_resource_config_coords'},      {'label':'Change Coords','action':'ECHO_resource_config_coords'},
     {'label':'Add coords','action':'ECHO_graphicEntry'},      {'label':'Add coords','action':'ECHO_graphicEntry'},
Line 845  class ECHO_resource(Folder,Persistent): Line 846  class ECHO_resource(Folder,Persistent):
         if not error=="": #Fehler beim Auslesen des Metafiles          if not error=="": #Fehler beim Auslesen des Metafiles
             return "ERROR:",error              return "ERROR:",error
         fields=self.findTagsFromMapping(self.contentType)          fields=self.findTagsFromMapping(self.contentType)
           
         #fields=self.findLabelsFromMapping(self.contentType)          #fields=self.findLabelsFromMapping(self.contentType)
         for field in fields[1]:          for field in fields[1]:
               
             if self.isDefinedInThisSet(fields,field):              if self.isDefinedInThisSet(fields,field):
                   #print urllib.unquote(metadict.get(self.getFieldTag(fields,field),''))
                 self.setFieldValue(self.getFieldTag(fields,field),metadict.get(self.getFieldTag(fields,field),''))                  self.setFieldValue(self.getFieldTag(fields,field),metadict.get(self.getFieldTag(fields,field),''))
   
                   
Line 1790  class ECHO_root(Folder,Persistent,Implic Line 1794  class ECHO_root(Folder,Persistent,Implic
         if not content or content=="":          if not content or content=="":
             return ""              return ""
         ret="<%s>"%tag          ret="<%s>"%tag
         ret+=urllib.quote(content)          #ret+=urllib.quote(content)
           ret+=content
   
         ret+="</%s>"%tag          ret+="</%s>"%tag
         return ret          return ret
   
     def getValueFromClass(self,field,found):      def getValueFromClass(self,field,found):
         """retattribute falss existing"""          """retattribute falss existing"""
         try:          try:
             return getattr(found,field)              
               return getattr(found,field).decode('ascii','ignore')
         except:          except:
             return ""              return ""
           

Removed from v.1.94  
changed lines
  Added in v.1.97


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