--- ECHO_content/ECHO_collection.py 2004/05/07 14:51:02 1.65 +++ ECHO_content/ECHO_collection.py 2004/05/07 18:04:29 1.72 @@ -598,9 +598,15 @@ class ECHO_collection(Folder, Persistent """ECHO Collection""" security=ClassSecurityInfo() meta_type='ECHO_collection' - + viewClassificationList=viewClassificationListMaster displayTypes=displayTypes - + + def getViewClassification(self): + if hasattr(self,'viewClassification'): + return self.viewClassification + else: + return "" + def getTitle(self): """title""" return self.title.encode('utf-8') @@ -677,21 +683,27 @@ class ECHO_collection(Folder, Persistent def createJavaScript(self): """CreateJava""" - #ret=javaScriptMain - ret="" + ret=javaScriptMain dynamical="\n" for ob in self.getGraphicCoords(): if ob[4][4] == "": - #dynamical+="""Coords.push(new Coord('%s', Img, %s));\n"""%(ob[1],ob[0]) + dynamical+="""Coords.push(new Coord('%s', Img, %s));\n"""%(ob[1],ob[0]) + else: + dynamical+="""Coords.push(new Coord('%s', Img, %s));//%s\n"""%(ob[1],ob[0],ob[4][4]) + dynamical+="ShowArrow(new getObj('i.%s'),Img,%s);\n"%(ob[1],ob[0]) + ret+=javaHandler%dynamical + return ret + + def createJSAreas(self): + """CreateJava""" + dynamical="\n" + for ob in self.getGraphicCoords(): + if ob[5] == "area": dynamical+="""addArea('%s', 'overview', %s, 'area');\n"""%(ob[1],ob[0]) else: dynamical+="""addArea('%s', 'overview', %s, 'arrow');\n"""%(ob[1],ob[0]) - #dynamical+="""Coords.push(new Coord('%s', Img, %s));//%s\n"""%(ob[1],ob[0],ob[4][4]) - #dynamical+="ShowArrow(new getObj('i.%s'),Img,%s);\n"%(ob[1],ob[0]) - #ret+=javaHandler%dynamical - ret+=dynamical - return ret + return dynamical security.declarePublic('getCreditObject') def getCreditObject(self,name): @@ -837,13 +849,14 @@ class ECHO_collection(Folder, Persistent else: return "#dddddd" - def changeECHO_collection(self,title,label,description,contentType,responsible,weight,secondaryLink,secondaryLinkTitle,credits=None,sortfield="weight",coords=None,RESPONSE=None,imageTag="",bgcolour=""): - """Änderung der Properties""" + def changeECHO_collection(self,title,label,description,contentType,responsible,weight,secondaryLink,secondaryLinkTitle,credits=None,sortfield="weight",coords=None,RESPONSE=None,imageTag="",bgcolour="",viewClassification=None): + """Aenderung der Properties""" self.secondaryLink=secondaryLink self.secondaryLinkTitle=secondaryLinkTitle self.imageTag=imageTag self.bgcolour=bgcolour + self.viewClassification=viewClassification if coords: coordsnew=[ string.split(x,",") for x in coords] @@ -920,26 +933,30 @@ class ECHO_collection(Folder, Persistent def getGraphicCoords(self): """Give list of coordinates""" - subColTypes=['ECHO_collection','ECHO_externalLink','ECHO_resource'] + subColTypes=['ECHO_collection','ECHO_resource'] ids=[] - for entry in self.__dict__.keys(): - object=getattr(self,entry) - try: - if object.meta_type in subColTypes: - for coordtemp in object.coords: - if len(coordtemp)>3: - coord=coordtemp[0:4] - label="" - if hasattr(object,'label') and not object.label=="": - label=object.label - elif hasattr(object,'title') and not object.title=="": - label=object.title + for entrySearch in self.ZopeFind(self,obj_metatypes=subColTypes): + object=entrySearch[1] + if hasattr(object,'coords'): + for coordtemp in object.coords: + if len(coordtemp)>3: + coord=coordtemp[0:4] + label="" + vc="" + if hasattr(object,'label') and not object.label=="": + label=object.label + elif hasattr(object,'title') and not object.title=="": + label=object.title + else: + label=object.getId() + if object.viewClassification != "": + vc=object.viewClassification + else: + if len(coordtemp) > 4 and coordtemp[4] != "": + vc="view point" else: - label=object.getId() - ids.append([string.join(coord,", "),object.getId(),label,object,coordtemp,object.getViewClassification()]) - except: - """nothing""" - + vc="area" + ids.append([string.join(coord,", "),object.getId(),label,object,coordtemp,vc]) return ids