Diff for /ECHO_content/ECHO_collection.py between versions 1.1.1.1 and 1.9

version 1.1.1.1, 2003/11/25 11:19:47 version 1.9, 2004/01/21 07:40:52
Line 30  import urllib Line 30  import urllib
 import xml.dom.minidom  import xml.dom.minidom
   
   
   #List of different types for the graphical linking viewer
   viewClassificationListMaster=['view point','area']
   
   
 def toList(field):  def toList(field):
     """Einzelfeld in Liste umwandeln"""      """Einzelfeld in Liste umwandeln"""
     if type(field)==StringType:      if type(field)==StringType:
Line 90  def readMetadata(url): Line 94  def readMetadata(url):
     return metadict,""      return metadict,""
           
   
 def setECHO_CollectionInformation(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,credits,weight,coords):  def setECHO_CollectionInformation(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,credits,weight,coordstrs,viewClassification=""):
   
         """Allegemeine Informationen zu einer ECHO Collection"""          """Allegemeine Informationen zu einer ECHO Collection"""
   
           self.viewClassification=viewClassification
   
         self.label = label          self.label = label
         self.title=title          self.title=title
         self.description=description          self.description=description
Line 108  def setECHO_CollectionInformation(self,c Line 114  def setECHO_CollectionInformation(self,c
         self.scientific_Information.scientific_Classification.science=science          self.scientific_Information.scientific_Classification.science=science
         self.scientific_Information.scientific_Classification.practice=practice          self.scientific_Information.scientific_Classification.practice=practice
                   
           coords=[]
         #coordinates of for rectangles          #coordinates of for rectangles
         self.coords=coords  <<<<<<< ECHO_collection.py
           #print "cs", coordstrs
           if coordstrs:
               for coordstr in coordstrs:
                   print "cs", coordstr
                   try:
                       temco=coordstr.split(",")
                   except:
                       temco=[]
                   #temco.append(angle)
                   coords.append(temco)
   
   =======
           for coordstr in coordstrs:
               try:
                   temco=coordstr.split(",")
               except:
                   temco=[]
               #temco.append(angle)
               coords.append(temco)
   >>>>>>> 1.8
           self.coords=coords[0:]
                           
   
 class scientificClassification(SimpleItem,Persistent,Implicit):  class scientificClassification(SimpleItem,Persistent,Implicit):
Line 163  class ECHO_resource(Folder): Line 190  class ECHO_resource(Folder):
     """ECHO Ressource"""      """ECHO Ressource"""
     meta_type='ECHO_resource'      meta_type='ECHO_resource'
   
       viewClassificationList=viewClassificationListMaster
   
       def getViewClassification(self):
           if hasattr(self,'viewClassification'):
               return self.viewClassification
           else:
               return ""
   
       def getCredits(self):
           """Ausgabe der credits"""
           if self.credits:
               return self.credits
           else:
               return []
   
     def __init__(self,id,link,metalink,title,label,description,content_type,responsible,credits,weight,coords):      def __init__(self,id,link,metalink,title,label,description,content_type,responsible,credits,weight,coords):
   
Line 178  class ECHO_resource(Folder): Line 219  class ECHO_resource(Folder):
         self.description=description          self.description=description
         self.content_type=content_type          self.content_type=content_type
         self.responsible=responsible          self.responsible=responsible
           
           if coords:
         coordsnew=[ string.split(x,",") for x in coords]          coordsnew=[ string.split(x,",") for x in coords]
           else:
               coordsnew=[]
           
         self.coords=coordsnew          self.coords=coordsnew
   
                   
       def getCoords(self):
           try:
               return [string.join(x,",") for x in self.coords]  
           except:
               return []
   
   
     def ECHO_resource_config(self):      def ECHO_resource_config(self):
         """Main configuration"""          """Main configuration"""
Line 195  class ECHO_resource(Folder): Line 247  class ECHO_resource(Folder):
         return pt()          return pt()
           
   
     def changeECHO_resource(self,metalink,link,context,science,practice,source_type,period,title,label,description,content_type,responsible,credits,weight,coords,RESPONSE=None):  <<<<<<< ECHO_collection.py
       def changeECHO_resource(self,metalink,link,context,science,practice,source_type,period,title,label,description,content_type,responsible,weight,credits=None,coords=None,viewClassification=None,RESPONSE=None):
   =======
       def changeECHO_resource(self,metalink,link,context,science,practice,source_type,period,title,label,description,content_type,responsible,credits,weight,viewClassification="",coords="",RESPONSE=None):
   >>>>>>> 1.8
   
         """Änderung der Properties"""          """Änderung der Properties"""
                   
   
         setECHO_CollectionInformation(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,credits,weight,coords)          setECHO_CollectionInformation(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,credits,weight,coords,viewClassification)
   
                   
         self.link=link          self.link=link
Line 213  class ECHO_resource(Folder): Line 269  class ECHO_resource(Folder):
     manage_options = Folder.manage_options+(      manage_options = Folder.manage_options+(
         {'label':'Main Config','action':'ECHO_resource_config'},          {'label':'Main Config','action':'ECHO_resource_config'},
         {'label':'Metadata','action':'ECHO_getResourceMD'},          {'label':'Metadata','action':'ECHO_getResourceMD'},
                {'label':'Graphics','action':'ECHO_graphicEntry'},
         )          )
   
       def ECHO_graphicEntry(self):
           """DO nothing"""
           if 'overview' in self.aq_parent.__dict__.keys():
               pt=PageTemplateFile('Products/ECHO_content/ECHO_draw.zpt').__of__(self)
               return pt()
           else:
               return "NO OVERVIEW GRAPHICS"
   
       def ECHO_enterCoords(self,coordstr,angle="",RESPONSE=None):
           """Enter coords"""
           coords=self.coords
           temco=coordstr.split(",")
           temco.append(angle)
           coords.append(temco)
           
           self.coords=coords[0:]
           #pt=PageTemplateFile('Products/ECHO_content/ECHO_draw.zpt').__of__(self)
           if RESPONSE is not None:
               RESPONSE.redirect('ECHO_graphicEntry')
           
     def ECHO_getResourceMD(self,template="yes"):      def ECHO_getResourceMD(self,template="yes"):
         """Einlesen der Metadaten und Anlegen dieser Metadaten als Informationen zur Resource"""          """Einlesen der Metadaten und Anlegen dieser Metadaten als Informationen zur Resource"""
Line 260  def manage_AddECHO_resourceForm(self): Line 335  def manage_AddECHO_resourceForm(self):
         return pt()          return pt()
   
   
 def manage_AddECHO_resource(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,link,metalink,credits,weight,coords,RESPONSE=None):  <<<<<<< ECHO_collection.py
   def manage_AddECHO_resource(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,link,metalink,credits,weight,coords=None,RESPONSE=None):
   =======
   def manage_AddECHO_resource(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,link,metalink,credits,weight,coords=[],RESPONSE=None):
   >>>>>>> 1.8
   
     """nothing yet"""      """nothing yet"""
     scientificClassificationObj=scientificClassification(context,science,practice)      scientificClassificationObj=scientificClassification(context,science,practice)
Line 305  class ECHO_externalLink(Folder): Line 384  class ECHO_externalLink(Folder):
         if not hasattr(self,'weight'):          if not hasattr(self,'weight'):
             self.weight=""              self.weight=""
         if not hasattr(self,'coords'):          if not hasattr(self,'coords'):
             print "HI"              
             self.coords=['']              self.coords=['']
             print "G",self.coords              print "G",self.coords
   
Line 419  class ECHO_collection(Folder, Persistent Line 498  class ECHO_collection(Folder, Persistent
     def getCoords(self):      def getCoords(self):
         try:          try:
             return [ string.join(x,",") for x in self.coords]              return [ string.join(x,",") for x in self.coords]
   
   
         except:          except:
             return []              return []
           
     def __init__(self,id,title,label,description,content_type,responsible,credits,weight,sortfield,coords):      def __init__(self,id,title,label,description,content_type,responsible,credits,weight,sortfield,coords):
         print "CO",coords          #print "CO",coords
   
         self.id = id          self.id = id
         """Festlegen der ID"""          """Festlegen der ID"""
Line 454  class ECHO_collection(Folder, Persistent Line 536  class ECHO_collection(Folder, Persistent
         else:          else:
             return "NO OVERVIEW GRAPHICS"              return "NO OVERVIEW GRAPHICS"
   
     def ECHO_enterCoords(self,coordstr):      def ECHO_enterCoords(self,coordstr,angle="",RESPONSE=None):
         """Enter coords"""          """Enter coords"""
         self.coords.append(coordstr.split(","))          coords=self.coords
         pt=PageTemplateFile('Products/ECHO_content/ECHO_draw.zpt').__of__(self)          temco=coordstr.split(",")
         return pt()          temco.append(angle)
           coords.append(temco)
           self.coords=coords[0:]
           #pt=PageTemplateFile('Products/ECHO_content/ECHO_draw.zpt').__of__(self)
           if RESPONSE is not None:
               RESPONSE.redirect('ECHO_graphicEntry')
   
           
     security.declarePublic('ECHO_Collection_config')      security.declarePublic('ECHO_Collection_config')
Line 480  class ECHO_collection(Folder, Persistent Line 567  class ECHO_collection(Folder, Persistent
   
     security.declarePublic('changeECHO_Collection')      security.declarePublic('changeECHO_Collection')
   
     def changeECHO_Collection(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,credits,weight,coords,sortfield="weight",RESPONSE=None):  <<<<<<< ECHO_collection.py
       def changeECHO_Collection(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,credits,weight,coords=[""],sortfield="weight",RESPONSE=None):
   =======
       def changeECHO_Collection(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,credits,weight,sortfield="weight",coords="",RESPONSE=None):
   >>>>>>> 1.8
   
         """Änderung der Properties"""          """Änderung der Properties"""
           #print "HI",coords
         coordsnew=[ string.split(x,",") for x in coords]          coordsnew=[ string.split(x,",") for x in coords]
           #print "HO",coordsnew
         setECHO_CollectionInformation(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,credits,weight,coordsnew)          setECHO_CollectionInformation(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,credits,weight,coordsnew)
   
         self.sortfield=sortfield          self.sortfield=sortfield
Line 504  class ECHO_collection(Folder, Persistent Line 596  class ECHO_collection(Folder, Persistent
         if 'index.html' in self.__dict__.keys():          if 'index.html' in self.__dict__.keys():
             return getattr(self,'index.html')()              return getattr(self,'index.html')()
         elif 'overview' in self.__dict__.keys():          elif 'overview' in self.__dict__.keys():
               #print "HI"
             return self.showOverview()              return self.showOverview()
                           
                   
Line 521  class ECHO_collection(Folder, Persistent Line 614  class ECHO_collection(Folder, Persistent
             #print "OB:",object              #print "OB:",object
                           
             try:              try:
                 print "MT:",object.meta_type                  #print "MT:",object.meta_type
                 if object.meta_type in subColTypes:                  if object.meta_type in subColTypes:
                     for coord in object.coords:                      #print "MT:",object.meta_type,object.getId()
                         if len(coord)==4:                      for coordtemp in object.coords:
                             ids.append([string.join(coord,", "),object.getId()])                          if len(coordtemp)>3:
                                                       coord=coordtemp[0:4]
                               if hasattr(object,'title'):
                                   if not object.title=="":
                                       ids.append([string.join(coord,", "),object.getId(),object.title])
                                   else:
                                       ids.append([string.join(coord,", "),object.getId(),object.getId()])
                               else:
                                   ids.append([string.join(coord,", "),object.getId(),object.getId()])
                                           
             except:              except:
                 """nothing"""                  """nothing"""
         print "IDS",ids          #print "IDS",ids
         return ids          return ids
           
     def getSubCols(self,sortfield="weight"):      def getSubCols(self,sortfield="weight"):
Line 578  def manage_AddECHO_collectionForm(self): Line 678  def manage_AddECHO_collectionForm(self):
         return pt()          return pt()
   
   
 def manage_AddECHO_collection(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,credits,weight,sortfield,coords,RESPONSE=None):  def manage_AddECHO_collection(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,weight,sortfield,coords,credits=None,RESPONSE=None):
   
     """nothing yet"""      """nothing yet"""
     scientificClassificationObj=scientificClassification(context,science,practice)      scientificClassificationObj=scientificClassification(context,science,practice)

Removed from v.1.1.1.1  
changed lines
  Added in v.1.9


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