version 1.47.2.22, 2005/09/14 20:45:56
|
version 1.47.2.27, 2005/10/11 13:14:01
|
Line 16 import re
|
Line 16 import re
|
import os |
import os |
from types import * |
from types import * |
import zLOG |
import zLOG |
import xmlhelper # Methoden zur Verwaltung der projekt xmls |
import xmlhelper # Methoden zur Verwaltung der projekt xml |
from OFS.SimpleItem import SimpleItem |
from OFS.SimpleItem import SimpleItem |
from OFS.Folder import Folder |
from OFS.Folder import Folder |
from Products.ZSQLMethods.SQL import SQLConnectionIDs |
from Products.ZSQLMethods.SQL import SQLConnectionIDs |
Line 700 class MPIWGRoot(ZSQLExtendFolder):
|
Line 700 class MPIWGRoot(ZSQLExtendFolder):
|
if RESPONSE is not None: |
if RESPONSE is not None: |
RESPONSE.redirect('manage_main') |
RESPONSE.redirect('manage_main') |
|
|
|
def updatePublicationDB(self,personId=None): |
|
"""updates the publication db, i.e. copy year into the main table""" |
|
|
|
if personId: |
|
founds = self.ZSQLInlineSearch(_table="publications",id_main=personId) |
|
else: |
|
founds = self.ZSQLInlineSearch(_table="publications") |
|
|
|
for found in founds: |
|
print found |
|
if found.id_institutsbibliographie and (not found.id_institutsbibliographie ==""): |
|
entries = self.ZSQLInlineSearch(_table="institutsbiblio",id=found.id_institutsbibliographie) |
|
for entry in entries: |
|
self.ZSQLChange(_table='publications',_identify='oid=%s' % found.oid,year=entry.year,referencetype=entry.reference_type) |
|
|
|
if found.id_gen_bib and (not found.id_gen_bib ==""): |
|
entries = self.ZSQLInlineSearch(_table="bibliography",id=found.id_gen_bib) |
|
for entry in entries: |
|
self.ZSQLChange(_table='publications',_identify='oid=%s' % found.oid,year=entry.year,referencetype=entry.reference_type) |
|
|
|
return True |
|
|
|
|
|
|
def updateHomepages(self,RESPONSE): |
def updateHomepages(self,RESPONSE): |
"""lege members an""" |
"""lege members an""" |
|
|
self.upDateSQL('personalwww.xml') |
self.upDateSQL('personalwww.xml') |
founds=self.ZSQLInlineSearch(_table='personal_www',publish_the_data='yes') |
founds=self.ZSQLInlineSearch(_table='personal_www',publish_the_data='yes') |
project=getattr(self,'members') |
project=getattr(self,'members') |
Line 718 class MPIWGRoot(ZSQLExtendFolder):
|
Line 741 class MPIWGRoot(ZSQLExtendFolder):
|
RESPONSE.write("<p>old:%s (%s,%s)</p>\n"%(found.username,found.name,found.vorname)) |
RESPONSE.write("<p>old:%s (%s,%s)</p>\n"%(found.username,found.name,found.vorname)) |
|
|
|
|
|
|
#delete non existing |
#delete non existing |
|
|
|
|
Line 733 class MPIWGRoot(ZSQLExtendFolder):
|
Line 757 class MPIWGRoot(ZSQLExtendFolder):
|
pass |
pass |
self.ProjectCatalog.manage_catalogReindex(self.REQUEST,RESPONSE,self.REQUEST['URL1']) |
self.ProjectCatalog.manage_catalogReindex(self.REQUEST,RESPONSE,self.REQUEST['URL1']) |
|
|
|
self.updatePublicationDB() |
|
|
if RESPONSE is not None: |
if RESPONSE is not None: |
RESPONSE.redirect('manage_main') |
RESPONSE.redirect('manage_main') |
Line 1298 class MPIWGProject(CatalogAware,Folder):
|
Line 1323 class MPIWGProject(CatalogAware,Folder):
|
"""get all Publications""" |
"""get all Publications""" |
def sort_images(x,y): |
def sort_images(x,y): |
return cmp(getattr(x[1],'place',0),getattr(y[1],'place',0)) |
return cmp(getattr(x[1],'place',0),getattr(y[1],'place',0)) |
print self.getId() |
|
publications=self.ZopeFind(self,obj_metatypes=['MPIWGProject_publication']) |
publications=self.ZopeFind(self,obj_metatypes=['MPIWGProject_publication']) |
|
|
publications.sort(sort_images) |
publications.sort(sort_images) |
Line 1340 class MPIWGProject(CatalogAware,Folder):
|
Line 1365 class MPIWGProject(CatalogAware,Folder):
|
"""get all Images""" |
"""get all Images""" |
def sort_images(x,y): |
def sort_images(x,y): |
return cmp(getattr(x[1],'place',0),getattr(y[1],'place',0)) |
return cmp(getattr(x[1],'place',0),getattr(y[1],'place',0)) |
print self.getId() |
|
images=self.ZopeFind(self,obj_metatypes=['MPIWGProject_image']) |
images=self.ZopeFind(self,obj_metatypes=['MPIWGProject_image']) |
|
|
images.sort(sort_images) |
images.sort(sort_images) |
Line 1710 class MPIWGProject(CatalogAware,Folder):
|
Line 1735 class MPIWGProject(CatalogAware,Folder):
|
def saveEditedContent(self,kupu=None,preview=None): |
def saveEditedContent(self,kupu=None,preview=None): |
"""save Edited content""" |
"""save Edited content""" |
|
|
|
if preview: |
kupu=preview |
kupu=preview |
#find content of body tags |
#find content of body tags |
start=kupu.find("<body>") |
start=kupu.find("<body>") |
Line 1717 class MPIWGProject(CatalogAware,Folder):
|
Line 1743 class MPIWGProject(CatalogAware,Folder):
|
newcontent= kupu[start+6:end] |
newcontent= kupu[start+6:end] |
|
|
if preview: |
if preview: |
|
|
return self.preview(newcontent) |
return self.preview(newcontent) |
|
|
|
self.copyObjectToArchive() |
self.WEB_project_description=newcontent[0:] |
self.WEB_project_description=newcontent[0:] |
|
|
self.REQUEST.RESPONSE.redirect("./edit") |
self.REQUEST.RESPONSE.redirect("./index.html") |
|
|
return True |
return True |
|
|
security.declareProtected('View managment screens','edit') |
security.declareProtected('View managment screens','edit') |
def edit(self): |
def edit(self,western=None): |
"""Edit pages""" |
"""Edit pages""" |
|
if western: |
|
self.REQUEST.RESPONSE.setCookie("MP_debug_code","western",path="/") |
|
|
|
|
pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','edit_MPIWGProjectNeu.zpt')).__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','edit_MPIWGProjectNeu.zpt')).__of__(self) |
return pt() |
return pt() |
|
|
Line 1749 class MPIWGProject(CatalogAware,Folder):
|
Line 1781 class MPIWGProject(CatalogAware,Folder):
|
|
|
def getWebProject_description(self): |
def getWebProject_description(self): |
"""get description""" |
"""get description""" |
|
debug= self.REQUEST.cookies.get("MP_debug_code",None) |
|
|
|
if debug and debug=="western": |
|
return """ |
|
<html> |
|
<head> |
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
|
</head> |
|
<body>%s |
|
</html></body> |
|
"""%self.WEB_project_description[0] |
|
|
|
return """ |
|
<html> |
|
<head> |
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
|
</head> |
|
<body>%s |
|
</html></body> |
|
"""%self.getContent('WEB_project_description') |
|
|
if type(self.WEB_project_description) is ListType: |
|
return "<html><body>"+self.WEB_project_description[0]+"</body></html>" |
|
else: |
|
return self.WEB_project_description |
|
|
|
|
|
def editMPIWGProjectForm(self): |
def editMPIWGProjectForm(self): |