Author: jmorliaguet
Date: Tue Oct 11 23:00:21 2005
New Revision: 28154

Added:
   
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/jsr168_authoring.css 
  (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/jsr168_authoring.pt  
 (contents, props changed)
   z3lab/cpsskins/branches/jmo-perspectives/browser/renderers/filters/jsr168.py 
  (contents, props changed)
   z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/
   z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/__init__.py   
(contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/configure.zcml   
(contents, props changed)
   z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/interfaces.py 
  (contents, props changed)
   z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/meta.zcml   
(contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/metaconfigure.py 
  (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/metadirectives.py
   (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/content/interfaces.py
   (contents, props changed)
   z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/jsr168/
   
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/jsr168/__init__.py
   (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/jsr168/configure.zcml
   (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/jsr168/interfaces.py
   (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/page/interfaces.py
   (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/default/interfaces.py 
  (contents, props changed)
   z3lab/cpsskins/branches/jmo-perspectives/settings/engines/jsr168/
   z3lab/cpsskins/branches/jmo-perspectives/settings/engines/jsr168/__init__.py 
  (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/jsr168/configure.zcml 
  (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/jsr168/interfaces.py  
 (contents, props changed)
Modified:
   z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/browser/negociation/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/browser/negociation/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/browser/renderers/__init__.py
   
z3lab/cpsskins/branches/jmo-perspectives/browser/renderers/filters/configure.zcml
   
z3lab/cpsskins/branches/jmo-perspectives/browser/renderers/filters/widgets.css
   z3lab/cpsskins/branches/jmo-perspectives/browser/skin/template.pt
   z3lab/cpsskins/branches/jmo-perspectives/configure.zcml
   
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/configure.zcml
   
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/content/configure.zcml
   
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/page/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/settings/engines/configure.zcml
   
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/default/configure.zcml
Log:

- added a ++engine++ namespace traverser for specifying the engine to use

- added JSR-168 like rendering engines



Modified: 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/configure.zcml   
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/configure.zcml   
Tue Oct 11 23:00:21 2005
@@ -21,6 +21,10 @@
       name="page_authoring.css" file="page_authoring.css"
       layer="cpsskins" />
 
+  <resource
+      name="jsr168_authoring.css" file="jsr168_authoring.css"
+      layer="cpsskins" />
+
   <page
       for="*"
       name="authoring_macros"
@@ -48,6 +52,13 @@
         template="page_authoring.pt"
     />
 
+    <page
+        name="jsr168-authoring.html"
+        menu="zmi_views"
+        title="JSR168 authoring"
+        template="jsr168_authoring.pt"
+    />
+
   </pages>
 
   <pages
@@ -70,6 +81,13 @@
         template="content_authoring.pt"
     />
 
+    <page
+        name="jsr168-authoring.html"
+        menu="zmi_views"
+        title="JSR168 authoring"
+        template="jsr168_authoring.pt"
+    />
+
   </pages>
 
   <menu
@@ -92,6 +110,11 @@
       />
 
       <menuItem
+          title="JSR-168 authoring"
+          action="@@jsr168-authoring.html"
+      />
+
+      <menuItem
           title="ZMI"
           action="@@contents.html"
       />

Added: 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/jsr168_authoring.css
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/jsr168_authoring.css 
    Tue Oct 11 23:00:21 2005
@@ -0,0 +1,158 @@
+
+
+/* Page blocks */
+.pageBlockEdit {
+  margin-top: 30px; 
+  margin-bottom: 1px; 
+  margin-left: 1px; 
+  margin-right: 1px; 
+}
+
+.pageBlockEditHeader a, .pageBlockEditHeaderSelected a {
+  text-decoration: none;
+}
+
+.pageBlockEditHeader, .pageBlockEditHeaderSelected {
+  background-color: #e9ff30;
+  text-align: center; 
+  border-style: solid; 
+  border-width: 2px;
+  border-color: #bbe #669 #669 #bbe;
+  padding: 4px;
+  vertical-align: middle;
+  color: #000;
+}
+
+.pageBlockEditHeader label, .pageBlockEditHeaderSelected label {
+  padding-left: 1em;
+}
+
+.pageBlockEditHeader form, .pageBlockEditHeaderSelected form {
+  padding: 0x;
+  margin: 0;
+}
+
+.pageBlockEditHeader input, .pageBlockEditHeaderSelected input {
+  text-align: center;
+  background-color: #ffffdd;
+  border: 1px dotted #666;
+}
+
+.pageBlockEditHeaderSelected {
+  border-color: #f00;
+  background-color: #ccff33;
+  border-width: 2px;
+}
+
+.pageBlockEditHeader:hover {
+  background-color: #fcff00;
+}
+
+.pageBlockAddButton {
+  padding: 4px; 
+  text-align: left; 
+  margin-top: 5px;
+  margin-bottom: 5px;
+}
+
+
+/* cell */
+.sizer {
+  padding: 0;
+  margin: 0;
+  height: 25px;
+  background: url(/++skin++cpsskins/@@/sizer_line.png); 
+  background-repeat: repeat-x;
+  background-position: center top;
+  text-align: center; 
+}
+.sizer .left {
+  float: left;
+  margin-left: 1px;
+  background: url(/++skin++cpsskins/@@/sizer_left.png); 
+  background-repeat: no-repeat; 
+  height: 10px;
+  width: 7px;
+}
+
+.sizer .right {
+  float: right;
+  margin-right: 1px;
+  background: url(/++skin++cpsskins/@@/sizer_right.png); 
+  background-repeat: no-repeat; 
+  height: 10px;
+  width: 7px;
+}
+
+.sizer input {
+  border: none;
+  background-color: white;
+  text-align: center;
+}
+
+.cellEditHeader {
+  background-color: #e6e6e6;
+  border-width: 1px !important;
+  border-style: solid !important;
+  border-color: #bbb #666 #666 #bbb !important;
+  text-align: center;
+  background-image: url(/++skin++cpsskins/@@/bg_cellgrip.png);
+  padding: 0 !important;
+  margin: 5px 0 5px 0 !important;
+}
+
+.cellEditHeader form {
+  padding: 0;
+  margin: 0;
+}
+
+.cellEditHeader input {
+  border: none;
+  font: bold 11px Arial, Sans-Serif;
+  text-align: center;
+  background-color: #e3e3e3;
+  color: #666;
+  width: 40%;
+}
+
+.cellEditHeader:hover {
+  background-color: #eee;
+}
+
+.cellEditHeader input:hover {
+  background-color: #fff;
+}
+
+.cellEmpty {
+  border: 1px dotted #999;
+  background-color: #fff;
+  padding: 10px;
+  text-align: center;
+  color: #333;
+}
+
+
+/* Slots */
+.slotFrame {
+  border: 1px solid #666 !important;
+  margin: 0 !important;
+  padding: 0 !important;
+}
+
+.slotFrame .title {
+  text-align: center;
+  background-color: #fc0;
+  font: bold 12px Trebuchet MS, Verdana, Arial, Sans-Serif;
+  color: #000;
+  margin: 0;
+  padding: 0;
+  border: none;
+}
+
+.slotFrame .body {
+  background-color: #ffc;
+  padding: 0.5em;
+  font: italic 11px Verdana, Arial, Sans-Serif;
+  margin: 0;
+  border: none;
+}

Added: 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/jsr168_authoring.pt
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/jsr168_authoring.pt  
    Tue Oct 11 23:00:21 2005
@@ -0,0 +1,42 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
+<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"
+  tal:define="canvas_mode view/getCanvasMode;
+              tmutil context/@@getThemeManager;
+              current_theme python:tmutil.getThemeInContext(context);
+              effective_page python:tmutil.getEffectivePage(context, request)">
+  <head>
+    <link rel="Stylesheet" type="text/css"
+          href="/++skin++cpsskins/@@/++resource++page_authoring.css" />
+    <link rel="Stylesheet" type="text/css"
+          href="/++skin++cpsskins/@@/++resource++authoring.css" />
+    <link rel="Stylesheet" type="text/css"
+          href="/++skin++cpsskins/@@/++resource++widgets.css" />
+    <link rel="Stylesheet" type="text/css" href="./renderCSS" />
+
+    <script type="text/javascript"
+            src="/@@/jsolait/init.js"></script>
+    <script type="text/javascript"
+            src="/++skin++cpsskins/@@/++resource++utils.js"></script>
+    <script type="text/javascript"
+            src="/++skin++cpsskins/@@/++resource++pdlib.js"></script>
+    <script type="text/javascript"
+            src="/++skin++cpsskins/@@/++resource++authoring.js"></script>
+  </head>
+  <body>
+
+    <div class="floatingHeader">
+      <div id="message-box"></div>
+      <metal:block use-macro="context/@@authoring_macros/navigation_pad" />
+      <metal:block use-macro="context/@@authoring_macros/add_content_panel" />
+    </div>
+
+    <div id="editSpace">
+      <tal:block content="structure python: view.draw(
+                          canvas_mode=canvas_mode,
+                          location=context,
+                          engine='jsr168-authoring')" />
+    </div>
+
+    <metal:block use-macro="context/@@authoring_macros/authoring_footer" />
+  </body>
+</html>

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/browser/negociation/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/negociation/__init__.py    
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/negociation/__init__.py    
Tue Oct 11 23:00:21 2005
@@ -20,7 +20,11 @@
 from zope.app import zapi
 from zope.app.publisher.browser import BrowserView
 from zope.app.session.interfaces import ISession
+from zope.component import getUtility
+from zope.interface import directlyProvidedBy
 
+from cpsskins.configuration.engines.interfaces import IEngine
+from cpsskins.configuration.interfaces import IRegistry
 from cpsskins.browser.renderers.interfaces import IRenderer
 from cpsskins.thememanager import getThemeManager
 
@@ -53,4 +57,10 @@
             perspective = None
         return perspective
 
-
+    def getEffectiveEngine(self):
+        engine_registry = getUtility(IRegistry, 'engines')
+        for iface in directlyProvidedBy(self.request):
+            if not iface.extends(IEngine):
+                continue
+            return engine_registry.get(iface, 'default')
+        return 'default'

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/browser/negociation/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/negociation/configure.zcml 
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/negociation/configure.zcml 
Tue Oct 11 23:00:21 2005
@@ -36,6 +36,11 @@
         attribute="getPerspective"
     />
 
+    <page
+        name="getEffectiveEngine"
+        attribute="getEffectiveEngine"
+    />
+
   </pages>
 
 </configure>

Modified: z3lab/cpsskins/branches/jmo-perspectives/browser/renderers/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/renderers/__init__.py      
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/renderers/__init__.py      
Tue Oct 11 23:00:21 2005
@@ -21,11 +21,13 @@
 from zope.app.zapi import getMultiAdapter, queryMultiAdapter
 from zope.component import adapts, getUtility
 from zope.interface import implements
+from zope.interface.declarations import directlyProvidedBy
 from zope.publisher.interfaces import IRequest
 
 from cpsskins.browser.negociation.interfaces import INegociation
 from cpsskins.browser.renderers.filters.interfaces import IFilter
 from cpsskins.configuration.interfaces import IRegistry
+from cpsskins.configuration.engines.interfaces import IEngine
 from cpsskins.elements.interfaces import IElement, ISlot, IDisplayable
 from cpsskins.relations.interfaces import IPredicate
 from cpsskins.storage.interfaces import IRelationStorage
@@ -217,6 +219,9 @@
                 )
             return data
 
+        # input data to the filter
+        info.input = data
+
         # apply all filters
         for f in self._getFilters(iface, engine, theme):
             data = f(data, info, **kw)

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/browser/renderers/filters/configure.zcml
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/browser/renderers/filters/configure.zcml
   (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/browser/renderers/filters/configure.zcml
   Tue Oct 11 23:00:21 2005
@@ -79,4 +79,21 @@
      factory=".effect.WebImageFormatVocabulary"
   />
 
+
+  <!-- JSR-168 filter: adds JSR168-like portlet box decorations --> 
+
+  <filter
+      name="jsr168"
+      for="cpsskins.elements.displays.interfaces.IDisplay"
+      factory=".jsr168.JSR168"
+  />
+
+  <browser:page
+      for="*"
+      permission="zope.Public"
+      name="setState"
+      class=".jsr168.JSR168"
+      attribute="setState"
+  />
+
 </configure>

Added: 
z3lab/cpsskins/branches/jmo-perspectives/browser/renderers/filters/jsr168.py
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/browser/renderers/filters/jsr168.py    
    Tue Oct 11 23:00:21 2005
@@ -0,0 +1,78 @@
+##############################################################################
+#
+# Copyright (c) 2005 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+from zope.app.traversing.api import getParent
+from zope.component import adapts
+from zope.interface import implements
+from zope.publisher.interfaces import IRequest
+
+from cpsskins.elements.interfaces import ISlot
+from cpsskins.elements.interfaces import IDisplay
+from interfaces import IFilter
+
+OPEN = 0
+CLOSED = 1
+
+class JSR168(object):
+    """Adds a JSR-168 like portlet box decoration to objects.
+    """
+
+    adapts(IDisplay, IRequest)
+    implements(IFilter)
+
+    def __init__(self, context, request):
+        self.context = context
+        self.request = request
+
+    def __call__(self, data='', info=None, **kw):
+        """Apply the filter"""
+
+        element = info.element
+        # We only apply decoration to portlets located in slots
+        if not ISlot.providedBy(getParent(element)):
+            return data
+
+        id = element.getIdentifier()
+        state = self.getState(id)
+
+        markup = '<div class="box">'
+        markup += '<div class="title">%s %s</div>' % (
+            STATE_BUTTON[state] % id, info.input.title
+            )
+        if state == OPEN:
+            markup += '<div class="body">%s</div>' % data
+        markup += '</div>'
+        return markup
+
+    def getState(self, id):
+        return int(self.request.cookies.get(self._getCookieName(id), OPEN))
+
+    def setState(self, id, state):
+        request = self.request
+        request.response.setCookie(self._getCookieName(id), state)
+        target = request.get('HTTP_REFERER', '.')
+        request.response.redirect(target)
+
+    def _getCookieName(self, id):
+        return 'cpsskins_state_%s' % id
+
+STATE_BUTTON = {
+    OPEN: '<a class="button" href="@@setState?state=1&id=%s">[-]</a>',
+    CLOSED: '<a class="button" href="@@setState?state=0&id=%s">[+]</a>'
+    }

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/browser/renderers/filters/widgets.css
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/browser/renderers/filters/widgets.css  
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/browser/renderers/filters/widgets.css  
    Tue Oct 11 23:00:21 2005
@@ -21,3 +21,26 @@
 a {
   text-decoration: none;
 }
+
+
+/* Box decoration */
+
+.box {
+  border: 1px solid #ccc;
+}
+
+.box .title {
+  border: 1px solid #999;
+  background-color: #669;
+  color: #fff;
+  font: bold 12px Verdana, Arial, sans-serif;
+  padding: 0.1em 0.5em;
+}
+
+.box .title a.button, .box .title a.button:visited {
+  color: white;
+}
+
+.box .body {
+  border: 1px solid #999;
+}

Modified: z3lab/cpsskins/branches/jmo-perspectives/browser/skin/template.pt
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/skin/template.pt   
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/skin/template.pt   Tue Oct 
11 23:00:21 2005
@@ -5,7 +5,8 @@
   </metal:block>
   <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"
   tal:define="tmutil context/@@getThemeManager;
-              pageview context/@@getDefaultPageView">
+              pageview context/@@getDefaultPageView;
+              engine context/@@getEffectiveEngine">
     <head>
       <title metal:define-slot="title">CPSSkins for Zope3</title>
       <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
@@ -19,6 +20,6 @@
       location=context,
       view=view,
       template=template,
-      engine='default')" />
+      engine=engine)" />
   </html>
 </metal:block>

Added: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/__init__.py
==============================================================================
--- (empty file)
+++ z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/__init__.py  
Tue Oct 11 23:00:21 2005
@@ -0,0 +1,51 @@
+##############################################################################
+#
+# Copyright (c) 2005 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+"""Rendering engine configuration
+"""
+
+from zope.app.traversing.namespace import view
+from zope.component import provideUtility, getUtility
+from zope.interface import implements
+from zope.interface import alsoProvides
+
+from cpsskins.configuration import ConfigurationRegistry
+from cpsskins.configuration.interfaces import IRegistry
+from interfaces import IEngine
+
+
+class EngineRegistry(ConfigurationRegistry):
+    """An engine registry stores information about rendering engines.
+    """
+    implements(IRegistry)
+
+provideUtility(EngineRegistry(), IRegistry, 'engines')
+
+class engine(view):
+
+    def traverse(self, name, ignored):
+        request = self.request
+
+        engine_registry = getUtility(IRegistry, 'engines')
+        engine = engine_registry.get(name, [])
+
+        alsoProvides(request, engine)
+
+        return self.context
+

Added: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/configure.zcml
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/configure.zcml   
    Tue Oct 11 23:00:21 2005
@@ -0,0 +1,22 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope";
+    xmlns:i18n="http://namespaces.zope.org/i18n";
+    i18n_domain="cpsskins"
+    >
+
+  <adapter
+    for="*"
+    name="engine"
+    provides="zope.app.traversing.interfaces.ITraversable"
+    factory=".engine"
+  />
+
+  <view
+    for="*"
+    name="engine"
+    type="zope.interface.Interface"
+    provides="zope.app.traversing.interfaces.ITraversable"
+    factory=".engine"
+  />
+
+</configure>

Added: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/interfaces.py
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/interfaces.py    
    Tue Oct 11 23:00:21 2005
@@ -0,0 +1,5 @@
+
+from zope.interface import Interface
+
+class IEngine(Interface):
+    """Theme engines must implement this"""

Added: z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/meta.zcml
==============================================================================
--- (empty file)
+++ z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/meta.zcml    
Tue Oct 11 23:00:21 2005
@@ -0,0 +1,13 @@
+
+<configure xmlns="http://namespaces.zope.org/meta";>
+
+  <directives namespace="http://namespaces.zope.org/cpsskins";>
+
+    <directive
+       name="engine"
+       schema=".metadirectives.IEngineDirective"
+       handler=".metaconfigure.engine" />
+
+  </directives>
+
+</configure>

Added: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/metaconfigure.py
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/metaconfigure.py 
    Tue Oct 11 23:00:21 2005
@@ -0,0 +1,28 @@
+##############################################################################
+#
+# Copyright (c) 2005 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+from zope.component import getUtility
+
+from cpsskins.configuration.interfaces import IRegistry
+
+engine_registry = getUtility(IRegistry, 'engines')
+
+def engine(_context, name, interface):
+    engine_registry.register(name, interface)
+    engine_registry.register(interface, name)

Added: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/metadirectives.py
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/metadirectives.py
    Tue Oct 11 23:00:21 2005
@@ -0,0 +1,40 @@
+##############################################################################
+#
+# Copyright (c) 2005 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+from zope.configuration.fields import GlobalObject
+from zope.interface import Interface
+from zope.i18nmessageid import MessageIDFactory
+from zope.schema import TextLine
+
+_ = MessageIDFactory("cpsskins")
+
+class IEngineDirective(Interface):
+
+    name = TextLine(
+        title=_("The engine's name"),
+        description=_("The engine that the renderer applies to."),
+        required=False,
+        )
+
+    interface = GlobalObject(
+        title=_("Interface"),
+        description=_("A marker interface for the engine"),
+        required=False,
+        )
+

Modified: z3lab/cpsskins/branches/jmo-perspectives/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/configure.zcml     (original)
+++ z3lab/cpsskins/branches/jmo-perspectives/configure.zcml     Tue Oct 11 
23:00:21 2005
@@ -53,8 +53,6 @@
 
   </content>
 
-
-
   <!-- Package includes -->
 
   <include package=".controllers" />
@@ -73,4 +71,6 @@
 
   <include package=".settings" />
 
+  <include package=".configuration.engines" />
+
 </configure>

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/configure.zcml
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/configure.zcml
  (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/configure.zcml
  Tue Oct 11 23:00:21 2005
@@ -10,4 +10,9 @@
 
   <include package=".content" />
 
+
+  <!-- JSR168 authoring -->
+
+  <include package=".jsr168" />
+
 </configure>

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/content/configure.zcml
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/content/configure.zcml
  (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/content/configure.zcml
  Tue Oct 11 23:00:21 2005
@@ -1,16 +1,21 @@
 <configure
     xmlns="http://namespaces.zope.org/cpsskins";>
 
+  <engine
+      name="content-authoring"
+      interface=".interfaces.IContentAuthoring"
+  />
+
   <renderer
       for="cpsskins.elements.interfaces.ITheme"
-      engines="content-authoring"
+      engine="content-authoring"
   />
 
   <renderer
       for="cpsskins.elements.interfaces.IThemePage
            cpsskins.elements.interfaces.IPageBlock
            cpsskins.elements.interfaces.ICell"
-      engines="content-authoring"
+      engine="content-authoring"
       >
 
     <filter
@@ -29,7 +34,7 @@
 
   <renderer
       for="cpsskins.elements.interfaces.ISlot"
-      engines="content-authoring"
+      engine="content-authoring"
       >
 
     <filter
@@ -40,7 +45,7 @@
 
   <renderer
       for="cpsskins.elements.interfaces.IPortlet"
-      engines="content-authoring"
+      engine="content-authoring"
       >
 
     <filter

Added: 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/content/interfaces.py
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/content/interfaces.py
   Tue Oct 11 23:00:21 2005
@@ -0,0 +1,5 @@
+
+from cpsskins.configuration.engines.interfaces import IEngine
+
+class IContentAuthoring(IEngine):
+    """A rendering engine for content authoring"""

Added: 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/jsr168/__init__.py
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/jsr168/__init__.py
      Tue Oct 11 23:00:21 2005
@@ -0,0 +1,21 @@
+##############################################################################
+#
+# Copyright (c) 2005 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+# make this directory a package
+
+pass

Added: 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/jsr168/configure.zcml
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/jsr168/configure.zcml
   Tue Oct 11 23:00:21 2005
@@ -0,0 +1,73 @@
+<configure
+    xmlns="http://namespaces.zope.org/cpsskins";>
+
+  <engine
+      name="jsr168-authoring"
+      interface=".interfaces.IJSR168Authoring"
+  />
+
+  <renderer
+      for="cpsskins.elements.interfaces.ITheme"
+      engine="jsr168-authoring"
+  />
+
+  <renderer
+      for="cpsskins.elements.interfaces.IThemePage
+           cpsskins.elements.interfaces.IPageBlock
+           cpsskins.elements.interfaces.ICell"
+      engine="jsr168-authoring"
+      >
+
+    <filter
+        name="widget"
+    />
+
+    <filter
+        name="layout"
+    />
+
+    <filter
+        name="style"
+    />
+
+  </renderer>
+
+  <renderer
+      for="cpsskins.elements.interfaces.ISlot"
+      engine="jsr168-authoring"
+      >
+
+    <filter
+        name="slot editor (content authoring)"
+    />
+
+  </renderer>
+
+  <renderer
+      for="cpsskins.elements.interfaces.IPortlet"
+      engine="jsr168-authoring"
+      >
+
+    <filter
+        name="effect"
+    />
+
+    <filter
+        name="widget"
+    />
+
+    <filter
+        name="style"
+    />
+
+    <filter
+        name="jsr168"
+    />
+
+    <filter
+        name="portlet editor (content authoring)"
+    />
+
+  </renderer>
+
+</configure>

Added: 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/jsr168/interfaces.py
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/jsr168/interfaces.py
    Tue Oct 11 23:00:21 2005
@@ -0,0 +1,5 @@
+
+from cpsskins.configuration.engines.interfaces import IEngine
+
+class IJSR168Authoring(IEngine):
+    """A rendering engine for JSR168 authoring"""

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/page/configure.zcml
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/page/configure.zcml
     (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/page/configure.zcml
     Tue Oct 11 23:00:21 2005
@@ -1,16 +1,21 @@
 <configure
     xmlns="http://namespaces.zope.org/cpsskins";>
 
+  <engine
+      name="page-authoring"
+      interface=".interfaces.IPageAuthoring"
+  />
+
   <renderer
       for="cpsskins.elements.interfaces.ITheme"
-      engines="page-authoring"
+      engine="page-authoring"
   />
 
   <renderer
       for="cpsskins.elements.interfaces.IThemePage
            cpsskins.elements.interfaces.IPageBlock
            cpsskins.elements.interfaces.ICell"
-      engines="page-authoring"
+      engine="page-authoring"
       >
 
     <filter
@@ -25,7 +30,7 @@
 
   <renderer
       for="cpsskins.elements.interfaces.ISlot"
-      engines="page-authoring"
+      engine="page-authoring"
       >
 
     <filter
@@ -36,7 +41,7 @@
 
   <renderer
       for="cpsskins.elements.interfaces.IPortlet"
-      engines="page-authoring"
+      engine="page-authoring"
       >
 
     <filter

Added: 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/page/interfaces.py
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/authoring/page/interfaces.py
      Tue Oct 11 23:00:21 2005
@@ -0,0 +1,5 @@
+
+from cpsskins.configuration.engines.interfaces import IEngine
+
+class IPageAuthoring(IEngine):
+    """A rendering engine for page authoring"""

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/settings/engines/configure.zcml    
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/settings/engines/configure.zcml    
Tue Oct 11 23:00:21 2005
@@ -3,6 +3,7 @@
 
   <include package=".default" />
 
+  <include package=".jsr168" />
 
   <!-- Page, content authoring -->
 

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/default/configure.zcml
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/default/configure.zcml
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/default/configure.zcml
    Tue Oct 11 23:00:21 2005
@@ -1,8 +1,13 @@
 <configure
     xmlns="http://namespaces.zope.org/cpsskins";>
 
+  <engine
+      name="default"
+      interface=".interfaces.IDefault"
+  />
+
   <renderer
-      engines="default"
+      engine="default"
       for="cpsskins.elements.interfaces.ITheme"
   />
 
@@ -13,7 +18,7 @@
       for="cpsskins.elements.interfaces.IThemePage
            cpsskins.elements.interfaces.IPageBlock
            cpsskins.elements.interfaces.ICell"
-      engines="default"
+      engine="default"
       >
 
     <filter
@@ -32,7 +37,7 @@
 
   <renderer
       for="cpsskins.elements.interfaces.ISlot"
-      engines="default"
+      engine="default"
       >
 
   </renderer>
@@ -42,7 +47,7 @@
 
   <renderer
       for="cpsskins.elements.interfaces.IPortlet"
-      engines="default"
+      engine="default"
       >
 
     <filter

Added: 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/default/interfaces.py
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/default/interfaces.py 
    Tue Oct 11 23:00:21 2005
@@ -0,0 +1,5 @@
+
+from cpsskins.configuration.engines.interfaces import IEngine
+
+class IDefault(IEngine):
+    """A default theme renderer"""

Added: 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/jsr168/__init__.py
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/jsr168/__init__.py    
    Tue Oct 11 23:00:21 2005
@@ -0,0 +1,21 @@
+##############################################################################
+#
+# Copyright (c) 2005 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+# make this directory a package
+
+pass

Added: 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/jsr168/configure.zcml
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/jsr168/configure.zcml 
    Tue Oct 11 23:00:21 2005
@@ -0,0 +1,75 @@
+<configure
+    xmlns="http://namespaces.zope.org/cpsskins";>
+
+  <engine
+      name="jsr168"
+      interface=".interfaces.IJSR168"
+  />
+
+  <renderer
+      engine="jsr168"
+      for="cpsskins.elements.interfaces.ITheme"
+  />
+
+
+  <!-- Canvas elements -->
+
+  <renderer
+      for="cpsskins.elements.interfaces.IThemePage
+           cpsskins.elements.interfaces.IPageBlock
+           cpsskins.elements.interfaces.ICell"
+      engine="jsr168"
+      >
+
+    <filter
+        name="widget"
+    />
+
+    <filter
+        name="layout"
+    />
+
+    <filter
+        name="style"
+    />
+
+  </renderer>
+
+  <renderer
+      for="cpsskins.elements.interfaces.ISlot"
+      engine="jsr168"
+      >
+
+  </renderer>
+
+
+  <!-- Content elements -->
+
+  <renderer
+      for="cpsskins.elements.interfaces.IPortlet"
+      engine="jsr168"
+      >
+
+    <filter
+        name="effect"
+    />
+
+    <filter
+        name="widget"
+    />
+
+    <filter
+        name="style"
+    />
+
+    <filter
+        name="htmlcleaner"
+    />
+
+    <filter
+        name="jsr168"
+    />
+
+  </renderer>
+
+</configure>

Added: 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/jsr168/interfaces.py
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/settings/engines/jsr168/interfaces.py  
    Tue Oct 11 23:00:21 2005
@@ -0,0 +1,5 @@
+
+from cpsskins.configuration.engines.interfaces import IEngine
+
+class IJSR168(IEngine):
+    """A JSR-168 like theme engine"""
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to