--- ECHO_content/ECHO_collection.py 2004/01/14 16:09:36 1.8 +++ ECHO_content/ECHO_collection.py 2004/01/27 13:33:27 1.11 @@ -8,7 +8,6 @@ class ECHO_resource contains information class ECHO_externalLink contains information on externalLinks - """ import string import OFS.Image @@ -116,13 +115,19 @@ def setECHO_CollectionInformation(self,c coords=[] #coordinates of for rectangles - for coordstr in coordstrs: - try: - temco=coordstr.split(",") - except: - temco=[] - #temco.append(angle) - coords.append(temco) + + #print "cs", coordstrs + if coordstrs: + for coordstr in coordstrs: + print "cs", coordstr + try: + temco=coordstr.split(",") + except: + temco=[] + #temco.append(angle) + coords.append(temco) + + self.coords=coords[0:] @@ -183,6 +188,13 @@ class ECHO_resource(Folder): 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): @@ -198,13 +210,17 @@ class ECHO_resource(Folder): self.description=description self.content_type=content_type self.responsible=responsible - coordsnew=[ string.split(x,",") for x in coords] + + if coords: + coordsnew=[ string.split(x,",") for x in coords] + else: + coordsnew=[] + self.coords=coordsnew def getCoords(self): try: - print return [string.join(x,",") for x in self.coords] except: return [] @@ -224,6 +240,7 @@ class ECHO_resource(Folder): def changeECHO_resource(self,metalink,link,context,science,practice,source_type,period,title,label,description,content_type,responsible,credits,weight,viewClassification="",coords="",RESPONSE=None): + """Änderung der Properties""" @@ -306,7 +323,9 @@ def manage_AddECHO_resourceForm(self): 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): + +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): + """nothing yet""" scientificClassificationObj=scientificClassification(context,science,practice) @@ -351,7 +370,7 @@ class ECHO_externalLink(Folder): if not hasattr(self,'weight'): self.weight="" if not hasattr(self,'coords'): - print "HI" + self.coords=[''] print "G",self.coords @@ -464,15 +483,16 @@ class ECHO_collection(Folder, Persistent def getCoords(self): try: - print self.coords - return [string.join(x,",") for x in self.coords] - + + x= [string.join(x,",") for x in self.coords] + return x except: + return [] def __init__(self,id,title,label,description,content_type,responsible,credits,weight,sortfield,coords): - print "CO",coords + #print "CO",coords self.id = id """Festlegen der ID""" @@ -535,11 +555,14 @@ class ECHO_collection(Folder, Persistent security.declarePublic('changeECHO_Collection') + def changeECHO_Collection(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,credits,weight,sortfield="weight",coords="",RESPONSE=None): - """Änderung der Properties""" + """Änderung der Properties""" + #print "HI",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) self.sortfield=sortfield @@ -567,6 +590,12 @@ class ECHO_collection(Folder, Persistent pt.content_type="text/html" return pt() + def getCredits(self): + """Ausgabe der credits""" + if self.credits: + return self.credits + else: + return [] def getGraphicCoords(self): """Give list of coordinates""" @@ -641,7 +670,7 @@ def manage_AddECHO_collectionForm(self): 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""" scientificClassificationObj=scientificClassification(context,science,practice) @@ -680,6 +709,7 @@ class ECHO_root(Folder,Persistent,Implic except: """nothing""" + return ids def getCollectionTree(self):