version 1.23, 2004/08/28 14:14:44
|
version 1.30, 2004/09/10 19:59:28
|
Line 80 class MPIWGRoot(ZSQLExtendFolder):
|
Line 80 class MPIWGRoot(ZSQLExtendFolder):
|
return "" |
return "" |
|
|
|
|
|
def redirectIndex_html(self,request): |
|
#return request['URL1']+'/index_html' |
|
|
|
return urllib.urlopen(request['URL1']+'/index_html').read() |
|
|
|
|
def formatBibliography(self,here,found): |
def formatBibliography(self,here,found): |
"""format""" |
"""format""" |
return formatBibliography(here,found) |
return formatBibliography(here,found) |
Line 362 class MPIWGRoot(ZSQLExtendFolder):
|
Line 368 class MPIWGRoot(ZSQLExtendFolder):
|
|
|
|
|
splitted=line.split(",") |
splitted=line.split(",") |
print splitted |
# print splitted |
|
|
if not (splitted[0]==""): |
if not (splitted[0]==""): |
newObj=MPIWGStaff.MPIWGStaff(splitted[0],splitted[1],splitted[2]) |
newObj=MPIWGStaff.MPIWGStaff(splitted[0],splitted[1],splitted[2]) |
|
|
try: |
try: |
project._setObject(splitted[0],newObj) |
project._setObject(splitted[0],newObj) |
print "done:",splitted[0] |
#print "done:",splitted[0] |
except: |
except: |
print "not done:",splitted[0] |
print "not done:",splitted[0] |
|
|
Line 428 class MPIWGRoot(ZSQLExtendFolder):
|
Line 434 class MPIWGRoot(ZSQLExtendFolder):
|
def formatElementForOverview(self,element): |
def formatElementForOverview(self,element): |
"""format the element for output in overview""" |
"""format the element for output in overview""" |
if element[0]==1: #department |
if element[0]==1: #department |
print element[3].getContent('xdata_05') |
#print element[3].getContent('xdata_05') |
if element[3].getContent('xdata_05') == "4": |
if element[3].getContent('xdata_05') == "4": |
return """<h2><a href="%s">Ind. Research Group II: %s</a></h2>"""%(element[3].absolute_url(),element[3].getContent('WEB_title')) |
return """<h2><a href="%s">Ind. Research Group I: %s</a></h2>"""%(element[3].absolute_url()+"/index.html",element[3].getContent('WEB_title')) |
|
if element[3].getContent('xdata_05') == "5": |
|
return """<h2><a href="%s">Ind. Research Group II: %s</a></h2>"""%(element[3].absolute_url()+"/index.html",element[3].getContent('WEB_title')) |
|
|
return """<h2><a href="%s">Department %s: %s</a></h2>"""%(element[3].absolute_url(),element[3].getContent('xdata_05'),element[3].getContent('WEB_title')) |
return """<h2><a href="%s">Department %s: %s</a></h2>"""%(element[3].absolute_url()+"/index.html",element[3].getContent('xdata_05'),element[3].getContent('WEB_title')) |
|
|
elif element[0]==2: #mainprojects |
elif element[0]==2: #mainprojects |
return """<h3><a href="%s">%s</a></h3><p>"""%(element[3].absolute_url(),element[3].getContent('WEB_title')) |
return """<h3><a href="%s">%s</a></h3><p>"""%(element[3].absolute_url()+"/index.html",element[3].getContent('WEB_title')) |
|
|
elif element[0]==3: |
elif element[0]==3: |
return """<p><a href="%s">%s</a></p>"""%(element[3].absolute_url(),element[3].getContent('WEB_title')) |
return """<p class="p_noindent"><a href="%s">%s</a></p>"""%(element[3].absolute_url()+"/index.html",element[3].getContent('WEB_title')) |
|
|
def changePosition(self,treeId,select,RESPONSE=None): |
def changePosition(self,treeId,select,RESPONSE=None): |
"""Change Postion Entry""" |
"""Change Postion Entry""" |
Line 522 class MPIWGRoot(ZSQLExtendFolder):
|
Line 530 class MPIWGRoot(ZSQLExtendFolder):
|
|
|
if proj: |
if proj: |
#ret.append("<a href=%s >%s</a>"%(proj[0].absolute_url,person.encode('utf-8'))) |
#ret.append("<a href=%s >%s</a>"%(proj[0].absolute_url,person.encode('utf-8'))) |
ret.append("<a href=%s >%s</a>"%('members/'+proj[0].id,person)) |
ret.append("<a href=%s >%s</a>"%('members/'+proj[0].id+'/index.html',person)) |
else: |
else: |
#ret.append("%s"%person.encode('utf-8')) |
#ret.append("%s"%person.encode('utf-8')) |
ret.append("%s"%person) |
ret.append("%s"%person) |
Line 538 class MPIWGRoot(ZSQLExtendFolder):
|
Line 546 class MPIWGRoot(ZSQLExtendFolder):
|
if len(person)>1: #nicht nur Trennzeichen |
if len(person)>1: #nicht nur Trennzeichen |
splitted=person.split(",") |
splitted=person.split(",") |
if len(splitted)==1: |
if len(splitted)==1: |
splitted=person.split(" ") |
splitted=person.lstrip().rstrip().split(" ") |
splittedNew=[re.sub(r'\s(.*)','$1',split) for split in splitted] |
splittedNew=[re.sub(r'\s(.*)','$1',split) for split in splitted] |
if splittedNew[0]=='': |
if splittedNew[0]=='': |
del splittedNew[0] |
del splittedNew[0] |
Line 553 class MPIWGRoot(ZSQLExtendFolder):
|
Line 561 class MPIWGRoot(ZSQLExtendFolder):
|
|
|
if proj: |
if proj: |
#ret.append("<a href=%s >%s</a>"%(proj[0].absolute_url,person.encode('utf-8'))) |
#ret.append("<a href=%s >%s</a>"%(proj[0].absolute_url,person.encode('utf-8'))) |
ret.append("<a href=%s >%s</a>"%(proj[0].absolute_url,person)) |
ret.append("<a href=%s >%s</a>"%(proj[0].absolute_url+"/index.html",person)) |
else: |
else: |
#ret.append("%s"%person.encode('utf-8')) |
#ret.append("%s"%person.encode('utf-8')) |
ret.append("%s"%person) |
ret.append("%s"%person) |
Line 585 class MPIWGRoot(ZSQLExtendFolder):
|
Line 593 class MPIWGRoot(ZSQLExtendFolder):
|
|
|
y=name |
y=name |
splitted=y.split(",") |
splitted=y.split(",") |
for s in splitted: |
#XXXX |
splitNeu.append("\""+s+"\"") |
splitNeu=["\'"+splitted[1]+" "+splitted[0]+"\'"] |
|
|
|
#for s in splitted: |
|
# splitNeu.append("\""+s+"\"") |
search=string.join(splitNeu,' AND ') |
search=string.join(splitNeu,' AND ') |
|
|
proj=self.ProjectCatalog({'xdata_01':search}) |
proj=self.ProjectCatalog({'xdata_01':search}) |
|
|
if proj: |
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) |
# proj2.sort(sortP) |
# ret.append((y,proj2)) |
# ret.append((y,proj2)) |
else: |
else: |
Line 617 class MPIWGRoot(ZSQLExtendFolder):
|
Line 635 class MPIWGRoot(ZSQLExtendFolder):
|
|
|
splitted=name.split(",") |
splitted=name.split(",") |
if len(splitted)==1: |
if len(splitted)==1: |
splitted=name.split(" ") |
splitted=name.lstrip().rstrip().split(" ") |
splittedNew=[re.sub(r'\s(.*)','$1',split) for split in splitted] |
splittedNew=[split.lstrip() for split in splitted] |
|
|
if splittedNew[0]=='': |
if splittedNew[0]=='': |
del splittedNew[0] |
del splittedNew[0] |
search=string.join(splittedNew,' AND ') |
search=string.join(splittedNew,' AND ') |
Line 812 class MPIWGProject(Folder):
|
Line 831 class MPIWGProject(Folder):
|
"""nothing""" |
"""nothing""" |
|
|
text2=re.sub(r';([^\s])','; \g<1>',text) |
text2=re.sub(r';([^\s])','; \g<1>',text) |
|
#teste ob ergebnis leer und header dann nehme title |
|
|
|
if (text2=='') and (field=='WEB_project_header'): |
|
return self.getContent('WEB_title') |
|
|
|
#teste ob WEB_project_description und keine führenden p tags |
|
if (len(text2)>4) and (not text2[0:3]=='<p>') and (field=='WEB_project_description'): |
|
return "<p>"+text2+"</p>" |
|
|
return text2 |
return text2 |
|
|
def show_html(self): |
def show_html(self): |