version 1.47.2.116, 2010/07/23 17:30:38
|
version 1.47.2.117, 2010/09/13 11:23:58
|
Line 25 from AccessControl import getSecurityMan
|
Line 25 from AccessControl import getSecurityMan
|
from bibliography import * |
from bibliography import * |
import time |
import time |
from OFS.Cache import Cacheable |
from OFS.Cache import Cacheable |
|
import xmlrpclib |
#import xml.dom.minidom |
#import xml.dom.minidom |
import sys |
import sys |
#from Ft.Xml.XPath import Evaluate |
#from Ft.Xml.XPath import Evaluate |
Line 72 class MPIWGProject_publication(Folder):
|
Line 73 class MPIWGProject_publication(Folder):
|
logging.debug(email.Utils.formatdate()+' GMT') |
logging.debug(email.Utils.formatdate()+' GMT') |
RESPONSE.redirect(url+addStr%timeStamp) |
RESPONSE.redirect(url+addStr%timeStamp) |
|
|
def editPublication(self,text=None,image1=None,image2=None,description=None,RESPONSE=None): |
def hasLinkToBookPage(self): |
|
"""teste ob eingebener link zu einer MPIWG Book page geht""" |
|
|
|
if (getattr(self,'link','')==''): |
|
return False #es gibt keinen link |
|
|
|
server = xmlrpclib.ServerProxy(self.link) |
|
|
|
try: |
|
server.getImageUrls() |
|
return True |
|
except: |
|
return False |
|
|
|
|
|
def getImageUrls(self): |
|
"""get the image urls""" |
|
|
|
if (getattr(self,'link','')==''): |
|
return False #es gibt keinen link |
|
|
|
server = xmlrpclib.ServerProxy(self.link) |
|
|
|
try: |
|
urls = server.getImageUrls() |
|
ret=[] |
|
for url in urls: |
|
url = os.path.join(self.link,url) |
|
ret.append(url) |
|
|
|
except: |
|
return [] |
|
|
|
return ret |
|
|
|
def editPublication(self,text=None,image1=None,image2=None,description=None,link=None,RESPONSE=None): |
"""edit a publication""" |
"""edit a publication""" |
|
|
if (not text) and (not description): |
if (not text) and (not description): |
Line 80 class MPIWGProject_publication(Folder):
|
Line 116 class MPIWGProject_publication(Folder):
|
return pt() |
return pt() |
|
|
|
|
|
if text: |
self.text=text[0:] |
self.text=text[0:] |
|
|
|
if description: |
self.description=description |
self.description=description |
|
|
|
if link: |
|
self.link=link[0:] |
|
|
if image1: |
if image1: |
if hasattr(self,'publicationImage1'): |
if hasattr(self,'publicationImage1'): |
self.publicationImage1.manage_upload(image1) |
self.publicationImage1.manage_upload(image1) |
Line 177 class MPIWGProject(CatalogAware,Folder,C
|
Line 219 class MPIWGProject(CatalogAware,Folder,C
|
pubSplit=pubSplit.replace("</p>","") |
pubSplit=pubSplit.replace("</p>","") |
self.addPublication(pubSplit) |
self.addPublication(pubSplit) |
|
|
|
setattr(self,"WEB_related_pub_copied",True); |
|
|
if RESPONSE: |
if RESPONSE: |
|
|
self.redirect(RESPONSE,'managePublications') |
self.redirect(RESPONSE,'managePublications') |
|
|
|
def hasRelatedPublicationsOldVersion(self): |
|
"""teste ob es related publications gibt""" |
|
|
|
ret = True; |
|
if (self.getContent('WEB_related_pub')==''): |
|
ret=False; #nichts im alten feld |
|
logging.debug("webrel:"+repr(ret)) |
|
if (getattr(self,'WEB_related_pub_copied',False)): |
|
ret=False; # alte daten sind schon kopiert worden |
|
|
|
logging.debug("webrel_copied:"+repr(ret)) |
|
publications=self.ZopeFind(self,obj_metatypes=['MPIWGProject_publication']); |
|
|
|
if(len(publications)>0): |
|
ret=False; # es gibt publicationen in der neuen liste |
|
|
|
|
|
logging.debug("len(publ)"+repr(ret)) |
|
|
|
return ret; |
|
|
|
def hasRelatedDigitalSources(self): |
|
"""test ob es digital sources gibt""" |
|
|
|
|
|
ret = (self.getContent('xdata_11')=='' and self.getContent('xdata_13')=='') |
|
|
|
|
|
|
|
return not ret; |
|
|
|
|
|
|
|
|
def copyImageToMargin(self,RESPONSE=None): |
def copyImageToMargin(self,RESPONSE=None): |
"""copy inline images to marginal images""" |
"""copy inline images to marginal images""" |