[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/content - dtmlpage.py:1.1
Stephan Richter
srichter@cbu.edu
Mon, 6 Jan 2003 10:46:31 -0500
Update of /cvs-repository/Zope3/src/zope/app/interfaces/content
In directory cvs.zope.org:/tmp/cvs-serv496/interfaces/content
Added Files:
dtmlpage.py
Log Message:
Moved DTML Page interfaces into Interfaces subtree.
Fixed Bug 120 by using a similar approach as ZPT. Mmmh, are schema
properties not Interface Attributes? If not, then the interface security
directive does not seem to catch these and they are not protected. We
should really fix that.
=== Added File Zope3/src/zope/app/interfaces/content/dtmlpage.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (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: dtmlpage.py,v 1.1 2003/01/06 15:46:27 srichter Exp $
"""
import zope.schema
from zope.interface import Interface, Attribute
class IDTMLPage(Interface):
"""DTML Pages are a persistent implementation of DTML."""
def setSource(text, content_type='text/html'):
"""Save the source of the page template."""
def getSource():
"""Get the source of the page template."""
source = zope.schema.Text(
title=u"Source",
description=u"""The source od the page template.""",
required=True)
class IRenderDTMLPage(Interface):
content_type = Attribute('Content type of generated output')
def render(request, *args, **kw):
"""Render the page template.
The first argument is bound to the top-level 'request'
variable. The positional arguments are bound to the 'args'
variable and the keyword arguments are bound to the 'options'
variable.
"""