NAME

Bricolage Element System Redesign Technical Specification


VITALS

CVS ID
$Id: TechnicalSpec.pod,v 1.72 2004/04/09 01:13:04 wheeler Exp $

Version
$Revision: 1.72 $

Date
$Date: 2004/04/09 01:13:04 $

Status
Incomplete Draft

Target Version
2.0


INTRODUCTION

This document outlines the technical details for implementing the element revision described in ElementRevision::FunctionalSpec. While that document explains what the revision will look like, this one explains the details of the API related to data structures. For implementation details, see ElementRevision::Implementation.

For all practical purposes, this document may be considered a working draft toward the design of features for Bricolage 2.0. It goes beyond what's specified in the Functional Specification by outlining a new foundation of APIs to which all of Bricolage will eventually be migrated.

Thus, the changes to the Bricolage API will manifest in several different categories of object classes, each of which will be described below. We start with the fundamentals.


PROJECT ARCHITECTURE

Bricolage 2.0 will be built on an architecture defined as follows:

Unix
Bricolage 2.0 will need to run on any Unix platform. Since we're targeting Apache 2, mod_perl 2, and MySQL it's possible that it'll run on Windows, too. But that'll be a bonus. That said, we should do everything we can to keep the code as platform-independent as possible.

Perl 5.8.0 and Later
Perl 5.6.x will not be supported.

PostgreSQL 7.4 and Later
A number of new features make this a must-have version, particularly with reference to handling exceptions.

MySQL 4.1
This is the first version of MySQL with the features that Bricolage demands, including support for Unicode, for subselects, and for derived tables.

mod_perl 2
I think it's time we targeted mod_perl 2, and strove to take advantage of its new features. We might be held up somewhat waiting for libapreq 2.0 to ship, but that, too, is a requirement.

Module::Build
All installation and configuration powered by Module::Build, App::Info, CPANPLUS and perhaps Arthur's forthcoming Alien::* modules. No configure, no make.

Alzabo
We'll use Alzabo as a development tool for designing the schema and for creating the Bricolage business classes. Dave Rolsky has agreed to do the work necessary to make this so. The advantage will be that we'll have schema definition in one place, rather than two (i.e., in classes and in *.sql files).

version
We'll use John Peacock's version module for all version numbers. All libraries will have version numbers drawn from the CVS revision number except the base class, Bricolage, which will have the canonical version number for the entire distribution.

Test::Class
The unit test suite will be built on Test::Class. We can probably use the foundations for it found in Bricolage 1.x to run it and to set up base test classes. Every module must have a comprehensive test suite. With luck, because we're building a much more componentized architecture than we did under 1.x, a lot of tests can be run from base classes, so that a new class has tests just by creating a new test module that inherits from other test modules.

Apache::Test
We must write a comprehensive test suite for every part of the UI, as well. That means that all UI widgets will have Test::Class-derived test modules to fully unit test them. There should also be full tests for the SOAP server, to test the interface for every Business module.

WWW::Mechanize
This module should be used to do thorough acceptance testing of the Bricolage UI. This means that we'll have to work out scenarios for user tasks and replicate and test them in WWW::Mechanize code in Test::Class test modules.


FOUNDATION CLASSES

Bricolage

This is the base class from which all Bricolage classes inherit. At a minimum, it will define an interface for automating the creation of attribute accessors. The module that will be used for this purpose is Class::Meta, a module I've been developing for some time, based on the old my_meths() and register_properties() functions in 1.x, but much more useful. Class::Meta will provide a simple, extensible interface that manages:

Accessor Automation
Accessor methods will be created for all of the attributes of each Bricolage class by Class::Meta. No more AUTOLOAD!

Data Type Validation
Strong data type checking will be used by the accessors for all attributes, including collections of attributes. This will likely be turned off for stable releases, as it will add a fair bit of overhead.

Facade
Metadata about the interface defined by the Class::Meta automation will be available via introspection methods for all objects. The introspection methods will return objects describing attributes, accessors, constructors, and classes. These methods constitute a facade that enables all Bricolage objects to be used in exactly the same way, by calling the same methods. This approach will come in extremely handy for UI and SOAP code.

The common API that Bricolage will provide for all of its base classes includes the following methods:

Attributes

None.

Constructors

new
A default constructor. Will likely be built by Class::Meta, and will take a list of parameters to set attributes on the new object.

Class Methods

my_class
Returns a Class::Meta::Class object describing the class.

my_key
Returns the unique key identifying the class.

Instance Methods
None.

Bricolage::Biz

All Bricolage 2 data classes will now inherit a common API, Bricolage::Biz. This class serves two purposes: First, it defines an interface common to all Bricolage business objects, where ``Bricolage business objects'' is defined as objects that store persistent data. And second, it defines and provides the complete data access interface (really a pass-through to Bricolage::Store).

The fundamentals of this common API are as follows:

Validation
All attribute accesors will throw only fatal exceptions such as when an invalid data type is assigned as a new value. Other exceptions will only be thrown when save() is called (such as when a user has provided a non-unique value for a unique attribute). This design is based on two assumptions: That users should be able to input just about any data and only have their changes checked when they save a business object; and that many such errors will be caught at the data store level (e.g., by constraints and unique indexes).

XML Serialization
Bricolage::Biz will provide methods to return an XML serialization of an object, to create a new object from an XML string, and to update an existing object with XML data. This API will greatly simplify the implementation of the SOAP server to handle any kind of Bricolage object, as well as enable the creation of an XSLT burner.

Cloning
All Bricolage business objects will be fully cloneable, meaning that when the clone() method is called on an object, a deep copy of the object will be returned as a brand new object with a new GUID. This will simplify numerous administrative tasks, as well as the cloning of content objects (such as documents).

Data Access Interface
The interface for managing object persistence will use the new Bricolage::Store API to interface with the persistence store (whether it be database, LDAP, XML files, or whatever), but transparently provide a common API without regard to the back end or the implementation of the interface to the back end.

That Bricolage::Biz persistence API will include the methods lookup(), search(), list_guids(), count(), and save(). See Bricolage::Store for more information on the persistence API. The important thing to note here is that the persistence API will be invisible to users of Bricolage::Biz classes. How the data is actually stored and retrieved will mainly be an implementation or perhaps installation configuration detail.

The common API Bricolage::Biz establishes for all Bricolage 2 objects will consist of the following interface:

Attributes

