diff 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
line wrap: on
line diff
--- a/MPIWGRoot.py	Wed Jan 30 11:47:21 2013 +0100
+++ b/MPIWGRoot.py	Thu Feb 07 19:50:39 2013 +0100
@@ -1,40 +1,36 @@
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
-from Products.PageTemplates.PageTemplate import PageTemplate
-from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
+from App.ImageFile import ImageFile
+
 from Products.ZSQLExtend.ZSQLExtend import ZSQLExtendFolder
 from Products.ZCatalog.CatalogPathAwareness import CatalogAware
 from OFS.Image import Image
 from Globals import package_home
 import urllib
-import MPIWGStaff
 import string
 import re
 import os
 from types import *
 import logging
-import xmlhelper # Methoden zur Verwaltung der projekt xml
 from OFS.SimpleItem import SimpleItem
 from OFS.Folder import Folder
-from Products.ZSQLMethods.SQL import SQLConnectionIDs
 from AccessControl import ClassSecurityInfo
-from bibliography import *
 import time
 import xml.dom.minidom
 import sys
 import transaction
-
-#from Ft.Xml.XPath import Evaluate
-#from Ft.Xml.XPath.Context import Context
-#from Ft.Xml.Domlette import NonvalidatingReader,PrettyPrint, Print
-#from Ft.Xml import EMPTY_NAMESPACE
 import copy
-import updatePersonalWWW
-import MPIWGStaff
-from MPIWGHelper import *
 from BeautifulSoup import BeautifulSoup, Comment
 from ZODB import FileStorage, DB
 from ZEO import ClientStorage
 
+
+from MPIWGHelper import *
+import updatePersonalWWW
+from bibliography import *
+import MPIWGStaff
+from SrvTxtUtils import getInt, utf8ify, refreshingImageFileIndexHtml
+
+
 def sortWeight(x,y):
     x1=int(getattr(x[1],'weight','0'))
     y1=int(getattr(y[1],'weight','0'))
@@ -47,6 +43,16 @@
     _v_harvestCache=None
     meta_type='MPIWGRoot'
 
+    manage_options = Folder.manage_options+(
+        {'label':'Update personal homepages','action':'updatePersonalwww_html'},
+        {'label':'Reindex catalogs','action':'reindexCatalogs'},
+        {'label':'Main config','action':'changeMPIWGRootForm'},
+        {'label':'add e-mails','action':'showNewDBEntries'},
+        #{'label':'update the institutsbibliography','action':'updateInstitutsbiliography'},
+        #{'label':'Edit Historical Persons','action':'editHistoricalPersonsForm'},
+        #{'label':'Store Historical Persons','action':'storeHistoricalPersons'},
+        )
+
     fieldLabels={'WEB_title':'WEB_Title',
                  'xdata_01':'Responsible Scientists',
                  'xdata_02':'Department',
@@ -72,18 +78,14 @@
     # types of objects that show up in navigation
     nav_meta_types = ['MPIWGTemplate','MPIWGLink','MPIWGFolder']
 
-    manage_options = Folder.manage_options+(
-        {'label':'Update personal homepages','action':'updatePersonalwww_html'},
-        {'label':'Reindex catalogs','action':'reindexCatalogs'},
-        {'label':'Main config','action':'changeMPIWGRootForm'},
-        {'label':'add e-mails','action':'showNewDBEntries'},
-        #{'label':'update the institutsbibliography','action':'updateInstitutsbiliography'},
-        #{'label':'Edit Historical Persons','action':'editHistoricalPersonsForm'},
-        #{'label':'Store Historical Persons','action':'storeHistoricalPersons'},
-        )
-    
-   
-             
+    #
+    # templates
+    #
+    main_template = PageTemplateFile('zpt/www/main_template', globals())
+    mpiwg_css = ImageFile('css/mpiwg.css', globals())
+    # make docuviewer_css refreshable for development
+    mpiwg_css.index_html = refreshingImageFileIndexHtml
+
 
     def decode(self,str):
         """decoder"""