--- MPIWGWeb/MPIWGProjects.py 2005/10/14 17:13:37 1.47.2.33 +++ MPIWGWeb/MPIWGProjects.py 2006/05/18 13:00:26 1.47.2.52 @@ -4,6 +4,7 @@ for organizing and maintaining the diffe """ #TODO: mechanismus fur links to personen ueberarbeiten, da jetzt alle e_mails als members auftauchen unabhaengig vom status publish_the_data #TODO: was passiert wenn aenderungen von jochen im filemaker nicht mit den aenderungen im sql uebereinstimmen +#TODO: in einzelnen projecte steht als pfad auf die bilder noch wwwneu statt www from Products.PageTemplates.PageTemplateFile import PageTemplateFile from Products.PageTemplates.PageTemplate import PageTemplate @@ -761,10 +762,10 @@ class MPIWGRoot(ZSQLExtendFolder): def updateHomepages(self,RESPONSE=None): """ update""" - #FIXME: seite wird hinter apache mehrfach ausgefŸhrt + 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" + url="http://itgroup.mpiwg-berlin.mpg.de:8050/FMPro?-db=personal-www&-format=-dso_xml&-lay=sql_export&-max=20000&-findall" dom = NonvalidatingReader.parseUri(url) #fh=urllib.urlopen(url) #dom=xml.dom.minidom.parse(fh) @@ -786,6 +787,7 @@ class MPIWGRoot(ZSQLExtendFolder): name=getTextFromNode(row.xpath('./dn:Name',explicitNss={'dn':'http://www.filemaker.com/fmpdsoresult'})[0]) vorname=getTextFromNode(row.xpath('./dn:Vorname',explicitNss={'dn':'http://www.filemaker.com/fmpdsoresult'})[0]) title=getTextFromNode(row.xpath('./dn:Title',explicitNss={'dn':'http://www.filemaker.com/fmpdsoresult'})[0]) + position=getTextFromNode(row.xpath('./dn:Position',explicitNss={'dn':'http://www.filemaker.com/fmpdsoresult'})[0]) e_mail=getTextFromNode(row.xpath('./dn:e_mail',explicitNss={'dn':'http://www.filemaker.com/fmpdsoresult'})[0]) e_mail_p=getTextFromNode(row.xpath('./dn:e_mail_p',explicitNss={'dn':'http://www.filemaker.com/fmpdsoresult'})[0]) date_from=getTextFromNode(row.xpath('./dn:Date_from',explicitNss={'dn':'http://www.filemaker.com/fmpdsoresult'})[0]) @@ -795,7 +797,7 @@ class MPIWGRoot(ZSQLExtendFolder): funded_by=getTextFromNode(row.xpath('./dn:funded_by',explicitNss={'dn':'http://www.filemaker.com/fmpdsoresult'})[0]) e_mail2=getTextFromNode(row.xpath('./dn:e_mail2',explicitNss={'dn':'http://www.filemaker.com/fmpdsoresult'})[0]) publish_the_data=getTextFromNode(row.xpath('./dn:publish_the_data',explicitNss={'dn':'http://www.filemaker.com/fmpdsoresult'})[0]) - + stay_at_mpiwg=getTextFromNode(row.xpath('./dn:stay_at_mpiwg',explicitNss={'dn':'http://www.filemaker.com/fmpdsoresult'})[0]) #cwNode=row.xpath('./dn:current_work.current',explicitNss={'dn':'http://www.filemaker.com/fmpdsoresult'})[0] cw=row.xpath('./dn:current_work/dn:DATA',explicitNss={'dn':'http://www.filemaker.com/fmpdsoresult'}) if cw: @@ -821,10 +823,10 @@ class MPIWGRoot(ZSQLExtendFolder): RESPONSE.write("new:%s
\n"%username.encode('utf-8')) obj=getattr(memberFolder,username) ret=obj.createNewDBEntry(publish_the_data,id,name, - vorname,username,title,e_mail, + vorname,username,title,position,e_mail, e_mail_p,date_from,date_to, abteilung,heimat_inst,funded_by, - e_mail2,txt,txt_p) + e_mail2,txt,txt_p,stay_at_mpiwg) 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'))) @@ -848,17 +850,31 @@ class MPIWGRoot(ZSQLExtendFolder): obj=getattr(memberFolder,username) - obj.updateDBEntry(DBid=id,publish_the_data=publish_the_data, + done= obj.updateDBEntry(DBid=id,publish_the_data=publish_the_data, date_from=date_from, - date_to=date_to) + date_to=date_to,stay_at_mpiwg=stay_at_mpiwg,position=position,abteilung=abteilung) + if not done and (publish_the_data=='yes'): + + ret=obj.createNewDBEntry(publish_the_data,id,name, + vorname,username,title,position,e_mail, + e_mail_p,date_from,date_to, + abteilung,heimat_inst,funded_by, + e_mail2,txt,txt_p,stay_at_mpiwg) + if not ret[0]: + + RESPONSE.write("Error: %s
\n"%repr(ret[1])) + else: + RESPONSE.write("New: %s
\n"%repr(ret[1])) - self.reindexCatalogs(RESPONSE) + #TODO: reindexCatlogs and updatePublications wieder einbaue + #self.reindexCatalogs(RESPONSE) - self.updatePublicationDB() - - RESPONSE.write("