[Checkins] SVN: lovely.remoteinclude/ imported from Lovely Systems private repository

Jodok Batlogg jodok.batlogg at lovelysystems.com
Thu Jun 7 15:06:05 EDT 2007


Log message for revision 76474:
  imported from Lovely Systems private repository

Changed:
  A   lovely.remoteinclude/
  A   lovely.remoteinclude/trunk/
  A   lovely.remoteinclude/trunk/CHANGES.txt
  A   lovely.remoteinclude/trunk/buildout.cfg
  A   lovely.remoteinclude/trunk/setup.py
  A   lovely.remoteinclude/trunk/src/
  A   lovely.remoteinclude/trunk/src/lovely/
  A   lovely.remoteinclude/trunk/src/lovely/__init__.py
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/LICENSE.txt
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/README.txt
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/__init__.py
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/adapter.py
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/configure.zcml
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/__init__.py
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/adapter.py
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/browser.zcml
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/configure.zcml
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/demo.pt
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/includes.py
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/includes.zcml
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/interfaces.py
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/main.pt
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/nginx.conf
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/responsecached.py
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/responsecached.zcml
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/seleniumtests.py
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/vanilla.py
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/vanilla.zcml
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/ftesting.zcml
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/interfaces.py
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/lovely.remoteinclude-configure.zcml
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/__init__.py
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/inc1.html
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/inc1.pt
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/inc2.pt
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/test.pt
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/views.py
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/tests.py
  A   lovely.remoteinclude/trunk/src/lovely/remoteinclude/view.py

-=-
Added: lovely.remoteinclude/trunk/CHANGES.txt
===================================================================
--- lovely.remoteinclude/trunk/CHANGES.txt	                        (rev 0)
+++ lovely.remoteinclude/trunk/CHANGES.txt	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,11 @@
+===============================
+Changes in lovely.remoteinclude
+===============================
+
+2007/06/03 0.2.0
+================
+
+- Added demo and selenium tests
+
+
+


Property changes on: lovely.remoteinclude/trunk/CHANGES.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/buildout.cfg
===================================================================
--- lovely.remoteinclude/trunk/buildout.cfg	                        (rev 0)
+++ lovely.remoteinclude/trunk/buildout.cfg	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,92 @@
+[buildout]
+develop = .
+parts = test selenium nginx instance memcached
+find-links = http://download.zope.org/distribution
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = lovely.remoteinclude [test]
+
+[zope3]
+location =
+
+[app]
+recipe = zc.zope3recipes:app
+servers = zserver
+site.zcml =
+   <include package="lovely.remoteinclude.demo"/>
+eggs = lovely.remoteinclude [test]
+
+[instance]
+recipe = zc.zope3recipes:instance
+application = app
+address = 8034
+zope.conf = ${database:zconfig}
+
+[database]
+recipe = zc.recipe.filestorage
+
+
+[selenium-app]
+recipe = zc.zope3recipes:app
+servers = zserver
+site.zcml =
+   <include package="lovely.remoteinclude.demo"/>
+   <include package="zc.selenium"/>
+eggs = lovely.remoteinclude [test]
+
+[selenium-instance]
+recipe = zc.zope3recipes:instance
+application = selenium-app
+zope.conf =
+    <server http0>
+      type WSGI-HTTP
+      address 8034
+    </server>
+
+    <zodb>
+      <demostorage>
+      </demostorage>
+    </zodb>
+
+    <accesslog>
+      <logfile>
+        path STDOUT
+      </logfile>
+    </accesslog>
+
+    <eventlog>
+      <logfile>
+        path STDERR
+      </logfile>
+    </eventlog>
+
+[selenium]
+recipe = zc.recipe.egg:scripts
+eggs = ${selenium-app:eggs}
+script = selenium
+entry-points = selenium=zc.selenium.selenium:main
+initialization =
+  # hoschi
+  sys.argv.insert(1, '${selenium-instance:run-directory}/zope.conf')
+
+
+[nginx]
+recipe = zc.recipe.cmmi
+url = http://sysoev.ru/nginx/nginx-0.5.22.tar.gz
+extra_options = --with-poll_module
+
+[memcached-rc]
+recipe = zc.recipe.rhrc
+parts = memcached
+dest = ${buildout:bin-directory}
+
+[memcached]
+recipe = zc.recipe.cmmi
+run-script = abc
+url = http://www.danga.com/memcached/dist/memcached-1.2.2.tar.gz
+extra_options = --with-libevent=${libevent:location}
+
+[libevent]
+recipe = zc.recipe.cmmi
+url = http://www.monkey.org/~provos/libevent-1.3b.tar.gz

