--- MPIWGWeb/MPIWGProjects.py 2005/10/14 15:21:22 1.47.2.30 +++ MPIWGWeb/MPIWGProjects.py 2005/11/22 17:58:27 1.47.2.42 @@ -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 @@ -296,12 +297,12 @@ class MPIWGRoot(ZSQLExtendFolder): ids=[int(x.id[1:]) for x in founds] maximum=max(ids) - id_raw=self.ZSQLQuery("select nextval('id_raw_test')",debug=debug) + id_raw=self.ZSQLQuery("select nextval('id_raw')",debug=debug) if id_raw: - self.ZSQLQuery("drop sequence id_raw_test",debug=debug) + self.ZSQLQuery("drop sequence id_raw",debug=debug) - self.ZSQLQuery("create sequence id_raw_test start %i"%(maximum+1),debug=debug) + self.ZSQLQuery("create sequence id_raw start %i"%(maximum+1),debug=debug) def queryLink(self,link): @@ -761,8 +762,10 @@ class MPIWGRoot(ZSQLExtendFolder): 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" + 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) @@ -784,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]) @@ -793,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: @@ -819,7 +823,7 @@ 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) @@ -848,17 +852,15 @@ class MPIWGRoot(ZSQLExtendFolder): 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) - self.reindexCatalogs(RESPONSE) + #TODO: reindexCatlogs and updatePublications wieder einbaue + #self.reindexCatalogs(RESPONSE) - self.updatePublicationDB() - - if RESPONSE: - RESPONSE.redirect('manage_main') - + #self.updatePublicationDB() - + RESPONSE.write("