version 1.5, 2003/12/10 10:53:55
|
version 1.11, 2004/01/27 13:33:27
|
Line 8 class ECHO_resource contains information
|
Line 8 class ECHO_resource contains information
|
class ECHO_externalLink contains information on externalLinks |
class ECHO_externalLink contains information on externalLinks |
|
|
|
|
|
|
""" |
""" |
import string |
import string |
import OFS.Image |
import OFS.Image |
Line 30 import urllib
|
Line 29 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 93 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,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""" |
"""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 110 def setECHO_CollectionInformation(self,c
|
Line 115 def setECHO_CollectionInformation(self,c
|
|
|
coords=[] |
coords=[] |
#coordinates of for rectangles |
#coordinates of for rectangles |
for coordstr in coordstrs: |
|
|
|
|
#print "cs", coordstrs |
|
if coordstrs: |
|
for coordstr in coordstrs: |
|
print "cs", coordstr |
|
try: |
temco=coordstr.split(",") |
temco=coordstr.split(",") |
|
except: |
|
temco=[] |
#temco.append(angle) |
#temco.append(angle) |
coords.append(temco) |
coords.append(temco) |
|
|
|
|
self.coords=coords[0:] |
self.coords=coords[0:] |
|
|
|
|
Line 168 class ECHO_resource(Folder):
|
Line 181 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 183 class ECHO_resource(Folder):
|
Line 210 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): |
def getCoords(self): |
try: |
try: |
print |
|
return [string.join(x,",") for x in self.coords] |
return [string.join(x,",") for x in self.coords] |
except: |
except: |
return [] |
return [] |
Line 207 class ECHO_resource(Folder):
|
Line 238 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): |
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""" |
"""Ä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 291 def manage_AddECHO_resourceForm(self):
|
Line 323 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): |
|
|
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""" |
"""nothing yet""" |
scientificClassificationObj=scientificClassification(context,science,practice) |
scientificClassificationObj=scientificClassification(context,science,practice) |
Line 336 class ECHO_externalLink(Folder):
|
Line 370 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 449 class ECHO_collection(Folder, Persistent
|
Line 483 class ECHO_collection(Folder, Persistent
|
|
|
def getCoords(self): |
def getCoords(self): |
try: |
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: |
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 520 class ECHO_collection(Folder, Persistent
|
Line 555 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): |
|
|
|
"""Änderung der Properties""" |
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""" |
|
#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 552 class ECHO_collection(Folder, Persistent
|
Line 590 class ECHO_collection(Folder, Persistent
|
pt.content_type="text/html" |
pt.content_type="text/html" |
return pt() |
return pt() |
|
|
|
def getCredits(self): |
|
"""Ausgabe der credits""" |
|
if self.credits: |
|
return self.credits |
|
else: |
|
return [] |
|
|
def getGraphicCoords(self): |
def getGraphicCoords(self): |
"""Give list of coordinates""" |
"""Give list of coordinates""" |
Line 626 def manage_AddECHO_collectionForm(self):
|
Line 670 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) |
Line 665 class ECHO_root(Folder,Persistent,Implic
|
Line 709 class ECHO_root(Folder,Persistent,Implic
|
|
|
except: |
except: |
"""nothing""" |
"""nothing""" |
|
|
return ids |
return ids |
|
|
def getCollectionTree(self): |
def getCollectionTree(self): |