Added: lovely.remoteinclude/trunk/setup.py
===================================================================
--- lovely.remoteinclude/trunk/setup.py	                        (rev 0)
+++ lovely.remoteinclude/trunk/setup.py	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,57 @@
+##############################################################################
+#
+# Copyright (c) 2007 Lovely Systems 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 setuptools import setup, find_packages
+
+setup(
+    name = 'lovely.remoteinclude',
+    version = '0.2.1',
+    author = "Lovely Systems",
+    author_email = "office at lovelysystems.com",
+    license = "ZPL 2.1",
+    keywords = "remoteinclude includes zope zope3",
+    description = "render include views of viewlets and views"
+    url = 'http://svn.zope.org/lovely.remoteinclude',
+    zip_safe = False,
+    packages = find_packages('src'),
+    include_package_data = True,
+    package_dir = {'':'src'},
+    namespace_packages = ['lovely',],
+    extras_require = dict(
+        test = ['zope.app.testing',
+                'zope.app.zcmlfiles',
+                'zope.app.securitypolicy',
+                'zope.testbrowser',
+                'zope.app.server',
+                'zope.contentprovider',
+                'zope.viewlet',
+                'z3c.traverser >= 0.1.3',
+                'z3c.configurator',
+                'zc.selenium',
+                'z3c.testing']
+        ),
+    install_requires = ['zope.component',
+                        'lovely.responsecache >= 0.2.1',
+                        'zope.cachedescriptors',
+                        'zope.contentprovider',
+                        'zope.publisher',
+                        'zope.traversing',
+                        ],
+    )


Property changes on: lovely.remoteinclude/trunk/setup.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/__init__.py
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/__init__.py	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/__init__.py	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,25 @@
+##############################################################################
+#
+# Copyright (c) 2007 Lovely Systems 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"
+
+
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    pass


