--- ECHO_content/ECHO_collection.py 2003/12/10 10:53:55 1.5 +++ ECHO_content/ECHO_collection.py 2004/01/21 07:40:52 1.9 @@ -30,6 +30,10 @@ import urllib import xml.dom.minidom +#List of different types for the graphical linking viewer +viewClassificationListMaster=['view point','area'] + + def toList(field): """Einzelfeld in Liste umwandeln""" if type(field)==StringType: @@ -90,10 +94,12 @@ def readMetadata(url): return metadict,"" -def setECHO_CollectionInformation(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,credits,weight,coordstrs): +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""" + self.viewClassification=viewClassification + self.label = label self.title=title self.description=description @@ -110,11 +116,27 @@ def setECHO_CollectionInformation(self,c coords=[] #coordinates of for rectangles +<<<<<<< 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: - - temco=coordstr.split(",") + try: + temco=coordstr.split(",") + except: + temco=[] #temco.append(angle) coords.append(temco) +>>>>>>> 1.8 self.coords=coords[0:] @@ -168,7 +190,21 @@ class ECHO_resource(Folder): """ECHO Ressource""" 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): self.id = id @@ -183,13 +219,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 [] @@ -207,12 +247,16 @@ class ECHO_resource(Folder): 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""" - 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 @@ -291,7 +335,11 @@ 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): +<<<<<<< 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""" scientificClassificationObj=scientificClassification(context,science,practice) @@ -336,7 +384,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 @@ -449,7 +497,6 @@ class ECHO_collection(Folder, Persistent def getCoords(self): try: - print self.coords return [string.join(x,",") for x in self.coords] @@ -457,7 +504,7 @@ class ECHO_collection(Folder, Persistent 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""" @@ -520,11 +567,16 @@ 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,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""" - + #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 @@ -626,7 +678,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)