CPS 3 Document objects

Revision: $Id$

Contents

Warning: This document is not up to date. Many details are wrong.

This is an overview of the basic object structure used in NuxCPS3Document.

This list of classes and groups of classes will start with the ones that do not rely on other classes, and work itself "upwards". This is so that you can read this document from the start without having to jump around in the document. It doesn't work 100%, but that's the aim. :)

1   General classes

The OrderedDictionary class is not connected to anything document-like but is simply an ordered version of PersistentMapping. If it is ever useful in any other product, we should probably move it to NuxCPS3 core.

DataStructure is also free of dependencies, and may have other uses completely independent of CPS and even Zope, but I'll describe it here anyway as it's an important and non-obvious part of the happenings.

2   General to do

3   Renderers

A Renderer is an object that knows how to render a logical design element, such as a combo-box or a border. There may be several different Renderers, such as HtmlRender, XmlRenderer and PdfRenderer. In this first phase only one renderer will be implemented to render things within CPS pages.

Used by:

Decisions to be taken:

4   Fields

There are several types of fields, and more types will be needed, so they should be easy to add. All fields need to inherit BasicField. Each Field class needs a corresponding FieldWidget class.

Used by:

Related to

Responsibility

Decisions to be taken:

Things to do

5   FieldWidgets

Each Field has a corresponding FieldWidget. Each FieldWidget needs to inherit from the BasicFieldWidget class.

Contained by:

Uses:

Related to:

Responsibility:

6   StorageAdapters

A StorageAdapter is a transient object that is responsible for storing and retrieving the data connected to a particular Schema. All StorageAdapters inherit from BasicStorageAdapter. The only StorageAdapter to be implemented in the first phase is AttributeStorageAdapter, that stores data as attributes on the document.

Uses:

Related to

Responsibility:

7   StorageAdapterFactories

These are objects that create StorageAdapters. They have settings for the StorageAdapter behavior. An SqlStorageAdapterFactory would have a setting for which SqlConnection to use, and maybe which table to use, and so on.

Used by:

Responsibility:

8   Schema

Schemas hold a list of fields that make up one part of a documents data model. There will be schemas local to a particular document type as well as inherited or global schemas. Each schema has a namespace.

Contains:

Used by:

Responsibilities:

Decisions to be taken:

9   Layout

Layouts are ordered lists of FieldWidgets. These FieldWidgets all correspond to one field in the schemas available to the document.

Contains:

Uses:

Responsibilities:

To be determined:

10   Template

Templates is the definition of the document type.

Contains:

Responsibilities:

11   DataStructure

This is a container of data in a "displayable" and "inputable" form. This means text or numbers, as opposed to objects. The DataStructure is used to display data, and to hold the data received from form input.

Responsibilities:

12   DataModel

The model of the data contained in one document. This is a transient object created when it needs to be used and then thrown away.

Contains:

Uses:

Responsibilities:

Things to do: