[Zope3-checkins]
SVN: Zope3/branches/jinty-zodbless/src/zope/app/zodbless/
An example of an extremly simple zope3 application that does
not use the ZODB. (Probably this should not be merged to the
trunk unless some tests are written)
Brian Sutherland
jinty at web.de
Mon Apr 9 21:25:48 EDT 2007
Log message for revision 74077:
An example of an extremly simple zope3 application that does not use the ZODB. (Probably this should not be merged to the trunk unless some tests are written)
Changed:
A Zope3/branches/jinty-zodbless/src/zope/app/zodbless/
A Zope3/branches/jinty-zodbless/src/zope/app/zodbless/README.txt
A Zope3/branches/jinty-zodbless/src/zope/app/zodbless/__init__.py
A Zope3/branches/jinty-zodbless/src/zope/app/zodbless/app.py
A Zope3/branches/jinty-zodbless/src/zope/app/zodbless/browser.py
A Zope3/branches/jinty-zodbless/src/zope/app/zodbless/configure.zcml
A Zope3/branches/jinty-zodbless/src/zope/app/zodbless/simple_site.zcml
A Zope3/branches/jinty-zodbless/src/zope/app/zodbless/zodbless_zope.conf
-=-
Added: Zope3/branches/jinty-zodbless/src/zope/app/zodbless/README.txt
===================================================================
--- Zope3/branches/jinty-zodbless/src/zope/app/zodbless/README.txt 2007-04-10 00:36:03 UTC (rev 74076)
+++ Zope3/branches/jinty-zodbless/src/zope/app/zodbless/README.txt 2007-04-10 01:25:47 UTC (rev 74077)
@@ -0,0 +1,12 @@
+Example of Zope 3 without the ZODB
+==================================
+
+This is an excruciatingly simple example Zope3 application that does not use
+the ZODB.
+
+To test it, copy the zodbless_zope.conf and simple_site.zcml to the top
+directory of a zope checkout.
+
+Start the zope server with ./z3.py -C zodbless_zope.conf
+
+Then go to http://localhost:8080/index.html
Property changes on: Zope3/branches/jinty-zodbless/src/zope/app/zodbless/README.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/branches/jinty-zodbless/src/zope/app/zodbless/__init__.py
===================================================================
Property changes on: Zope3/branches/jinty-zodbless/src/zope/app/zodbless/__init__.py
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/branches/jinty-zodbless/src/zope/app/zodbless/app.py
===================================================================
--- Zope3/branches/jinty-zodbless/src/zope/app/zodbless/app.py 2007-04-10 00:36:03 UTC (rev 74076)
+++ Zope3/branches/jinty-zodbless/src/zope/app/zodbless/app.py 2007-04-10 01:25:47 UTC (rev 74077)
@@ -0,0 +1,34 @@
+from zope.interface import implements, Interface
+from zope.component import getGlobalSiteManager
+from zope.location import Location
+from zope.traversing.interfaces import IContainmentRoot
+from zope.app.component.interfaces import ISite
+from zope.app.appsetup.interfaces import IApplicationFactory
+
+class IMyApplication(Interface):
+ """Marker interface to hang views onto."""
+ pass
+
+class Application(Location):
+ """A simple application."""
+
+ # If you want resources to work, ISite must come before IContainmentRoot
+ implements(IMyApplication, ISite, IContainmentRoot)
+
+ def setSiteManager(self, sm):
+ # no ZODB to set the site manager in, but we want resources, so...
+ raise NotImplementedError()
+
+ def getSiteManager(self):
+ return getGlobalSiteManager()
+
+class ApplicationFactory:
+ implements(IApplicationFactory)
+
+ def prepare(self):
+ pass
+
+ def __call__(self, request):
+ return Application()
+
+app_factory = ApplicationFactory()
Property changes on: Zope3/branches/jinty-zodbless/src/zope/app/zodbless/app.py
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/branches/jinty-zodbless/src/zope/app/zodbless/browser.py
===================================================================
--- Zope3/branches/jinty-zodbless/src/zope/app/zodbless/browser.py 2007-04-10 00:36:03 UTC (rev 74076)
+++ Zope3/branches/jinty-zodbless/src/zope/app/zodbless/browser.py 2007-04-10 01:25:47 UTC (rev 74077)
@@ -0,0 +1,6 @@
+from zope.publisher.browser import BrowserView
+
+class Index(BrowserView):
+
+ def __call__(self):
+ return "This Zope3 application does not use the ZODB."
Property changes on: Zope3/branches/jinty-zodbless/src/zope/app/zodbless/browser.py
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/branches/jinty-zodbless/src/zope/app/zodbless/configure.zcml
===================================================================
--- Zope3/branches/jinty-zodbless/src/zope/app/zodbless/configure.zcml 2007-04-10 00:36:03 UTC (rev 74076)
+++ Zope3/branches/jinty-zodbless/src/zope/app/zodbless/configure.zcml 2007-04-10 01:25:47 UTC (rev 74077)
@@ -0,0 +1,18 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:browser="http://namespaces.zope.org/browser"
+ >
+
+ <utility
+ provides="zope.app.appsetup.interfaces.IApplicationFactory"
+ component=".app.app_factory"
+ />
+
+ <browser:page
+ for=".app.IMyApplication"
+ permission="zope.Public"
+ class=".browser.Index"
+ name="index.html"
+ />
+
+</configure>
Property changes on: Zope3/branches/jinty-zodbless/src/zope/app/zodbless/configure.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/branches/jinty-zodbless/src/zope/app/zodbless/simple_site.zcml
===================================================================
--- Zope3/branches/jinty-zodbless/src/zope/app/zodbless/simple_site.zcml 2007-04-10 00:36:03 UTC (rev 74076)
+++ Zope3/branches/jinty-zodbless/src/zope/app/zodbless/simple_site.zcml 2007-04-10 01:25:47 UTC (rev 74077)
@@ -0,0 +1,12 @@
+<configure xmlns="http://namespaces.zope.org/zope">
+
+ <include package="zope.app.zcmlfiles" />
+ <include package="zope.app.twisted" />
+ <include package="zope.app.zodbless" />
+
+ <unauthenticatedPrincipal
+ id="zope.anybody"
+ title="Unauthenticated User"
+ />
+
+</configure>
Property changes on: Zope3/branches/jinty-zodbless/src/zope/app/zodbless/simple_site.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/branches/jinty-zodbless/src/zope/app/zodbless/zodbless_zope.conf
===================================================================
--- Zope3/branches/jinty-zodbless/src/zope/app/zodbless/zodbless_zope.conf 2007-04-10 00:36:03 UTC (rev 74076)
+++ Zope3/branches/jinty-zodbless/src/zope/app/zodbless/zodbless_zope.conf 2007-04-10 01:25:47 UTC (rev 74077)
@@ -0,0 +1,76 @@
+# identify the component configuration used to define the site:
+site-definition simple_site.zcml
+
+# number of bytecode instructions to execute between checks for
+# interruptions (SIGINTR, thread switches):
+interrupt-check-interval 200
+
+<server>
+ type HTTP
+ address 8080
+</server>
+
+# Ready to go HTTPS server. You just need to make sure OpenSSL is installed.
+# <sslserver>
+# type HTTPS
+# address 8443
+# privatekeypath server.pem
+# certificatepath server.pem
+# </sslserver>
+
+# For debugging purposes, you can use this publisher instead/as well
+# (obviously if it's as well, use a different port number). If there's
+# an exception, Zope will drop into pdb at the point of the exception.
+#<server>
+# type PostmortemDebuggingHTTP
+# address 8080
+#</server>
+
+# A special HTTP server that records HTTP session that can be converted to
+# functional tests.
+# <server>
+# type RecordingHTTP
+# address 8081
+# </server>
+
+#<server>
+# type FTP
+# address 8021
+#</server>
+
+<accesslog>
+ # This sets up logging to both a file (access.log) and to standard
+ # output (STDOUT). The "path" setting can be a relative or absolute
+ # filesystem path or the tokens STDOUT or STDERR.
+
+ <logfile>
+ path access.log
+ </logfile>
+
+ <logfile>
+ path STDOUT
+ </logfile>
+</accesslog>
+
+<eventlog>
+ # This sets up logging to both a file (z3.log) and to standard
+ # output (STDOUT). The "path" setting can be a relative or absolute
+ # filesystem path or the tokens STDOUT or STDERR.
+
+ <logfile>
+ path z3.log
+ </logfile>
+
+ <logfile>
+ path STDOUT
+ </logfile>
+</eventlog>
+
+# devmode
+#
+# Switches the Developer Mode on and off.
+#
+# Default:
+# devmode off
+#
+# devmode on
More information about the Zope3-Checkins
mailing list