--- MPIWGWeb/MPIWGProjects.py 2005/10/13 18:00:36 1.47.2.29 +++ MPIWGWeb/MPIWGProjects.py 2005/10/14 16:32:09 1.47.2.31 @@ -536,7 +536,7 @@ class MPIWGRoot(ZSQLExtendFolder): list[urllib.quote(personNormal)]=(personNormal,[project[1]]) except: - zLOG.LOG("MPIWG Web (harvestHistoricalPerson)",zLOG.ERROR,"cannot annalyize: %s"%repr(project)) + zLOG.LOG("MPIWG Web (harvestHistoricalPerson)",zLOG.ERROR,"cannot analyize: %s"%repr(project)) return list @@ -700,10 +700,11 @@ class MPIWGRoot(ZSQLExtendFolder): manage_options = Folder.manage_options+( - {'label':'Update Personal Homepages','action':'updateHomepages'}, + {'label':'Update personal homepages','action':'updateHomepages'}, + {'label':'Reindex catalogs','action':'reindexCatalogs'}, {'label':'Main config','action':'changeMPIWGRootForm'}, - {'label':'Edit Historical Persons','action':'editHistoricalPersonsForm'}, - {'label':'Store Historical Persons','action':'storeHistoricalPersons'}, + #{'label':'Edit Historical Persons','action':'editHistoricalPersonsForm'}, + #{'label':'Store Historical Persons','action':'storeHistoricalPersons'}, ) def importNamesForm(self): @@ -744,8 +745,9 @@ class MPIWGRoot(ZSQLExtendFolder): founds = self.ZSQLInlineSearch(_table="publications") for found in founds: - - if found.id_institutsbibliographie and (not found.id_institutsbibliographie ==""): + + if found.id_institutsbibliographie and (not found.id_institutsbibliographie =="") and (not found.id_institutsbibliographie =="0"): + entries = self.ZSQLInlineSearch(_table="institutsbiblio",id=found.id_institutsbibliographie) for entry in entries: self.ZSQLChange(_table='publications',_identify='oid=%s' % found.oid,year=entry.year,referencetype=entry.reference_type) @@ -757,14 +759,15 @@ class MPIWGRoot(ZSQLExtendFolder): return True - def updateHomepage_neu(self,RESPONSE=None): + def updateHomepages(self,RESPONSE=None): """ update""" + RESPONSE.setHeader('Content-type', 'text/html') RESPONSE.write("
\n") url="http://itgroup.mpiwg-berlin.mpg.de:8050/FMPro?-db=personal-www&-format=-dso_xml&-lay=sql_export&-max=10000&-findall" dom = NonvalidatingReader.parseUri(url) #fh=urllib.urlopen(url) #dom=xml.dom.minidom.parse(fh) - + RESPONSE.write("got_xml_File\n") memberFolder=getattr(self,'members') @@ -810,8 +813,9 @@ class MPIWGRoot(ZSQLExtendFolder): project=getattr(self,'members') if not (username in memberList):#neuer eintrag + try: - newObj=MPIWGStaff.MPIWGStaff(str(username),name,vorname) + newObj=MPIWGStaff.MPIWGStaff(str(username),name.encode('utf-8'),vorname.encode('utf-8')) memberFolder._setObject(str(username),newObj) RESPONSE.write("new:%s
\n"%username.encode('utf-8')) obj=getattr(memberFolder,username) @@ -820,7 +824,7 @@ class MPIWGRoot(ZSQLExtendFolder): e_mail_p,date_from,date_to, abteilung,heimat_inst,funded_by, e_mail2,txt,txt_p) - RESPONSE.write("""%s
"""%ret[1]) + RESPONSE.write("""%s
"""%ret[1].encode('utf-8')) except: RESPONSE.write("ERROR:%s %s %s
\n"%(username.encode('utf-8'),name.encode('utf-8'),vorname.encode('utf-8'))) RESPONSE.write(": %s %s"%sys.exc_info()[:2]) @@ -847,11 +851,34 @@ class MPIWGRoot(ZSQLExtendFolder): date_from=date_from, date_to=date_to) + self.reindexCatalogs(RESPONSE) + + self.updatePublicationDB() + + RESPONSE.write("