[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/utilities - __init__.py:1.1.2.1 content.py:1.1.2.1 schema.py:1.1.2.1

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Aug 15 11:04:59 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/interfaces/utilities
In directory cvs.zope.org:/tmp/cvs-serv12471/interfaces/utilities

Added Files:
      Tag: dreamcatcher-ttwschema-branch
	__init__.py content.py schema.py 
Log Message:
Check point. Refactored all of the new code and moved it to the right places.

Everything still broken though. But they are just import problems from the
move.


=== Added File Zope3/src/zope/app/interfaces/utilities/__init__.py ===


=== Added File Zope3/src/zope/app/interfaces/utilities/content.py ===
##############################################################################
#
# Copyright (c) 2003 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.
#
##############################################################################
"""Content Component Definition and Instance Interfaces

$Id: content.py,v 1.1.2.1 2003/08/15 14:04:52 srichter Exp $
"""
from zope.interface import Interface, Attribute
from zope.schema import TextLine
from zope.app.component.interfacefield import InterfaceField


class IContentComponentDefinition(Interface):
    """Content Component Definitions describe simple single-schema based
    content components including their security declarations."""

    name = TextLine(
        title=u"Name of Content Component Type",
        description=u"""This is the name of the document type.""",
        required=True)

    schema = InterfaceField(
        title=u"Schema",
        description=u"Specifies the schema that characterizes the document.",
        required=True)

    permissions = Attribute(
        u"A dictionary that maps set/get permissions on the schema's"
        u"fields. Entries looks as follows: {fieldname:(set_perm, get_perm)}")


class IContentComponentInstance(Interface):
    """Interface describing a Content Component Instance"""

    __name__ = TextLine(
        title=u"Name of Content Component Type",
        description=u"""This is the name of the document type.""",
        required=True)

    __schema__ = InterfaceField(
        title=u"Schema",
        description=u"Specifies the schema that characterizes the document.",
        required=True)


=== Added File Zope3/src/zope/app/interfaces/utilities/schema.py ===
##############################################################################
#
# Copyright (c) 2003 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.
#
##############################################################################
"""TTW Schema Interfaces

$Id: schema.py,v 1.1.2.1 2003/08/15 14:04:52 srichter Exp $
"""
from zope.interface import Interface, Attribute
from zope.interface.interfaces import IInterface
from zope.schema import TextLine
from zope.app.interfaces.container import IAdding
from zope.app.interfaces.component import IInterfaceField, IInterfacesField

class ISchemaUtility(Interface):
    pass

class ISchemaAdding(IAdding):
    pass

class IMutableSchema(IInterface):
    """This object represents an interface/schema that can be edited by
    managing the fields it contains."""

    def getName(name):
        """Get the name of the schema."""

    def setName(name):
        """Set the name of the schema."""

    def addField(name, field):
        """Add a field to schema."""

    def removeField(name):
        """Remove field by name from the schema.

        If the field does not exist, raise an error.
        """

    def renameField(orig_name, target_name):
        """Rename a field.

        If the target_name is already taken, raise an error.
        """

    def insertField(name, field, position):
        """Insert a field with a given name at the specified position.

        If the position does not make sense, i.e. a negative number of a
        number larger than len(self), then an error is raised.
        """

    def moveField(name, position):
        """Move a field (given by its name) to a particular position.

        If the position does not make sense, i.e. a negative number of a
        number larger than len(self), then an error is raised.
        """

class IMutableSchemaField(IInterfaceField):
    """A type of Field that has an IMutableSchema as its value."""

class IMutableSchemasField(IInterfaceField):
    """A type of Field that has a tuple of IMutableSchemas as its value."""






More information about the Zope3-Checkins mailing list