[Checkins] SVN: z3c.demo/trunk/src/z3c/demo/ Added calculator sample

Roger Ineichen roger at projekt01.ch
Mon May 21 00:48:00 EDT 2007


Log message for revision 75853:
  Added calculator sample

Changed:
  A   z3c.demo/trunk/src/z3c/demo/__init__.py
  A   z3c.demo/trunk/src/z3c/demo/calculator/SETUP.cfg
  A   z3c.demo/trunk/src/z3c/demo/calculator/__init__.py
  A   z3c.demo/trunk/src/z3c/demo/calculator/browser.py
  A   z3c.demo/trunk/src/z3c/demo/calculator/browser.zcml
  A   z3c.demo/trunk/src/z3c/demo/calculator/calculator.py
  A   z3c.demo/trunk/src/z3c/demo/calculator/configure.zcml
  A   z3c.demo/trunk/src/z3c/demo/calculator/interfaces.py
  A   z3c.demo/trunk/src/z3c/demo/calculator/z3c.demo.calculator-configure.zcml

-=-
Added: z3c.demo/trunk/src/z3c/demo/__init__.py
===================================================================
--- z3c.demo/trunk/src/z3c/demo/__init__.py	                        (rev 0)
+++ z3c.demo/trunk/src/z3c/demo/__init__.py	2007-05-21 04:48:00 UTC (rev 75853)
@@ -0,0 +1,16 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation 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: __init__.py 69382 2006-08-09 13:26:53Z rogerineichen $
+"""

Added: z3c.demo/trunk/src/z3c/demo/calculator/SETUP.cfg
===================================================================
--- z3c.demo/trunk/src/z3c/demo/calculator/SETUP.cfg	                        (rev 0)
+++ z3c.demo/trunk/src/z3c/demo/calculator/SETUP.cfg	2007-05-21 04:48:00 UTC (rev 75853)
@@ -0,0 +1,3 @@
+<data-files zopeskel/etc/package-includes>
+  z3c.demo.calculator-*.zcml
+</data-files>

Added: z3c.demo/trunk/src/z3c/demo/calculator/__init__.py
===================================================================
--- z3c.demo/trunk/src/z3c/demo/calculator/__init__.py	                        (rev 0)
+++ z3c.demo/trunk/src/z3c/demo/calculator/__init__.py	2007-05-21 04:48:00 UTC (rev 75853)
@@ -0,0 +1,16 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation 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: __init__.py 69382 2006-08-09 13:26:53Z rogerineichen $
+"""

