The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

OpenInteract2::Manual::Intro - Quick introduction to OpenInteract2

SYNOPSIS

This part of the manual has pointers to the major pieces of OpenInteract2.

WHAT IS IT?

OpenInteract2 is an extensible application server that includes everything you need to quickly build robust applications. It includes:

  • A robust system of components that can access your data just about any way that you can think up and present the data in reusable templates.

  • A very flexible separation of presentation and data access: you can use one template for accessing data from different sources (e.g., a listing of users from the system, from an LDAP server, from an NT/SMB authentication controller, etc.) or you can use one set of data to fill multiple templates.

  • A consistent security mechanism allowing you to control security for users and groups not only at the task level, but also at the individual data object level.

  • A simple user and group-management system that allows users to create their own accounts and an administrator to assign them to one or more groups.

  • A convenient packaging system that makes it simple for developers to distribute code, data schemas, configuration, initial data and all other information necessary for an application. It also makes the installation and upgrading processes very straightforward and simple.

  • An integrated, database-independent method for distributing data necessary for a package. You should be able to install any package on any database that's been tested with OpenInteract.

  • The ability to deploy an OpenInteract2 application server as a standalone service, inside an Apache/mod_perl server, or even accessed as a CGI process. And it's easy to extend OI2 to use additional interfaces.

CONCEPTS

For more information about these concepts see OpenInteract2::Manual::Architecture.

Context

Holds all application configuration information and provides a central lookup mechanism. This is a singleton (there's only one in the system at any time) and can be imported from the OpenInteract2::Context class since it's used fairly often.

Adapter

This is the tool that sits between your interface (e.g., Apache/mod_perl, CGI, etc.) and the OpenInteract server. The adapter translates parameters from the user, information about the request (hostname, URL, referer, cookies, etc.) and other data into the relevant OpenInteract2::Request subclass.

Once the OpenInteract cycle is complete it translates OpenInteract data (content, headers, etc.) into a response to send back to the user via the relevant OpenInteract2::Response subclass. For an example see Apache::OpenInteract2.

Controller

Once the adapter has created the request and response it hands off the processing to the OpenInteract2::Controller object. This reads the URL and asks a set of small objects called action resolvers to create an Action from the URL. Once that action is created it executes the action which generates the primary content for the request. The controller places that content in a larger content scope so you can control common graphical elements (sidebars, menus, etc.) from one place.

Action

Actions are the core of OpenInteract2. Each action provides a discrete set of functionality. What "discrete set" means is up to the developer, but typically this is a set of CRUDS (Create - Remove - Update - Display - Search) operations on a class of objects.

Each action is represented by zero or more URLs, and each operation is typically specified by a task referenced in that URL. So if I created a 'news' action my URLs might look like:

 /news/search/
 /news/create/
 /news/update/
 /news/remove/

Every task returns some sort of content, generally by passing data to a Content Generator which marries it with a template. See OpenInteract2::Action for much more information.

Content Generator

As mentioned above tasks in an Action return content. They normally generate that content by assembling a set of data and passing that data off to a content generator. A content generator is a wrapper around some sort of templating system, such as the Template Toolkit, HTML::Template or Text::Template or even your own homegrown system. (Admit it, you've written your own.)

Each action is associated with a content generator. And you can even associate an action with multiple content generators so you can settle a bet as to which templating system is easiest to use.

CONFIGURATION FILES

These are the major configuration files at the server level. Each package has its own configuration files -- see OpenInteract2::Manual::Packages for more information about packages, and OpenInteract2::Manual::QuickStart for how to modify some of these files to get a server started quickly.

server configuration - conf/server.ini

This is the main OpenInteract2 configuration file. No matter what interface you use you will need to modify this file. It holds the global debugging level, deployment URL, email addresses, directory layouts, database connection data, session information along with lots of other items. Much of it you don't need to edit, but it's useful to give it a once-over so you're familiar with it.

logging configuration - conf/log4perl.conf

This controls logging for the application server. Here you can determine the logging level for the whole server or discrete parts of it, which logfiles get written, when/if they're rolled over, etc. See OpenInteract2::Manual::Logging for a quick intro to logging and read up about Log::Log4perl for details.

interface configuration: Apache - conf/httpd_modperl_solo.conf

This describes a virtual host configuration for running the server inside Apache/mod_perl without a front-end proxy server. It's useful for development but in real life you'd probably want the proxy server (see conf/httpd_static.conf for a proxy configuration and conf/httpd_modperl.conf for the corresponding proxied backend configuration). See OpenInteract2::Manual::AdminApache for more.

interface configuration: standalone - conf/oi2_daemon.ini

Just a few directives to tell the standalone web server what host and port to run on.

COPYRIGHT

Copyright (c) 2002-2005 Chris Winters. All rights reserved.

AUTHORS

Chris Winters <chris@cwinters.com>