comparison MPIWGRoot.py @ 2:ddf6c1a27a4b

new version with main_template and css in product.
author casties
date Thu, 07 Feb 2013 19:50:39 +0100
parents 1f2760ed3efe
children 5db416602e85
comparison
equal deleted inserted replaced
1:1f2760ed3efe 2:ddf6c1a27a4b
1 from Products.PageTemplates.PageTemplateFile import PageTemplateFile 1 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
2 from Products.PageTemplates.PageTemplate import PageTemplate 2 from App.ImageFile import ImageFile
3 from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate 3
4 from Products.ZSQLExtend.ZSQLExtend import ZSQLExtendFolder 4 from Products.ZSQLExtend.ZSQLExtend import ZSQLExtendFolder
5 from Products.ZCatalog.CatalogPathAwareness import CatalogAware 5 from Products.ZCatalog.CatalogPathAwareness import CatalogAware
6 from OFS.Image import Image 6 from OFS.Image import Image
7 from Globals import package_home 7 from Globals import package_home
8 import urllib 8 import urllib
9 import MPIWGStaff
10 import string 9 import string
11 import re 10 import re
12 import os 11 import os
13 from types import * 12 from types import *
14 import logging 13 import logging
15 import xmlhelper # Methoden zur Verwaltung der projekt xml
16 from OFS.SimpleItem import SimpleItem 14 from OFS.SimpleItem import SimpleItem
17 from OFS.Folder import Folder 15 from OFS.Folder import Folder
18 from Products.ZSQLMethods.SQL import SQLConnectionIDs
19 from AccessControl import ClassSecurityInfo 16 from AccessControl import ClassSecurityInfo
20 from bibliography import *
21 import time 17 import time
22 import xml.dom.minidom 18 import xml.dom.minidom
23 import sys 19 import sys
24 import transaction 20 import transaction
25
26 #from Ft.Xml.XPath import Evaluate
27 #from Ft.Xml.XPath.Context import Context
28 #from Ft.Xml.Domlette import NonvalidatingReader,PrettyPrint, Print
29 #from Ft.Xml import EMPTY_NAMESPACE
30 import copy 21 import copy
31 import updatePersonalWWW
32 import MPIWGStaff
33 from MPIWGHelper import *
34 from BeautifulSoup import BeautifulSoup, Comment 22 from BeautifulSoup import BeautifulSoup, Comment
35 from ZODB import FileStorage, DB 23 from ZODB import FileStorage, DB
36 from ZEO import ClientStorage 24 from ZEO import ClientStorage
25
26
27 from MPIWGHelper import *
28 import updatePersonalWWW
29 from bibliography import *
30 import MPIWGStaff
31 from SrvTxtUtils import getInt, utf8ify, refreshingImageFileIndexHtml
32
37 33
38 def sortWeight(x,y): 34 def sortWeight(x,y):
39 x1=int(getattr(x[1],'weight','0')) 35 x1=int(getattr(x[1],'weight','0'))
40 y1=int(getattr(y[1],'weight','0')) 36 y1=int(getattr(y[1],'weight','0'))
41 return cmp(x1,y1) 37 return cmp(x1,y1)
44 class MPIWGRoot(ZSQLExtendFolder): 40 class MPIWGRoot(ZSQLExtendFolder):
45 """Stammordner fuer den Web-Server""" 41 """Stammordner fuer den Web-Server"""
46 42
47 _v_harvestCache=None 43 _v_harvestCache=None
48 meta_type='MPIWGRoot' 44 meta_type='MPIWGRoot'
45
46 manage_options = Folder.manage_options+(
47 {'label':'Update personal homepages','action':'updatePersonalwww_html'},
48 {'label':'Reindex catalogs','action':'reindexCatalogs'},
49 {'label':'Main config','action':'changeMPIWGRootForm'},
50 {'label':'add e-mails','action':'showNewDBEntries'},
51 #{'label':'update the institutsbibliography','action':'updateInstitutsbiliography'},
52 #{'label':'Edit Historical Persons','action':'editHistoricalPersonsForm'},
53 #{'label':'Store Historical Persons','action':'storeHistoricalPersons'},
54 )
49 55
50 fieldLabels={'WEB_title':'WEB_Title', 56 fieldLabels={'WEB_title':'WEB_Title',
51 'xdata_01':'Responsible Scientists', 57 'xdata_01':'Responsible Scientists',
52 'xdata_02':'Department', 58 'xdata_02':'Department',
53 'xdata_03':'Historical Persons', 59 'xdata_03':'Historical Persons',
70 # language of this instance 76 # language of this instance
71 lang = 'en' 77 lang = 'en'
72 # types of objects that show up in navigation 78 # types of objects that show up in navigation
73 nav_meta_types = ['MPIWGTemplate','MPIWGLink','MPIWGFolder'] 79 nav_meta_types = ['MPIWGTemplate','MPIWGLink','MPIWGFolder']
74 80
75 manage_options = Folder.manage_options+( 81 #
76 {'label':'Update personal homepages','action':'updatePersonalwww_html'}, 82 # templates
77 {'label':'Reindex catalogs','action':'reindexCatalogs'}, 83 #
78 {'label':'Main config','action':'changeMPIWGRootForm'}, 84 main_template = PageTemplateFile('zpt/www/main_template', globals())
79 {'label':'add e-mails','action':'showNewDBEntries'}, 85 mpiwg_css = ImageFile('css/mpiwg.css', globals())
80 #{'label':'update the institutsbibliography','action':'updateInstitutsbiliography'}, 86 # make docuviewer_css refreshable for development
81 #{'label':'Edit Historical Persons','action':'editHistoricalPersonsForm'}, 87 mpiwg_css.index_html = refreshingImageFileIndexHtml
82 #{'label':'Store Historical Persons','action':'storeHistoricalPersons'}, 88
83 )
84
85
86
87 89
88 def decode(self,str): 90 def decode(self,str):
89 """decoder""" 91 """decoder"""
90 92
91 if not str: 93 if not str: