--- ECHO_content/ECHO_collection.py 2005/07/20 11:49:05 1.229 +++ ECHO_content/ECHO_collection.py 2005/08/19 07:53:16 1.233 @@ -1,3 +1,5 @@ + + """New version of the product started February, 8th. Without scientific classification, use content-type for further classification.""" """Echo collection provides the classes for the ECHO content web-site. @@ -1507,20 +1509,24 @@ class ECHO_collection(Folder, Persistent def localizeObjects(self): """localize all objects""" - contents=self.ZopeFind(self,obj_metatypes=['ECHO_link','ECHO_mapText']) + contents=self.ZopeFind(self,obj_metatypes=['ECHO_externalLink','ECHO_link','ECHO_mapText']) + find=self.ZopeFind(self,obj_ids=('locale_en')) if not find: self.manage_addECHO_locale("en",'','') for content in contents: - if content[1].meta_type=='ECHO_link': + if content[1].meta_type in['ECHO_link','ECHO_externalLink']: find=content[1].ZopeFind(content[1],obj_metatypes=('ECHO_mapText')) - root=find[0][1] + if find: + root=find[0][1] - locale=find[0][1].ZopeFind(find[0][1],obj_ids=('locale_en')) + locale=find[0][1].ZopeFind(find[0][1],obj_ids=('locale_en')) + else: + root=None else: root=content[1] locale=content[1].ZopeFind(content[1],obj_ids=('locale_en')) - if not locale: + if root and not locale: root.manage_addECHO_locale("en",'','') pt=zptFile(self, 'zpt/localizeObjects.zpt') @@ -2086,7 +2092,7 @@ class ECHO_collection(Folder, Persistent security.declarePublic('changeECHO_collection') - def changeECHO_collection(self,title,label,description,contentType,responsible,weight,secondaryLink,secondaryLinkTitle,credits=None,sortfield="weight",coords=None,RESPONSE=None,imageTag="",bgcolour="",location=None,isAlwaysClickable=None): + def changeECHO_collection(self,title,label,description,contentType,responsible,weight,secondaryLink,secondaryLinkTitle,credits=None,sortfield="weight",coords=None,RESPONSE=None,imageTag="",bgcolour="",location=None,isAlwaysClickable=None,prefix="",suffix=""): """Aenderung der Properties""" self.secondaryLink=secondaryLink @@ -2095,7 +2101,9 @@ class ECHO_collection(Folder, Persistent self.bgcolour=bgcolour self.location=location self.isAlwaysClickable=isAlwaysClickable - + self.prefix=prefix[0:] + self.suffix=suffix[0:] + setECHO_collectionInformation(self,title,label,description,contentType,responsible,credits,weight) self.sortfield=sortfield @@ -3112,13 +3120,14 @@ class ECHO_root(Folder,Persistent,Implic #str= dom.toxml('utf-8') buf = cStringIO.StringIO() - PrettyPrint(dom, stream=buf, encoding='UTF-8') + PrettyPrint(dom, stream=buf) str = buf.getvalue() buf.close() #str=PrettyPrint(dom.documentElement,encoding='UTF-8') #print link.toxml('utf-8') #print type(str) retStr=regexpPage.search(str) + try: # hack warum fehtl manchmal page?? return retStr.group(1) except: @@ -3135,7 +3144,7 @@ class ECHO_root(Folder,Persistent,Implic except: """nothing""" - dbs={'vl_technology':'','vl_people':'','vl_sites':''} + dbs={'vl_technology':'','vl_people':" AND complete='yes'",'vl_sites':''} res=None for db in dbs.keys(): res=res or self.search(var=str("select reference from %s where reference =\'%s\' %s"%(db,ref,dbs[db])))