--- ECHO_content/ECHO_collection.py 2005/10/13 15:07:26 1.237 +++ 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"""