--- MPIWGWeb/MPIWGProjects.py 2004/09/01 09:35:12 1.24 +++ MPIWGWeb/MPIWGProjects.py 2004/09/10 18:40:56 1.29 @@ -79,7 +79,13 @@ class MPIWGRoot(ZSQLExtendFolder): else: return "" + + def redirectIndex_html(self,request): + #return request['URL1']+'/index_html' + return urllib.urlopen(request['URL1']+'/index_html').read() + + def formatBibliography(self,here,found): """format""" return formatBibliography(here,found) @@ -362,14 +368,14 @@ class MPIWGRoot(ZSQLExtendFolder): splitted=line.split(",") - print splitted + # print splitted if not (splitted[0]==""): newObj=MPIWGStaff.MPIWGStaff(splitted[0],splitted[1],splitted[2]) try: project._setObject(splitted[0],newObj) - print "done:",splitted[0] + #print "done:",splitted[0] except: print "not done:",splitted[0] @@ -428,19 +434,19 @@ class MPIWGRoot(ZSQLExtendFolder): def formatElementForOverview(self,element): """format the element for output in overview""" if element[0]==1: #department - print element[3].getContent('xdata_05') + #print element[3].getContent('xdata_05') if element[3].getContent('xdata_05') == "4": - return """

Ind. Research Group II: %s

"""%(element[3].absolute_url(),element[3].getContent('WEB_title')) + return """

Ind. Research Group I: %s

"""%(element[3].absolute_url()+"/index.html",element[3].getContent('WEB_title')) if element[3].getContent('xdata_05') == "5": - return """

Ind. Research Group I: %s

"""%(element[3].absolute_url(),element[3].getContent('WEB_title')) + return """

Ind. Research Group II: %s

"""%(element[3].absolute_url()+"/index.html",element[3].getContent('WEB_title')) - return """

Department %s: %s

"""%(element[3].absolute_url(),element[3].getContent('xdata_05'),element[3].getContent('WEB_title')) + return """

Department %s: %s

"""%(element[3].absolute_url()+"/index.html",element[3].getContent('xdata_05'),element[3].getContent('WEB_title')) elif element[0]==2: #mainprojects - return """

%s

"""%(element[3].absolute_url(),element[3].getContent('WEB_title')) + return """

%s

"""%(element[3].absolute_url()+"/index.html",element[3].getContent('WEB_title')) elif element[0]==3: - return """

%s

"""%(element[3].absolute_url(),element[3].getContent('WEB_title')) + return """

%s

"""%(element[3].absolute_url()+"/index.html",element[3].getContent('WEB_title')) def changePosition(self,treeId,select,RESPONSE=None): """Change Postion Entry""" @@ -524,7 +530,7 @@ class MPIWGRoot(ZSQLExtendFolder): if proj: #ret.append("%s"%(proj[0].absolute_url,person.encode('utf-8'))) - ret.append("%s"%('members/'+proj[0].id,person)) + ret.append("%s"%('members/'+proj[0].id+'/index.html',person)) else: #ret.append("%s"%person.encode('utf-8')) ret.append("%s"%person) @@ -540,7 +546,7 @@ class MPIWGRoot(ZSQLExtendFolder): if len(person)>1: #nicht nur Trennzeichen splitted=person.split(",") if len(splitted)==1: - splitted=person.split(" ") + splitted=person.lstrip().rstrip().split(" ") splittedNew=[re.sub(r'\s(.*)','$1',split) for split in splitted] if splittedNew[0]=='': del splittedNew[0] @@ -555,7 +561,7 @@ class MPIWGRoot(ZSQLExtendFolder): if proj: #ret.append("%s"%(proj[0].absolute_url,person.encode('utf-8'))) - ret.append("%s"%(proj[0].absolute_url,person)) + ret.append("%s"%(proj[0].absolute_url+"/index.html",person)) else: #ret.append("%s"%person.encode('utf-8')) ret.append("%s"%person) @@ -586,14 +592,24 @@ class MPIWGRoot(ZSQLExtendFolder): name = members[0][1].title.decode('utf-8') y=name - splitted=y.split(",") - for s in splitted: - splitNeu.append("\""+s+"\"") + splitted=y.split(",") + #XXXX + splitNeu=["\'"+splitted[1]+" "+splitted[0]+"\'"] + + #for s in splitted: + # splitNeu.append("\""+s+"\"") search=string.join(splitNeu,' AND ') - + proj=self.ProjectCatalog({'xdata_01':search}) + if proj: - proj2=[x for x in proj] + proj2=[] + for x in proj: + + if not((splitted[1]==" Christoph") and (splitted[0]=="Hoffmann") and (str(x.WEB_title).find('Einstein')>0)): + + #print repr(splitted[1]),repr(splitted[0]),repr(x.WEB_title) + proj2.append(x) # proj2.sort(sortP) # ret.append((y,proj2)) else: @@ -619,8 +635,9 @@ class MPIWGRoot(ZSQLExtendFolder): splitted=name.split(",") if len(splitted)==1: - splitted=name.split(" ") - splittedNew=[re.sub(r'\s(.*)','$1',split) for split in splitted] + splitted=name.lstrip().rstrip().split(" ") + splittedNew=[split.lstrip() for split in splitted] + if splittedNew[0]=='': del splittedNew[0] search=string.join(splittedNew,' AND ')