version 1.47.2.44, 2005/12/22 21:09:00
|
version 1.47.2.47, 2006/01/16 15:21:47
|
Line 826 class MPIWGRoot(ZSQLExtendFolder):
|
Line 826 class MPIWGRoot(ZSQLExtendFolder):
|
vorname,username,title,position,e_mail, |
vorname,username,title,position,e_mail, |
e_mail_p,date_from,date_to, |
e_mail_p,date_from,date_to, |
abteilung,heimat_inst,funded_by, |
abteilung,heimat_inst,funded_by, |
e_mail2,txt,txt_p) |
e_mail2,txt,txt_p,stay_at_mpiwg) |
RESPONSE.write("""<p>%s</p>"""%ret[1].encode('utf-8')) |
RESPONSE.write("""<p>%s</p>"""%ret[1].encode('utf-8')) |
except: |
except: |
RESPONSE.write("<p>ERROR:%s %s %s</p>\n"%(username.encode('utf-8'),name.encode('utf-8'),vorname.encode('utf-8'))) |
RESPONSE.write("<p>ERROR:%s %s %s</p>\n"%(username.encode('utf-8'),name.encode('utf-8'),vorname.encode('utf-8'))) |
Line 859 class MPIWGRoot(ZSQLExtendFolder):
|
Line 859 class MPIWGRoot(ZSQLExtendFolder):
|
vorname,username,title,position,e_mail, |
vorname,username,title,position,e_mail, |
e_mail_p,date_from,date_to, |
e_mail_p,date_from,date_to, |
abteilung,heimat_inst,funded_by, |
abteilung,heimat_inst,funded_by, |
e_mail2,txt,txt_p) |
e_mail2,txt,txt_p,stay_at_mpiwg) |
if not ret[0]: |
if not ret[0]: |
|
|
RESPONSE.write("<p>Error: %s</p>\n"%repr(ret[1])) |
RESPONSE.write("<p>Error: %s</p>\n"%repr(ret[1])) |
Line 871 class MPIWGRoot(ZSQLExtendFolder):
|
Line 871 class MPIWGRoot(ZSQLExtendFolder):
|
|
|
#self.updatePublicationDB() |
#self.updatePublicationDB() |
|
|
self.ZSQLResetConnection() |
#self.ZSQLResetConnection() |
RESPONSE.write("<h2>Done</h2></body></html>") |
RESPONSE.write("<h2>Done</h2></body></html>") |
|
|
return True |
return True |
Line 1413 class MPIWGProject(CatalogAware,Folder):
|
Line 1413 class MPIWGProject(CatalogAware,Folder):
|
|
|
|
|
def copyImageToMargin(self,RESPONSE=None): |
def copyImageToMargin(self,RESPONSE=None): |
#TODO: copy more than one image |
|
"""copy inline images to marginal images""" |
"""copy inline images to marginal images""" |
self.getContent('WEB_project_description',filter='yes') |
|
|
|
filename=self.imageURL.split("/")[-1] |
|
|
#getImages from WEB_project_description |
|
description=self.getContent('WEB_project_description') |
|
|
|
text2=description |
|
splitted=text2.split("""<p class="picture">""") |
|
|
|
imageURLs=[] |
|
imageCaptions=[] |
|
for split in splitted[1:]: |
|
tmp=split.split("</p>") |
|
#return repr(splitted[1]) |
|
try: |
|
imageURLs.append(tmp[0].split("\"")[1].encode('utf-8')) |
|
except: |
|
imageURLs.append(tmp[0].split("src=")[1].split(" ")[0].encode('utf-8')) |
|
|
|
split2="</p>".join(tmp[1:]) |
|
|
|
|
|
splitted=split2.split("""<p class="picturetitle">""") |
|
if len(splitted)>1: |
|
tmp=splitted[1].split("</p>") |
|
imageCaptions.append(tmp[0].encode('utf-8')) |
|
|
|
|
|
else: |
|
#keine caption |
|
|
|
imageCaptions.append("") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#eintragen: |
|
for imageURL in imageURLs: |
|
filename=imageURL.split("/")[-1] |
#lege neues images object an, mit leerem bild |
#lege neues images object an, mit leerem bild |
|
|
if self.ZopeFind(self,obj_ids=[filename]): |
if self.ZopeFind(self,obj_ids=[filename]): |
#existiert das bild schon, dann neueun filenamen |
#existiert das bild schon, dann neuen filenamen |
filename="project_image_"+filename |
filename="project_image_"+filename |
|
|
self.addImage(None,self.imagecap,filename=filename) |
self.addImage(None,imageCaptions[imageURLs.index(imageURL)],filename=filename) |
#hole die bilddaten aus der url |
#hole die bilddaten aus der url |
url=self.absolute_url()+"/"+self.imageURL |
url=self.absolute_url()+"/"+imageURL |
#url=self.absolute_url()+"/"+filename |
#url=self.absolute_url()+"/"+filename |
|
|
try:#relative url |
try:#relative url |