Index: /main/kofacustom.nigeria/branches/henrik-diazo-themed/buildout.cfg
===================================================================
--- /main/kofacustom.nigeria/branches/henrik-diazo-themed/buildout.cfg	(revision 11089)
+++ /main/kofacustom.nigeria/branches/henrik-diazo-themed/buildout.cfg	(revision 11090)
@@ -16,6 +16,8 @@
     site_zcml
     zdaemon_conf
-    deploy_ini
-    debug_ini
+    raw_deploy_ini
+    raw_debug_ini
+    themed_deploy_ini
+    themed_debug_ini
     profile_ini
 # waeupdocs
@@ -24,4 +26,6 @@
 # kofactl creation must be _after_ app!
     kofactl
+    lxml
+    diazo
 # For backward compatibility, telling buildout not to throw away
 # the data and log subdirectories from the parts directory.
@@ -34,4 +38,5 @@
 update-versions-file = versions.cfg
 
+
 # eggs will be installed in the default buildout location
 # (see .buildout/default.cfg in your home directory)
@@ -39,6 +44,5 @@
 
 [sources]
-waeup.kofa = svn https://svn.waeup.org/repos/main/waeup.kofa/trunk
-
+waeup.kofa = svn https://svn.waeup.org/repos/main/waeup.kofa/branches/uli-diazo-themed
 [kofa_params]
 ## Basic parameters for deployment.
@@ -64,5 +68,5 @@
 # This creates all scripts in bin/. The kofactl created here is 'faulty'.
 recipe = zc.recipe.egg
-eggs = kofacustom.nigeria [beaker]
+eggs = kofacustom.nigeria [beaker, diazo]
        z3c.evalexception>=2.0
        Paste
@@ -78,5 +82,5 @@
 # fixed path to zdaemon.conf as argument.
 recipe = zc.recipe.egg
-eggs = kofacustom.nigeria [beaker]
+eggs = kofacustom.nigeria [beaker, diazo]
        waeup.kofa
 arguments = "${buildout:parts-directory}/etc/zdaemon.conf"
@@ -151,13 +155,23 @@
 output = ${buildout:parts-directory}/etc/zdaemon.conf
 
-[deploy_ini]
-recipe = collective.recipe.template
-input = etc/deploy.ini.in
-output = ${buildout:parts-directory}/etc/deploy.ini
-
-[debug_ini]
-recipe = collective.recipe.template
-input = etc/debug.ini.in
-output = ${buildout:parts-directory}/etc/debug.ini
+[raw_debug_ini]
+recipe = collective.recipe.template
+input = etc/raw/debug.ini.in
+output = ${buildout:parts-directory}/etc/raw-debug.ini
+
+[raw_deploy_ini]
+recipe = collective.recipe.template
+input = etc/raw/deploy.ini.in
+output = ${buildout:parts-directory}/etc/raw-deploy.ini
+
+[themed_debug_ini]
+recipe = collective.recipe.template
+input = etc/themed/debug.ini.in
+output = ${buildout:parts-directory}/etc/themed-debug.ini
+
+[themed_deploy_ini]
+recipe = collective.recipe.template
+input = etc/themed/deploy.ini.in
+output = ${buildout:parts-directory}/etc/themed-deploy.ini
 
 [profile_ini]
@@ -191,2 +205,13 @@
 scripts = coveragereport
 arguments = ('${buildout:parts-directory}/coverage-detect/working-directory/coverage', '${buildout:directory}/coverage-report')
+
+[lxml]
+recipe = z3c.recipe.staticlxml
+egg = lxml
+
+[diazo]
+recipe = zc.recipe.egg
+eggs =
+    diazo [wsgi]
+    PasteScript
+    kofacustom.nigeria [beaker,diazo]
Index: /main/kofacustom.nigeria/branches/henrik-diazo-themed/setup.py
===================================================================
--- /main/kofacustom.nigeria/branches/henrik-diazo-themed/setup.py	(revision 11089)
+++ /main/kofacustom.nigeria/branches/henrik-diazo-themed/setup.py	(revision 11090)
@@ -33,4 +33,9 @@
     'roman',
     'repoze.sphinx.autointerface',
+    ]
+
+diazo_require = [
+    'diazo',
+    'webob',
     ]
 
@@ -81,4 +86,5 @@
         docs = docs_require,
         beaker = beaker_require,
