# HG changeset patch # User casties # Date 1365445709 -7200 # Node ID 5ed0b0c21fe59a3082493c404718a10fadcd3033 # Parent faa7c9e936a80c59e0441a20ee2591ac6da237c4 started to clean up MPIWGProject. diff -r faa7c9e936a8 -r 5ed0b0c21fe5 MPIWGProjects.py --- a/MPIWGProjects.py Fri Apr 05 19:01:59 2013 +0200 +++ b/MPIWGProjects.py Mon Apr 08 20:28:29 2013 +0200 @@ -7,27 +7,30 @@ from Products.PageTemplates.PageTemplateFile import PageTemplateFile from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate from Products.ZCatalog.CatalogPathAwareness import CatalogAware -from Products.MPIWGBibliography.BibliographyManager import BibliographyManager from OFS.Image import Image +from App.ImageFile import ImageFile +from OFS.SimpleItem import SimpleItem +from OFS.Folder import Folder +from OFS.Image import Image +from OFS.Cache import Cacheable +from AccessControl import ClassSecurityInfo +from AccessControl import getSecurityManager from Globals import package_home import urllib import re import os import email +import xmlhelper # Methoden zur Verwaltung der projekt xml +import xmlrpclib +import sys from types import * import logging -import xmlhelper # Methoden zur Verwaltung der projekt xml -from OFS.SimpleItem import SimpleItem -from OFS.Folder import Folder -from OFS.Image import Image -from AccessControl import ClassSecurityInfo -from AccessControl import getSecurityManager +import time + +from SrvTxtUtils import getInt, unicodify, utf8ify, refreshingImageFileIndexHtml +from Products.MPIWGBibliography.BibliographyManager import BibliographyManager from bibliography import * -import time -from OFS.Cache import Cacheable -import xmlrpclib #import xml.dom.minidom -import sys #from Ft.Xml.XPath import Evaluate #from Ft.Xml.XPath.Context import Context #from Ft.Xml.Domlette import NonvalidatingReader,PrettyPrint, Print @@ -260,6 +263,68 @@ meta_type='MPIWGProject' default_catalog='ProjectCatalog' + manage_options = Folder.manage_options+( + {'label':'Load New File','action':'loadNewFileForm'}, + {'label':'Edit','action':'editForm'}, + ) + + #{'label':'Edit ProjectInfo','action':'editMPIWGProjectForm'}, + #{'label':'Edit BasisInfo','action':'editMPIWGBasisForm'}, + #{'label':'Edit Publications','action':'editMPIWGRelatedPublicationsForm'}, + #{'label':'Edit Themes & Disciplines','action':'editMPIWGDisciplinesThemesForm'}, + #{'label':'Versionmanager','action':'versionManageForm'}, + + + # TODO: fix this + fieldLabels={'WEB_title':'WEB_Title', + 'xdata_01':'Responsible Scientists', + 'xdata_02':'Department', + 'xdata_03':'Historical Persons', + 'xdata_04':'Time period', + 'xdata_05':'Sorting number', + 'xdata_06':'Keywords', + 'xdata_07':'Short title', + 'xdata_08':'Other involved scholars' , + 'xdata_09':'Disciplines', + 'xdata_10':'Themes', + 'xdata_11':'Object Digitallibrary', + 'xdata_12':'Cooperation partners', + 'xdata_13':'Funding institutions', + 'WEB_project_header':'WEB_project_header', + 'WEB_project_description':'WEB_project_description', + 'WEB_related_pub':'WEB_related_pub'} + + checkFields = ['xdata_01'] + + edit_css = ImageFile('css/edit.css', globals()) + # make css refreshable for development + edit_css.index_html = refreshingImageFileIndexHtml + editForm = PageTemplateFile('zpt/project/edit_description', globals()) + edit_template = PageTemplateFile('zpt/project/edit_template', globals()) + # TODO: compat + edit_MPIWGProject_main = edit_template + + + def __init__(self, id, argv=None): + """initiere classe""" + + self.creationTime=time.strftime("%Y%m%d%H%M%S",time.localtime())[0:] + self.id=id + self.title=id + self.isActiveFlag=True #Flag is true is the project is still active, False if accomplished + self.responsibleScientistsList=[] # enthaelt die Lister der verantwortlichen Wissenschaftler in der Form (NAME, KEY), key ist "" flass Wissenschaftler nicht an unserem Haus + + if argv: + for arg in definedFields: + try: + setattr(self,arg,argv[arg]) + except: + setattr(self,arg,"") + else: + for arg in definedFields: + setattr(self,arg,'') + + def redirect(self,RESPONSE,url): """mache ein redirect mit einem angehaengten time stamp um ein reload zu erzwingen""" @@ -277,6 +342,10 @@ def decode(self,str): """return unicode object""" return unicodify(str) + + def isCheckField(self,fieldname): + """return chechfield""" + return (fieldname in checkFields) def sortedByPlace(self,metatype): """find metatype and sort by place""" @@ -436,7 +505,7 @@ pass - pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','MPIWGProject_manageImagesForm.zpt')).__of__(self) + pt = PageTemplateFile('zpt/project/edit_images', globals()).__of__(self) return pt() def managePublications(self,pubName=None,op=None): @@ -464,7 +533,7 @@ pass - pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','MPIWGProject_managePublicationsForm.zpt')).__of__(self) + pt=PageTemplateFile('zpt/project/edit_publications', globals()).__of__(self) return pt() def manageRelatedProjects(self,pubName=None,op=None): @@ -492,7 +561,7 @@ pass - pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','MPIWGProject_manageRelatedProjectsForm.zpt')).__of__(self) + pt=PageTemplateFile('zpt/project/edit_related_projects', globals()).__of__(self) return pt() @@ -870,35 +939,6 @@ if RESPONSE is not None: self.redirect(RESPONSE,'manage_main') - def __init__(self, id, argv=None): - """initiere classe""" - - self.creationTime=time.strftime("%Y%m%d%H%M%S",time.localtime())[0:] - self.id=id - self.title=id - self.isActiveFlag=True #Flag is true is the project is still active, False if accomplished - self.responsibleScientistsList=[] # enthaelt die Lister der verantwortlichen Wissenschaftler in der Form (NAME, KEY), key ist "" flass Wissenschaftler nicht an unserem Haus - - if argv: - for arg in definedFields: - try: - setattr(self,arg,argv[arg]) - except: - setattr(self,arg,"") - else: - for arg in definedFields: - setattr(self,arg,'') - - manage_options = Folder.manage_options+( - {'label':'Load New File','action':'loadNewFileForm'}, - {'label':'Edit ProjectInfo','action':'editMPIWGProjectForm'}, - {'label':'Edit BasisInfo','action':'editMPIWGBasisForm'}, - {'label':'Edit Publications','action':'editMPIWGRelatedPublicationsForm'}, - {'label':'Edit Themes & Disciplines','action':'editMPIWGDisciplinesThemesForm'}, - {'label':'Versionmanager','action':'versionManageForm'}, - ) - - def isActiveProject(self): """check if the project is still active, default is true, set to false is the project is accomplished""" return getattr(self,'isActiveFlag',True) @@ -1327,11 +1367,10 @@ 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) + pt = self.editForm return pt() - edit_MPIWGProject_main = PageTemplateFile('zpt/edit_MPIWGProject_main', globals()) def getPathStyle(self, path, selected, style=""): """returns a string with the given style + 'sel' if path == selected.""" @@ -1662,16 +1701,16 @@ return 1 return 0 - security.declareProtected('View management screens','editMPIWGBasisEditor') - def editMPIWGBasisEditor(self, identifiedNames=None): + security.declareProtected('View management screens','editBasic') + def editBasic(self, identifiedNames=None): """editform""" if not identifiedNames: identifiedNames=self.identifyNames(self.getContent('xdata_01')) # identifiedNames=self.getFullNameEntries() - logging.error("IdentifiedNames: %s"% repr(identifiedNames)) - pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','edit_MPIWGBasisNeu.zpt')).__of__(self) + logging.debug("IdentifiedNames: %s"%repr(identifiedNames)) + pt=PageTemplateFile('zpt/project/edit_basic', globals()).__of__(self) return pt(identifiedNames=identifiedNames) security.declareProtected('View management screens','editMPIWGBasisForm') diff -r faa7c9e936a8 -r 5ed0b0c21fe5 MPIWGRoot.py --- a/MPIWGRoot.py Fri Apr 05 19:01:59 2013 +0200 +++ b/MPIWGRoot.py Mon Apr 08 20:28:29 2013 +0200 @@ -53,6 +53,7 @@ #{'label':'Store Historical Persons','action':'storeHistoricalPersons'}, ) + # TODO: is this used here? fieldLabels={'WEB_title':'WEB_Title', 'xdata_01':'Responsible Scientists', 'xdata_02':'Department', @@ -1269,9 +1270,9 @@ return x + # TODO: do we need this here? def isCheckField(self,fieldname): """return chechfield""" - return (fieldname in checkFields) diff -r faa7c9e936a8 -r 5ed0b0c21fe5 css/edit.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/css/edit.css Mon Apr 08 20:28:29 2013 +0200 @@ -0,0 +1,43 @@ +@CHARSET "UTF-8"; + +.title { + color: #010658; +} +div.content { + padding: 5px 5px 5px 5px; + margin-top: 5px; + background-color: #eeeeee; +} +div.mainnav a { + font-weight: bold; +} +.mainmenu { + padding: 5px 5px 5px 5px; + margin-bottom: 5px; + background-color: #000066; +} +.mainmenu a { + text-decoration: none; + font-weight: bold; + color: #ffffff; +} +.mainmenusel { + border-width: 3px; + border-color: #000066; + border-style: solid solid none solid; + padding: 5px 5px 5px 5px; + margin-bottom: 5px; + background-color: #eeeeee; +} +.mainmenusel a { + text-decoration: none; + font-weight: bold; + color: #000066; +} +#kupu-toolbox-links { + display : none; +} + +#kupu-toolbox-images { + display : none; +} diff -r faa7c9e936a8 -r 5ed0b0c21fe5 css/mpiwg.css --- a/css/mpiwg.css Fri Apr 05 19:01:59 2013 +0200 +++ b/css/mpiwg.css Mon Apr 08 20:28:29 2013 +0200 @@ -425,7 +425,7 @@ font-weight: normal; margin-top: 0; } -/* "current research topic */ +/* current research topic */ div.teaser_text h2 { font-size: 14px; color: #887163; diff -r faa7c9e936a8 -r 5ed0b0c21fe5 zpt/MPIWGProject_manageImagesForm.zpt --- a/zpt/MPIWGProject_manageImagesForm.zpt Fri Apr 05 19:01:59 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - -
ImageCaption
- up
- down -
- - - - Edit
- Delete -
- -