Property changes on: lovely.remoteinclude/trunk/src/lovely/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/LICENSE.txt
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/LICENSE.txt	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/LICENSE.txt	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,54 @@
+Zope Public License (ZPL) Version 2.1
+-------------------------------------
+
+A copyright notice accompanies this license document that
+identifies the copyright holders.
+
+This license has been certified as open source. It has also
+been designated as GPL compatible by the Free Software
+Foundation (FSF).
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the
+following conditions are met:
+
+1. Redistributions in source code must retain the
+   accompanying copyright notice, this list of conditions,
+   and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the accompanying
+   copyright notice, this list of conditions, and the
+   following disclaimer in the documentation and/or other
+   materials provided with the distribution.
+
+3. Names of the copyright holders must not be used to
+   endorse or promote products derived from this software
+   without prior written permission from the copyright
+   holders.
+
+4. The right to distribute this software or to use it for
+   any purpose does not give you the right to use
+   Servicemarks (sm) or Trademarks (tm) of the copyright
+   holders. Use of them is covered by separate agreement
+   with the copyright holders.
+
+5. If any files are modified, you must cause the modified
+   files to carry prominent notices stating that you changed
+   the files and the date of any change.
+
+Disclaimer
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''
+  AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+  NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+  NO EVENT SHALL THE COPYRIGHT HOLDERS BE
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+  DAMAGE.
\ No newline at end of file


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/LICENSE.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/README.txt
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/README.txt	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/README.txt	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,32 @@
+=========================
+Remote Includes Renderers
+=========================
+
+This package allows to render include views of viewlets and views
+which implement the IContentProvider interface. This is done by
+a subscriber on BeforeUpdateEvent.
+
+  >>> from zope.testbrowser.testing import Browser
+  >>> browser = Browser()
+  >>> browser.handleErrors = False
+
+If we include it in a pagetemplate, includes are rendered.
+
+  >>> browser.open('http://localhost/@@test.html')
+  >>> print browser.contents
+  <html>
+  <body>
+  <div>
+  This is the real content of inc1
+  </div>
+  <BLANKLINE>
+  <!--# include virtual="/inc2.html" -->
+  <!--# include virtual="/inc3.html" -->
+  </body>
+  </html>
+
+But not if accessed directly, the real content is rendered.
+
+  >>> browser.open('http://localhost/@@inc2.html')
+  >>> browser.contents
+  '<div>\n  This is the real content of inc2\n</div>\n'


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/README.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/__init__.py
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/__init__.py	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/__init__.py	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1 @@
+# package


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/adapter.py
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/adapter.py	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/adapter.py	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,53 @@
+##############################################################################
+#
+# Copyright (c) 2007 Lovely Systems 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.traversing.namespace import view
+from interfaces import IIncludeableView
+from zope import component
+
+from zope.contentprovider.interfaces import IBeforeUpdateEvent
+from zope import component
+from zope.security.proxy import removeSecurityProxy
+
+
+ at component.adapter(IIncludeableView, IBeforeUpdateEvent)
+def makeInclude(view, ev):
+    traversed = removeSecurityProxy(ev.request._last_obj_traversed)
+    if traversed.context is view or traversed is view:
+        # if we are directly published do not render an include
+        return
+    inc = component.queryMultiAdapter((view, ev.request),
+                                      name="include")
+    if inc is not None:
+        view = removeSecurityProxy(view)
+        view.update = lambda: None
+        view.render = inc.__call__
+
+
+class IncludeViewTraversable(view):
+
+    def traverse(self, name, ignored):
+        view = super(IncludeViewTraversable, self).traverse(name,
+                                                            ignored)
+        if IIncludeableView.providedBy(view):
+            inc = component.queryMultiAdapter((view, self.request),
+                                              name="include")
+            if inc is not None:
+                return inc
+        return view
+


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/adapter.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/configure.zcml
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/configure.zcml	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/configure.zcml	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,16 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:browser="http://namespaces.zope.org/browser"
+           i18n_domain="zope">
+
+  <subscriber handler=".adapter.makeInclude"/>
+
+  <!-- register on browserrequest as layer, so we have it in all layers -->
+
+  <browser:page
+      name="include"
+      for=".interfaces.IIncludeableView"
+      layer="zope.publisher.interfaces.browser.IBrowserRequest"
+      permission="zope.Public"
+      class="lovely.remoteinclude.view.IncludeView"/>
+  
+</configure>


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/configure.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/__init__.py
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/__init__.py	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/__init__.py	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1 @@
+# package
\ No newline at end of file


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/adapter.py
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/adapter.py	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/adapter.py	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,31 @@
+##############################################################################
+#
+# Copyright (c) 2007 Lovely Systems 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 import component
+from zope import event
+
+from zope.proxy import removeAllProxies
+from zope.lifecycleevent.interfaces import IObjectModifiedEvent
+
+from lovely.memcached.event import InvalidateCacheEvent
+
+
+ at component.adapter(IObjectModifiedEvent)
+def objectModified(ev):
+    event.notify(InvalidateCacheEvent(dependencies=[removeAllProxies(ev.object)]))
+


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/adapter.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/browser.zcml
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/browser.zcml	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/browser.zcml	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,32 @@
+<configure xmlns:zope="http://namespaces.zope.org/zope"
+           xmlns="http://namespaces.zope.org/browser"
+           i18n_domain="zope">
+
+  <page
+      menu="zmi_views"
+      title="Demo"
+      for="zope.app.component.interfaces.ISite"
+      name="demo.html"
+      template="demo.pt"
+      permission="zope.Public"
+      />
+
+  <viewletManager
+      for="*"
+      permission="zope.Public"
+      name="IBody"
+      provides=".interfaces.IBody"/>
+
+  <page
+      name="remoteinclude.html"
+      template="main.pt"
+      permission="zope.Public"
+      for="*"/>
+
+  <zope:subscriber handler=".adapter.objectModified"/>
+
+  <include file="vanilla.zcml"/>
+  <include file="responsecached.zcml"/>
+  <include file="includes.zcml"/>
+
+</configure>


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/browser.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/configure.zcml
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/configure.zcml	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/configure.zcml	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,104 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:browser="http://namespaces.zope.org/browser"
+           xmlns:zcml="http://namespaces.zope.org/zcml"
+           xmlns:meta="http://namespaces.zope.org/meta"
+           i18n_domain="zope">
+
+
+  <include package="zope.app.zcmlfiles"/>
+
+  <securityPolicy
+      component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+  <include package="zope.app.server" />
+
+  <include package="zope.app.component"/>
+
+  <include package="zope.app.component.browser" file="meta.zcml" />
+  <include package="zope.app.securitypolicy" file="meta.zcml"/>
+  <include package="zope.viewlet" file="meta.zcml"/>
+
+  <include package="zope.app.securitypolicy" />
+  <include package="zope.app.error" />
+  <include package="zope.app.authentication" />
+  <include package="zope.app.basicskin"/>
+  <include package="zope.app.rotterdam"/>
+  <include package="zope.viewlet"/>
+  <include package="zope.formlib"/>
+  <include package="zope.size"/>
+  <include package="zope.app.renderer"/>
+  <include package="zope.contentprovider"/>
+  <include package="z3c.configurator" />
+  <include package="z3c.traverser.viewlet" />
+  <include package="lovely.memcached" />
+  <include package="lovely.responsecache" file="meta.zcml" />
+  <include package="lovely.responsecache" />
+  <include package="lovely.remoteinclude" />
+
+
+
+
+  <role id="zope.Anonymous" title="Everybody"
+        description="All users have this role implicitly" />
+
+  <role id="zope.Manager" title="Site Manager" />
+
+
+  <principal
+      id="zope.manager"
+      title="Administrator"
+      login="mgr"
+      password="mgrpw" />
+
+  <grant
+      role="zope.Manager"
+      principal="zope.manager"
+      />
+
+  <unauthenticatedPrincipal
+      id="zope.anybody"
+      title="Unauthenticated User" />
+
+  <unauthenticatedGroup
+      id="zope.Anybody"
+      title="Unauthenticated Users"
+      />
+
+
+  <authenticatedGroup
+      id="zope.Authenticated"
+      title="Authenticated Users"
+      />
+
+  <everybodyGroup
+      id="zope.Everybody"
+      title="All Users"
+      />
+
+  <grant permission="zope.View"
+         principal="zope.Everybody"/>
+
+  <grantAll role="zope.Manager" />
+
+  <adapter
+      factory=".seleniumtests.VanillaTestSuite"
+      name="vanillaremoteinclude.html"
+      permission="zope.Public"
+      for="*"
+      />
+
+  <adapter
+      factory=".seleniumtests.ResponseCachedTestSuite"
+      name="responsecachedremoteinclude.html"
+      permission="zope.Public"
+      for="*"
+      />
+
+  <adapter
+      factory=".seleniumtests.ResponseCachedTestSuite"
+      name="includes.html"
+      permission="zope.Public"
+      for="*"
+      />
+
+  <include file="browser.zcml"/>
+</configure>


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/configure.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/demo.pt
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/demo.pt	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/demo.pt	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,25 @@
+<html metal:use-macro="context/@@standard_macros/view">
+  <metal:block fill-slot="body">
+    <div>
+      <ul>
+        <li>
+          <a href="/++skin++vanilla/remoteinclude.html" target="_blank">
+          Vanilla Zope page</a>
+        </li>
+        <li>
+          <a href="/++skin++responsecached/remoteinclude.html" target="_blank">
+          Page with Viewlets cached in Memcached</a>
+        </li>
+        <li>
+          <a href="/++skin++includes/remoteinclude.html" target="_blank">
+            Page with Viewlets as includes.</a>
+        </li>
+        <li>
+          <a href="http://localhost:8033/remoteinclude.html" target="_blank">
+          Page with Viewlets cached memcached. NGINX renders viewlets
+          via includes from Memcached.</a>
+        </li>
+      </ul>
+    </div>
+  </metal:block>
+</html>


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/demo.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/includes.py
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/includes.py	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/includes.py	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,49 @@
+##############################################################################
+#
+# Copyright (c) 2007 Lovely Systems 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'
+
+import vanilla
+from zope import interface
+from zope import event
+from lovely.remoteinclude.interfaces import IIncludeableView
+from zope.publisher.interfaces.browser import IDefaultBrowserLayer
+from zope.contentprovider.interfaces import (IContentProvider,
+                                             BeforeUpdateEvent)
+from time import sleep
+
+class IIncludesLayer(IDefaultBrowserLayer):
+    """Includes layer"""
+
+class MainPage(object):
+    interface.implements(IContentProvider)
+
+    def update(self):
+        sleep(1)
+
+    def render(self):
+        return self.index()
+
+    def __call__(self):
+        event.notify(BeforeUpdateEvent(self, self.request))
+        self.update()
+        return self.render()
+
+class FirstViewlet(vanilla.FirstViewlet):
+    interface.implements(IIncludeableView)
+
+class SecondViewlet(vanilla.SecondViewlet):
+    interface.implements(IIncludeableView)


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/includes.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/includes.zcml
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/includes.zcml	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/includes.zcml	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,56 @@
+<configure xmlns:zope="http://namespaces.zope.org/zope"
+           xmlns="http://namespaces.zope.org/browser"
+           i18n_domain="zope">
+
+  <zope:interface
+      interface=".includes.IIncludesLayer"
+      type="zope.publisher.interfaces.browser.IBrowserSkinType"
+      name="includes"
+      />
+
+  <page
+      name="remoteinclude.html"
+      class=".includes.MainPage"
+      template="main.pt"
+      permission="zope.Public"
+      layer=".includes.IIncludesLayer"
+      for="*"/>
+
+  <viewlet
+      weight="1"
+      layer=".includes.IIncludesLayer"
+      permission="zope.Public"
+      for="zope.app.container.interfaces.IContainer"
+      manager=".interfaces.IBody"
+      name="first"
+      class=".includes.FirstViewlet"/>
+
+  <viewlet
+      weight="2"
+      layer=".includes.IIncludesLayer"
+      permission="zope.Public"
+      for="zope.app.container.interfaces.IContainer"
+      manager=".interfaces.IBody"
+      name="second"
+      class=".includes.SecondViewlet"/>
+
+  <cacheSettings
+      for=".includes.MainPage"
+      lifetime="3600"
+      layer=".includes.IIncludesLayer"
+      />
+
+  <cacheSettings
+      for=".vanilla.FirstViewlet"
+      lifetime="3600"
+      dependOnContext="True"
+      layer=".includes.IIncludesLayer"
+      />
+
+  <cacheSettings
+      for=".vanilla.SecondViewlet"
+      lifetime="3600"
+      layer=".includes.IIncludesLayer"
+      />
+
+</configure>


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/includes.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/interfaces.py
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/interfaces.py	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/interfaces.py	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,23 @@
+##############################################################################
+#
+# Copyright (c) 2007 Lovely Systems 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.viewlet.interfaces import IViewletManager
+
+class IBody(IViewletManager):
+
+    """The IBody viewlet manager"""


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/interfaces.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/main.pt
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/main.pt	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/main.pt	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,6 @@
+<html>
+  <body>
+     <h1>Remoteinclude Demo</h1>
+    <div tal:replace="structure provider:IBody"/>
+  </body>
+</html>
\ No newline at end of file


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/main.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/nginx.conf
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/nginx.conf	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/nginx.conf	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,86 @@
+worker_processes  1;
+events {
+    worker_connections  1024;
+}
+http {
+    include       conf/mime.types;
+    default_type  application/octet-stream;
+    sendfile        on;
+    ssi on;
+    keepalive_timeout       65;
+
+    upstream backend-zope {
+        server 127.0.0.1:8034;
+    }
+
+    server {
+        listen 127.0.0.1:8033;
+        set $qargs '';
+        userid          on;
+        userid_name     uid_v2;
+        userid_path     /;
+        userid_expires  365d;
+        # everything that is finally fetched from zope goes here
+        location ^~ '/zope/' {
+            proxy_read_timeout 300;
+            proxy_set_header Host $host;
+            rewrite ^/zope/(.*) /++skin++includes/++vh++http:$host:8033/++/$1  break;
+            proxy_pass http://backend-zope;
+            internal;
+        }
+
+        # rewrite the principal uid to $uid or to anonymous if we are
+        # not authenticated
+        location ~ '^.*/\+\+ckey\+\+p_/.*$' {
+            set $uid 'anonymous';
+            if ($http_cookie ~ "uid_v2=([^;]+)(?:;|$)" ) {
+                set $uid $1;
+            }
+            if ($http_cookie !~* "z3.authenticated=True(.*)" ){
+                set $uid 'anonymous';
+            }
+            rewrite '^(.*/\+\+ckey\+\+p_)(/.*)$' '$1$uid$2';
+        }
+
+        # resources are not in memcache
+        location ^~ '/@@/' {
+            ssi off;
+            rewrite '^(.*)$' '/zope$1';
+        }
+
+        location ^~ '/memcached/' {
+            rewrite ^/memcached/(.*)$ $1;
+            set $memcached_key  mc/$uri$qargs;
+            memcached_pass   127.0.0.1:11211;
+            default_type     text/html;
+            # send it to zope as fallback
+            error_page       404 = /zope/$uri$qargs;
+            internal;
+        }
+
+        location '/' {
+            # offline page
+            #return 503;
+            if ($args) {
+                set $qargs ?$args;
+            }
+            if ($args = '') {
+                # we need to set qargs to empty because includes dont
+                # want to have the args of the root repquest
+                set $qargs $args;
+            }
+
+            # we rewrite the beginning slash with index.html, for some
+            # reason we have an empty path if we do not do this
+            rewrite ^/$ /index.html;
+
+            # just send get request to memcached
+            if ($request_method = "GET" ) {
+                # we need last because otherwise it will be recursive
+                rewrite ^(.*)$ /memcached$1 last;
+            }
+            # everything else goes directly to zope
+            rewrite ^(.*)$ '/zope$1' last;
+        }
+    }
+}

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/responsecached.py
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/responsecached.py	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/responsecached.py	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,25 @@
+##############################################################################
+#
+# Copyright (c) 2007 Lovely Systems 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 import interface
+from lovely.responsecache.view import ResponseCacheSettings
+import vanilla
+
+class IResponseCachedLayer(vanilla.IVanillaLayer):
+    """Responsecached layer"""
+


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/responsecached.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/responsecached.zcml
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/responsecached.zcml	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/responsecached.zcml	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,24 @@
+<configure xmlns="http://namespaces.zope.org/browser"
+           xmlns:zope="http://namespaces.zope.org/zope"
+           i18n_domain="zope">
+
+  <zope:interface
+      interface=".responsecached.IResponseCachedLayer"
+      type="zope.publisher.interfaces.browser.IBrowserSkinType"
+      name="responsecached"
+      />
+
+  <cacheSettings
+      for=".vanilla.FirstViewlet"
+      layer=".responsecached.IResponseCachedLayer"
+      lifetime="1*60*60"
+      dependOnContext="True"
+      />
+
+  <cacheSettings
+      for=".vanilla.SecondViewlet"
+      layer=".responsecached.IResponseCachedLayer"
+      lifetime="1*60*60"
+      />
+
+</configure>


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/responsecached.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/seleniumtests.py
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/seleniumtests.py	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/seleniumtests.py	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,92 @@
+##############################################################################
+#
+# Copyright (c) 2007 Lovely Systems 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 zc.selenium.pytest import Test
+from zope.app.component.hooks import getSite
+from zope.app.folder.folder import Folder
+from zope.traversing.browser.absoluteurl import absoluteURL
+from z3c.configurator import configurator
+from zope import event
+from zope.lifecycleevent import ObjectCreatedEvent
+
+class SkinTestSuite(Test):
+
+    skin = None
+
+    def setUp(self):
+        super(SkinTestSuite, self).setUp()
+        self.baseURL = 'http://%s/++skin++%s/seleniumtmp' % \
+                       (self.selenium.server, self.skin)
+
+    def reset(self):
+        s = self.selenium
+        s.open(self.baseURL)
+
+    def sharedSetUp(self):
+        super(SkinTestSuite, self).sharedSetUp()
+        self.root = getSite()
+        configurator.configure(self.root, {},
+                               names=['lovely.memcachedclient'])
+        if not 'seleniumtmp' in self.root:
+            tmp = Folder()
+            event.notify(ObjectCreatedEvent(tmp))
+            self.tmp = self.root['seleniumtmp'] = tmp
+        else:
+            self.tmp = self.root['seleniumtmp']
+
+    def sharedTearDown(self):
+        #del self.root['seleniumtmp']
+        super(SkinTestSuite, self).sharedTearDown()
+
+    def open(self, path):
+        self.selenium.open(self.baseURL + path)
+
+    def test_base(self):
+        s = self.selenium
+        self.reset()
+        self.open('/remoteinclude.html')
+        s.verifyTextPresent('Remoteinclude Demo')
+        s.verifyTextPresent('First Viewlet content')
+        s.verifyTextPresent('Second Viewlet content')
+
+class VanillaTestSuite(SkinTestSuite):
+    """
+    Tests basic view without caching
+    """
+    skin = 'vanilla'
+
+class ResponseCachedTestSuite(SkinTestSuite):
+    """
+    Tests views with two cached viewlets
+    """
+    skin = 'responsecached'
+
+class IncludesTestSuite(SkinTestSuite):
+    """
+    Tests views with viewlets as includes
+    """
+    skin = 'includes'
+
+    def test_includes(self):
+        s = self.selenium
+        self.reset()
+        self.open('/remoteinclude.html')
+        self.verifyTextPresent(
+            '/remoteinclude.html/++manager++IBody/++viewlet++first')
+        self.verifyTextPresent(
+            '/remoteinclude.html/++manager++IBody/++viewlet++second')


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/seleniumtests.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/vanilla.py
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/vanilla.py	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/vanilla.py	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,43 @@
+##############################################################################
+#
+# Copyright (c) 2007 Lovely Systems 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 time import sleep
+from zope.publisher.interfaces.browser import IDefaultBrowserLayer
+from zope.viewlet.viewlet import ViewletBase
+from zope.dublincore.interfaces import IZopeDublinCore
+
+class IVanillaLayer(IDefaultBrowserLayer):
+    """Vanilla layer"""
+
+class SleeperViewlet(ViewletBase):
+
+    def update(self):
+        sleep(1)
+
+class FirstViewlet(SleeperViewlet):
+
+    def render(self):
+        title = IZopeDublinCore(self.context).title
+        return u"<p>First Viewlet content: %s</p>"% title
+
+
+class SecondViewlet(SleeperViewlet):
+
+    def render(self):
+        return u"<p>Second Viewlet content</p>"
+


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/vanilla.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/vanilla.zcml
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/vanilla.zcml	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/vanilla.zcml	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,29 @@
+<configure xmlns:zope="http://namespaces.zope.org/zope"
+           xmlns="http://namespaces.zope.org/browser"
+           i18n_domain="zope">
+
+  <zope:interface
+      interface=".vanilla.IVanillaLayer"
+      type="zope.publisher.interfaces.browser.IBrowserSkinType"
+      name="vanilla"
+      />
+
+  <viewlet
+      weight="1"
+      layer=".vanilla.IVanillaLayer"
+      permission="zope.Public"
+      for="zope.app.container.interfaces.IContainer"
+      manager=".interfaces.IBody"
+      name="first"
+      class=".vanilla.FirstViewlet"/>
+
+  <viewlet
+      weight="2"
+      layer=".vanilla.IVanillaLayer"
+      permission="zope.Public"
+      for="zope.app.container.interfaces.IContainer"
+      manager=".interfaces.IBody"
+      name="second"
+      class=".vanilla.SecondViewlet"/>
+
+</configure>
\ No newline at end of file


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/demo/vanilla.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/ftesting.zcml
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/ftesting.zcml	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/ftesting.zcml	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,103 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:browser="http://namespaces.zope.org/browser"
+           xmlns:zcml="http://namespaces.zope.org/zcml"
+           xmlns:meta="http://namespaces.zope.org/meta"
+           i18n_domain="zope">
+
+
+  <include package="zope.app.securitypolicy" file="meta.zcml" />
+
+  <include
+      zcml:condition="installed zope.app.zcmlfiles"
+      package="zope.app.zcmlfiles"
+      />
+  <include
+      zcml:condition="not-installed zope.app.zcmlfiles"
+      package="zope.app"
+      />
+
+  <include package="zope.app.authentication" />
+  <securityPolicy
+      component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+  <include package="zope.app.securitypolicy" />
+
+  <role id="zope.Anonymous" title="Everybody"
+        description="All users have this role implicitly" />
+
+  <role id="zope.Manager" title="Site Manager" />
+
+
+  <principal
+      id="zope.manager"
+      title="Administrator"
+      login="mgr"
+      password="mgrpw" />
+
+  <grant
+      role="zope.Manager"
+      principal="zope.manager"
+      />
+
+  <unauthenticatedPrincipal
+      id="zope.anybody"
+      title="Unauthenticated User" />
+
+  <unauthenticatedGroup
+      id="zope.Anybody"
+      title="Unauthenticated Users"
+      />
+
+
+  <authenticatedGroup
+      id="zope.Authenticated"
+      title="Authenticated Users"
+      />
+
+  <everybodyGroup
+      id="zope.Everybody"
+      title="All Users"
+      />
+
+  <include package="lovely.responsecache" file="meta.zcml" />
+  <include package="lovely.responsecache" />
+  <include package="lovely.remoteinclude" />
+
+  <browser:page
+      name="test.html"
+      template="testing/test.pt"
+      for="zope.app.folder.interfaces.IFolder"
+      permission="zope.View"
+      />
+  <browser:page
+      name="inc1.html"
+      template="testing/inc1.pt"
+      for="zope.app.folder.interfaces.IFolder"
+      permission="zope.View"
+      />
+  <browser:page
+      name="inc2.html"
+      template="testing/inc2.pt"
+      for="zope.app.folder.interfaces.IFolder"
+      class="lovely.remoteinclude.view.IncludeableView"
+      permission="zope.View"
+      />
+
+  <browser:page
+      name="inc3.html"
+      for="zope.app.folder.interfaces.IFolder"
+      class="lovely.remoteinclude.testing.views.Inc3View"
+      permission="zope.View"
+      />
+
+  <browser:cacheSettings
+      for="lovely.remoteinclude.testing.views.Inc3View"
+      lifetime="1*60*60"
+      />
+
+  <grant permission="zope.View"
+         principal="zope.Everybody"/>
+
+  <grantAll role="zope.Manager" />
+
+</configure>


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/interfaces.py
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/interfaces.py	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/interfaces.py	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,28 @@
+##############################################################################
+#
+# Copyright (c) 2007 Lovely Systems 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 import interface
+from zope import schema
+from zope.contentprovider.interfaces import IContentProvider
+
+class IIncludeableView(IContentProvider):
+
+    """marker interface for views that can be rendered as includes. It
+    needs to be a contentprovider because we listen on
+    BeforeUpdteEvent."""
+


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/interfaces.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/lovely.remoteinclude-configure.zcml
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/lovely.remoteinclude-configure.zcml	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/lovely.remoteinclude-configure.zcml	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1 @@
+<include package="lovely.remoteinclude"/>


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/lovely.remoteinclude-configure.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/__init__.py
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/__init__.py	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/__init__.py	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1 @@
+#package


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/inc1.html
===================================================================

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/inc1.pt
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/inc1.pt	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/inc1.pt	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,3 @@
+<div>
+  This is the real content of inc1
+</div>


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/inc1.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/inc2.pt
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/inc2.pt	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/inc2.pt	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,3 @@
+<div>
+  This is the real content of inc2
+</div>
\ No newline at end of file


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/inc2.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/test.pt
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/test.pt	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/test.pt	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,7 @@
+<html>
+  <body>
+    <div tal:replace="structure context/@@inc1.html"/>
+    <div tal:replace="structure context/@@inc2.html"/>
+    <div tal:replace="structure context/@@inc3.html"/>
+  </body>
+</html>
\ No newline at end of file


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/test.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/views.py
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/views.py	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/views.py	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,12 @@
+from lovely.remoteinclude.view import IncludeableView
+from zope import interface
+from lovely.responsecache.view import ResponseCacheSettings
+
+class Inc3View(IncludeableView):
+
+    def render(self):
+        return "inc3 should not be seen in test"
+
+class HourCacheSettings(ResponseCacheSettings):
+    lifetime=3600
+    


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/testing/views.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/tests.py
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/tests.py	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/tests.py	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,37 @@
+##############################################################################
+#
+# Copyright (c) 2007 Lovely Systems 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'
+
+import unittest
+from zope.app.testing import functional
+from zope.app.testing import setup
+from z3c.testing import layer
+
+layer.defineLayer('RemoteIncludeLayer', zcml='ftesting.zcml', clean=True)
+
+def test_suite():
+    fsuite = functional.FunctionalDocFileSuite('README.txt')
+    fsuite.layer=RemoteIncludeLayer
+    level2Suites = (
+        fsuite,
+        )
+    for suite in level2Suites:
+        suite.level = 2
+    return unittest.TestSuite(level2Suites)
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/tests.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: lovely.remoteinclude/trunk/src/lovely/remoteinclude/view.py
===================================================================
--- lovely.remoteinclude/trunk/src/lovely/remoteinclude/view.py	                        (rev 0)
+++ lovely.remoteinclude/trunk/src/lovely/remoteinclude/view.py	2007-06-07 19:06:01 UTC (rev 76474)
@@ -0,0 +1,69 @@
+##############################################################################
+#
+# Copyright (c) 2007 Lovely Systems 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.publisher.browser import BrowserPage
+from zope.publisher.browser import BrowserView
+from zope.cachedescriptors.property import Lazy
+from zope.traversing.browser import absoluteURL
+from lovely.responsecache.interfaces import IResponseCacheSettings
+from zope import component
+from zope import interface
+from zope.app.component.hooks import getSite
+import interfaces
+from zope.contentprovider.interfaces import BeforeUpdateEvent
+from zope import event
+
+def includeView(context, request):
+    return component.queryMultiAdapter((context, request),
+                                       name='include')
+
+class IncludeableView(object):
+
+    """base class for registering via page directive"""
+    interface.implements(interfaces.IIncludeableView)
+
+    def update(self):
+        pass
+
+    def render(self):
+        return self.index()
+
+    def __call__(self):
+        event.notify(BeforeUpdateEvent(self, self.request))
+        self.update()
+        return self.render()
+
+class IncludeView(BrowserPage):
+
+    @Lazy
+    def viewURL(self):
+        cs = component.queryMultiAdapter(
+            (self.context, self.request), IResponseCacheSettings)
+        if cs is not None:
+            return cs.key
+        # we return the path from site if we have no key
+        siteURL = absoluteURL(getSite(), self.request)
+        cURL = absoluteURL(self.context, self.request)
+        return cURL[len(siteURL):]
+
+    def __call__(self):
+        s = """<!--# include virtual="%s" -->"""
+        return s % self.viewURL
+
+    def browserDefault(self, request):
+        return (self, ())


Property changes on: lovely.remoteinclude/trunk/src/lovely/remoteinclude/view.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native



More information about the Checkins mailing list