Any objects inheriting from Bricolage::Biz that contain *_guid attributes (such as site_guid or user_guid) will have, in addition to the usual accessors (such as get_site_guid() and set_site_guid()), an extra accessor to return the actual object (such as get_site()) and an accessor to set with an object (such as set_site(), which of course has the side effect of changing the corresponding GUID.

guid
All Bricolage business objects will have a globally unique identifier. The GUID will make it easier to exchange objects between two Bricolage systems yet keep their identifiers the same across systems, with virtually no risk of ID collision. It also means that an object will have a GUID as soon as it is created, not just after it has been saved to the database. The old simple numeric IDs will be discarded or used internally, depending on the data store implementation.

This functionality is available in Perl via the Data::UUID module.

GUIDs will be stored in the data store as a string representation of the GUID proviced by the create_str() in the Data::UUID class.

state
Object state, implemented as an instance of the Bricolage::Util::State class.

name
Object's name.

description
Object's description.

Constructors

The default new() constructor will be inherited from Bricolage.

new_from_xml
Loads the data in an XML representation of the Bricolage business object as a new object.

lookup
Look up a business object in the database and return it. See Bricolage::Store for details.

Class Methods

search
Searches for and returns a collection of business objects based on the list of search parameters passed as arguments. See Bricolage::Store for details.

list_guids
Searches for and returns a list or array reference of business object GUIDs based on the list of search parameters passed as arguments. See Bricolage::Store for details.

count
Returns a count of the number of objects that would be in the collection returned by search() should the same search parameters be passed. See Bricolage::Store for details.

Instance Methods

can_do
  if ($bric->can_do(EDIT)) {
      # Access allowed.
  }

Returns a true value of the current use has at least the perimssion specified in the argument. This method will be used in the UI to provide apporopriate access to an object. Internally, this means that, for optimal efficiency, every Bricolage object must be loaded from the database with its ACL.

save
Saves the business object to the data store. If the storage back end supports transactions, a call to save() will be encapsulated in a single transaction. Cascading calls to the save() methods of contained objects will be a part of a single transaction, so that one transaction manages to save changed to all or none of an object and all of its contained objects.

clone
Clones the object to create an exact duplicate with a new GUID, and which may then be saved to the data store as a new object.

dump_xml
Dumps an XML representation of the object.

load_xml
Loads the data in an XML representation of the Bricolage business object in order to update its values.

Bricolage::Store

This class will handle all of the work necessary to communicate with back-end storage systems. Bricolage::Store itself is an abstract class; its subclasses will implement its interface for different storage devices: RDBMSs, OODBMSs, XML Files, LDAP, or whatever. The initial target persistence back end will be PostgreSQL 7.4, but MySQL 4.1 support may be developed concurrently. These will be implemented as Bricolage::Store::DBI::Pg and Bricolage::Store::DBI::mysql. Others, such as the likely Bricolage::Store::LDAP, will be added later.

A few notes on the implementation of this class are relevant here. First, the API has been designed in such a way as to offload as much of the work of selecting, sorting, and retrieving data to the back-end system as possible. This is done is by preventing instantiation of thousands or millions of objects at once by using a combination of features, including a collection (a.k.a. iterator) class to only fetch objects from the store and instantiate them as they're needed, and new Limit and Offset parameters to search(). See the Bricolage::Util::Collection manpage for more about the collection API.

But even more importantly, I want to move permission checking to the storage device, as well. From the point of view of an RDBMS, this means that we will have to change the way permissions work so that they can be easily and efficiently checked by the use of SQL joins or similar approach. But ultimately, that's an implementation detail, and if necessary, we can start out by doing the permission checking the old fashioned way, but still behind the API, so that we can later refactor it to use the database. What this means is that the current user object will always have its GUID implicitly used by the storage API to limit the number of objects returned to those that the user has READ or greater permission to access.Fundamentally, this means that we'll likely have to change the DENY permission in such a way that it always trumps other permissions. This will be the truly hard part.

In the end, the upshot wiil be that any call to search() or list_guids() will return only those objects to which the current user has at least READ access.


SUPPORT CLASSES

Bricolage::Util::Config

This class will handle Bricolage configuration. Configurations are kept in a file, and can only be changed by restarting the server after changing the file. Thus it makes sense to continue to use such configurations as Perl constants in order to maximize performance. The interface has yet to be determined, but the simplest approach may be to keep the current interface. Choices of other configuration file formats will be entertained (the Apache httpd.conf-like format comes to mind, as does a pure Perl format; see Config::ApacheFormat and Myco::Config for examples).

Bricolage::Util::Context

This class provides access to objects that need to be universally accessed. Specifically, it provides access to the currently logged-in user object, the system-wide shared cache, and the curent localization object. It should be assumed that nothing can be done with the Bricolage API without first logging in as a user.

Class Methods

current_user
Returns the currently logged in Bricolage::Biz::Party::Person::User object.

cache
Returns a Bricolage::Util::Cache object, used for interprocess data caching.

language
Reutnrs a Bricolage::Util::Language object for use localizing strings.

Bricolage::Util::Exceptions

This class defines all the Bricolage exceptions. It will be defined by Exception::Class, and will provide exportable functions that can be used to easily throw exceptions. Functionally it will be similar to Bricolage 1.x's Bric::Util::Fault, but without the legacy baggage from the pre-Exception::Class version of Bricolage exceptions. All exception messages will be localized by an instance of the Bricolage::Util::Language class. Bricolage::Util::Exception::Fatal exceptions will be thrown for developer or configuration errors; all other non-fatal errors will be thrown for user errors, such as when a non-unique value was entered by a user for a unique attribute.

Bricolage::Util::State

Defines the various states of Bricolage business objects. It will export constants that can be used with the state attribute accessors of Bricolage::Biz-inherited objects. These constants will return singleton objects that overload == to facilitate comparison of states, and "" to return a localized string representing the state.

Exportable Constants

PERMANENT
Objects in this state can never be deactivated or deleted, and can never have their state changed. Used primarily by Bric::Biz::Group for permanent groups.

ACTIVE
Objects in this state are actively in use.

INACTIVE
Objects in this state are no longer actively in use but can be activated via the UI.

DELETED
Objects in this state have been deleted and can no longer be used or reactivated. A deletion should be considered permanent. Any attributes that must be unique across a class of objects should not include deleted instances of those objects when evaluating uniqueness (this should be enforced by a uniqueness constraint in the data store, if possible).

Instance Methods

equals
This method takes another state object as its sole argument and returns true if they're the same state, and false otherwise. This method overrides comparison operators.

as_string
Returns a localized string representing the name of the state. This method overrides stringification.

Bricolage::Util::Priority

Defines the various priorities of Bricolage workflowable objects. It will export constants that can be used with the priority attribute accessors of Bricolage::Biz::Decorator::Workflowable-inherited objects. These constants will return singleton objects that overload == to facilitate comparison of states, and "" to return a localized string representing the state.

Exportable Constants

LOWEST_PRIORITY
LOW_PRIORITY
MEDIUM_PRIORITY
HIGH_PRIORITY
HIGHEST_PRIORITY

Instance Methods

equals
This method takes another priority object as its sole argument and returns true if they're the same priority, and false otherwise. This method overrides comparison operators.

as_string
Returns a localized string representing the name of the priority. This method overrides stringification.

Bricolage::Util::Language

Locale::Maketext-inherited localization module. This class and its subclasses will be used to generate all hard-coded text emitted by Bricolage, including text in exceptions. We will not be using the _AUTO key; all strings will be required to be present in at least the en_us language class, from which all other classes inherit. This requirement makes it easier to keep en_us canonical and up-to-date.

Bricolage::Util::DateTime

Complete Bricolage DateTime support, inherited from DateTime. Any methods or values that are date or time or date and time values will return objects of this class or one of its subclasses. Bricolage::Util::DateTime will handle all aspects of time zone translation, since all dates and times in Bricolage are stored in UTC in the database. By default, Bricolage::Util::DateTime objects will be set to the value of the Date/Time preference. Bricolage::Store will change it to UTC before saving values to the data store.

Bricolage::Util::DateTime will also have stringification overloaded so as to facilitate saving to the data store and to simplify outputting values in templates.

Bricolage::Util::Session

This class provides the interface for Bricolage sessions, which are associated with user objects. The data will be stored in the database, and the interface for accessing the session data will be entirely object-oriented (that is, no tied hash will be exposed as with Apache::Session). It will also support the concept of contexts, so that different parts of Bricolage can use their own contxts in the session without fear of tromping on the data used by other parts of Bricolage.

Bricolage::Util::Session will most likely be a wrapper class around a series of sessions, instead of one big session. Each sub-session will represent a single context. This approach optimizes for the most common case, in which Bricolage needs to access only a single context's session in a given request, and therefore eliminates the need to load a monolithic session with considerable data from other contexts that will never be used in a given request.

The idea of contexts also allows for us to develop a continuation-style Web application. Because the current context will be tracked for every page, it will also allow multiple browser windows to be open, as each will have its own context. If two windows enter the same context, the one that submitted a request most recently will ``win''; the other window will be synced to the status of the first window upon its subsequent request.

Furthermore, each context will have a ``state'' and a ``state history''. This will enable the user to use the back-button in the browser. When she does, and submits a form that was submitted, say, 3 requests ago, because the context and state of that page was included in its request, the application will be able to revert to that state without triggering an error. If she goes back past the point where the context state was cleared (for example, before a ``save''), a message will be sent with the response stating that the state is no longer valid, and the page will render in the current state.

All of this is of course dependent upon any given request containing its context and state. So every form submit and/or URL + GET string should contain this data:

  <input type="hidden" name="cx" value="context+state" />

This section will likely see further expansion as we continue to consider the benefits of continuation-style UI design.

Bricolage::Util::Cache

This class manages a system-wide, interprocess shared cache for Bricolage, and its instance will normally be retreived from Bricolage::Util::Context->cache. This object will be useful for caching commonly-accessed but rarely changed data. We expect that the data in this object will be volatile and will not persist between shutdowns.

Bricolage::Util::Auth

This is the abstract base class for Bricolage's plugin authentication system. At a minimum, its concrete derived classes will be Bricolage::Util::Auth::DBI and Bricolage::Util::Auth::LDAP. These may use the Bricolage::Store API for data access. The concrete implementation used for authentication will be determined by a Bricolage::Util::Config setting. This class will be only be used internally by Bricolage::Biz::Party::Person::User.

Class Methods

login
  Bricolage::Util::Auth->login($user, $password);

Authenticates a user against an authentication back-end. Returns true on success and throws an exception on failure. Called by Bricolage::Biz::Party::Person::User->login.

change_password
  Bricolage::Util::Auth->change_password($user, $password);

Changes a user's password in the authentication back-end. Returns true on success and throws an exception on failure. Called by Bricolage::Biz::Party::Person::User->save.

change_username
  Bricolage::Util::Auth->change_username($user, $username);

Changes a user's username in the authentication back-end. Returns true on success and throws an exception on failure. Called by Bricolage::Biz::Party::Person::User->save.

Bricolage::Util::Collection

A true collection class that iterates over its collection of objects, fetching them from the data store only when they're needed by the user, thus cutting down on memory usage. At least that's the plan. Even if we don't do that at first, the API will work as if we had, so we can always refactor it later and thus come to enjoy the efficiency gains.

The Bricolage::Store search() method will always return a collection object. For the purposes of convenience and backwards compatibility, the collection class will also be implemented as a tied array, so that users can simply use it like an array reference if they wish, while retaining the efficiency benefits of a true collection. See the Apache::FakeTable manpage for an example of a class that doubles as a tied variable.

Bricolage::Biz::Class

A subclass of Class::Meta::Class, this class provides additional information about every Bricolage class, including its GUID (all Bricolage classes have a record in the database for building relationships) and their localized names, descriptions, etc. Replaces the old Bric::Util::Class.

Attributes

plural_name
Pluralized version of the class name. For example, if the class name is ``Document'', the plural name will be ``Documents''. Will be localized.


MEDIATOR CLASSES

Bricolage::Biz::Mediator

This is an abstract base class defining the interface for mediating the relationship between two objects in a ``has many'' pattern. That is to say, it represents the relationship between the two objects.

In many cases of a has-many relationship, Bricolage::Biz::Mediator will not be used, because other than identifying the two related objects, no other data is needed. However, in those situations when the relationship itself requires extra data--such as some rules about the relationship--a subclass of Bricolage::Biz::Mediator will be used.

Bricolage::Biz::Mediator::Subelement

This subclass mediates the relationship between element types and subelement types. It is necessary because the relationship tracks the element constraints and occurrence specifications for subelements.

Attributes

Note that the name and description attributes inherited from Bricolage::Biz can just return the value of the name and the description of the child element, but can't set it.

element_type_guid
The parent element type.

subelement_type_guid
The subelement type.

min
The minimum number of child subelements that may be added to the parent. A false value means that there is no minimum.

max
The maximum number of child subelements that may be added to the parent. A false value means that there is no maximum.

Bricolage::Biz::Mediator::DocumentTypeSite

Mediates the relationship between a document type and a site in which documents of that type can be created or aliased.

Attributes

document_type_guid
The GUID of the Bricolage::Type::Model::Document object.

site_guid
The GUID of the Site.

allow_create
A boolean value indicating whether documents of the type defined by the document type can be created in the site.

allow_alias
A boolean value indicating whether documents of the type defined by the document type can be aliased from other sites to the site.

primary_output_channel_guid
The primary output channel for documents of this type created in this site. The output channel must of course be associated with the site. This attribute cannot be null, and the corresponding output channel must also of course be included in the collection of output channels returned by output_channels().

Instance Methods

output_channels
Returns a Bricolage::Util::Collection object of Bricolage::Biz::Mediator::DocumentTypeOutputChannel objects that represent the output channels to which documents of the type defined by the document_type_guid attribute can be published. The primary output channel will always be the first output channel in the collection.

Bricolage::Biz::Mediator::DocumentTypeOutputChannel

This object mediates the relationship between document type/site associations (as defined by Bricolage::Biz::Mediator::DocumentTypeSite) and output channels. A mediator object is required because an output channel may or may not be associated with a new document of the document type when a new document is created. [Is that as clear as mud?]

Attributes

output_channel_guid
The GUID of the output channel.

document_site_guid
The GUID of the Bricolage::Biz::Mediator::DocumentTypeSite object.

enabled
A boolean value indicating whether a new document created based on the document type will automatically have the output channel associated with it or just available to be added. True by default.

Bricolage::Biz::Mediator::AlertParty

This object mediates the relationship between alert types and the parties that will receive alerts.

Attributes

alert_type_guid
The GUID of the Bricolage::Biz::Type::Alert with which the recipient party is associated.

party_guid
The GUID of the Bricolage::Biz::Party object to receive alerts.

contact_type_guid
The GUID of the contact type by which the recipient will receive alerts.

Bricolage::Biz::Mediator::AlertGroup

This object mediates the relationship between alert types and the groups of parties that will receive alerts.

Attributes

alert_type_guid
The GUID of the Bricolage::Biz::Type::Alert with which the recipient group is associated.

group_guid
The GUID of the Bricolage::Biz::Group::Party object whose members will receive alerts.

contact_type_guid
The GUID of the contact type by which the recipients will receive alerts.


GROUPS AND PERMISSIONS

Bricolage::Biz::Group

This class replaces the old Bric::Util::Grp, and is used for managing groups of objects in Bricolage. The interface can be simplified a great deal over the existing interface. For example, it does not have to support inherited groups, since this is a feature we've never used (though we can always add it later, if necessary). The ``permanent'' attribute will be replaced with a ``PERMANENT'' value for the state attribute (See Bricolage::Util::State) to indicate groups that should never be deleted, such as the ``All'' groups. The ``secret'' attribute might be able to go, depending on our needs. Unlike the original Bricolage 1.0 design, no Bricolage 2.0 groups should really be completely internal, and thus don't need to be hidden. But we'll have to see what the implementation requires. Attributes and member attributes can definitely go.

Of course, the primary use of groups is for assigning permissions to groups of objects. Some groups will need to hold objects of different types, such as the groups of objects maintained by Desk, Workflow, Category, and Site objects, which can hold anything desks and workflows and categories can hold (Documents and Templates, as of this writing). There may be a way to siplify this by allowing groups to hold objects of only one class (simplified Group class design), and then have Desk, Workflow, Category, and Site use separate groups for each of the types of objects they need to maintain.

As I said, the primary use of Groups is to group objects for granting permissions. This functionality can probably be largely ported from 1.x, but see the notes on Bricolage::Biz::Permission for more details.

One thing we need to keep in mind is how to handle limited permissions so that users can't give themselves greater permissions than they already have. This means that no user should be able to add herself to a user group with greater permissions than she already has. Nor should she be able to increase the permissions of a user group of which she's a member, or of a group to which any user group she's in has been granted permission.

To manage this, I think that these rules should apply:

The rules of thumb are: A user can never grant herself or any other user greater permissions than she herself has, either through group membership or through permission changes.

Attributes

class_guid
The GUID of the Bric::Biz::Class that represents the class of the member objects.

Instance Methods

members
Returns a Bric::Util::Collection object of the members of the group. Add or remove objects from the collection to add or remove them from the group.

Bricolage::Biz::Permission

This object manages permissions granted to groups of users to access groups of objects. It might need some more thought as to how it will integrate with Bricolage::Biz::Group and Bricolage::Biz::Party::Person::User, but we can start out by simply porting it at first.

The permissions supported will be ``READ'', ``EDIT'' (assumes READ), ``CREATE'' (assumes EDIT) and ``DENY''. The highest priority permission will trump other permissions. If a user has multiple permissions to access an object due to multiple group memberships, then the highest-priority permission will be the permission granted to that user. Note that DENY has the highest priority; so if a user has ``EDIT'' and ``DENY'' permissions to access an object, he will be denied access.

Note that groups of workflowable objects (that is, objects that can be managed in workflow) can have additional permissions applied to them, ``RECALL'', which allows the user to recall an object from the library; and ``PUBLISH'', which allows the user to publish the document or deploy the template.

The permission priorities, from lowest to highest, are as follows:

READ
Read-only access.

EDIT
Assumes READ access.

RECALL
Assumes EDIT access.

CREATE
Assumes RECALL access.

PUBLISH
Assumes CREATE access.

DENY
No access.


PREFERENCES

Bricolage::Biz::Pref

This class manages system-wide preferences. It can largely be ported from Bricolage 1.x.

Bricolage::Biz::Pref::User

This class manages userñ preferences. It can largely be ported from Bricolage 1.x.


PARTIES

Bricolage::Biz::Party

This class is the base class for all persons and organzations. It handles the interfaces that are common to both people and organizations, such as managing contacts and addresses. The term was selected after reading ``Data Modeling Patterns,'' By David C. Hay (http://www.dorsethouse.com/books/dmp.html).

Instance Methods

contacts
Returns a Bricolage::Util::Collection of Bricolage::Biz::Contact objects associated with the party. Use the collection API to add contacts to or remove contacts from the party.

placements
Returns a Bricolage::Util::Collection of Bricolage::Biz::Placment objects associated with the party. Use the collection API to add places to or remove places from the party.

Bricolage::Biz::Party::Person

This is the base class representing all person objects in Bricolage, currently meaning users and contributors. Data for all persons will be managed centrally. That is to say, if a person is both a user and a contributor, the same data for the base class attributes and relationships will be used for both types of objects.

Attributes

last_name
Person's last or family name.

first_name
Person's first or given name.

middle_name
Person's middle or second name.

nickname
Person's nick name or alias.

prefix
Person's prefix, such as ``Mr.'', ``Dr.'', etc.

suffix
Person's suffix, such as ``MD'', ``PhD'', etc.

generation
Person's generation, such as ``Jr.,'' ``III'', etc.

Instance Methods

get_name
This instance method overrides the accessor of the same name from Bricolage::Biz to return the person's name as formatted by Lingua::Strfname::strfname(). The set_name() method will be overridden to throw an exception.

Bricolage::Biz::Party::Person::User

This class inherits from Bricolage::Biz::Party::Person and extends it by providing an authentication and session management interface. The session object's data will be stored in the data store along with other user data. See Bricolage::Util::Session for details. The user's login status will be tracked by comparing the current time to the time they last authenticated. If the time exceeds the AUTH_TTL Bricolage::Util::Config setting, the user will be considered logged out.

Note that the Bricolage API makes no attempt to verify the validity of the client logging in. It is assumed that the validity will have been confirmed by the code calling authenticate(). For exampe, Bricolage::Server::Apache must take care that its authentication cookie hasn't been tampered with.

Bricolage::Biz::Party::Person::User will use a subclass of Bricolage::Util::Auth to athenticate users and enable the changing of usernames and passwords.

Attributes

username
User's login name.

password
User's password, write-only.

last_access
The last time the user accessed the application.

Instance Methods

session
  my $session = $user->session;

User's Bricolage::Util::Session object.

authenticate
  $user->authenticate;

Authenticates the user to Bricolage, sets the last_access time to the current time, and sets the user object as the object to be returned by BricolageUtil::Context->current_user. Throws an exception if the user's last access was longer ago than the number of seconds specified by the AUTH_TTL Bricolage::Util::Config setting.

login
  $user->login($password);

Logs the user into Bricolage. Throw an exception if the authentication fails. Sets the last_access attribute to the current time and calls authenticate() upon success. Internally, this method uses a subclass of Bricolage::Util::Auth to handle the authentication.

logout
  $user->logout;

Logs the user out and sets the last_access attribute to undef.

is_logged_in
Based on the last access time and the login expiration time.

Bricolage::Biz::Party::Person::Contributor

This class defines the interface for Bricolage contributors. Contributors are defined by a Bricolage::Biz::Type::Model::Contributor object. The old ``Role'' feature from Bricolage 1.x will instead by handled via Input Channels [This may or may not actually work, because the number of possible Input Channels is determined by the Bricolage::Biz::Type::Model::Contributor object. It's not unlimited as is the number of ``Roles'' per contributor in 1.x. But how many people really use this feature?] A single person can be multiple contributors, in that they may contribute different types of content and thus be different types of contributors. For example, one person may be both a ``Photographer'' contributor type and a ``Writer'' contributor type. She may even be a user. But regardless, the record is always based the same person with the same data inherited from Bricolage::Biz::Party::Person.

The profile for Bricolage::Biz::Party::Person::Contributor will display custom subelements defined by the contributor type object. The interface will be identical as that used for the element hierarchy of documents. See Bricolage::Biz::Document for more information.

Attributes

contributor_type_guid
The GUID of the Bricolage::Biz::Type::Model::Contributor defining the structure and input channel relatitionships of the contributor object.

element_guid
The GUID of the Bricolage::Biz::Element object that contains the contributor's content structure. This object cannot be replaced with another element, but its contents can of course be changed.

Bricolage::Biz::Party::Org

This class inherits from Bricolage::Biz::Party, and represents an organization. Its additional interface is simple.

Attributes

short_name
The short name for an organization. The name attribute inherited from Bricolage::Biz is assumed to be the formal name for an organization. Thus if the name is ``Apple Computer, Inc.'', the short_name might be ``Apple''.

purpose
The organization's purpose, such as ``Biggest Customer'' or ``Sprocket Vendor''.

Bricolage::Biz::Source

This class manages sources of content, that is, organizations that are the sources for content, such as wire services or stock photo warehouses. Its expire_interval attribute may be used to automatically expire content after a certain period of time. It is associated with an organization, and more than one source can use the same organization (because they could have different expiration rules for different content they supply.

Attributes

org_guid
The GUID of the Bricolage::Biz::Party::Org object supplying the content.

name
The name of the source. This attribute, inherited from Bricolage::Biz, allows multiple sources from a single organization to be distinguished.

expire_interval
The period of time that can pass after the initial publication of content from the source before the content must be expired. Defaults to undef (or any false value, really), meaning that content from the source need not be expired.

Bricolage::Biz::Contact

A method of contacting a party, such as phone, email, instant message, etc. Contacts are defined by contact types, Bricolage::Biz::Type::Contact.

Attributes

contact_type_guid
The GUID for the Bricolage::Biz::Type::Contact representing the type of contact.

value
The contact value (e.g., phone number, email address, etc.).

Bricolage::Biz::Address

A party's address, associated with a Bricolage::Biz::Placement. Addresses are defined by address types, Bricolage::Biz::Type::Address. Implementation of this class can be deferred.

Attributes

address_type_guid
The GUID for the Bricolage::Biz::Type::Address representing the type of address.

purpose
The purpose of the address.

lines
An Bricolage::Util::Collection object of address lines (as simple strings), such as street, suite, etc.

city
The address city.

state
The address state or province, if any.

postal_code
The address zip or postal code, if any.

country
The address country.

Bricolage::Biz::Placement

The object defining the relationship between a party and one ore more addresses. Think of the party's placement as where it's located. This might be ``Home'' or ``Work'' or ``Corporate Headquarters''. Some may have more than one address, such as shipping and billing. And finally, a party can have more than one placement of a particular type over time. For example, there may be a ``home'' placement for a person until a particular date, and then a different ``home'' placement starting on a later date. This ensures the keeping of a history of placements for a party over time.

Attributes

placement_type_guid
The GUID for the Bricolage::Biz::Type::Placement object representing the type of placement.

start_date
The date when the placement became or will become relevant.

end_date
The date when the placement ceased to be or will cease to be relevant.

Instance Methods

addresses
Returns a Bricolage::Util::Collection object containing the addresses associated with this placement. Add or remove addresses from the collection to add or remove them from the placement.


TYPES

Bricolage::Biz::Type

This namespace is use for classes that specify the type for an object of a given class. So a Bricolage::Biz::Document object has an associated Bricolage::Biz::Type::Model::Document, and a Bricolage::Biz::Element object has an associated Bricolage::Biz::Type::Element, etc. All classes in this namespace will inherit from Bricolage::Biz::Type.

Bricolage::Biz::Type::Media

This class is used to determine the media types (formerly known as ``MIME types'') of files uploaded to Bricolage, as well as for elements. It can largely be ported from Bricolage 1.x's Bric::Util::MediaType. Note that the get_type_by_ext and get_guid_by_ext constructors from that class can be eliminated, since one can use search() and list_guids(), instead. The only difference is that the consumer of the class must pass in a suffix parameter, not a full filename.

Attributes

type_string
A system-wide unique attribute identifying the standard media type string for a media type. Examples include ``application/xhtml+xml'' and ``image/jpeg''.

suffixes
An Bricolage::Util::Collection object of filename suffixes (as simple strings) that uniquely identify the media type. Two different media type objects cannot share the same suffix.

Bricolage::Biz::Type::Element

This is the base class for element types. These define the structure of elements, which are used to add content to documents, contributors, and categories. It defines the interface for its inherited classes, so that any part of an element tree (branch or leaf, container or field) can be handled identically.

Attributes

key_name
Unique key name identifying the element.

widget_type_guid
The GUID for a Bricolage::Biz::Type::Widget object defining the interface for the element.

value_type_guid
The GUID for a Bricolage::Biz::Type::Value object defining the type of value the element contains.

media_type_guid
The GUID for a Bricolage::Biz::Type::Media object defining the type of content of elements of this type. The default will be ``text/plain'' or ``application/xhtml+xml'', but can be any value, really. It's not really intended for enforcement, at this point, but as a cue to templates to determine what to do with content of a given media type, for example whether to escape any XHTML tags or to leave them.

paginated
A boolean value indicating whether the content of elements of this type are to be considered independent pages.

Instance Methods

ordered_subelement_types
Returns a Bricolage::Util::Collection object of Bricolage::Biz::Mediator::Subelement objects representing the ordered subelement types of the element.

unordered_subelement_types
Returns a Bricolage::Util::Collection object of Bricolage::Biz::Mediator::Subelement objects representing unordered subelement types of the element.

subelement_types
Returns a Bricolage::Util::Collection object of all of the Bricolage::Biz::Mediator::Subelement objects representing subelement types of the element, starting with the ordered element types (in order, of course) and followed by the unordered element types.

Bricolage::Biz::Type::Element::Container

This is a concrete derived class of Bricolage::Biz::Type::Element whose objects function as container element type specifications. Container element types are the branches in an element type tree, and can contain fields (Bricolage::Biz::Type::Element::Field) or other container types as subelements. Its interface is identical to that of Bricolage::Biz::Type::Element. Its widget_type_guid attribute always points to a Bricolage::Biz::Type::Widget::Profile object. Its value type will always be undefined.

Bricolage::Biz::Type::Element::Field

This is a concrete derived class of Bricolage::Biz::Type::Element whose objects function as field element type specifications. Field elements types are the leaves in an element type tree, and contain exactly one value and no subelements. Its interface is identical to that of Bricolage::Biz::Type::Element. However, its ordered_subelement_types(), unordered_subelement_types(), and subelement_types() methods always return undef.

Bricolage::Biz::Type::Value

This abstract base class defines the struture of Bricolage element values. Although Bricolage defines a limited number of element values, all defined as subclasses of Bricolage::Value, because element administrators can set up constraints for the particular value to be used in a particular element, we needed an object to store that data. Each subclass will have a corresponding Bricolage::Value subclass.

Attributes

required
Boolean attribute to determine whether the value is required or not.

default
The default value.

allowed_values
An array of allowed values.

lower_bound
A lower bound to allowed values.

upper_bound
An upper bound to allowed values.

Subclasses

The initial Bricolage::Biz::Type::Value subclasses wil be:

Bricolage::Biz::Type::Value::String
Bricolage::Biz::Type::Value::URI
Bricolage::Biz::Type::Value::Boolean
Bricolage::Biz::Type::Value::File
Extends Bricolage::Biz::Type::Value by adding a collection of allowed media types, defined by Bricolage::Biz::Type::Media objects.

Bricolage::Biz::Type::Value::Biz
Extends Bricolage::Biz::Type::Value by adding a class_guid field for the Bricolage::Biz::Class object defining the class of Bricolage business object that the value links to.

Bricolage::Biz::Type::Value::Number
Bricolage::Biz::Type::Value::DateTime
Extends Bricolage::Biz::Type::Value by adding a precision attribute that defines how precise the datetime objects can be. The options are:
year
month
date
yearless date
hour
minute
second
millisecond
microsecond
Bricolage::Biz::Type::Value::Interval

Bricolage::Biz::Type::Widget

This abstract base class defines the structure of widgets to be used for displaying elements. Although Bricolage defines a limited number of widgets, all defined as subclasses of Bricolage::UI::Widget, because element administrators can set up constraints for the particular widget to be used in a particular element, we needed an object to store that data. Each subclass will have a corresponding Bricolage::UI::Widget subclass.

The subclasses of Bricolage::Biz::Type::Widget will often add to the following simple interface.

Attributes

help_text
Brief context-sensitive help (such as may be displayed in a tool tip) describing the value to be entered for the element.

value_options
An array of arrays, each with two elements: An option and a label. [Should this perhaps be a collection? Should each option actually be an object of some kind?]

class_attribute
The attribute of the class of objects to display, such as in a select list. Used for Bricolage::Value::Biz values. Defaults to ``name''.

display_size
Size of the widget to be displayed.

checked
A boolean to indicate whether a checkbox is checked by default.

rows
The number of rows to display for the widget.

cols
The number of columns to display for the widget.

Subclasses

Bricolage::Biz::Type::Widget::Text
Uses help_text and display_size.

Bricolage::Biz::Type::Widget::Textarea
Uses help_text, rows, and cols.

Bricolage::Biz::Type::Widget::File
Uses help_text.

Bricolage::Biz::Type::Widget::Select
Uses help_text and either value_options or class_attribute.

Bricolage::Biz::Type::Widget::Checkbox
Uses help_text and checked.

Bricolage::Biz::Type::Widget::Radio
Uses help_text and checked.

Bricolage::Biz::Type::Widget::DateTime
Uses help_text.

Bricolage::Biz::Type::Widget::Interval
Uses help_text.

Bricolage::Biz::Type::Widget::Calendar
Uses help_text.

Bricolage::Biz::Type::Widget::Interval
Uses help_text.

Bricolage::Biz::Type::Widget::Profile
Uses help_text.

Bricolage::Biz::Type::Widget::Search
Used only for Bricolage::Biz::Type::Value::Biz elements. Uses help_text and class_attribute.

Bricolage::Biz::Type::Widget::Multi
Classes that inherit from this class will allow the user to add multiple field subelements at once.

Bricolage::Biz::Type::Widget::Multi::Select
Uses help_text and display_size and either value_options or class_attribute.

Bricolage::Biz::Type::Widget::Multi::Search
Used only for Bricolage::Biz::Type::Value::Biz elements. Uses help_text and class_attribute.

Bricolage::Biz::Type::Widget::Multi::DoubleList
Uses help_text and display_size and either value_options or class_attribute.

Bricolage::Biz::Type::Widget::Multi::Checkbox
Uses help_text and value_options.

Bricolage::Biz::Type::Model

This class is the base class for those types whose instances are associated with an element tree and with input channels. It defines the relationship between a container element type, which defines the structure of the document; the sites in which objects based on a model can be created; the input channels that can be used for objects based on a model; and identification of the primary input channel for objects based on a model.

Attributes

element_type_guid
GUID identifying the container element type that marks the top of the element type tree that defines the structure of objects based on the type.

primary_input_channel_guid
GUID identifying the default primary input channel to be used for objects based on the model.

Instance Methods

sites
Returns a collection of the sites in which objects of the defined model can be created.

input_channels
Returns a collection of the input channels that can be used for objects created based on the model. The primary input channel will always be the first input channel in the collection.

Bricolage::Biz::Type::Model::Document

The famous Document Type class. This class defines the structure and allowed relationships for document objects created based on the model. In addition to the interface inherited from Bricolage::Biz::Type::Model, it defines relationships to sites.

Instance Methods

sites
Returns a Bricolage::Util::Collection object of Bricolage::Biz::Mediator::DocumentTypeSite objects that define the reltionship of the document type to sites. These relationships are complex, thus necessitating the mediator object. Put simply, it identifies the sites in which documents of a given type can be created or aliased. See the specification for Bricolage::Biz::Mediator::DocumentTypeSite for more details.

Bricolage::Biz::Type::Model::Contributor

This class defines contributor types. It inherits from Bricolage::Biz::Type::Model but, as of this writing, does not add to its interface.

Bricolage::Biz::Type::Model::Category

This class defines category types. The idea is that categories might need custom fields and elements to define content that's common to the entire category. Bricolage::Biz::Type::Model::Category inherits from Bricolage::Biz::Type::Model but, as of this writing, does not add to its interface.

Bricolage::Biz::Type::Address

This class defines address types. Really this is just a name and a description for a type of address, so it doesn't extend its parent classes as of this writing. See Bricolage::Biz::Address for the interface of address objects. Implementation of this class may be deferred.

Bricolage::Biz::Type::Placement

This class defines placement types. Really this is just a name and a description for a type of placement, so it doesn't extend its parent classes as of this writing. See Bricolage::Biz::Placement for the interface of placement objects. Implementation of this class may be deferred.

Bricolage::Biz::Type::Contact

This class defines contact types. Really this is just a name and a description for a type of contact, so it doesn't extend its parent classes as of this writing. See Bricolage::Biz::Contact for the interface of contact objects.

Bricolage::Biz::Type::Event

This class defineds a type of event. It can largely be ported from Bricolage 1.x's Bric::Util::EventType. The event class is Bricolage::Biz::Event.

Attributes

class_guid
The GUID of the class for which the event can be triggered.

key_name
A system-wide unique name for the event, which can used so simplify logging an event (that is, use the key name to indicate which type of event to log, rather than a GUID).

Instance Methods

attributes
Returns an anonymous hash of the attributes required of Bricolage::Util::Event objects of this Bricolage::Biz::Type::Event type. The keys are the attribute names and the values are the default values.

log_event
  $et->log_event($bric_obj, \%attrbutes);

A shortcut to Bricolage::Biz::Event->new. Pass in a the object for which to log the event and a hash reference of attributes for the event, and a new event of this type will be logged for the object passed. Note that not all attributes need to be explicitly passed in order to log a new event. Any that can be called via a get_ accessor on $obj, where the method combines 'get_' with an attribute's name, will automatically call that accessor.

See Bricolage::Biz::Event for more information and for details on how it expects arugments to be passed.

Bricolage::Biz::Type::Alert

Defines Bricolage alerts. Alerts are triggered by the logging of an event, and are sent when the event meets certain criteria defined by Bricolage::Biz::Rule objects. Can largely be ported from Bricolage 1.x's Bric::Util::AlertType.

Attributes

event_type_guid
The GUID for the type of event that will trigger alerts of this type.

user_guid
The GUID for the user who ``owns'' the alert type.

subject
The subject of the message to be sent in the alert, including psuedo variables that can pull in attributes of the event or of the object for which the event was logged.

message
The the message to be sent in the alert, including psuedo variables that can pull in attributes of the event or of the object for which the event was logged.

Attributes

rules
Returns a collection of Bricolage::Biz::Rules objects defining the rules that an event must adhere to in order to trigger an alert of this type.

recipients
Returns a collection of Bricolage::Biz::Mediator::AlertParty objects defining the Bricolage::Biz::Party objects to whom the alert should be sent. The mediator object must be used to identify the type of Bricolage::Biz::Contact object to use to send the alert.

recipient_groups
Returns a collection of Bricolage::Biz::Mediator::AlertGroup objects defining the Bricolage::Biz::Group::Party objects whose members should receive the alert. The mediator object must be used to identify the type of Bricolage::Biz::Contact object to use to send the alert.


EVENTS & ALERTS

Bricolage::Biz::Rule

This class defines rules that an object or event must adhere to in order to trigger a job or an alert. For example, when an event is triggered, it looks up a list of alert types configured for events of its type, and then processes all of the rules for that alert type. Provided that the event or its subject meet the criteria of all the rules (that is, their attributes compare favorably to the values or regular expressions defined for the rule), then the alert will be sent. Event-triggered jobs will come in a later phase (2.2?), but will also use rules.

This functionality can be ported from Bric::Util::AlertType::Parts::Rule in Bricolage 1.x.

Attributes

attribute
The name of the event or event object attribute the rule will compare.

operator
An operator to determine how to carry out the comparison. Note that the comparisons will always be case-insensitive. The valid operators are:
==
>=
<=
!=
eq
ne
gt
lt
ge
le
=~
!~
value
The value or regular expression to compare to the event or event object attribute.

Bricolage::Biz::Event

Bricolage events. Can most likely be ported from Bricolage 1.x, based on Bricolage::Biz::Type::Event. Events will be logged for objects from within the object libraries (instead of in the UI, as in Bricolage 1.x). It may be that certain methods will be configured to log the events by attaching attributes to them, although this approach will need some exploration. How attributes will work may also take some thought, although I'm okay with the current hash-based design for the time being.

Bricolage::Biz::Job

A Bricolage job, essentially an event-triggered or time-triggered set of actions that can be carred out. Jobs are based on Bricolage::Biz::Type::Job objects, which describe the job parameters and the conditions under which they're carried out. Publishes, distributions, and alerts will all be executed as jobs.

Bricolage::Biz::Alert

Bricolage alerts. These can be sent as part of a job, and are thus event-triggered. They're set up by Bricolage::Biz::Type::Alert configurations. Can largely be ported from 1.x's Bric::Util::Alert.

Bricolage::Biz::Alerted

Alert sent to an individual recipient. Can largely be ported from 1.x's Bric::Util::Alerted.


DISTRIBUTION

Bricolage::Biz::Dist

The classes in this package space will, for the time being, be directly ported from Bricolage 1.x's Bric::Dist namespace. The classes to be ported are:

Bricolage::Biz::Dist::Destination
Renamed from Bric::Dist::ServerType.

Bricolage::Biz::Dist::Server
Bricolage::Biz::Dist::Resource
Bricolage::Biz::Dist::Action
Bricolage::Biz::Dist::Action::Mover
Bricolage::Biz::Dist::Action::Email
Bricolage::Biz::Dist::Action::DTDValidate

Bric::Dist::ActionType will become Bricolage::Dist::Type::Action and Bric::Dist::Job will become Bricolage::Biz::Job. Bric::Client::Dist will also be moved, probably to Bricolage::Client::Dist.


CONTENT CLASSES

Bricolage::Biz::Element

This is the abstract base class defining the API for all Bricolage elements. Because container and field elements will have the same interface, they can be treated identically by their consumers.

Note that because element templates have their file names based on the corrsponding element's key_name attribute, all templates associated with a given element must be updated and redeployed whenever the key name of the corresponding element changes.

Attributes

element_type_guid
The GUID for the Bricolage::Biz::Type::Element object that defines the structure of the element, including the type of value it may have, its default display order, and the types and number of subelements it may contain. An element object can have its type changed, but doing so may change its data and/or subelement relationships. This conversion from one element type to another must ensure that as much information as possible must be retained through the conversion.

value
A Bricolage::Biz::Value object, representing the content of the element. For container elements, this attribute will be undefined. For the get_value() accessor, pass in an input channel object, GUID, or name to get the value for that input channel.

Instance Methods

get_name
get_key_name
get_media_type
Convenience methods passing through the values of the attributes of the element type for the element.

ordered_subelements
Returns a Bricolage::Util::Collection object of Bricolage::Biz::Element objects that are the ordered subelements of the element. Add or remove subelements to the collection to add or remove them as subelements of the element. Change their order to, um, change their order. The legality of adding or removing or reordering elements will be compared to the specification defined by the associated Bricolage::Biz::Type::Element object; exceptions will be thrown for invalid changes to the subelements. For field elements it will return undef.

unordered_subelements
Returns a Bricolage::Util::Collection object of Bricolage::Biz::Element objects that are the unordered subelements of the element. Add or remove subelements to the collection to add or remove them as subelements of the element.The legality of adding or removing or reordering elements will be compared to the specification defined by the associated Bricolage::Biz::Type::Element object; exceptions will be thrown for invalid changes to the subelements. For field elements it will return undef.

subelements
Returns a list or array reference of all of the Bricolage::Biz::Element objects that are subelements of the element, starting with the ordered elements (in order, of course) and followed by the unordered elements.

subelements_for_key_name
Returns a list or array reference of all of the subelements of the element of a particular type -- that is, with a given key name.

Bricolage::Biz::Element::Container

This class is a concrete derived class of Bricolage::Biz::Element. It implements the interface necessary for the branches of the element tree, that is, containers for other elements.

Bricolage::Biz::Element::Field

This class is a concrete derived class of Bricolage::Biz::Element. It implements the interface necessary for the leaves of the element tree, that is, individual content fields.


VALUES

Bricolage::Biz::Value

Value objects define the interface for the values of field element objects. They're defined as a class in order to make it easier to add new types of values to Bricolage. Think of them as data types. They define an interface for validating that a raw value meets the definition of a value. For example, a number must not contain any non-numeric characters. All of the validation of a raw value must be encapsulated in the validate() method.

Each value object is further defined by a Bricolage::Biz::Type::Value object. This object allows administrators to specify other constraints on a value other than its raw definition. For example, a numeric value might be required to fall withing a range, or a string might be required not to exceed a certain length.

Unlike the interfaces defined by most abstract base classes in Bricolage, value subclasses can be extended. This is to allow for certain metadata to be associated with values of particular types. For example, the File value needs methods to access the location and contents of the file, as well as data about the file, such as its size. Image file values additionally require attributes for height and width. See the subclasses below for further specifics.

A value object can have its class changed, ostensibly without changing its value. This conversion from one value class to another must ensure that as much information as possible be retained through the conversion.

Value objects may overload a number of Perl operators. By default, double-quoted string context will be overloaded to return the raw value stored in the value() attribute.

Attributes

value_type_guid
The GUID of the Bricolage::Biz::Type::Value object defining the parameters of the value. The value type object class must correspond to the value class. For example, for the Bricolage::Biz::Value::Number class, the value type object must be a Bricolage::Biz::Type::Value::Number object.

value
The raw value.

Instance Methods

validate
Validates the raw value to ensure that it meets the requirements both of the subclass data type an of the value type object. Called automatically when a new value object is created via the new() method.

Subclasses

Each value subclass must override the validate() method, and may add other attributes as necessary to provide metadata about a value. This list of subclasses is intended to make a strong start for Bricolage, but may be extended indefinitely into the future as new users identify a need for new data types.

Bricolage::Biz::Value::String
A simple string.

Bricolage::Biz::Value::URI
A URI object, the value of which is defined by the URI module from CPAN. Its raw value can be stored as a string, and double-quoted string context should be overloaded to return the value returned by URI's as_string() method.

Bricolage::Biz::Value::Number
Any kind of number. May be subclassed to support integers.

Bricolage::Biz::Value::Boolean
A boolean value.

Bricolage::Biz::Value::Biz
A reference to another Bricolage business object. This is how other documents (stories, media, etc.) can be associated with an element, as well as any other business object (elements, users, whatever).

Bricolage::Biz::Value::DateTime
A DateTime object, subclassing the DateTime class from CPAN. Datetime values are stored in the data store in the UTC time zone, but the Bricolage::Biz::Value::DateTime object should convert it to the time zone selected in the time zone preference. In a double-quoted string context, Bricolage::Biz::Value::DateTime should be overloaded to return the value of the DateTime datetime() method.

Bricolage::Biz::Value::Interval
A DateTime::Span object.

Bricolage::Biz::Value::File
An uploaded file. Based on its media type, any given instance may manifest via one of the subclasses (see below). It adds the attributes file_name, size, and local_uri, as well as instance methods for retrieving the contents of the file. The file may be stored in the data store, and a copy will definitely be stored on the file system, to facilitate downloads (hence the local_uri attribute).

Bricolage::Biz::Value::File::Audio
Subclasses Bricolage::Biz::Value::File to add metadata relevant to audio files, such as bit rate, length (duration), and sample rate. Maybe even MP3-type metadata (artist, album, track, etc.). It will use Audio::Info from CPAN to harvest the relevant information.

Bricolage::Biz::Value::File::Image
Subclasses Bricolage::Biz::Value::File to add metadata relevant to image files, such as height and width. It will use Image::Info from CPAN to harvest the relevant information.

Bricolage::Biz::Value::File::Video
Subclasses Bricolage::Biz::Value::File to add metadata relevant to video files, such as height, width, bit rate, sample rate, and length (duration). It will use Video::Info from CPAN to harvest the relevant information.


CORE CLASSES

Bricolage::Biz::Site

A site, representing a collection of categories, workflows, output channels, elements, and content. Can largely be based on the implementation of Bric::Biz::Site in Bricolage 1.x. However, it must have at least one associated output channel and at least two associated workflows -- one for documents and one for templates.

Attributes

hostname
The complete and system-wide unique hostname of the site, like ``foo.example.com''.

Instance Methods

output_channels
Returns a Bricolage::Util::Collection object of Bricolage::Biz::OutputChannel objects associated with the site.

workflows
Returns a Bricolage::Util::Collection object of Bricolage::Biz::Workflow objects associated with the site.

Bricolage::Biz::OutputChannel

Output Channels are collections of templates that output content in a particular format. Typically, a site will have output channels for XHTML, RSS, etc. Largely the same as in Bricolage 1.x [although Dave had some ideas about specifying what templaetes within an OC apply to what elements. Look for more details later as we hash out the ideas].

Attributes

name
The name attribute, which is inherited from Bricolage::Biz, is unique within a given site.

site_guid
The site with which the output channel is associated.

class_guid
The GUID of the Bricolage::Biz::Class object representing the subclass of the burner class for which all templates in the output channel will be written. For examle, if the associated burner class is Bricolage::Burner::Mason, all of the templates in the output channel will be Mason components.

protocol
The URI protocol or ``scheme'' for this output channel, such as ``http'', ``ftp'', ``https'', etc.

pre_path
String to prepend as a top-level directory to the category URI when generating URIs for this output channel. For example, with the pre_path set to ``en'' and the uri_format set to ``/categories'', a document in the ``/reviews/books'' category would be published to the URI ``/en/reviews/books'' when output from this output channel. Useful for dividing a site between, for example, different languages.

post_path
String to append as a directory to the category URI when generating URIs for this output channel. For example, with the post_path set to ``email'' and the uri_format set to ``/categories'', a document in the ``/reviews/books'' category would be published to the URI ``/reviews/books/email'' when output from this output channel.

filename
The default file name for files written to this output channel. Defaults to the value of the DEFAULT_FILENAME Bricolage::Util::Config setting.

file_suffix
The default file name suffix for files written to ths output channel. Defaults to the value of the DEFAULT_FILE_SUFFIX Bricolage::Util::Config setting.

uri_format
The format of the URIs generated from this output channel. The format is made up of a slash (``/'') separated string of the various parts of a document than can be used for the URI. The possible pars include:
categories
The category hierarchy for each category a document is in.

guid
The document GUID.

year
The year from the document's cover date.

month
The month from the document's cover date.

day
The day from the document's cover date.

slug
The contents of the document's slug.

uri_case
Enforces the case for a URI genereated for the output channel. The possible values are ``lowercase'' (the default), ``mixed case'', and ``uppercase''.

use_slug
A boolean value indicating whether to use the document's slug for the file name instead of the value of the filename attribute, if the slug has a value.

Instance Methods

included_output_channels
Returns a Bricolage::Util::Collection of other Bricolage::Biz::OutputChannel objects from which output channel includes templates. Think of it as like Perl's @INC array or multiple Mason component roots. The Burner object will know to look for templates in these output channels if it cannot find them in the main output channel. The search order is the order in which they're included in the collection.

page_suffixes
Returns a Bricolage::Util::Collection of suffixes (as strings) that can be used to append to the names of files the written out after the first file. For example, with the values ``_who'' and ``_what'', a three page document written to the output channel might create the files ``index.html'', ``index_who.html'', and ``index_what.html''. If no page suffixes are defined, the output channel will revert to the default behavior of using numbers, such as ``index.html'', index1.html``, and ''index2.html``.

Bricolage::Biz::InputChannel

InputChannels are associated with models (that is, anything that inherits from Bricolage::Biz::Type::Model), and defines different channels for content. This means that every field in an element can contain different data for each input channel. This feature will see the most use for sites that require documents to be published in multiple languages.

For example, If a document type is associated with the input channels ``English'' and ``Spanish'', then the document can be edited in the context of either of those output channels. The document will have the same number of elements and fields--it will be structurally identical accross input channels. The only difference is that the individual fields can contain completely different data (presumably English content in the ``English'' input channel and Spanish content in the ``Spanish'' input channel).

All attributes and methods are inherited from Bricolage::Biz. The name attribute is unique system-wide.

Bricolage::Biz::Category

Categories are hierarchically organized categorizations of content. They're used for both documents and templates. Because categories can contain other categories, together making up a hierarchy similar to a file system's directories, they are inherently strucutred as a tree objects. It may or may not make sense to use special code to efficiently load all of the parents of a category whenever the category itself is loaded.

Attributes

site_guid
The GUID of the site the category is in. Category URIs are unique within a site, but different sites have independent category tress, and therefore can have the same URIs as categories in other sites.

directory
The name of the directory to use for a category in its URI. Defaults to the same value as name. Any character is assumed to be usable in the directory name, including a space, although OS restrictions may apply.

path
The path for the category, relative to the root category. This attribute will be changed whenever the directory attribute of a category or any of its parents changes. This attribute is read-only.

uri
The URI for the category. Essentially just the URI-escaped version of the path attribute.

parent_guid
The GUID of the parent category of the category object. All categories have parent category except for the root category in each site.

category_type_guid
The GUID of the Bricolage::Biz::Type::Model::Category object that defineds the element type and input channels for the category. Note: Implementation of this feature may be deferred, in which case we should add simple ad string attributes as in Bricolage 1.x to maintain backward compatability.

Instance Methods

keywords
Returns a Bricolage::Util::Collection object with the Bricolage::Biz::Keyword objects associated with the category. Add or remove keywords to the collection to add or remove them from the category, and reorder them in the collection to change the order of their association with the category.

subcategories
Returns a Bricolage::Util::Collection object of the Bricolage::Biz::Category objects that are subcategories of the category object.

Bricolage::Biz::Keyword

This class defines the interface for keywords, which can be associated with documents and categories. Can largely be ported from Bricolage 1.x.

Attributes

The name attribute inherited from Bricolage::Biz is the actual keyword.

display_name
The name of the keyword to use when displaying the keyword. Defaults to the value of name

sort_name
A variation of the keyword for use in sorting keywors. For example, for the keyword ``Bill Clienton,'' you might like to use ``Clinton, Bill'' for the sort name. Defaults to the value of name


WORKFLOW

Bricolage::Biz::Desk

A desk is an area of responsibility within a workflow. It generally indicates what needs to be done to or is being done to the objects it contains. Examples are ``Edit Desk'', where documents are being edited, ``Copy Desk'', where they're being copy edited, and ``Publish Desk'', where they're ready to be approved for publication. Desks can also be implicitly related to approval processes, in that permissions limit who can access what desks.

Desks must be uniquely named within a workflow, but can have the same name as desks in other workflows. A single desk can also be in more than one workflow, and in this way, objects may be transferred across workflows. This is also useful when there's a single department responsible for editing or approving content in all workflows, such as ``Legal'' or ``Translation''.

Attributes

All attributes are inherited from Bricolage::Biz.

Instance Methods

objects
Returns a Bricolage::Util::Collection ojbect of all of the objects currently on the desk. Add or remove objects from the collection to add them to or remove them from the desk. Note that all of the objects on a desk must be decorated by the Bricolage::Biz::Decorator::Workflowable class.

When an object is added to the desk, its desk_guid attribute will be set to the desk's GUID, and the object will be added to the desk's object group so that permissions set to access the objects on the desk can be applied. Note that an object can be on only one desk at a time; an attempt to add an object to a desk when it's already on another desk will trigger an exception.

Bricolage::Biz::Workflow

This class defines the interface for Bricolage workflows. A workflow is essentially a collection of desks onto which objects can be placed. There are two different types of workflows: those for documents and those for templates. Each type is represented by a subclass.

Attributes

site_guid
The GUID of the Bricolage::Biz::Site object with which the workflow object is associated.

content_type
A string identifying, in general terms, the type of objects that can be managed in a given workflow. This string will be used for the ``Create'', ``Find'', ``Alias'', and ``Active'' items in the admint interface. Defaults to ``Document'', but can be set to ``Story'', ``Media'', ``Template'', or any other value.

Instance Methods

desks
Returns a Bricolage:Util::Collection object of Bricolage::Biz::Desk objects representing the the desks in the workflow. Add or remove Bricolage::Biz::Desk objects to the collection to add desks to or to remove desks from the workflow. Reorder the desks in the collection to change their order of appearance in the UI.

Note that the first desk in the collection returned by the desks method and for which a user has ``CREATE'' permission to its objects will be the desk on which a newly created document will be placed. Likewise, the first desk for which a user has ``EDIT'' permission to edit its objects will be the desk on which an object retrieved from the library will be placed. The cumulative permissions of all of the desks in a workflow will determine the visibility of the workflow to a user.

Bricolage::Biz::Workflow::Document

Subclass of Bricolage::Biz::Workflow defining the interface for workflows that manage documents. It adds a method to manage the types of documents that can be created in a given workflow.

Attributes

All Attributes are inherited from Bricolage::Biz::Workflow.

Instance Methods

document_types
Returns a Bricolage::Util::Collection object of the Bricolage::Biz::Type::Model::Document objects that represent the types of documents that can be created in the workflow.

Bricolage::Biz::Workflow::Template

Subclass of Bricolage::Biz::Workflow defining the interface for workflows that manage templates. It adds a method to manage the types of elements for which templates can be created in a given workflow. No limitations exist on the creation of utility or category templates other than the usual permission checks.

Attributes

All Attributes are inherited from Bricolage::Biz::Workflow.

Instance Methods

element_types
Returns a Bricolage::Util::Collection object of the Bricolage::Biz::Type::Element objects that represent the types of element templates that can be created in the workflow. The list of templates will be based on the element type and any subelement types of that element type.

Bricolage::Biz::Decorator::Workflowable

This class defines the interface for managing Bricolage objects in workflows. It includes methods for desk checkin and checkout, shelving, and version control. Ideally, it will include the necessary implementation so that other classes don't have to implement its interface, but can add to it via inheritance.

I think that the best approach at this point is to make this interface a decorator for other classes. This will allow us to decorate other classes in the future, should we decded to add workflow management to their interfaces. At this point, only documents and templates will be workflowable. They can probably just inherit from Bricolage::Biz::Decorator::Workflowable as a second parent class in order to get its interface.

Attributes

Each of these attributes must be implemented by a ``workflowable'' class, and must also be added to the list of parameters that can be passed to search() and friends. All attributes are versioned unless otherwise noted.

desk_guid
The GUID for the Bricolage::Biz::Des object an object is on when it is in workflow. Its value will be undefined when an object is not in workflow. This attribute is not versioned.

user_guid
The GUID of the user who created the version of the object.

checkout_user_guid
The GUID of the user who currently has an object checked out. This attribute is not versioned.

version_guid
The GUID for a particular version of an object.

version
The dot-delimited combination of the major and minor version number, such as ``2.3''. This attribute is read-only.

major_version
The major version of an object. This number is incremented only when an object is published or deployed, or, in the case of objects that aren't published or deployed (none at this writing), when they're removed from workflow. This attribute is read-only.

This number can also be considered the ``deployed version'', as it is only incremented at the time an object is deployed. Thus, if the current version of an object is ``7.3'', the deployed version (the version number at the last time the object was deployed) would be ``7.0''.

minor_version
The minor version of an object. This number is incemented every time an object is checked in. It reverts to 0 when the major version is incremented. This attribute is read-only.

This number can also be considered to indicate the ``deployed status'' of an object. For an object containing its latest version data, if it is ``0'', then it means that the current object is the most-recently deployed. If it is any other number, it means that the object has been changed since it was last deployed and may need to be deployed again.

deploy_date
The date and time when the object was last deployed. This attribute is not versioned.

priority
The priority of the object. Its value can be any one of those defined by Bricolage::Util::Priority.

Instance Methods

These methods must be implemented by a class that's ``workflowable''. They are designed to facilitate the management of an object in workflow, as well as version control.

checkout
Checks an object out to the current user. This adds the user's GUID to the object. An object must be on a desk whenever it is checked out. If it isn't on a desk when this method is called, the desk_guid attribute must be set before the object is saved.

checkin
Checks an object in, making the object available for checkout by other users. It increments the minor version number so that the object will be saved to the database as a new version. The old version will continue to exist, with the GUID of the user that had checked it in associated with it; a new version will be created with the user GUID set to undef, waiting for the object to be checked in by a new user.

move
  $bric_obj->move($desk);

Moves an object onto a desk. If a user has an object checked out and a different user attempts to move it, an exception will be thrown.

shelve
Removes an object from workflow -- that is, takes it off a desk and ``shelves'' it in the Bricolage ``library''. If a user has an object checked out, shelve() will first call checkin() when that user shelves the object. If a different user attempts to shelve it, an exception will be thrown. If no user has it checked out, it will simply be removed from workflow.

deploy
Like shelve() except that the deploy date will be set, the major version number will be incremented and the minor version number set to 0. The only exception is if the minor version of the object being deployed is already 0, in which case neither version number nor the deploy date will be changed.

A given implementation of this method will likely do other things, too. For example, Bricolage::Biz::Document will publish the document, and Bricolage::Biz::Template will deploy the template.

revert
  $bric_obj->revert($version);
  $bric_obj->revert($version_guid);

Reverts the object to a previous version. The argument can be either a version number as returned by the version() attribute (such as ``6.23''), or a version GUID (since each version of an object has its own version GUID). If a GUID is passed as an argument, the GUID must be the GUID of a version of the object, not of some other object. Similarly, if the argument is a version number, such a pre-existing version number must exist. If either of these criteria are not met, an exception will be thrown.

An object must be checked out in order to be reverted. Reversion does not change the version number, but simply copies the state of the object from the pre-existing version number. When the object is next checked in, its version number will increment as normal. For example, say we have an object with the version number ``8.6'' and wish to revert to the state as of version ``5.4''. This is how it would work:

  $bric_obj->revert('5.4'); # Copy state from v 5.4
  $bric_obj->checkin; # Increments version number to 8.7.


ASSETS

Bricolage::Biz::Document

A document is an instance of a Bricolage::Biz::Type::Model::Document object. The contents of its associated Bricolage::Biz::Element object adhere to the Bricolage::Biz::Type::Element associated with the document type object. Bricolage::Biz::Document inherits from both Bricolage::Biz and Bricolage::Biz::Decorator::Workflowable, as its instances can move through workflows and are versioned.

All attributes and all associations of a document are versioned, including the name and description attributes inherited from Bricolage::Biz. The name and description attributes are also subject to the input channel associations (meaning that they can have different values for each associated input channel).

Attributes

document_type_guid
The GUID of the Bricolage::Biz::Type::Model::Document object that defines the available relationships for the instance of the document class. The side-effects of changing this attributes are multiple; the method will do its best to copy the contents of the document to a new structure that adheres to that defined by the new Bricolage::Biz::Type::Model object, but some data may be lost. So change this attribute with great care!

cover_date
An arbitrary date associated with the document. It may not include the time [does anyone ever use the time?]. Changing this attribute has the side-effect of changing the document's URIs when the document is saved.

expire_date
Date and time on which to remove the document's published files from wherever they have been distributed. This attribute's value will be undefined by default, and set to undef subsequent to a successful expiration.

site_guid
The Bricolage::Biz::Site GUID for the site the document is in.

source_guid
The GUID for the Bricolage::Biz::Org::Source object identifying the source of the document.

slug
The document slug. The slug is a short (usually one word or two underscore-delimited words, but has no limitations) string describing the document. Most oven used as prt of the document's URIs. Changing this attribute has the side-effect of changing the document's URIs when the document is saved.

primary_uri
The document's primary URI, as defined by the URI format for the primary output channel. This attribute is read-only.

element_guid
The GUID of the Bricolage::Biz::Element object that contains the document's content structure. This object cannot be replaced with another element, but its contents can of course be changed.

primary_category_guid
The GUID of the document's primary category association. The category must be in the collection returned by categories().

primary_output_channel_guid
The GUID of the document's primary output channel. The output channel must be in the collection returned by output_channels().

primary_input_channel_guid
The GUID of the document's primary input channel. The input channel must be in the collection returned by input_channels().

Instance Methods

categories
Returns a Bricolage::Util::Collection object with the categories with which the document is associated. The first category in the collection will always be the primary category; changing the first object has the side-effect of also changing the primary_category_guid attribute. Add or remove categories to the collection to add or remove them from the document, and reorder them in the collection to change the order of their association with the document.

output_channels
Returns a Bricolage::Util::Collection object with the output channels through which the document will be pushed when it is published. The first output channel in the collection will always be the primary output channel; changing the first object has the side-effect of also changing the primary_output_channel_guid attribute. Add or remove output channels to the collection to add or remove them from the document, and reorder them in the collection to change the order of their association with the document.

New output channels must be associated with the Bricolage::Biz::Type::Model::Document object that defines the structure of the document. Existing output channels need not be associated with the document type, since they may have been added in the past when they were associated with the document type.

input_channels
Returns a Bricolage::Util::Collection object with the input channels for which content can be added to the elements of the document. The first input channel in the collection will always be the primary input channel; changing the first object has the side-effect of also changing the primary_input_channel_guid attribute. Add or remove input channels to the collection to add or remove them from the document, and reorder them in the collection to change the order of their association with the document.

New input channels must be associated with the Bricolage::Biz::Type::Model::Document object that defines the structure of the document. Existing input channels need not be associated with the document type, since they may have been added in the past when they were associated with the document type.

The values returned for field subelements in the element tree associated with the element attribute are subject to the input channel. If a value is sought from a field for a given input channel but has no value for that input channel, the Element object will search backwards from that input channel through the collection for the first one that does have a value for the field. In this way, input channels can inherit the values of the higher priority input channels. The same applies to the value of the name and description attributes.

input_channel_for_output
  $doc->input_channel_for_output($input_channel);
  $doc->input_channel_for_output($input_channel_guid);
  $doc->input_channel_for_output($input_channel_name);

Sets the input channel to be used to retrieve values for the name and description attributes, as well as all of the text fields in the element tree stored returned by the element() method. Defaults to the primary input channel.

keywords
Returns a Bricolage::Util::Collection object with the Bricolage::Biz::Keyword objects associated with the document. Add or remove keywords to the collection to add or remove them from the document, and reorder them in the collection to change the order of their association with the document.

contributors
Returns a Bricolage::Util::Collection object with the Bricolage::Biz::Party::Person::Contributor objects associated with the document. Add or remove contributors to the collection to add or remove them from the document, and reorder them in the collection to change the order of their association with the document.

uri
  my $uri = $doc->get_uri;
  $uri = $doc->get_uri($output_channel);
  $uri = $doc->get_uri($output_channel, $category);

Returns a URI for the document. If called without arguments, it will return the value of the primary_uri attribute.

If passed an output channel object, it will retuurn the URI according to that output channel's URI format using the primary category. The output channel must be associated with the document.

If passed a category object, it will return the URI for the document in that category using the primary output channel's URI format. The category must be associated with the document.

If passed both an output channel object and a category object, it will return the URI for the document in that category using that primary output channel's URI format. The output channel and category must both be associated with the document.

publish
Publishes the document. This is immediate. If the document is currently checked out, the deploy() method will also be called. This method should be called when a user wishes to burn and distribute a document immediately. Otherwise, in the event of scheduling a publish for later, the publish job should call this method when it's time for the publish. The actual act of publishing can be ported from Bricolage 1.x's Bric::Util::Burner. The only difference is that disstribution should take place immediately, and not be scheduled (publishes will be scheduled, rather than distributions).

All files burned to disk by the burn process and all files associated with the document's element and subelements via file fields will be deistributed. Any related documents will also be published, provided the publishing user has PUBLISH permission to those documents.

expire
Removes any distributed files from their destinations. If the document is currently checked out, the deploy() method will also be called. Any publishes or expiration jobs not yet executed will be cancelled. Sets the expire_date to undef. This method will also be called when the state attribute is changed to DELETED.

Bricolage::Biz::Document::Alias

This subclass of Bricolage::Biz::Document changes its interface so that it aliases another Bricolage::Biz::Document object. The only differences from other Bricolage::Biz::Document objects are the associated alias_guid and that the element method returns the element object from the aliased document with read-only permission to that object.

Attributes

alias_guid
The GUID of the Bricolage::Biz::Document object to which the alias document is aliased.

Bricolage::Biz::Template

An abstract base class for Bricolage templates. Templates pull in the contents of documents and format them for output. This class inherits from both Bricolage::Biz and Bricolage::Biz::Decorator::Workflowable, as its instances can move through workflows and are versioned. All attributes of a document are versioned, including the name and description attributes inherited from Bricolage::Biz.

Note that the deploy() method inherited from Bricolage::Biz::Decorator::Workflowable must be overridden to also deploy the template to the appropriate output channel root, as well as to delete any previous versions of the template (if it's path attribute has changed).

Attributes

output_channel_guid
The GUID for the output channel the template is in.

category_guid
The GUID for the category the template is in.

class_guid
The GUID for the Bricolage::Biz::Class object indicating the subclass of Bricolage::Biz::Template of which the template is an instance.

uri
The URI of the template -- that is, how it can be found relative to the output channel root.

path
The path to the template relative to the output channel root on the file system. The value of this attribute is OS-dependent.

code
The template code.

Bricolage::Biz::Template::Element

Element templates are associated with elements. Their name attributes are the same as for the corresponding element. The corresponding element's key_name attribute is used in the path and uri attributes for the file name. Thus the path and uri attributes will be updated by any changes to the corresponding element's key_name attribute.

Attributes

element_guid
The GUID of the Bricolage::Biz::Element object for which the element template has been created.

Bricolage::Biz::Template::Category

Category templates are named for the standard category template name and suffix supplied by the burner class associated with the output channel the category template is in. It is otherwise no different than its base class.

Bricolage::Biz::Template::Utility

Utility templates can have an artibrary name supplied by the uesr. That name is used for the file name, as well. It is otherwise no different than its base class.


BURNERS

Bricolage::Burner

The abstract base class for Bricolage burners. These can largely be ported from Bricolage 1.x.

Bricolage::Burner::XSLT

This is a new burner for Bricolage 2.0. It will use the Bricolage::Biz XML API and chained SAX machines to use XSLT to format documents for output. Or maybe it'll use AxKit? I leave it to Mike Slattery to fill in the holes here.

Bricolage::Burner::Mason

The Bricolage Mason burner. Can be ported from 1.x.

Bricolage::Burner::TemplateToolkit

The Bricolage Template Toolkit burner. Can be ported from 1.x.

Bricolage::Burner::HTMLTemplate

The Bricolage HTML::Template burner. Can be ported from 1.x.


USER INTERFACE

Bricolage::UI

This namespace it set aside for Bricolage UI classes.

Bricolage::UI::Widget

The Bricolage XHTML widget base class. This class defines the interface for widgets, which are used for the display of field elements as well as to power the UI of Bricolage in general.

Bricolage::UI::Widget::XHTML

This is a concrete subclass of Bricolage::UI::Widget that implements all of the required elements to drive the Bricoalge XHTML UI. This is the default and main UI implementation; others may be added in the future.

Subclasses

Bricolage::UI::Widget::XHTML::Text
Outputs a text input field.

Bricolage::UI::Widget::XHTML::Textarea
Output a textarea field.

Bricolage::UI::Widget::XHTML::File
Outputs a file input field.

Bricolage::UI::Widget::XHTML::Table
Outputs a table of Bricolage business objects. The XHTML will use JavaScript and the DOM to allow sorting of objects inline in the page. See http://www.kryogenix.org/code/browser/sorttable/ for a nice example.

Bricolage::UI::Widget::XHTML::AddMore
Outputs a the add more widget.

Bricolage::UI::Widget::XHTML::Select
Outputs a select field and its options.

Bricolage::UI::Widget::XHTML::Checkbox
Outputs a checkbox input field.

Bricolage::UI::Widget::XHTML::Radio
Outputs a radio input field.

Bricolage::UI::Widget::XHTML::DateTime
Outputs a datetime select widget.

Bricolage::UI::Widget::XHTML::Date
Outputs a date select widget.

Bricolage::UI::Widget::XHTML::Time
Output a time select widget.

Bricolage::UI::Widget::XHTML::Calendar
Outputs a calendar widget.

Bricolage::UI::Widget::XHTML::Interval
Outputs an interval widget (two DateTime widgets?).

Bricolage::UI::Widget::XHTML::Profile
Outputs a link to an object profile.

Bricolage::UI::Widget::XHTML::Multi
Classes that inherit from this class will output fields that accept multiple values.

Bricolage::UI::Widget::XHTML::Multi::Select
Uses help_text and display_size and either value_options or class_attribute. Outputs a select list and options and allows multiple options to be selected.

Bricolage::UI::Widget::XHTML::Multi::Search
Uses help_text and class_attribute. Allows for objects of a particular type to be searche for.

Bricolage::UI::Widget::XHTML::Multi::DoubleList
Outputs a double list, which allows multiple values to be added.

Bricolage::UI::Widget::XHTML::Multi::Checkbox
Outputs multiple chekbox input fields.

Bricolage::UI::Callback

This class is the abstract base class for UI callbacks. It inherits from Params::Callback to implement the callback interface. These classes are used by any and all of the UIs, plus the SOAP server, to perform common tasks.

Subclasses

Here are few to start with. Many more will likely follow.

Bricolage::UI::Callback::List
Bricolage::UI::Callback::Search
Bricolage::UI::Callback::DoubleList
Bricolage::UI::Callback::Profile
Bricolage::UI::Callback::Select
Bricolage::UI::Callback::DateTime
Bricolage::UI::Callback::Calendar
Bricolage::UI::Callback::Profile
This class may need subclasses for the different types of objects, but ideally it won't. If we successfully create an abstract enough interface so that all objects can be treated the same, we may be able to get away with very few subclasses.


SERVERS

Bricolage::Server

This namespace is set aside for classes that manage servers that Bricolage runs.

Bricolage::Server::Apache

The handler for the main Bricolage apache server interface (Mason UI, etc.). It may be subclassed to add the necessary code for various Apache request phases, such as Bricolage::Server::Apache::Cleanup.

Bricolage::Server::SOAP

The Apache handler for the Bricolage SOAP server. This class should be able to use the standard XML interface and Class::Meta introspection classes defined for all Bricolage business classes to handle them all with a minumum of code. The goal is to have the SOAP server not replicate all of the code that's in the UI callbacks as is the case in 1.x.

Bricolage::Server::Dist

The Bricolage distribution server. Can likely be ported from 1.x's Bric::Dist::Handler.


CLIENTS

Bricolage::Client

This namespace is set aside for any modules useful for Bricolage client applications, such as the bric_soap script and the bric_dist_mon script.

Bricolage::Client::SOAP

Libraries for clients of the Bricolage SOAP server.

Bricolage::Client::Dist

Libraries for clients of the Bricolage distribution server.


AUTHORS

David Wheeler <david@wheeler.net>

With input, advice, feedback, and contributions from:

Mark Jaroski <mark@geekhive.net>

Scott Lanning <slanning@theworld.com>

Dave Rolsky <autarch@urth.org>


SEE ALSO

ElementRevision
This is the main document for the element revision project, pointing to all documentation relevant to the project.

ElementRevision::FunctionalSpec
The functional specification describes the element revision, what it will look like, and how it will work.

ElementRevision::Implementation
This document describes how the new element system was implemented. It includes details on what was changed, how it was changed, and how the finished product varies from the functional and technical specifications

WorkflowRevision
The workflow revision project documentation.

[GHJV94] Design Patterns - Elements of Reusable Object Oriented Software
By Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides. 1994: Addison-Wesley Professional Computing Series.

Primary Key Reengineering Projects: The Problem
By Tom Johnston. http://www.dmreview.com/editorial/dmreview/print_action.cfm

Primary Key Reengineering Projects: The Solution
By Tom Johnston. http://www.dmreview.com/editorial/dmreview/print_action.cfm


COPYRIGHT AND LICENSE

Copyright (c) 2001-2003 the World Health Organization. See Bric::License for complete license terms and conditions.