Add an Image

- -
- - - - - - -
ImageCaption
-

-
- -

(if the marginal image from your current project description is not occuring in this list, click here.)

-
- - diff -r faa7c9e936a8 -r 5ed0b0c21fe5 zpt/MPIWGProject_managePublicationsForm.zpt --- a/zpt/MPIWGProject_managePublicationsForm.zpt Fri Apr 05 19:01:59 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - -
- up
- down -
- - Edit
- Delete -
- -

Add a publication

-
- -

-
-

(If the publications from your current project description are not showing in this list, click here to copy them.)

-

- - Manage Extended Publication List - - - - Create Extended Publication List - -

-
- - diff -r faa7c9e936a8 -r 5ed0b0c21fe5 zpt/MPIWGProject_manageRelatedProjectsForm.zpt --- a/zpt/MPIWGProject_manageRelatedProjectsForm.zpt Fri Apr 05 19:01:59 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - -
- up
- down -
- - - Edit
- Delete -
- -

Add related projects

-

Please add the link to the project you want to add a relation to.

-
- -

-
- -
- - diff -r faa7c9e936a8 -r 5ed0b0c21fe5 zpt/edit_MPIWGBasisNeu.zpt --- a/zpt/edit_MPIWGBasisNeu.zpt Fri Apr 05 19:01:59 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Project Title - -
- - - : - found - not found - -
-
Project is visiblevisible (status cannot be changed, because the project has visible children.) - - - - - - - - WARNING: This project is not visible, but has visible children. - -
Completed at: - - (format dd.mm.yyyy or mm.yyyy or yyyy) -
Startet at: - - (format dd.mm.yyyy or mm.yyyy or yyyy) -
- - -

