NAME
OpenInteract2::Manual::Changes - Significant changes to OpenInteract2
NOTE
Each package maintains its own changelog. These changes are not mentioned here except to note the package version changes with successive OI2 releases.
THE FUTURE
OI2 is currently at 1.99_04, equivalent to 2.0 beta 4. The next release should be a release candidate (1.99_05/2.0 RC1) -- it will have new features (see below) but everything else should be bugfixes after that or pushed off to 2.01.
Changes before 2.0
These haven't happened yet, but they will before 2.0.
I18N/L10N
Be able to set Locale::Maketext object from somewhere other than OI2::Request; this may require moving the access/shortcut methods out into a separate object entirely.
Find all error messages from within the system (and packages) and add to message file. This may mean adding the Locale::Maketext object to CTX for every request just so that request-unaware components know what language to use.
Allow each package to maintain its own namespace of message keys, falling back to the global (sitewide) keys when necessary/requested. The assumption is that packages will only need access to their own keys and the set of global keys -- every package is separate.
This will require us to track what the 'current package' is. This will be set by default when executing an action and processing a template, and there will be an API call in OI2::Request to set it by hand if you'd like.
Allow a message file to be overridden by a permanent one, similar to how we allow 'permanent' package templates that live in $WEBSITE_DIR/template/{package}; similarly we'll have message files in $WEBSITE_DIR/msg/{package} that get read first when the Locale::Maketext classes are built at server startup.
NOTE: This may require modifying OI2::Package->get_message_files()
Create new package 'translate', which allows you to manipulate message files through the browser. The previous item must be implemented first.
Display
Create a comprehensive CSS file for the site. This means getting rid of all FONT/SIZE/etc. tags/attributes, getting rid of all 'bordered' tables, getting rid of many tables used for layout, etc. This will be a huge PITA and if you want to make your bones in the OI community you'll get major points here.
See the OI wiki topic 'OpenInteract2Idea' for some concrete ideas.
Create system to copy package CSS files to public directory on package install, or somehow manage this. (Still not clear how it will work...)
Actions
Introduce an 'autobind' implementation that will allow for setting inbound request parameters to an object and for automatic validation. Configuration may look like this:
[myaction autobind] # Use either 'object' or 'object_class' to specify the # object you're binding to object = myobject object_class = OpenInteract2::MyObject # List the tasks for which autobind is enabled task = create task = update # List the fields that will be bound field = id field = title field = content # ...or have the object do it for you, returning an # arrayref of fieldnames field_list_method = field_list # Whether to perform validation validate = yes|no # Task to execute on validation error; 'REDO' is a # special key to re-execute the action that got you # here (tasks inherited from Common* know what to do...) on_validate_error = REDO # ...or have the action determine this for itself on_validate_error_method = _get_validate_error Before action is 'execute()'d, check to see if autobind enabled for task. If so, instantiate an object of the given type, fill in with data from OI2::Request object, and call 'validate()' on it if instructed to do so. The 'validate()' method should return a undef/false on success, or a hashref of field to error mappings on failure. Filled object goes to $action->param( 'object' ) and validation errors go to $action->add_view_message().
Have the common handlers be able to report their caller where appropriate. For instance, 'create' will return 'display_new' and 'update' 'display_form'.
External Interfaces
It would be great if someone familiar with Apache2/mod_perl2 could take a look at it and see why libapreq2 seems to bomb.
See if LDAP still works...
Packages
Along with the CSS ideas above (under Display), put package-specific display information into CSS files for inclusion.
Get the 'base_page' package nailed down -- use IDs instead of locations in the 'page' table, ensure directory requests are clean, etc.
Modify 'base_error' package to save error messages to the filesystem rather than the datbase.
See if the object keys are being used anywhere; if not, get rid of them; if so, see if they're actually needed and if not THEN get rid of them.
Add extra package 'full_text_plucene' that uses Plucene to run searches instead of the hacked 'full_text' package that uses stemming and a crude (but universal) database-backed algorithm.
Port OI 1.x extra package 'object_link' to core distribution. This allows you to link arbitrary SPOPS objects based on a set of categories. When you're viewing an object you can pull up a list of related objects and display them in a box, under the main display, whatever.
1.99_04, 22 May 2004
Major Changes
Added basic localization support. See OpenInteract2::Manual::I18N for more information. Note that a number of OI2 classes have been modified to support additional data for i18n infrastructure. Also note: you don't have to use i18n if you don't want to :-)
You can now migrate your 1.x data automatically. The base SQL installation class OpenInteract2::SQLinstall has hooks for doing it yourself or for declaring a few pieces of information which it will use to copy data from table to table or to copy data to SPOPS objects which get saved to tables as normal. Read its docs under 'DEVELOPERS: MIGRATING DATA' for more information. All packages shipped in the distribution should be able to migrate themselves from a 1.x system.
The management task 'migrate_data' (OpenInteract2::Manage::Website::MigratePackageData) is the external hook to this. Run:
oi2_manage task_info --task=migrate_data
for description and parameter information.
Added new package 'comments' to core distribution. It implements a simple flat comment thread for any object, so you can have comments on news items, links, documents, users, etc.
Added new package 'whats_new' to core distribution. With this you can register an SPOPS object with the service and track new additions to a central location. So when users click "What's new?" they see new documents, news items, comments, etc.
OpenInteract2 now runs under Apache 2/mod_perl 2. This has not been tested very deeply and I've got about two hours of experience with mod_perl 2, but at least it's something to work with.
A couple of table fieldname changes were necessary to make OI2 work under Sybase Adaptive Server Anywhere (ASA). So if you have an earlier beta you'll need to change the name of 'sys_error.message' to 'sys_error.err_message' and the 'comment' table to 'oi_comment'. The former has a backward-compatibility change in the SPOPS configuration (under 'field_map') so you won't even notice.
Tons of cleanup, rewriting, redoing...
Minor Changes
Add interface for Apache2/mod_perl2.
Disambiguate 'close()' call on filehandle since we have a 'close()' method.
OpenInteract2::Action
Add
clone()
which copies the properties and parameters of the given object into a new object of the same class. We use this to cache actions created from the action configuration (profiling showed a good bit of time spent on this operation).
OpenInteract2::Action::Common*
Added SYNOPSIS documentation displaying all configuration entries
OpenInteract2::Config::Initializer
Added documentation for people wishing to catch the 'localization' event, fired when we generate a new localization class.
OpenInteract2::Config::Package
Add configuration item 'message_file' so users can declare one or more message files.
OpenInteract2::ContentGenerator
Remove unused 'instance_sub' method.
OpenInteract2::ContentGenerator::TT2Context
Move to OpenInteract2::TT2::Context
OpenInteract2::ContentGenerator::TT2Plugin
Add 'require' for Text::Sentence in 'limit_sentences()'. Thanks to Mike Castle for pointing out the error.
Move to OpenInteract2::TT2::Plugin
OpenInteract2::ContentGenerator::TemplateSource
Add new template source type 'message_key' which asks the language handle to lookup the template name (the normal 'package::name' syntax) given a particular key.
OpenInteract2::ContentGenerator::TT2Process
Modify 'initialize()' to save data as state in the content generator object ($self) rather than use class variables and store it in CTX -- the TT object is now a content generator property, not a CTX property.
Configuration data has moved from 'template_process' to 'content_generator' declaration and is pushed into 'initialize()' rather than being pulled from the server config/CTX.
You can no longer specify the methods in 'custom_init_class' and 'custom_variable_class' -- you need to use predefined methods for each ('custom_template_initialize' and 'customize_template_vars', respectively).
OpenInteract2::ContentGenerator::TT2Provider
Move to OpenInteract2::TT2::Provider
Add method 'lookup_mail_config' as shortcut into 'email' configuration.
Add step during setup() 'initialize messages' to read in the localized messages from all packages.
Modify docs for
lookup_content_generator_config()
(only returns class associated with name) andcontent_generator()
(clarify what's returned).Remove 'template()' method since content generators can store their own state now, and if you need a Template object you can get it from the content generator or create one yourself.
Add 'lookup_datasource_type_config()' as shortcut into 'datasource_type' configuration
Add 'lookup_id_config()' as shortcut into 'id' configuration.
Add 'lookup_cache_config()' as shortcut into 'cache' configuration.
Add 'lookup_config_watcher_config()' as shortcut into 'config_watcher' configuration
OpenInteract2::Exception::Parameter
Move to separate class so we can do customized stringification (previously just a declaration in OI2::Exception)
Add base class for use with Locale::Maketext
OpenInteract2::I18N::Initializer
Add class to read message keys and generate Locale::Maketext subclasses from them. (Called from OI2::Setup)
OpenInteract2::Manage::Website::CreateSuperuserPassword
Add check so that if 'login.disable_superuser_password_change' is set we'll throw an exception.
OpenInteract2::Manage::Website::PackageCheckExportInstall
Add new task to check a package, export it if the check succeeds, and install it to a website if the export succeeds.
Add section of manual to deal with I18N/L10N issues.
Add
get_message_files()
to retrieve the files with localized messages.In 'create_skeleton()' reject any blank/all-space package names.
OpenInteract2::Reponse::Apache2
Add interface for Apache2/mod_perl2 output.
Add 'auth_clear()' method to clear all 'auth_*' properties from current request. Generally used when loggin a user out.
OpenInteract2::Request::Apache2
Add interface for Apache2/mod_perl2 input, although we're not using the mp2 version of Apache::Request yet because I couldn't get it working properly on my machine. (Lots of 'child pid 12671 exit signal Bus error (10)' type messages...) Instead we just borrow the parameter/upload parsing from OpenInteract2::Request::CGI.
Add
read_localized_messages()
to read in the localized messages.
Add
migrate_data()
method along with implementations to copy data between tables and from a table to objects.Modify the data file and structure file installations to report the full path to the files used rather than the filename itself.
Fix bug where a '0' specified in the object ID in a security specification would actually try to insert a hashref of the default security information. (Ah, perl's true/false semantics...)
sample/README
Add description of what the sample files are for and how to create a public source directory.
sample/apache2/*
Add Apache 2/mod_perl 2 configuration files, copied over to a new website when it's created.
sample/msg/*
Add global message files (only US English for now, like to help?)
sample/website/conf/server.ini
Add key 'dir.package' so we can get the base package directory easily.
Add key 'dir.msg' so we can get the global message directory
Remove 'template_process' configuration section, moving the data into the respective 'content_generator' section.
Modify content generator type 'HTMLT' to be 'HTMLTemplate', and 'TextTmpl' to be 'TextTemplate'. (Seems friendlier...)
Add section 'language' to support I18N efforts.
Add 'login.disable_superuser_password_change' to stop people from changing superuser password using oi2_manage.
Rename 'cache_info' to 'cache', and remove subsections 'data' and 'template' -- all 'data' items are in 'cache' and 'template' items moved to the TT2 content generator configuration.
Remove 'context.info.request' and 'context_info.response', the adapters are responsible for setting this.
Rename 'display_info' to 'redirect' since that's all it was holding.
Remove key 'system_class.security' since you can just do CTX->lookup_object( 'security' ) instead.
1.99_03, 8 September 2003
Major Changes
A very thorough package development tutorial is in full effect, see OpenInteract2::Manual::Tutorial.
API for management tasks has changed, and
oi2_manage
is now a much simpler shell around the main facade. Adding a new task is as simple as creating a class under the right namespace and registering yourself with the facade.Actions can store messages for the view to pickup and the built-in template input widgets are hooked into them, making for fairly seamless validation roundtripping.
SPOPS and Action configurations can now be modified at server startup by your code. This allows you to create configuration shortcuts (like 'is_googlable') and make other developers on your team happy. (See OpenInteract2::Config::Initializer)
Actions in all system packages should work as advertised, with the exception of some functionality in the
base_page
package.Tons of smaller changes throughout, including cleaner APIs, more tests, lots more documentation and examples, and cleaning up as a result of testing more of the system.
Minor Changes
Makefile.PL/Build.PL
Bump up required version for File::DirSync since it has new feature.
Add Test::MockObject as requirement.
Use the
version()
from the context rather than hardcoding it ourselves. (old...)Move most of the functionality from
script/oi2_daemon
here so we can access it from other places too (like tests).
Rename a number of methods to give them a 'protected' veneer:
check_task_validity()
,find_task()
,find_task_method()
become_check_task_validity()
,_find_task()
,_find_task_method()
, respectively.Add factory_log() and factory_error() to capture messages from Class::Factory and redirect to our logger
Add overridable init_at_startup() and documentation with example.
OpenInteract2::Action::CommonRemove
Blew up because wrong method called, how embarrassing. Works now.
OpenInteract2::Action::CommonSearch
Always pass
search_criteria
to template to be nice, add warning about the format of the fieldnames.
OpenInteract2::Action::TemplateOnly
Reflect parent change of
find_task()
to_find_task()
.
Make an object rather than using class methods. The various information that we passed around is now in the auth object, and this object is passed to any custom handlers you may have defined as well.
Port change from 1.x allowing users to configure the website not to accept users who aren't logged in.
OpenInteract2::Auth::AdminCheck
Modify to use information from auth object rather than having it passed in.
Modify to use information from auth object rather than having it passed in.
Modify to use information from auth object rather than having it passed in.
Add factory_log() and factory_error() to capture messages from Class::Factory and redirect to our logger
In translate_dirs() ensure that 'dir.website' doesn't have a trailing slash.
After object initialized remove trailing '/' from all set directories.
OpenInteract2::Config::Initializer
Add class to handle SPOPS and Action configuration initialization duties. The class is observable so you can add custom behavior. (See docs for details and how this hooks into packages.)
Note that the use of 'TASK_EDIT' in the 'display' key of SPOPS objects will only result in the 'url_edit' key being populated from a call to 'object_configuration()' on an SPOPS object if you're using SPOPS >= 0.79. It doesn't do any harm otherwise, you just won't get the right URLs...
OpenInteract2::Config::Package
Add 'config_watcher' property
OpenInteract2::ContentGenerator::TT2Plugin
Add
can_write
shortcut so we don't have to use 'tmp_security_level' anymore...
Add factory_log() and factory_error() to capture messages from Class::Factory and redirect to our logger
Create
lookup_session_config()
rather than having outsiders root around server config. In the same vein add 'lookup_default_action_info', 'default_action_id', 'lookup_default_datasource_name', lookup_system_datasource_name', 'lookup_default_ldap_datasource_name', 'lookup_directory', 'lookup_temp_lib_directory'.Rename 'datasource_config' -> 'lookup_datasource_config'
Add docs for filter shortcut methods
Remove
alias()
and replace withlookup_class()
. This means that:CTX->template_class
and similar calls (based on the names in the 'system_alias' server configuration key, now replaced by 'system_class') will no longer work and you must use:
CTX->lookup_class( 'template' )
instead. This wasn't used terribly often and all uses in OI2 and packages have been replaced.
This change also entailed modifying the setup so that the alias building features weren't called, and removing the corresponding OI2::Setup call (see below).
Remove
global_attribute()
-- feature without a purpose.
Modify the API quite a bit. Some is just renaming (e.g., 'brief_description()' is now 'get_brief_description()') but other bits are much more substantial. Just read OpenInteract2::Manual::Management for how things work now.
No tasks are hardcoded in this class (or the OpenInteract2::Manage::Package or OpenInteract2::Manage::Website abstract subclasses). Instead we find all classes from
@INC
under theOpenInteract2::Manage
namespace (including subnamespaces) andrequire
them. This means all you need to do to create a new task is put it under the right package and register yourself with the main management class and you're good to go.Add factory_log() and factory_error() to capture messages from Class::Factory and redirect to our logger
OpenInteract2::Manage::CreateSourceDirectory
Update to use new feature in File::DirSync so we can return on request information about what got synchronized.
OpenInteract2::Manage::Website::CleanExpiredSessions
Add new task to delete old and empty sessions. Replaces script from 'base' package.
OpenInteract2::Manage::Website::CreateSecurity
Add new task to batch create security for SPOPS objects. Replaces script from 'base_security' package.
OpenInteract2::Manage::Website::InstallPackage
After package is installed add notification to refresh the temp lib dir if necessary.
Do explicit check to see if this package name/version already installed, and if so don't fail but generate a message indicating that the install wasn't performed.
OpenInteract2::Manage::Website::ReindexObjects
Add new task to reindex (or initially index) SPOPS objects. Replaces script from 'full_text' package.
OpenInteract2::Manual::AdminDatabase
Add instructions for initializing iAnywhere ASA, thanks to Greg Fenton for writing them up.
OpenInteract2::Manual::Architecture
Fix errors in request process pointed out by Greg Fenton.
Add discussion of how OI implements MVC (or really, how it implements separation of concerns and the pieces of OI that map to the letters in MVC...)
OpenInteract2::Manual::Management
Add content, reflects fully the recent API changes.
OpenInteract2::Manual::QuickStart
Fix errors and inconsistencies and make clarifications throughout document, thanks to Greg Fenton for detailed report.
OpenInteract2::Manual::Templates
Add discussion of multiple content generators with the same code, declaring 'template_source' in an action to enable this, and similar matters.
OpenInteract2::Manual::Tutorial
Write the thing. It's really big, read it now!
OpenInteract2::Manual::TutorialAdvanced
Add placeholder for tutorial on advanced OI functionality.
Add little 'parse_full_name()' class method to complement 'full_name' object method.
Modify check() for templates -- it was succeeding even though the template file didn't exist.
On install() be sure to translate the package filename into an absolute one, otherwise we eventually lose track.
Fix for reading package from file -- directory wasn't being set correctly.
Add internal methods to maintain a cache of packages rather than refetch them on every 'fetch_package()'. This may come back to bite us in the future because there's no synchronization going on...
Add 'action_errors' and 'add_action_errors()', plus docs.
Add 'get_implementation_type'
Add 'get_implementation_type'
Rename
_set_url()
toassign_request_url()
so other modules can call; rename call in subclasses as well.
Add factory_log() and factory_error() to capture messages from Class::Factory and redirect to our logger
Add factory_log() and factory_error() to capture messages from Class::Factory and redirect to our logger
Use methods instead of object hash references. Another notch for Class::Accessor...
Renamed this and all subclasses from OI2::Session* to reflect that we're not session objects, we're managing session objects.
Move all initialization methods for action config and calls to the datasource-specific initializer to OpenInteract2::Config::Initializer so that users can add custom behaviors.
Document
create_temp_lib
call better, explaining our intentions.Remove
build_aliases
and documentation for it. (No longer needed, see OI2::Context change docs.)
Fix bug resulting from evaluating
$spops_obj->id
in list context that was fixed in 1.x but didn't get replicated. Thanks to damien leri (again!) for pointing it out.Move all configuration initialization modification routines into OpenInteract2::Config::Initializer.
All object key methods now use the 'system' datasource name rather than relying on the object that was being keyed.
Move all configuration initialization modification routines into OpenInteract2::Config::Initializer.
Move all configuration initialization modification routines into OpenInteract2::Config::Initializer.
Modify some server config retrievals into method calls on the context. (Data hiding, what's that?)
sample/website/conf/server.ini
Add 'config_watcher' section. Allows us to declare SPOPS/action configuration initialization observers.
Add 'datasource_config.ldap' for the default LDAP datasource
Add 'required', 'required_url' and 'required_skip' to 'login'
Add 'use_meta_redirect' and 'use_header_redirect' to 'display_info'
Rename 'system_alias' section to 'system_class', remove a number of items from it and rename some others.
script/oi2_daemon
Store the PID file in the directory from where the configuration file is read. (Thanks to Greg Fenton for suggestion.)
Move most functionality to HTTP::OpenInteract2::Daemon so we can run it outside the script.
t/*
Add lots of stub tests to be filled in shortly -- honest! Also created a TODO listing of tests to create.
1.99_02
NOTE: Skipped this release to sync up the beta number with the extra dev number.
1.99_01, 3 July 2003
Major Changes
Log4perl is now used for all logging. This is a major change in how OI2 presents its state to you, allowing you far more flexibility than you previously had.
Lots of documentation additions and updates.
Different content generators than the Template Toolkit exist and can be used. They're not as featureful (e.g., nothing similar to the TT plugin) but may be useful when porting applications. They are
Text::Template
(using OpenInteract2::ContentGenerator::TextTemplate) andHTML::Template
(using OpenInteract2::ContentGenerator::HtmlTemplate).You can find examples of using them in the 'news' package -- look at the bottom of the conf/action.ini file to enable the different actions.
The controller has been decoupled from the content generator. Each controller is associated with a content generator, but a content generator doesn't map to a single controller. (This probably doesn't make sense to anybody who didn't read the code or try to use a different content generator, but trust me that it's better.)
OpenInteract2 now has content filters. And they're easy! A filter is just an observer (see Class::Observable) that catches 'filter' observations and has an opportunity to modify the content generated before it's optionally cached.
...which leads to caching of action content, now implemented. It's mostly transparent to your action as long as the cached content doesn't depend on any non-request parameters. (See OpenInteract2::Manual::Caching for lots of info.)
OpenInteract2::Exception now uses Exception::Class rather than SPOPS::Exception, and E::C is a depdendency.
The standalone daemon (
oi2_daemon
) respects theOPENINTERACT2
environment variable and will use it to find the server configuration and the daemon configuration if unspecified.
Minor changes
Too many small fixes and improvements to note, sorry. As we stabilize to 2.0 this will get explicit.
Broken stuff
Full text searching doesn't seem to work. A number of other actions have not been fully tested by hand, much less in an automated fashion.
Also, tests for other areas of the system are lagging.
1.99_00, 10 June 2003
This is the first BETA release. DO NOT run production systems on it.
Compatibility
Since OpenInteract 2.x uses a separate namespace than OpenInteract 1.x (OpenInteract2 vs. OpenInteract), you should have no problems installing this on a machine with OpenInteract 1.x.
There is currently no automated way to upgrade the server configuration or everything about a custom package. (You can translate the conf/action.perl
and conf/spops.perl
into the new INI format -- see scripts in script/
.) In addition, a number of core packages have upgraded schemas so you can't simply dump your table and reload it.
Before 2.0 final is released there should be tools to:
Do a simple translation of content handlers and other classes. This would just translate most of the $R calls to CTX calls (or CTX->request, CTX->response calls).
Do a translation of Template Toolkit directives that have changed (there aren't many).
Major Changes
These are the highlights. Many others are lurking under the covers.
There is no longer a package repository and a website, only a website. This greatly simplifies development.
You can deploy OI2 under a specific URL-space so that, for instance, all requests under '/OI2/' will get translated to the proper action.
And along with deployment you can easily rewrite URLs to fit in the deployment scheme.
Tight integration with SPOPS object persistence still exists and has been enhanced to make development easier -- you do not have to specify 'SPOPS::Secure' in the ISA, just set the 'is_secure' key to 'yes'. You also do not have to specify the database type in your persistent object -- it's wired to a datasource which knows this information, so we generate it at startup time.
An entirely new management scheme replaced the massive
oi_manage
with programmable tasks to create a website, create and install packages, install database schemas along with associated data and security settings, and more.Request parameters that OI2 deals with are separate from the how those parameters are retrieved. This means it's easy to deploy an OI2 server in different environments -- it ships with interfaces for Apache 1.x/mod_perl 1.x, CGI, and a standalone server based on LWP. It's easy to create interfaces for other systems as well. (See "OI2 INTERFACES".)
Content handlers are now objects instead of classes, all deriving from OpenInteract2::Action. This simplifies development, making each action stateful rather than passing around a dumb hashref.
You can now generate any kind of content from OI2. OI2 is still heavily biased toward the Template Toolkit (can you blame it?), but you can plugin any type of content generator you like. A sample one is in the distribution: OpenInteract2::ContentGenerator::TextTemplate.
The
OpenInteract::CommonHandler
megalith has been split up into separate classes to deal with searching, displaying, updating, adding, and removing objects.All actions in the core packages have been modified to use these common handlers where possible, and when not possible they don't overload as much functionality into a single task. For instance, 'display' will just display a non-editable object; 'display_form' will just display an existing object in a form for updating; 'display_add' will display a form without an object.
The procedures for installing SQL structures, initial data and security has been totally overhauled. It's much to create an installer now.
Authentication is more flexible and can be adapted to different systems (e.g., HTTP authentication instead of cookies) more easily.
The package and repository code was entirely rewritten. The repository now holds the bare minimum to keep track of objects and it should never become corrupted.
Everything in OI2 should throw an exception object rather than issue a
die
. This allows us to discern the different types of errors more easily, keep track of where they were thrown, etc.An ever-growing testing suite ensures that OI2 can adapt easily and also provides a separate bunch of documentation.
OI2 INTERFACES
An 'interface' refers to how OpenInteract2 interacts with the outside world. An interface consists of three parts:
Adapter to take the user's request, login the user and create the necessary OpenInteract2 objects (OpenInteract2::Request, OpenInteract2::Response, OpenInteract2::Controller).
Subclass of OpenInteract2::Request to take the parameters, cookies, and other user information from the user's request and put it into the OpenInteract2 framework.
Subclass of OpenInteract2::Response to take the generated headers, cookies, and content generated by OpenInteract2 and send it back to the client.
Since most of the functionality is pushed down into the Request and Response subclasses, adapters are generally pretty simple. For instance, here's an example of the Adapter for Apache 1.x/mod_perl 1.x:
package Apache::OpenInteract2;
use strict;
use OpenInteract2::Auth;
use OpenInteract2::Request;
use OpenInteract2::Response;
sub handler($$) {
my ( $class, $r ) = @_;
my $response = OpenInteract2::Response->new({ apache => $r });
my $request = OpenInteract2::Request->new({ apache => $r });
OpenInteract2::Auth->login( $r->pnotes( 'login_user' ) );
my $controller = eval {
OpenInteract2::Controller->new( $request, $response )
};
if ( $@ ) {
$response->content( $@ );
}
else {
$controller->execute;
}
$response->send;
return $response->status;
}
SEE ALSO
OpenInteract Wiki
http://openinteract.sourceforge.net/cgi-bin/twiki/view/OI/
COPYRIGHT
Copyright (c) 2002-2004 Chris Winters. All rights reserved.
AUTHORS
Chris Winters <chris@cwinters.com>