+        diazo = diazo_require,
         ),
       entry_points="""
Index: /main/kofacustom.nigeria/branches/henrik-diazo-themed/src/kofacustom/nigeria/students/tests/test_browser.py
===================================================================
--- /main/kofacustom.nigeria/branches/henrik-diazo-themed/src/kofacustom/nigeria/students/tests/test_browser.py	(revision 11089)
+++ /main/kofacustom.nigeria/branches/henrik-diazo-themed/src/kofacustom/nigeria/students/tests/test_browser.py	(revision 11090)
@@ -287,5 +287,5 @@
             name='upload_acceptanceletterupload').click()
         self.assertTrue(
-            '<a target="image" href="acc_let">'
+            'http://localhost/app/students/K1000000/acc_let'
             in self.browser.contents)
         self.browser.getControl(
Index: /main/kofacustom.nigeria/branches/henrik-diazo-themed/versions.cfg
===================================================================
--- /main/kofacustom.nigeria/branches/henrik-diazo-themed/versions.cfg	(revision 11089)
+++ /main/kofacustom.nigeria/branches/henrik-diazo-themed/versions.cfg	(revision 11090)
@@ -128,2 +128,21 @@
 # zc.recipe.testrunner==2.0.0
 zope.testrunner = 4.3.3
+
+# Added by buildout at 2014-02-13 08:26:53.898100
+WebOb = 1.3.1
+diazo = 1.0.5
+repoze.xmliter = 0.5
+z3c.recipe.staticlxml = 0.10
+
+# Required by:
+# diazo==1.0.5
+experimental.cssselect = 0.3
+
+# Required by:
+# diazo==1.0.5
+# experimental.cssselect==0.3
+lxml = 3.3.1
+
+# Required by:
+# z3c.recipe.staticlxml==0.10
+zc.recipe.cmmi = 1.3.5
Index: /main/waeup.kofa/trunk/etc/raw/debug.ini.in
===================================================================
--- /main/waeup.kofa/trunk/etc/raw/debug.ini.in	(revision 11090)
+++ /main/waeup.kofa/trunk/etc/raw/debug.ini.in	(revision 11090)
@@ -0,0 +1,94 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog, asynclog, async_tracelog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_asynclog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[handler_async_tracelog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async_trace.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[logger_async]
+level = INFO
+handlers = asynclog
+qualname = zc.async
+propagate = 0
+
+[logger_async_trace]
+level = INFO
+handlers = async_tracelog
+qualname = zc.async.trace
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:${kofa_params:devel_pkg}#debug
+filter-with = translogger
+exempt-exceptions = zope.security.interfaces.IUnauthorized
+
+[server:main]
+use = egg:Paste#http
+host = ${kofa_params:host}
+port = ${kofa_params:base_port}
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
+env_vars = ZC_ASYNC_UUID ${buildout:directory}/var/uuid1.txt
Index: /main/waeup.kofa/trunk/etc/raw/deploy.ini.in
===================================================================
--- /main/waeup.kofa/trunk/etc/raw/deploy.ini.in	(revision 11090)
+++ /main/waeup.kofa/trunk/etc/raw/deploy.ini.in	(revision 11090)
@@ -0,0 +1,94 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi, async, async_trace
+
+[handlers]
+keys = null, console, accesslog, asynclog, async_tracelog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+#handlers = accesslog
+handlers = null
+qualname = wsgi
+propagate = 0
+
+[logger_async]
+level = INFO
+handlers = asynclog
+qualname = zc.async
+propagate = 0
+
+[logger_async_trace]
+level = INFO
+handlers = async_tracelog
+qualname = zc.async.trace
+propagate = 0
+
+[handler_null]
+# you can use 'NullHandler' (w/o the path) if under Python 2.7+
+class = waeup.kofa.utils.helpers.NullHandler
+args = ()
+level = NOTSET
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[handler_asynclog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[handler_async_tracelog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async_trace.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:${kofa_params:devel_pkg}
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = ${kofa_params:host}
+port = ${kofa_params:base_port}
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
+env_vars = ZC_ASYNC_UUID ${buildout:directory}/var/uuid1.txt
Index: /main/waeup.kofa/trunk/etc/themed/debug.ini.in
===================================================================
--- /main/waeup.kofa/trunk/etc/themed/debug.ini.in	(revision 11090)
+++ /main/waeup.kofa/trunk/etc/themed/debug.ini.in	(revision 11090)
@@ -0,0 +1,118 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI and diazo
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog, asynclog, async_tracelog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_asynclog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[handler_async_tracelog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async_trace.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[logger_async]
+level = INFO
+handlers = asynclog
+qualname = zc.async
+propagate = 0
+
+[logger_async_trace]
+level = INFO
+handlers = async_tracelog
+qualname = zc.async.trace
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter:debugger]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+
+[app:zope]
+use = egg:${kofa_params:devel_pkg}#debug
+exempt-exceptions = zope.security.interfaces.IUnauthorized
+
+[app:static]
+use = egg:Paste#static
+document_root = %(LAYOUT_DIR)s/static
+
+[composite:main]
+use = egg:Paste#urlmap
+/static = static
+/ = default
+
+[filter:theme]
+use = egg:diazo
+rules = file:///%(LAYOUT_DIR)s/rules.xml
+prefix = /
+doctype = <!DOCTYPE html>
+# set to false, if you don't want rules.xml being rebuild on each request
+debug = true
+
+[pipeline:default]
+pipeline = theme
+           translogger
+           debugger
+           zope
+
+[server:main]
+use = egg:Paste#http
+host = ${kofa_params:host}
+port = ${kofa_params:base_port}
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
+env_vars = ZC_ASYNC_UUID ${buildout:directory}/var/uuid1.txt
+# the directory where all real diazo config is done (no trailing slash)
+LAYOUT_DIR = ${buildout:directory}/layout
+STATIC_DIR = %(LAYOUT_DIR)s/static
Index: /main/waeup.kofa/trunk/etc/themed/deploy.ini.in
===================================================================
--- /main/waeup.kofa/trunk/etc/themed/deploy.ini.in	(revision 11090)
+++ /main/waeup.kofa/trunk/etc/themed/deploy.ini.in	(revision 11090)
@@ -0,0 +1,118 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi, async, async_trace
+
+[handlers]
+keys = null, console, accesslog, asynclog, async_tracelog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+#handlers = accesslog
+handlers = null
+qualname = wsgi
+propagate = 0
+
+[logger_async]
+level = INFO
+handlers = asynclog
+qualname = zc.async
+propagate = 0
+
+[logger_async_trace]
+level = INFO
+handlers = async_tracelog
+qualname = zc.async.trace
+propagate = 0
+
+[handler_null]
+# you can use 'NullHandler' (w/o the path) if under Python 2.7+
+class = waeup.kofa.utils.helpers.NullHandler
+args = ()
+level = NOTSET
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[handler_asynclog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[handler_async_tracelog]
+class = FileHandler
+args = (os.path.join(r'${zope_conf:logfiles}', 'async_trace.log'),
+        'a')
+level = INFO
+formatter = generic
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:content]
+use = egg:${kofa_params:devel_pkg}
+filter-with = translogger
+
+[app:static]
+use = egg:Paste#static
+document_root = %(LAYOUT_DIR)s/static/
+
+[composite:main]
+use = egg:Paste#urlmap
+/static = static
+/ = default
+
+[server:main]
+use = egg:Paste#http
+host = ${kofa_params:host}
+port = ${kofa_params:base_port}
+
+[filter:theme]
+use = egg:diazo
+rules = file:///%(LAYOUT_DIR)s/rules.xml
+prefix = /
+doctype = <!DOCTYPE html>
+# set to true, if you want rules.xml being rebuild on each request
+debug = false
+
+[pipeline:default]
+pipeline = theme
+           content
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
+env_vars = ZC_ASYNC_UUID ${buildout:directory}/var/uuid1.txt
+# the directory where all real diazo config is done (no trailing slash)
+LAYOUT_DIR = ${buildout:directory}/sources/waeup.kofa/layout
+STATIC_DIR = %(LAYOUT_DIR)s/static
Index: /main/waeup.kofa/trunk/etc/zdaemon.conf.in
===================================================================
--- /main/waeup.kofa/trunk/etc/zdaemon.conf.in	(revision 11089)
+++ /main/waeup.kofa/trunk/etc/zdaemon.conf.in	(revision 11090)
@@ -1,4 +1,4 @@
 <runner>
-  program ${buildout:directory}/bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  program ${buildout:directory}/bin/paster serve ${buildout:directory}/parts/etc/themed-deploy.ini
   daemon on
   transcript ${zope_conf:logfiles}/zdaemon.log