Added: z3c.demo/trunk/src/z3c/demo/calculator/browser.py
===================================================================
--- z3c.demo/trunk/src/z3c/demo/calculator/browser.py	                        (rev 0)
+++ z3c.demo/trunk/src/z3c/demo/calculator/browser.py	2007-05-21 04:48:00 UTC (rev 75853)
@@ -0,0 +1,44 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation 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: __init__.py 69382 2006-08-09 13:26:53Z rogerineichen $
+"""
+__docformat__ = "reStructuredText"
+
+import zope.interface
+import zope.component
+from zope.component.interfaces import IFactory
+from zope.dublincore.interfaces import IZopeDublinCore
+from zope.traversing.browser import absoluteURL
+from zope.traversing import api
+from zope.app.renderer.rest import ReStructuredTextToHTMLRenderer
+from zc.table import column
+from zc.table import table
+
+from z3c.configurator import configurator
+from z3c.pagelet import browser
+from z3c.form import form
+from z3c.form import field
+from z3c.form import widget
+from z3c.template.interfaces import ILayoutTemplate
+
+from z3c.website.i18n import MessageFactory as _
+from z3c.website.browser.page import PageAddForm
+from z3c.demo.calculator import calculator
+
+
+class CalculatorAddForm(PageAddForm):
+
+    label = _('Add Calculator sample')
+    factory = calculator.Calculator

Added: z3c.demo/trunk/src/z3c/demo/calculator/browser.zcml
===================================================================
--- z3c.demo/trunk/src/z3c/demo/calculator/browser.zcml	                        (rev 0)
+++ z3c.demo/trunk/src/z3c/demo/calculator/browser.zcml	2007-05-21 04:48:00 UTC (rev 75853)
@@ -0,0 +1,49 @@
+<configure
+    xmlns:zope="http://namespaces.zope.org/zope"
+    xmlns="http://namespaces.zope.org/browser"
+    xmlns:z3c="http://namespaces.zope.org/z3c"
+    i18n_domain="z3c.website">
+
+  <z3c:pagelet
+      name="addZ3CCalculator.html"
+      for="z3c.website.interfaces.ISamples"
+      class=".browser.CalculatorAddForm"
+      layer="z3c.website.layer.IWebSiteBrowserLayer"
+      permission="z3c.website.ManageSite"
+      />
+
+
+  <!-- register formdemo views -->
+  <configure package="z3c.formdemo.calculator">
+  <z3c:pagelet
+      name="sample.html"
+      for="z3c.demo.calculator.interfaces.ICalculator"
+      class=".browser.Calculator"
+      layer="z3c.website.layer.IWebSiteBrowserLayer"
+      permission="zope.Public"
+      />
+
+  <z3c:template
+      template="calculator.pt"
+      for=".browser.Calculator"
+      layer="z3c.website.layer.IWebSiteBrowserLayer"
+      />
+
+  <zrt-resource
+      name="calculator.css"
+      file="calculator.css"
+      layer="z3c.website.layer.IWebSiteBrowserLayer"
+      />
+
+  <viewlet
+      name="calculator.css"
+      for="z3c.demo.calculator.interfaces.ICalculator"
+      view=".browser.Calculator"
+      manager="z3c.website.layer.ICSS"
+      class=".browser.CalculatorCSSViewlet"
+      layer="z3c.website.layer.IWebSiteBrowserLayer"
+      permission="zope.Public"
+      />
+  </configure>
+
+</configure>

Added: z3c.demo/trunk/src/z3c/demo/calculator/calculator.py
===================================================================
--- z3c.demo/trunk/src/z3c/demo/calculator/calculator.py	                        (rev 0)
+++ z3c.demo/trunk/src/z3c/demo/calculator/calculator.py	2007-05-21 04:48:00 UTC (rev 75853)
@@ -0,0 +1,27 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation 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: __init__.py 69382 2006-08-09 13:26:53Z rogerineichen $
+"""
+
+import zope.interface
+from z3c.website import page
+from z3c.demo.calculator import interfaces
+
+
+class Calculator(page.Page):
+    """Calculator sample."""
+
+    zope.interface.implements(interfaces.ICalculator)
+

Added: z3c.demo/trunk/src/z3c/demo/calculator/configure.zcml
===================================================================
--- z3c.demo/trunk/src/z3c/demo/calculator/configure.zcml	                        (rev 0)
+++ z3c.demo/trunk/src/z3c/demo/calculator/configure.zcml	2007-05-21 04:48:00 UTC (rev 75853)
@@ -0,0 +1,18 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    i18n_domain="z3c.website">
+
+  <class class=".calculator.Calculator">
+    <require
+        permission="zope.Public"
+        interface=".interfaces.ICalculator"
+        />
+    <require
+        permission="z3c.website.ManageContent"
+        set_schema=".interfaces.ICalculator"
+        />
+  </class>
+
+  <include file="browser.zcml" />
+
+</configure>

Added: z3c.demo/trunk/src/z3c/demo/calculator/interfaces.py
===================================================================
--- z3c.demo/trunk/src/z3c/demo/calculator/interfaces.py	                        (rev 0)
+++ z3c.demo/trunk/src/z3c/demo/calculator/interfaces.py	2007-05-21 04:48:00 UTC (rev 75853)
@@ -0,0 +1,23 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation 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: __init__.py 69382 2006-08-09 13:26:53Z rogerineichen $
+"""
+
+from z3c.website import interfaces
+
+
+class ICalculator(interfaces.ISample):
+    """Calculator sample."""
+

Added: z3c.demo/trunk/src/z3c/demo/calculator/z3c.demo.calculator-configure.zcml
===================================================================
--- z3c.demo/trunk/src/z3c/demo/calculator/z3c.demo.calculator-configure.zcml	                        (rev 0)
+++ z3c.demo/trunk/src/z3c/demo/calculator/z3c.demo.calculator-configure.zcml	2007-05-21 04:48:00 UTC (rev 75853)
@@ -0,0 +1 @@
+<include package="z3c.demo.calculator" />



More information about the Checkins mailing list