--- ECHO_content/ECHO_collection.py 2005/10/10 19:11:12 1.236 +++ ECHO_content/ECHO_collection.py 2005/10/23 09:46:26 1.238 @@ -14,7 +14,7 @@ try: from reportlab.lib.pagesizes import A4 except: print "PDF generation will not work" - + import string import tempfile @@ -1563,6 +1563,10 @@ class ECHO_collection(Folder, Persistent path="/mpiwg/online/permanent/shipbuilding" + def getTitleAndLabel(self): + """gibt title und label zurueck""" + return (getattr(self,'title',''),getattr(self,'label','')) + def localizeObjects(self): """localize all objects""" contents=self.ZopeFind(self,obj_metatypes=['ECHO_externalLink','ECHO_link','ECHO_mapText']) @@ -2575,15 +2579,24 @@ class ECHO_root(Folder,Persistent,Implic security=ClassSecurityInfo() meta_type="ECHO_root" + - def findObjectFromFulltext(self,url=None,existUri=None): + def findObjectFromFulltext(self,existUri): ''' @param url: @param existUri: ''' - #TODO: at the moment assume that the filename is unique, the whole has to changed to a system of ids. - return None + + if existUri: + #TODO: at the moment assume that the filename is unique, the whole has to changed to a system of ids. + filename=existUri.split("/")[-1] + + founds=self.resourceCatalog.search({'fullTextUrl':os.path.splitext(filename)[0]}) + + ret=[(found.title,found.getObject().absolute_url(),found.getObject().aq_parent.absolute_url()) for found in founds] + + return ret def reindex(self,RESPONSE=None): """indiziere alle Objecte neu""" @@ -3812,7 +3825,7 @@ def repairCoords(self): print "fixing: ", col.id msg += "fixing: "+col.id+"\n" coords = col.coords - if len(coords) > 0: + if len(coords) > 0: # delete old MapAreas for areas in self.ZopeFind(col, obj_metatypes=['MapArea']): #area = areas[1]