Mercurial > hg > MPIWGWeb
changeset 246:8fca81581883
getConeIDsFromDB added
author | dwinter |
---|---|
date | Tue, 25 Feb 2014 08:07:59 +0100 |
parents | 45ef92d6aa8c |
children | 5584046a6a04 |
files | MPIWGStaff.py |
diffstat | 1 files changed, 27 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/MPIWGStaff.py Wed Jan 08 14:24:36 2014 +0100 +++ b/MPIWGStaff.py Tue Feb 25 08:07:59 2014 +0100 @@ -309,6 +309,33 @@ return ret+"</body></html>" + def getConeIDsFromDB(self,REQUEST): + """holt die cone ids aus personalwww und gibt sie als RDF fuer den cone import zurueck""" + + qs = "select personal_www.last_name, personal_www.first_name, keys.coneid from personal_www inner join keys on personal_www.key = keys.key_main;" + coneIds = self.executeZSQL(qs) + + ret="""<?xml version="1.0" encoding="UTF-8"?> +<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> +""" + + templ=""" + <rdf:Description rdf:about="%s"> + <dc:title>%s, %s</dc:title> + </rdf:Description> + """ + print coneIds.names() + for coneId in coneIds: + + ret+=templ%(coneId["coneid"],coneId["last_name"],coneId["first_name"]) + + ret+=""" + </rdf:RDF> + """ + if REQUEST is not None: + REQUEST.response.setHeader("Content-type", "text/XML") + return ret + def manage_addMPIWGStaffFolderForm(self): """form for adding the project""" pt=PageTemplateFile('zpt/addMPIWGStaffFolderForm', globals()).__of__(self)