twingle/doc/teps tep-0108.txt,NONE,1.1
[email protected] Mon, 10 Mar 2003 10:23:31 -0700 (MST)
| Newsgroups | gmane.comp.cms.oscom.twingle.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvs/root/twingle/doc/teps
In directory alpha.oscom.org:/tmp/cvs-serv27128
Added Files:
tep-0108.txt
Log Message:
(by srichter) It is a bit Python/Zope centric, but I think people will get
the idea and I will generalize it a bit.
--- NEW FILE: tep-0108.txt ---
"""Interface definitions for an advanced Content Type registry. Note that
these interfaces were particular written for the Moztop IDE and are supposed
to be implemented using Javascript.
However, I think that the Zope 3 core could profit from a similar
infrastructure, however the features would slightly differ.
"""
from zope.interface import Interface
from zope.interface.Attribute import Attribute
class IContentTypeRegistry(Interface):
"""Note that this is a read-only interface.
The registry manages content types by their id and version. The version is
very important, since Moztop should be able to handle sites running
various versions of Zope 3.
"""
def getContentType(id, version):
"""Get the Content Type by its id and a version. If the content type
is part of the official Zope distribution, the version will be the
version of Zope, i.e. 3.1.1."""
class IContentType(Interface):
"""A Content Type object knows about the various tasks it has to perform.
Note that it should only deal with presentation and not functionality.
"""
id = Attribute("Id of the content type.")
version = Attribute("Version of content type.")
title = Attribute("Title of content type which can help describing the
object.")
zope_interface = Attribute("Name of the Zope Interface that this content
object represents.")
def getViewNames():
"""Get the names of all views."""
def getView(name):
"""Get a particular view by name."""
def updateViews():
"""Update the local versions of all views for this content type."""
class IView(Interface):
"""A particular view where the user can do something. Examples include
Contents, Meta Data, Security and Preview.
I think at some point we might have special interfaces for some views so
we can save duplicate efforts.
Also, note that since we only save the path to the view, we can reuse some
of them, such as Meta Data.
"""
name = Attribute("The name of the View.")
path = Attribute("The local path of the file that represents the view,
which is XUL in for Mozilla.")