--- ECHO_content/ECHO_collection.py 2004/03/30 18:10:00 1.22 +++ ECHO_content/ECHO_collection.py 2004/03/30 19:12:22 1.23 @@ -30,7 +30,7 @@ import xml.dom.minidom import urllib import xml.dom.minidom - +from ECHO_graphicalOverview import javaHandler,javaScriptMain #List of different types for the graphical linking viewer viewClassificationListMaster=['view point','area'] @@ -426,7 +426,15 @@ class ECHO_collection(Folder, Persistent security=ClassSecurityInfo() meta_type='ECHO_collection' - + def createJavaScript(self): + """CreateJava""" + ret=javaScriptMain + + dynamical="" + for ob in self.getGraphicCoords(): + dynamical+="""Coords.push(new Coord('%s', Img, %s));\n"""%(ob[1],ob[0]) + ret+=javaHandler%dynamical + return ret security.declarePublic('getCreditObject') def getCreditObject(self,name): @@ -577,8 +585,14 @@ class ECHO_collection(Folder, Persistent security.declarePublic('index_html') - showOverview=DTMLFile('dtml/ECHO_content_overview',globals()) - + + def showOverview(self): + """overview""" + if 'ECHO_overview.html' in self.__dict__.keys(): + return getattr(self,'ECHO_overview.html')() + pt=PageTemplateFile('Products/ECHO_content/zpt/ECHO_content_overview.zpt').__of__(self) + return pt() + def index_html(self): """standard page""" @@ -600,6 +614,8 @@ class ECHO_collection(Folder, Persistent else: return [] + + def getGraphicCoords(self): """Give list of coordinates""" subColTypes=['ECHO_collection','ECHO_externalLink','ECHO_resource'] @@ -611,13 +627,15 @@ class ECHO_collection(Folder, Persistent for coordtemp in object.coords: if len(coordtemp)>3: coord=coordtemp[0:4] - if hasattr(object,'title'): + if hasattr(object,'label') and not object.label=="": + ids.append([string.join(coord,", "),object.getId(),object.label,object]) + elif hasattr(object,'title'): if not object.title=="": - ids.append([string.join(coord,", "),object.getId(),object.title]) + ids.append([string.join(coord,", "),object.getId(),object.title,object]) else: - ids.append([string.join(coord,", "),object.getId(),object.getId()]) + ids.append([string.join(coord,", "),object.getId(),object.getId(),object]) else: - ids.append([string.join(coord,", "),object.getId(),object.getId()]) + ids.append([string.join(coord,", "),object.getId(),object.getId(),object]) except: """nothing""" @@ -681,6 +699,8 @@ class ECHO_root(Folder,Persistent,Implic """ECHO Root Folder""" meta_type="ECHO_root" + + def ECHO_newViewerLink(self,obj=None): """change links (:86 faellt weg)"""