Names

- - - - - - - - -
- - - - - - - - - - - - - - -
- - -
- -
-

-
- -
- - diff -r faa7c9e936a8 -r 5ed0b0c21fe5 zpt/edit_MPIWGProjectNeu.zpt --- a/zpt/edit_MPIWGProjectNeu.zpt Fri Apr 05 19:01:59 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ - - - - - - - -
-
- - - - - - -
- - saveEditedContent - - - - - - -
- - -
-
- -
- - - -
-
- - - - - - - - -
-

-
-
- - diff -r faa7c9e936a8 -r 5ed0b0c21fe5 zpt/edit_MPIWGProject_main.zpt --- a/zpt/edit_MPIWGProject_main.zpt Fri Apr 05 19:01:59 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ - - - - - - - - - - - - - -

(!!Project is not visible!!)

-

Edit project

- - -
- -
- - \ No newline at end of file diff -r faa7c9e936a8 -r 5ed0b0c21fe5 zpt/project/edit_basic.zpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/project/edit_basic.zpt Mon Apr 08 20:28:29 2013 +0200 @@ -0,0 +1,108 @@ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Project Title
+ + + : + found + + not found + + +
+
Project is visiblevisible (status cannot be changed, because the project has visible children.) + WARNING: This project is not visible, but has visible children. +
Started at: + (format dd.mm.yyyy or mm.yyyy or yyyy)
Completed at: (format dd.mm.yyyy or mm.yyyy or yyyy)
+ + +

Names

+ + + + + + + +
+ + + + + + +
+ + +
+ +
+

+ +

+
+ +
+ + diff -r faa7c9e936a8 -r 5ed0b0c21fe5 zpt/project/edit_description.zpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/project/edit_description.zpt Mon Apr 08 20:28:29 2013 +0200 @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+ + saveEditedContent + + + + + + +
+ + +
+
+ +
+ + + +
+
+ + + + + + + + +
+

+
+
+ + diff -r faa7c9e936a8 -r 5ed0b0c21fe5 zpt/project/edit_images.zpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/project/edit_images.zpt Mon Apr 08 20:28:29 2013 +0200 @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + +
ImageCaption
+ up
+ down +
+ + + + Edit
+ Delete +
+ +

Add an Image

+ +
+ + + + + + +
ImageCaption
+

+
+ +

(if the marginal image from your current project description is not in this list, click here.)

+
+ + diff -r faa7c9e936a8 -r 5ed0b0c21fe5 zpt/project/edit_publications.zpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/project/edit_publications.zpt Mon Apr 08 20:28:29 2013 +0200 @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + +
+ up
+ down +
+ + Edit
+ Delete +
+ +

Add a publication

+
+ +

+
+

(If the publications from your current project description are not showing in this list, click here to copy them.)

+

+ + Manage Extended Publication List + + + + Create Extended Publication List + +

+
+ + diff -r faa7c9e936a8 -r 5ed0b0c21fe5 zpt/project/edit_related_projects.zpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/project/edit_related_projects.zpt Mon Apr 08 20:28:29 2013 +0200 @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + +
+ up
+ down +
+ + + Edit
+ Delete +
+ +

Add related projects

+

Please add the link to the project you want to add a relation to.

+
+ +

+
+ +
+ + diff -r faa7c9e936a8 -r 5ed0b0c21fe5 zpt/project/edit_template.zpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/project/edit_template.zpt Mon Apr 08 20:28:29 2013 +0200 @@ -0,0 +1,26 @@ + + + + + + + + +

(!!Project is not visible!!)

+

Edit project

+ + +
+ +
+ + \ No newline at end of file