You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(381) |
Nov
(176) |
Dec
(310) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(334) |
Feb
(96) |
Mar
(149) |
Apr
(214) |
May
(120) |
Jun
(56) |
Jul
(10) |
Aug
(273) |
Sep
(182) |
Oct
(56) |
Nov
(125) |
Dec
(22) |
2003 |
Jan
(63) |
Feb
(181) |
Mar
(498) |
Apr
(433) |
May
(39) |
Jun
(512) |
Jul
(276) |
Aug
(156) |
Sep
(101) |
Oct
(66) |
Nov
(24) |
Dec
(161) |
2004 |
Jan
(1) |
Feb
(377) |
Mar
(68) |
Apr
(26) |
May
(107) |
Jun
(333) |
Jul
(13) |
Aug
|
Sep
(76) |
Oct
(88) |
Nov
(170) |
Dec
(91) |
2005 |
Jan
(52) |
Feb
(239) |
Mar
(402) |
Apr
(15) |
May
(2) |
Jun
(1) |
Jul
(13) |
Aug
|
Sep
(71) |
Oct
(34) |
Nov
|
Dec
|
2006 |
Jan
(5) |
Feb
(5) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(7) |
Oct
(2) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Chris W. <la...@us...> - 2005-02-26 22:49:15
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21561 Modified Files: InstallPackageStructure.pm Log Message: OIN-134: fix bug when passing empty files to restrict by Index: InstallPackageStructure.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/InstallPackageStructure.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** InstallPackageStructure.pm 26 Feb 2005 04:17:54 -0000 1.13 --- InstallPackageStructure.pm 26 Feb 2005 22:49:05 -0000 1.14 *************** *** 46,50 **** $action, $repository, $package_name ); next PACKAGE unless ( $installer ); ! $installer->install_structure( $self->param( 'file' ) ); my @install_status = $installer->get_status; for ( @install_status ) { --- 46,51 ---- $action, $repository, $package_name ); next PACKAGE unless ( $installer ); ! my @restrict_to = grep { $_ } $self->param( 'file' ); ! $installer->install_structure( @restrict_to ); my @install_status = $installer->get_status; for ( @install_status ) { |
From: Chris W. <la...@us...> - 2005-02-26 05:56:31
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29627/OpenInteract2 Modified Files: Action.pm Util.pm Log Message: OIN-91: move time spec parsing (simple) from OI2::Action to OI2::Util so we can use it when parsing the user expiration time Index: Action.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action.pm,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** Action.pm 25 Feb 2005 00:02:22 -0000 1.68 --- Action.pm 26 Feb 2005 05:56:20 -0000 1.69 *************** *** 595,604 **** foreach my $task ( keys %{ $cache_info } ) { my $time_spec = $cache_info->{ $task }; ! $new_info{ $task } = $self->_translate_cache_time( $time_spec ); } $self->{cache_expire} = \%new_info; } elsif ( $cache_info ) { ! my $cache_time = $self->_translate_cache_time( $cache_info ); $self->{cache_expire} = { CACHE_ALL_KEY() => $cache_time }; } --- 595,606 ---- foreach my $task ( keys %{ $cache_info } ) { my $time_spec = $cache_info->{ $task }; ! $new_info{ $task } = OpenInteract2::Util ! ->time_duration_as_seconds( $time_spec ); } $self->{cache_expire} = \%new_info; } elsif ( $cache_info ) { ! my $cache_time = OpenInteract2::Util ! ->time_duration_as_seconds( $cache_info ); $self->{cache_expire} = { CACHE_ALL_KEY() => $cache_time }; } *************** *** 612,629 **** } - sub _translate_cache_time { - my ( $self, $cache_time ) = @_; - return undef unless ( $cache_time ); - my $cache_secs = $cache_time; - if ( $cache_time =~ /^\s*(\d+)(\w)\s*$/ ) { - my $time = $1; - my $spec = lc $2; - $cache_secs = $time * 60 if ( $spec eq 'm' ); - $cache_secs = $time * 3600 if ( $spec eq 'h' ); - $cache_secs = $time * 86400 if ( $spec eq 'd' ); - } - return $cache_secs; - } - # Since we can't be sure what's affected by a change that would prompt # this call, just clear out all cache entries for this action. (For --- 614,617 ---- Index: Util.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Util.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Util.pm 13 Feb 2005 20:22:52 -0000 1.20 --- Util.pm 26 Feb 2005 05:56:20 -0000 1.21 *************** *** 55,59 **** --- 55,76 ---- } + # evaluate a given time specification as number of seconds + sub time_duration_as_seconds { + my ( $class, $time_spec ) = @_; + return undef unless ( defined $time_spec and $time_spec !~ /^\s*$/ ); + # default: spec is just number of seconds + my $secs = $time_spec; + + if ( $time_spec =~ /^\s*(\d+)(\w)\s*$/ ) { + my $time = $1; + my $spec = lc $2; + $secs = $time * 60 if ( $spec eq 'm' ); + $secs = $time * 3600 if ( $spec eq 'h' ); + $secs = $time * 86400 if ( $spec eq 'd' ); + } + return $secs; + + } ######################################## *************** *** 432,435 **** --- 449,472 ---- '2003-04-01' for April 1, 2003. + B<time_duration_in_seconds( $time_spec )> + + Evaluates simple specifications like '3h' or '391m' into seconds. It + does not handle complex ones like '3d5h'. + + Available specs: m (minutes); h (hours); d (days) + + Returns: number of equivalent seconds; + + Example: + + OpenInteract2::Util->time_duration_in_seconds( '5m' ); + # returns: 300 + + OpenInteract2::Util->time_duration_in_seconds( '5h' ); + # returns: 18000 + + OpenInteract2::Util->time_duration_in_seconds( '2d' ); + # returns: 172800 + =head1 FILE METHODS |
From: Chris W. <la...@us...> - 2005-02-26 05:53:02
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28979/t Modified Files: utils.pl Log Message: update base_user version Index: utils.pl =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/utils.pl,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** utils.pl 25 Feb 2005 05:21:16 -0000 1.92 --- utils.pl 26 Feb 2005 05:52:53 -0000 1.93 *************** *** 53,57 **** base_template => '3.15', base_theme => '2.10', ! base_user => '2.36', comments => '1.19', full_text => '2.58', --- 53,57 ---- base_template => '3.15', base_theme => '2.10', ! base_user => '2.37', comments => '1.19', full_text => '2.58', |
From: Chris W. <la...@us...> - 2005-02-26 05:52:31
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28850/pkg/base_user Modified Files: Changes package.conf Log Message: OIN-91: add management task to cleanup orphaned users and modify the newuser action to read waittime from server configuration Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_user/Changes,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Changes 25 Feb 2005 00:11:39 -0000 1.37 --- Changes 26 Feb 2005 05:52:18 -0000 1.38 *************** *** 1,4 **** --- 1,8 ---- Revision history for OpenInteract package base_user. + 2.37 Sat Feb 26 00:38:57 EST 2005 + + OIN-91: add configurable removal time to new user action + 2.36 Thu Feb 24 00:31:11 EST 2005 Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_user/package.conf,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** package.conf 25 Feb 2005 00:11:39 -0000 1.37 --- package.conf 26 Feb 2005 05:52:18 -0000 1.38 *************** *** 1,4 **** name base_user ! version 2.36 author Chris Winters (ch...@cw...) url http://www.openinteract.org/ --- 1,4 ---- name base_user ! version 2.37 author Chris Winters (ch...@cw...) url http://www.openinteract.org/ |
From: Chris W. <la...@us...> - 2005-02-26 05:52:28
|
Update of /cvsroot/openinteract/OpenInteract2/sample/website/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28850/sample/website/conf Modified Files: server.ini Log Message: OIN-91: add management task to cleanup orphaned users and modify the newuser action to read waittime from server configuration Index: server.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/sample/website/conf/server.ini,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** server.ini 25 Feb 2005 05:39:16 -0000 1.51 --- server.ini 26 Feb 2005 05:52:18 -0000 1.52 *************** *** 277,280 **** --- 277,284 ---- # 'create_password' management task. # + # initial_login_expires: amount of time after which a 'cleanup_user' + # task (if run) will delete a user; if you never cleanup orphaned + # logins don't worry about this. + # # *_field: These are the fields used to read in the username and # password from the user and are used in the 'login_box' component *************** *** 304,317 **** disable_superuser_password_change = 0 ! login_field = login_login_name ! password_field = login_password ! remember_field = login_remember ! always_remember = 0 ! required = 0 ! required_url = /login.html ! required_skip = ^/$ ! required_skip = ^/index.html$ ! required_skip = ^/Login.* ! required_skip = ^/help.* --- 308,322 ---- disable_superuser_password_change = 0 ! initial_login_expires = 24h ! login_field = login_login_name ! password_field = login_password ! remember_field = login_remember ! always_remember = 0 ! required = 0 ! required_url = /login.html ! required_skip = ^/$ ! required_skip = ^/index.html$ ! required_skip = ^/Login.* ! required_skip = ^/help.* |
From: Chris W. <la...@us...> - 2005-02-26 05:52:28
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28850/lib/OpenInteract2/Manage/Website Added Files: CleanOrphanedUsers.pm Log Message: OIN-91: add management task to cleanup orphaned users and modify the newuser action to read waittime from server configuration --- NEW FILE: CleanOrphanedUsers.pm --- package OpenInteract2::Manage::Website::CleanOrphanedUsers; # $Id: CleanOrphanedUsers.pm,v 1.1 2005/02/26 05:52:18 lachoy Exp $ use strict; use base qw( OpenInteract2::Manage::Website ); use Log::Log4perl qw( get_logger ); use OpenInteract2::Constants qw( :log ); use OpenInteract2::Context qw( CTX ); use OpenInteract2::Exception qw( oi_error ); $OpenInteract2::Manage::Website::CleanOrphanedUsers::VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/); sub get_name { return 'clean_users'; } sub get_brief_description { return "Remove users who created themselves via the wizard but did " . "not login within the time alloted."; } sub run_task { my ( $self ) = @_; my $users = OpenInteract2::User->fetch_group({ where => 'removal_date IS NOT NULL', order => 'removal_date DESC', }); my $now = CTX->create_date(); my @to_remove = (); foreach my $user ( @{ $users } ) { if ( $user->{removal_date} < $now ) { push @to_remove, $user; } } my $total = scalar @to_remove; my ( $success, $failed ) = ( 0, 0 ); my @errors = (); foreach my $user ( @to_remove ) { eval { $user->remove }; if ( $@ ) { $failed++; push @errors, "$@"; } else { $success++; } } if ( $success == $total ) { $self->_ok( 'clean users', "All available users ($total) removed" ); } else { my $msg = "$total users to delete, $success ok, $failed failed; errors:\n" . join( "\n", @errors ); $self->_fail( 'clean users', $msg ); } } OpenInteract2::Manage->register_factory_type( get_name() => __PACKAGE__ ); 1; __END__ =head1 NAME OpenInteract2::Manage::Website::CleanOrphanedUsers - Remove users who created an account but never logged in =head1 SYNOPSIS #!/usr/bin/perl use strict; use OpenInteract2::Manage; my $website_dir = '/home/httpd/mysite'; my $task = OpenInteract2::Manage->new( 'clean_users', website_dir => $website_dir ); my @status = $task->execute; foreach my $s ( @status ) { my $ok_label = ( $s->{is_ok} eq 'yes' ) ? 'OK' : 'NOT OK'; my $default_label = ( $s->{is_default} eq 'yes' ) ? ' (default) ' : ''; print "Status OK? $s->{is_ok}\n", "$s->{message}\n"; } =head1 STATUS INFORMATION No additional information. =head1 COPYRIGHT Copyright (C) 2005 Chris Winters. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHORS Chris Winters, E<lt>ch...@cw...E<gt> |
From: Chris W. <la...@us...> - 2005-02-26 05:52:28
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_user/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28850/pkg/base_user/OpenInteract2/Action Modified Files: NewUser.pm Log Message: OIN-91: add management task to cleanup orphaned users and modify the newuser action to read waittime from server configuration Index: NewUser.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_user/OpenInteract2/Action/NewUser.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** NewUser.pm 5 Dec 2004 08:51:21 -0000 1.21 --- NewUser.pm 26 Feb 2005 05:52:18 -0000 1.22 *************** *** 15,19 **** my ( $log ); ! use constant REMOVAL_TIME => 60 * 60 * 24; # 1 day sub display { --- 15,19 ---- my ( $log ); ! use constant DEFAULT_REMOVAL_TIME => 60 * 60 * 24; # 1 day sub display { *************** *** 133,139 **** $log ||= get_logger( LOG_APP ); - # Now, create an entry in the user table; note that we set the removal - # date to now plus whatever REMOVAL_TIME is set to - my $new_user = CTX->lookup_object( 'user' )->new; $new_user->{login_name} = $login; --- 133,136 ---- *************** *** 141,145 **** $new_user->{password} = $password; $new_user->{theme_id} = CTX->lookup_default_object_id( 'theme' ); ! $new_user->{removal_date} = CTX->create_date({ epoch => time + REMOVAL_TIME }); eval { $new_user->save }; if ( $@ ) { --- 138,148 ---- $new_user->{password} = $password; $new_user->{theme_id} = CTX->lookup_default_object_id( 'theme' ); ! my $removal_deadline = time + DEFAULT_REMOVAL_TIME; ! my $login_info = CTX->lookup_login_config(); ! if ( my $time_spec = $login_info->{initial_login_expires} ) { ! $removal_deadline = time + OpenInteract2::Util ! ->time_duration_as_seconds( $time_spec ); ! } ! $new_user->{removal_date} = CTX->create_date({ epoch => $removal_deadline }); eval { $new_user->save }; if ( $@ ) { |
From: Chris W. <la...@us...> - 2005-02-26 05:07:06
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18131 Modified Files: Changes.pod Log Message: latest changes Index: Changes.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Changes.pod,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** Changes.pod 25 Feb 2005 05:42:19 -0000 1.67 --- Changes.pod 26 Feb 2005 05:06:57 -0000 1.68 *************** *** 108,111 **** --- 108,122 ---- =back + L<OpenInteract2::Action::CommonSearch> + + =over 4 + + =item * + + OIN-122: Set 'total_hits', 'total_pages' and 'page_num' even if you're + not using paged search results. + + =back + L<OpenInteract2::Action::CommonUpdate> *************** *** 202,205 **** --- 213,225 ---- =back + L<OpenInteract2::Manage::Website::InstallPackageStructure> + + =over 4 + + OIN-134: Add 'file' parameter to pass to modified + L<OpenInteract2::SQLInstall> C<install_structure()>. + + =back + L<OpenInteract2::Package> *************** *** 288,291 **** --- 308,323 ---- =back + L<OpenInteract2::SQLInstall> + + =over 4 + + =item * + + OIN-134: Allow C<install_structure()> to optionally take one or more + files as arguments. If specified the installer will only process files + by that name. This allows for incremental upgrades. + + =back + L<OpenInteract2::TT2::Plugin> *************** *** 325,328 **** --- 357,383 ---- =back + =head2 Package Updates + + The following packages have been updated since the last version. See + the 'Changes' file for each to view the modifications: + + OpenInteract 1.99_05 -> 1.99_06 + ----------------------------------- + base: 2.11 -> 2.12 + base_box: 2.17 -> 2.17 + base_error: 2.10 -> 3.00 + base_group: 2.16 -> 2.16 + base_page: 2.28 -> 2.28 + base_security: 2.18 -> 2.18 + base_template: 3.15 -> 3.15 + base_theme: 2.10 -> 2.10 + base_user: 2.35 -> 2.36 + comments: 1.18 -> 1.19 + full_text: 2.58 -> 2.58 + lookup: 2.07 -> 2.07 + news: 2.20 -> 2.20 + object_activity: 2.11 -> 2.11 + system_doc: 2.08 -> 2.08 + whats_new: 2.10 -> 2.10 |
From: Chris W. <la...@us...> - 2005-02-26 05:06:43
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18028 Modified Files: Architecture.pod Log Message: add references to action resolvers; other small fixes Index: Architecture.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Architecture.pod,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Architecture.pod 25 Feb 2005 05:42:06 -0000 1.11 --- Architecture.pod 26 Feb 2005 05:06:33 -0000 1.12 *************** *** 19,26 **** MVC was developed in Smalltalk and targeted at desktop applications. It's meant to decouple the various graphical widgets ! from the actions resulting from them. While some (see link to Andy ! Wardley's discussion in L<SEE ALSO>) have argued that MVC isn't ! appropriate for web applications, it's still useful to categorize how ! the different pieces of the application are separated. =head2 Model --- 19,26 ---- MVC was developed in Smalltalk and targeted at desktop applications. It's meant to decouple the various graphical widgets ! from the actions resulting from them. While some have argued that MVC ! isn't appropriate for web applications (see link to Andy Wardley's ! discussion in L<SEE ALSO>), it's still useful to categorize how the ! different pieces of the application are separated. =head2 Model *************** *** 79,89 **** =head2 Controller ! Also known as a dispatcher, this is what decides which model (Action) ! is called and how to represent the data from the outside world. These ! are represented by the Controller object which dispatches the user's ! request, the Request object which takes the user's inputs (however ! they arrive) and translates them to a standard format, and the ! Response object which translates the work done during the request ! cycle into something the user can understand. For a web application: --- 79,89 ---- =head2 Controller ! Also known as a dispatcher, this uses a utility (ActionResolver) to ! decide which model (Action) is called and how to represent the data ! from the outside world. These are represented by the Controller object ! which dispatches the user's request, the Request object which takes ! the user's inputs (however they arrive) and translates them to a ! standard format, and the Response object which translates the work ! done during the request cycle into something the user can understand. For a web application: *************** *** 99,108 **** =item * ! The Controller instantiates the Action matching the URL as reported by ! the Request, populates the Action with any necessary information and ! executes the Action, capturing its output. It doesn't care what the ! Action does or how the Action does it. The Controller will also place ! this Action's output in a larger context (e.g., as part of a larger ! web page) as necessary. =item * --- 99,109 ---- =item * ! The Controller hands the URL off to the ActionResolver, which ! instantiates a number of small objects in a chain of ! responsibility. It then asks each if it's able to create an action ! from the given URL. Once created the Controller executes the Action, ! capturing its output. It doesn't care what the Action does or how the ! Action does it. The Controller will also place this Action's output in ! a larger context (e.g., as part of a larger web page) as necessary. =item * *************** *** 117,129 **** =head2 Overview ! The Context (abbrev: CTX) glues the system together and is therefore ! used everywhere. It holds all application configuration information ! and provides a central lookup mechanism for actions, content ! generators, controllers and SPOPS object classes. ! It is a singleton (there's only one in the system at any time) and ! this singleton can be imported from the ! L<OpenInteract2::Context|OpenInteract2::Context> class since it's used ! fairly often. =head2 Creating the Context --- 118,129 ---- =head2 Overview ! The Context (abbrev: CTX) glues the system together so you'll see it a ! lot.It holds all application configuration information and provides a ! central lookup mechanism for actions, content generators, controllers ! and SPOPS object classes. ! It is a singleton (there's only one in the system at any time) and you ! can import this singleton reference from the ! L<OpenInteract2::Context|OpenInteract2::Context> class. =head2 Creating the Context *************** *** 134,138 **** when bootstrapping a new website into existence, and this is already done for you in ! L<OpenInteract2::Manage::Website::Create|OpenInteract2::Manage::Website::Create>. So normally it looks something like this: --- 134,138 ---- when bootstrapping a new website into existence, and this is already done for you in ! L<OpenInteract2::Manage::Website::Create|OpenInteract2::Manage::Website::Create>.) So normally it looks something like this: *************** *** 142,147 **** }); ! Once it's created the C<CTX> symbol can be imported and used anywhere, ! like this: use OpenInteract2::Context qw( CTX ); --- 142,147 ---- }); ! Once it's created the C<CTX> symbol from L<OpenInteract2::Context> can ! be imported and used anywhere, like this: use OpenInteract2::Context qw( CTX ); *************** *** 177,183 **** Creating an adapter is not difficult. Adapter classes tend to be fairly short as most of the work is done in in the ! L<OpenInteract2::Request|OpenInteract2::Request>/L<OpenInteract2::Response|OpenInteract2::Response> ! subclasses. For instance, here's the full adapter for Apache/mod_perl ! 1.x: package Apache::OpenInteract2; --- 177,183 ---- Creating an adapter is not difficult. Adapter classes tend to be fairly short as most of the work is done in in the ! L<OpenInteract2::Request|OpenInteract2::Request> and ! L<OpenInteract2::Response|OpenInteract2::Response> subclasses. For ! instance, here's the full adapter for Apache/mod_perl 1.x: package Apache::OpenInteract2; *************** *** 241,246 **** # Create the context... ! my $ctx = OpenInteract2::Context->create( ! $base_config, { temp_lib_create => 'create' } ); # ...let the context know what type of adapter we are --- 241,245 ---- # Create the context... ! my $ctx = OpenInteract2::Context->create( $base_config ); # ...let the context know what type of adapter we are *************** *** 316,322 **** =back ! Additionally if your adapter is more of a standalone service (like the ! C<oi2_daemon>) that spawns off children/threads for requests, you need ! to also be aware of the following: =over 4 --- 315,321 ---- =back ! If your adapter is more of a standalone service (like the ! C<oi2_daemon>) that spawns off children/threads for requests, you also ! need to also be aware of the following: =over 4 *************** *** 346,356 **** processing to the L<OpenInteract2::Controller|OpenInteract2::Controller> object. Now ! we're entirely inside the OI2 server environment. This reads the ! action and task from the request and creates the relevant action ! object that will generate the content. It knows which action object to ! create through a URL-to-action mapping created at Context startup. The ! most-used controller (L<OpenInteract2::Controller::MainTemplate|OpenInteract2::Controller::MainTemplate>) ! places the generated content in a larger scope so you can control common graphical elements (sidebars, menus, etc.) from once place. Another controller --- 345,394 ---- processing to the L<OpenInteract2::Controller|OpenInteract2::Controller> object. Now ! we're entirely inside the OI2 server environment. Its main ! responsibility is to match up the URL with an L<OpenInteract2::Action> ! object and execute it, returning its generate content to the browser. ! ! To match up the URL with the Action we use a chain of responsibility ! pattern, organized by L<OpenInteract2::ActionResolver>. Children ! classes under this namespace are C<require>d at server startup. So for ! each request the main ActionResolver class will instantiate all its ! children and pass each the L<OpenInteract2::Request> object and ! URL. Each child can decide to match up the URL with an ! L<OpenInteract2::Action> object or do nothing. ! ! The ActionResolvers shipped with the system can respond to: ! ! =over 4 ! ! =item B<user directory requests> ! ! So something like C<http://foo.com/~lucyliu/> will get recognized by ! this resolver and matched to a user action. A successive item in the ! URL (e.g., '/~lucyliu/profile/') will get assigned as the action's ! task. ! ! =item B<name from URL> ! ! This will get used most often -- from something like ! C<http://foo.com/news/latest/> it finds the name ('news') and tries to ! lookup an action based on it. If found it also assigns the next item ! in the URL as the action's task. ! ! =item B<action not found or action missing> ! ! If the name in the URL wasn't matched to a URL we assign it to the ! 'not found' action. This is a catch-all action and very useful if you ! want to map what look like simple page requests to an ! L<OpenInteract2::Action> object. By default we use the 'page' action. ! ! And if there was no action in the URL (e.g., C<http://foo.com/>) we ! invoke the 'none' action. This also uses the 'page' action. ! ! =back ! ! Once the action's found we call C<execute()> on it, which generates ! its content. The most-used controller (L<OpenInteract2::Controller::MainTemplate|OpenInteract2::Controller::MainTemplate>) ! places that generated content in a larger scope so you can control common graphical elements (sidebars, menus, etc.) from once place. Another controller *************** *** 364,369 **** 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 SCRUD (Search - CReate - ! Update - Delete) operations on a class of objects. Each action is represented by zero or more URLs, and each operation is --- 402,407 ---- 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 - Update - ! Delete - Search) operations on a class of objects. Each action is represented by zero or more URLs, and each operation is *************** *** 371,374 **** --- 409,417 ---- action my URLs might look like: + http://foo.com/news/ + http://foo.com/news/display/ + http://foo.com/news/search_form/ + http://foo.com/news/search/ + Every task returns some sort of content, generally by passing data to a Content Generator which marries it with a template. See *************** *** 462,482 **** request and response objects created earlier. ! The controller asks the request for the action name and asks the ! context for an action object of that name. (It's always a subclass of ! L<OpenInteract2::Action|OpenInteract2::Action>.) If the action name ! exists but is not found we use the action named in the ! C<action_info.not_found> server configuration key. If the action name ! doesn't exist we use the action from C<action_info.none>. ! ! Once the action is found we assign it the task (if available) as ! reported by the request. =head2 Step 5: Adapter Executes Controller ! If created properly the adapter calls C<execute()> on the ! controller. This starts the content generation process running. ! The controller will call C<execute()> on the action which returns the ! content for it. =head2 Step 6: Action Finds Task --- 505,522 ---- request and response objects created earlier. ! The controller invokes a chain of responsibility provided by ! L<OpenInteract2::ActionResolver> to figure out what action to create ! based on the URL. =head2 Step 5: Adapter Executes Controller ! If the controller was created properly the adapter calls C<execute()> ! on it. This starts the content generation process running. ! The controller will call C<execute()> on the action which starts the ! action's content generation process. ! ! If the controller was not created properly it threw an exception which ! we return as content. =head2 Step 6: Action Finds Task |
From: Chris W. <la...@us...> - 2005-02-26 05:06:09
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17792 Modified Files: Logging.pod Log Message: change 'database' references to 'filesystem Index: Logging.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Logging.pod,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Logging.pod 30 Nov 2004 00:24:31 -0000 1.4 --- Logging.pod 26 Feb 2005 05:05:58 -0000 1.5 *************** *** 121,124 **** --- 121,126 ---- So the following would write to the appender: + # Note: LOG_OI and LOG_CONFIG are constants; more below + my $log = get_logger( LOG_OI ); $log->info( "This info message will get written" ); *************** *** 156,161 **** OI2 comes with a custom appender which takes a message, creates an ! error object from it and saves it to the database. From there you can ! browse it using the OI admin tools. WARNING: Do not set the 'Threshold' too low on the OI --- 158,163 ---- OI2 comes with a custom appender which takes a message, creates an ! error object from it and saves it to your filesystem organized by ! date. From there you can browse it using the OI admin tools. WARNING: Do not set the 'Threshold' too low on the OI *************** *** 173,176 **** --- 175,180 ---- L<OpenInteract2::Log::OIAppender|OpenInteract2::Log::OIAppender> + L<OpenInteract2::ErrorStorage|OpenInteract2::ErrorStorage> + =head1 COPYRIGHT |
From: Chris W. <la...@us...> - 2005-02-26 05:05:22
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17622 Modified Files: Packages.pod Log Message: cosmetic Index: Packages.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Packages.pod,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Packages.pod 30 Nov 2004 01:55:02 -0000 1.8 --- Packages.pod 26 Feb 2005 05:05:13 -0000 1.9 *************** *** 18,24 **** functionality while the core framework handles the storage interface (e.g., putting your objects in a database), dispatches URL requests to ! your objects (this is called I<handling> an I<action>), security, ! authentication and authorization, session management and a few other ! details. An application usually defines persistent objects that keep state from --- 18,23 ---- functionality while the core framework handles the storage interface (e.g., putting your objects in a database), dispatches URL requests to ! your objects, security, authentication and authorization, session ! management and lots of other features. An application usually defines persistent objects that keep state from *************** *** 29,34 **** OpenInteract2 comes with tools to install, uninstall and query ! currently installed packages. This greatly simplifies the task of ! creating, testing and distributing your application. =head1 PACKAGE CONTENTS --- 28,37 ---- OpenInteract2 comes with tools to install, uninstall and query ! packages currently installed to a website. This greatly simplifies the ! task of creating, testing and distributing your application. ! ! You can also bundle a package up in a CPAN-friendly distribution and ! use Perl's built-in tools to install the package to your Perl ! installation as well as to your website. =head1 PACKAGE CONTENTS |
From: Chris W. <la...@us...> - 2005-02-26 05:04:59
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17454 Modified Files: Tutorial.pod Log Message: mostly small fixes, but mainly get rid of the 'source_dir' discussion Index: Tutorial.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Tutorial.pod,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Tutorial.pod 30 Nov 2004 03:04:04 -0000 1.26 --- Tutorial.pod 26 Feb 2005 05:04:50 -0000 1.27 *************** *** 18,31 **** come back when you're done. - =head2 Install OI2 - - Not only must OI2 be installed, but you also need to either have - access to the distribution source B<or> your friendly local sysadmin - needs to create a source directory. This is as simple as: - - $ oi2_manage create_source_dir \ - --distribution_dir=/private/path/to/OpenInteract-2.00 \ - --source_dir=/public/path/to/oi_source - =head2 Create a website --- 18,21 ---- *************** *** 51,54 **** --- 41,61 ---- data about a book. + =head2 Looking for shortcuts? + + If you want to get something running in the fastest manner possible we + can generate a simple CRUDS application for you. (CRUDS: CReate Update + Delete Search) Just run something like the following: + + $ oi2_manage easy_app --package=book --table=book \ + --dsn=DBI:Pg:dbname=mylibrary --username=foo --password=bar + + This will create a simple application built off a table 'book' with + templates and objects for searching, creating, updating and removing + objects. (More at + L<OpenInteract2::Manage::Package::CreatePackageFromTable>.) + + Since this is a tutorial we'll assume you want to read to learn, so on + we go. + =head2 Generating the skeleton *************** *** 59,65 **** to the directory under which the package will be created: ! $ oi2_manage create_package \ ! --source_dir=/public/path/to/oi_source \ ! --package=book And here's what you'll see: --- 66,70 ---- to the directory under which the package will be created: ! $ oi2_manage create_package --package=book And here's what you'll see: *************** *** 138,144 **** We'll just make this very easy to start out with. Unlike the venerable intro database shipped with Sybase products, we're not defining ! separate tables for authors, publishers, book artists, etc. We'll just ! define a single table and make some assumptions. Here's the table that ! we'll save to C<book/struct/book.sql>: CREATE TABLE book ( --- 143,150 ---- We'll just make this very easy to start out with. Unlike the venerable intro database shipped with Sybase products, we're not defining ! separate tables for authors, publishers, book artists, etc. (See ! L<OpenInteract2::Manual::TutorialAdvanced> for some of that...) We'll ! just define a single table and make some assumptions. Here's the table ! that we'll save to C<book/struct/book.sql>: CREATE TABLE book ( *************** *** 670,691 **** 71: 72: 1; ! 73: ! 74: __END__ ! 75: ! 76: =head1 NAME ! 77: ! 78: OpenInteract2::Action::Book - Handler for this package ! 79: ! 80: =head1 SYNOPSIS ! 81: ! 82: =head1 DESCRIPTION ! 83: ! 84: =head1 BUGS ! 85: ! 86: =head1 TO DO ! 87: ! 88: =head1 SEE ALSO ! 89: ! 90: =head1 AUTHORS Excellent. We'll just leave the 'hello()' method as-is for right now, --- 676,680 ---- 71: 72: 1; ! 73: ... documentation below here... Excellent. We'll just leave the 'hello()' method as-is for right now, *************** *** 1281,1288 **** package. First edit the C<book/package.conf> file to reflect the new version number and add an entry to the top of the 'Changes' ! file. Next, export it and install the distribution to your website: ! $ oi2_manage export_package ! $ oi2_manage install_package --package_file=book-0.02.zip Restart the server and try to run an empty search again. There's the --- 1270,1277 ---- package. First edit the C<book/package.conf> file to reflect the new version number and add an entry to the top of the 'Changes' ! file. Next, export it and install the distribution to your website ! with a single command: ! $ oi2_manage package_all Restart the server and try to run an empty search again. There's the *************** *** 1433,1438 **** C<book/package.conf>.) ! $ oi2_manage export_package ! $ oi2_manage install_package --package_file=book-0.03.zip Restart the server and type in the '/book' URL again. Looks the same, --- 1422,1426 ---- C<book/package.conf>.) ! $ oi2_manage package_all Restart the server and type in the '/book' URL again. Looks the same, *************** *** 1501,1508 **** L<OpenInteract2::Action::CommonSearch|OpenInteract2::Action::CommonSearch> provides another parameter to the template, 'total_hits', which we can ! use to display how many entries we found. (Note that 'total_hits' is ! only provided when you're using paged results, but since that's the ! default and we didn't change the setting we can use the parameter. See ! the docs for more.) Finally, on line 25 we had to modify our 'FOREACH' loop into a 'WHILE' --- 1489,1493 ---- L<OpenInteract2::Action::CommonSearch|OpenInteract2::Action::CommonSearch> provides another parameter to the template, 'total_hits', which we can ! use to display how many entries we found. Finally, on line 25 we had to modify our 'FOREACH' loop into a 'WHILE' *************** *** 1669,1674 **** reflect the updates, bundle the package up and install it: ! $ oi2_manage export_package ! $ oi2_manage install_package --package_file=book-0.05.zip Restart your server and run a search, then click on a title. There's --- 1654,1658 ---- reflect the updates, bundle the package up and install it: ! $ oi2_manage package_all Restart your server and run a search, then click on a title. There's *************** *** 1839,1844 **** reflect the updates, bundle the package up and install it: ! $ oi2_manage export_package ! $ oi2_manage install_package --package_file=book-0.06.zip Restart your server, run a search, and drill down to an object. You --- 1823,1827 ---- reflect the updates, bundle the package up and install it: ! $ oi2_manage package_all Restart your server, run a search, and drill down to an object. You *************** *** 1931,1936 **** then put your new package in the website: ! $ oi2_manage export_package ! $ oi2_manage install_package --package_file=book-0.07.zip Now try to add a new object then do a search, display and edit on it. --- 1914,1918 ---- then put your new package in the website: ! $ oi2_manage package_all Now try to add a new object then do a search, display and edit on it. *************** *** 1984,1988 **** $ oi2_manage export_package - $ oi2_manage install_package --package_file=book-0.08.zip See how it works! --- 1966,1969 ---- |
From: Chris W. <la...@us...> - 2005-02-26 05:04:12
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17223 Modified Files: TutorialAdvanced.pod Log Message: OIN-92: add documentation about adding and using a lookup table and a template-only action Index: TutorialAdvanced.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/TutorialAdvanced.pod,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TutorialAdvanced.pod 17 Feb 2004 04:30:11 -0000 1.4 --- TutorialAdvanced.pod 26 Feb 2005 05:04:04 -0000 1.5 *************** *** 1,2 **** --- 1,3 ---- + [%- TAGS star -%] =head1 NAME *************** *** 5,33 **** =head1 SYNOPSIS ! You are getting sleepy... ! =head1 COMMON EDITING: ADDING VALIDATION ! =head1 ADDING OBJECT BEHAVIORS ! =head2 Define the class ! =head2 Add to declaration ! =head1 ADDING SECURITY ! =head2 Secure the action ! =head2 Secure individual objects ! =head1 ADDING SPOPS BEHAVIOR ! =head1 COMMON SEARCHING: USING MULTIPLE TABLES ! =head1 SETUP LOOKUP ACTION ! =head1 SETUP TEMPLATE-ONLY ACTION ! =head1 USING MULTIPLE DATASOURCES =head1 SEE ALSO --- 6,335 ---- =head1 SYNOPSIS ! This document will walk through some of the more advanced (but still ! common) actions you can do with OpenInteract2. ! For the examples in this document we'll rely on the 'books' ! application created in L<OpenInteract2::Manual::Tutorial>. ! =head1 ACTIONS: SETTING UP A LOOKUP TABLE ! =head2 Create the data structure ! One of the immediate problems with our 'book' record is that there's ! no way to categorize them. Sure, most books are cross-category -- my ! favorite: 'Computer Programming' + 'Self-Help' -- but our books don't ! even have B<one>. ! But we don't want the user to type in any old category. We should be ! able to define a list of known categories then allow her to choose one ! of them when creating or updating a book. ! So, first we'll create a table to hold these categories. It's commonly ! known as a 'lookup' table because it's so simple, all we do is find ! values: ! CREATE TABLE book_category ( ! category_id %%INCREMENT%%, ! category varchar(25) not null, ! primary key( category_id ) ! ); ! Store this in C<struct/book_category.sql> and if you're using ! Oracle/PostgreSQL add a sequence in ! C<struct/book_category_sequence.sql>: ! CREATE SEQUENCE book_category_seq ! Now we'll need to add the table and sequence to our SQL installer ! class. In C<OpenInteract2/SQLInstall/Book.pm> change: ! my %FILES = ( ! oracle => [ 'book.sql', 'book_sequence.sql' ], ! pg => [ 'book.sql', 'book_sequence.sql' ], ! default => [ 'book.sql' ], ! ); ! to: ! ! my @tables = qw( book.sql book_category.sql ); ! my @sequences = qw( book_sequence.sql book_category_sequence.sql ); ! my %FILES = ( ! oracle => [ @tables, @sequences ], ! pg => [ @tables, @sequences ], ! default => [ @tables ], ! ); ! ! Also add an SPOPS class to C<conf/spops_book_category.ini>: ! ! [book_category] ! class = OpenInteract2::BookCategory ! isa = ! field = ! field_discover = yes ! id_field = category_id ! increment_field = yes ! sequence_name = book_category_seq ! is_secure = no ! no_insert = category_id ! no_update = category_id ! base_table = book_category ! name = category ! object_name = Book Category ! ! [book_category display] ! ACTION = lookups ! TASK = ! ! =head2 Setup lookup action ! ! And here's the interesting part -- to add simple editing functionality ! to your lookup table you can just add the following action to ! C<conf/action.ini>: ! ! [book_category] ! action_type = lookup ! object_key = book_category ! title = Book Categories ! field_list = category ! label_list = Category ! size_list = 25 ! order = category ! url_none = yes ! ! The 'action_type' setting is the important one. OI2 references a list ! of action types in the server configuration (key: ! 'action_type'). Think of these as parent actions to yours -- all they ! require is configuration and you're set. In this case you need to set: ! ! =over 4 ! ! =item B<object_key> ! ! SPOPS name of your object. ! ! =item B<title> ! ! Title of the values to edit. ! ! =item B<field_list> ! ! List of fields you want to edit. (We've only got one.) ! ! =item B<label_list> ! ! List of labels for each of the fields in C<field_list>, in the same ! order. ! ! =item B<size_list> ! ! Size of text fields to edit for each of the fields in C<field_list>, ! in the same order. ! ! =item B<order> ! ! Field/ORDER-BY clause used to retrieve the data. ! ! =back ! ! See the documentation for the C<lookup> package for more information ! and additional options you can set. ! ! Add these files to your C<MANIFEST>, modify your C<Changes> and ! C<package.conf> and update your site. You can install the SQL ! structures like this (assuming C<OPENINTERACT2> environment variable ! is set to your website): ! ! $ oi2_manage install_sql_structure --package=book \ ! --file=book_category.sql --file=book_category_sequence.sql ! ! Back in the original tuturial we ran the 'install_sql' management ! task. That's really just a wrapper around three separate tasks: ! 'install_sql_structure', 'install_sql_data' and ! 'install_sql_security'. Additionally, since we don't want to try to ! reinstall our 'book.sql' we're giving it an argument to limit the ! files it will operate on. ! ! Once you restart your server go to the 'Lookup Tables' link in your ! 'Admin Tools' box. (Or just go to the '/lookups/' URL.) You'll see ! 'Book Categories' there. Click on the link and you'll see a set of ! text entry fields, one per table row. ! ! Each entry will become a new category, so enter a few and click ! 'Save'. You'll get a status message with your entries and get taken ! back to the initial lookup tables page. Click on 'Book Categories' ! again and you'll see your categories. You can now add, edit and remove ! at will. ! ! =head2 Add field to table ! ! So now we need to add our category to the book table. Using whatever ! database tool you're comfortable with add the following definition: ! ! category_id int null ! ! When you restart the server all your 'book' objects will have the new ! property 'category_id'. Since we set 'field_discover' to 'yes' in the ! previous tutorial we didn't need to tell SPOPS or OI2 about it. ! ! But we still can't assign the category from our book editing form... ! ! =head2 Source values for field from lookup ! ! What we want to do is present a list of all the available categories ! to the user when she's editing a book. But how do we do that? ! Remember, we're using one of the Common actions and didn't actually ! write any code to do inserts and updates. ! ! Fortunately the Common actions have a callback just for this. It's ! always named "customize" -- "_display_add_customize", ! "_display_form_customize", etc. ! ! So in our action L<OpenInteract2/Action/Book.pm> we'll implement these ! callbacks. This is very similar to how we added our list of publishers ! to the search form but instead of plain strings as the source we're ! using objects: ! ! So add the following method: ! ! sub _add_categories { ! my ( $self, $template_params ) = @_; ! $template_params->{categories} = ! OpenInteract2::BookCategory->fetch_group({ order => 'category' }); ! } ! ! And reference it: ! ! sub _display_add_customize { ! my ( $self, $template_params ) = @_; ! $self->_add_categories( $template_params ); ! } ! ! sub _display_form_customize { ! my ( $self, $template_params ) = @_; ! $self->_add_categories( $template_params ); ! } ! ! Then add a reference to those categories in your data editing form: ! ! [%- count = count + 1 -%] ! [% INCLUDE label_form_select_row( label = 'Category' ! name = 'category_id', ! picked = book.category, ! list = categories, ! value_field = 'category_id', ! label_field = 'category', ! first_label = '---Categories---' ) -%] ! ! Assuming you have categrories: ! ! category_id category ! --------------------- ! 1 Self-Help ! 2 Perl ! 3 Regular Expressions ! 4 Vegetarian Cooking ! ! You'll see something like this (remember that we sorted the categories ! when we assigned them to the template parameters): ! ! <select name="category_id"> ! <option value="">---Categories---</option> ! <option value="2">Perl</option> ! <option value="3">Regular Expressions</option> ! <option value="1">Self-Help</option> ! <option value="4">Vegetarian Cooking</option> ! </select> ! ! =head2 Add fields to action configuration ! ! Finally, since we configured our SPOPS object with 'field_discover' we ! didn't have to add the field to our SPOPS configuration. But since ! common action configurations don't have this feature yet you'll have ! to add to your C<conf/action.ini> under '[book]' these keys and ! values: ! ! c_update_fields = category_id ! c_add_fields = category_id ! ! =head1 ACTIONS: A TEMPLATE CAN BE AN ACTION ! ! =head2 Another action type: template_only ! ! Another way to create an action without any code is to point it ! directly at a template. This is very useful for embeddable ! components. For instance, many actions come with a 'box' that has ! pointers to common actions. Say we wanted to create a 'Book Actions ! Box' that had links like 'Search', 'Add' and (when you're on a book ! record), 'Edit' and 'Remove'. ! ! We'll go backwards first this time, defining the action first. In your ! C<conf/action.ini> add the following: ! ! [book_box] ! action_type = template_only ! template = book::toolbox ! title = Book Tools ! url_none = yes ! ! We can now reference 'book_box' just like any other action. But first ! we need to create a simple template in C<template/toolbox.tmpl>: ! ! [%- search_url = OI.make_url( ACTION = 'book', TASK = 'search' ); ! add_url = OI.make_url( ACTION = 'book', TASK = 'display_add' ); -%] ! - <a href="[% search_url %]">Search</a> <br /> ! - <a href="[% add_url %]">Add</a> <br /> ! [% IF book -%] ! [%- edit_url = OI.make_url( ACTION = 'book', TASK = 'display_form', ! book_id = book.id ); ! remove_url = OI.make_url( ACTION = 'book', TASK = 'remove', ! book_id = book.id ) -%] ! - <a href="[% search_url %]">Edit</a> <br /> ! - <a href="[% add_url %]">Remove</a><br /> ! [% END %] ! ! We're done. Just add the new file to your C<MANIFEST> and install. ! ! You can execute the content from within a template too. For instance, ! just add the following to any template: ! ! [% OI.action_execute( 'book_box' ) %] ! ! Once it's processed you'll see your content. You do something similar ! when you place the action content in a box: ! ! [% OI.box_add( 'book_box' ) %] ! ! The 'box_add' method stores the action away for execution later (by ! another action, L<OpenInteract2::Action::Box>). But since we've ! wrapped our template as an action we can now treat it like every other ! component. ! ! It's also worth mentioning that we can still reference the template ! with Template Toolkit directives, like: ! ! [% INCLUDE book::toolbox %] ! ! The only differences are that when we call C<OI.action_execute()> we ! go through the action's security checks as well as use its cached ! content if available. The C<INCLUDE> call does not -- but it's also ! faster. ! ! =head1 ACTIONS: ADDING VALIDATION TO COMMON TASKS ! ! =head1 ACTIONS: USING MULTIPLE TABLES WITH COMMON SEARCHING ! ! =head1 ACTIONS: SECURING AN ACTION ! ! =head1 SPOPS: ADDING OBJECT BEHAVIORS ! ! =head2 Define the class ! ! =head2 Add to declaration ! ! =head1 SPOPS: USING SECURITY ! ! =head1 MISC ! ! =head2 Using Multiple Datasources =head1 SEE ALSO |
From: Chris W. <la...@us...> - 2005-02-26 04:18:05
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6212 Modified Files: InstallPackageStructure.pm InstallPackageSql.pm Log Message: OIN-134: add a 'file' parameter to the structure and overall installers; value(s) get passed to the structure install execution Index: InstallPackageStructure.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/InstallPackageStructure.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** InstallPackageStructure.pm 13 Jun 2004 18:19:54 -0000 1.12 --- InstallPackageStructure.pm 26 Feb 2005 04:17:54 -0000 1.13 *************** *** 23,26 **** --- 23,31 ---- website_dir => $self->_get_website_dir_param, package => $self->_get_package_param, + file => { + description => 'Process only the listed structure file(s); if unspecified all are processed', + is_required => 'no', + is_multivalued => 'yes', + }, }; } *************** *** 41,45 **** $action, $repository, $package_name ); next PACKAGE unless ( $installer ); ! $installer->install_structure; my @install_status = $installer->get_status; for ( @install_status ) { --- 46,50 ---- $action, $repository, $package_name ); next PACKAGE unless ( $installer ); ! $installer->install_structure( $self->param( 'file' ) ); my @install_status = $installer->get_status; for ( @install_status ) { *************** *** 87,90 **** --- 92,109 ---- Installs SQL data structures for one or more packages. + =head1 PARAMETERS + + =over 4 + + =item B<website_dir> + + =item B<package> + + =item B<file> ($ or @; optional) + + Tell the installer to restrict itself to the listed files. + + =back + =head1 STATUS MESSAGES Index: InstallPackageSql.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/InstallPackageSql.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** InstallPackageSql.pm 14 Feb 2005 18:11:20 -0000 1.14 --- InstallPackageSql.pm 26 Feb 2005 04:17:54 -0000 1.15 *************** *** 25,28 **** --- 25,33 ---- website_dir => $self->_get_website_dir_param, package => $self->_get_package_param, + file => { + description => 'Process only the listed structure file(s); if unspecified all are processed', + is_required => 'no', + is_multivalued => 'yes', + }, }; } |
From: Chris W. <la...@us...> - 2005-02-26 04:14:32
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5298 Modified Files: SQLInstall.pm Log Message: OIN-134: tell the installer to process only certain structure files Index: SQLInstall.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/SQLInstall.pm,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** SQLInstall.pm 25 Feb 2005 05:29:13 -0000 1.26 --- SQLInstall.pm 26 Feb 2005 04:14:18 -0000 1.27 *************** *** 166,170 **** sub install_structure { ! my ( $self ) = @_; my $pkg = $self->package; unless ( UNIVERSAL::isa( $self->package, 'OpenInteract2::Package' ) ) { --- 166,170 ---- sub install_structure { ! my ( $self, @restrict_files ) = @_; my $pkg = $self->package; unless ( UNIVERSAL::isa( $self->package, 'OpenInteract2::Package' ) ) { *************** *** 230,241 **** my $driver_name = $ds_info->{sql_install} || $ds_info->{driver_name}; ! my @files = $self->_massage_arrayref( $self->get_structure_file( $structure_set, $driver_name ) ); ! foreach my $structure_file ( @files ) { $log->info( "Processing structure file '$structure_file'" ); $self->_set_datasource( $structure_file, $ds_name ); - # XXX: Need to use File::Spec here? my ( $table_sql ); my $relative_file = "$STRUCT_DIR/$structure_file"; --- 230,247 ---- my $driver_name = $ds_info->{sql_install} || $ds_info->{driver_name}; ! my @all_files = $self->_massage_arrayref( $self->get_structure_file( $structure_set, $driver_name ) ); ! my %restrict_to_files = map { $_ => 1 } @restrict_files; ! foreach my $structure_file ( @all_files ) { ! if ( scalar @restrict_files ! and ! $restrict_to_files{ $structure_file } ) { ! $log->info( "Skipping file '$structure_file' since files ", ! "were specified and it's not in the list" ); ! next; ! } $log->info( "Processing structure file '$structure_file'" ); $self->_set_datasource( $structure_file, $ds_name ); my ( $table_sql ); my $relative_file = "$STRUCT_DIR/$structure_file"; *************** *** 830,833 **** --- 836,843 ---- # Do one at a time $installer->install_structure; + + # ..and restrict to processing a single file + $installer->install_structure( 'table-A.sql' ); + $installer->install_data; $installer->install_security; *************** *** 931,935 **** Returns: nothing. ! B<install_structure()> If you have needs that declaration cannot fill, you can install the --- 941,945 ---- Returns: nothing. ! B<install_structure( [ @restrict_to_files ] )> If you have needs that declaration cannot fill, you can install the *************** *** 939,942 **** --- 949,955 ---- section on customization below.) + If you do implement it note that, if they specify it, users will + expect that you only process files in C<@restrict_to_files>. + B<get_structure_set()> |
From: Chris W. <la...@us...> - 2005-02-26 03:56:45
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32738 Modified Files: CommonSearch.pm Log Message: OIN-122: update docs to reflect modifications Index: CommonSearch.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action/CommonSearch.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** CommonSearch.pm 26 Feb 2005 03:52:19 -0000 1.21 --- CommonSearch.pm 26 Feb 2005 03:56:36 -0000 1.22 *************** *** 601,606 **** =item * ! B<iterator>: An L<SPOPS::Iterator|SPOPS::Iterator> with your search ! results. =item * --- 601,606 ---- =item * ! B<iterator>: An L<SPOPS::Iterator|SPOPS::Iterator> (or one of its ! subclasses) with your search results. =item * *************** *** 612,629 **** modify the fieldnames in C<_search_customize()>. - =back - - And if you have set C<c_search_results_paged> (see below) to 'yes' - you will also get: - - =over 4 - =item * ! B<page_num>: Page of the results we are currently on. =item * ! B<total_pages>: The total number of pages in the result set. =item * --- 612,624 ---- modify the fieldnames in C<_search_customize()>. =item * ! B<page_num>: Page of the results we are currently on. (If results not ! paged, always '1'.) =item * ! B<total_pages>: The total number of pages in the result set. (If ! results not paged, always '1'.) =item * *************** *** 633,647 **** =item * ! B<search_id>: The ID of this search. =back - If C<c_search_results_paged> is set to 'no', you will get nothing - beyond the default. The only difference is that 'iterator' will - contain all of your search results. If you would like to get all the - results in a list so you can see how many there are, call 'get_all()' - on the iterator and ask the returned arrayref how many members it - contains. - =head1 METHODS FOR 'search' --- 628,635 ---- =item * ! B<search_id>: The ID of this search. (Not set if results not paged.) =back =head1 METHODS FOR 'search' |
From: Chris W. <la...@us...> - 2005-02-26 03:52:27
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31496 Modified Files: CommonSearch.pm Log Message: OIN-122: oops, $iter->get_all() returns an arrayref, not an array... Index: CommonSearch.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action/CommonSearch.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** CommonSearch.pm 26 Feb 2005 03:43:05 -0000 1.20 --- CommonSearch.pm 26 Feb 2005 03:52:19 -0000 1.21 *************** *** 67,75 **** }; $self->_search_catch_errors( "$@" ); ! my @items = $iter->get_all; $tmpl_params{iterator} = SPOPS::Iterator::WrapList->new({ ! object_list => \@items }); ! $tmpl_params{total_hits} = scalar @items; $tmpl_params{page_num} = 1; $tmpl_params{total_pages} = 1; --- 67,78 ---- }; $self->_search_catch_errors( "$@" ); ! my $items = $iter->get_all(); ! $log->is_debug && ! $log->debug( scalar( @{ $items } ), " objects in iterator, ", ! "recreating iterator" ); $tmpl_params{iterator} = SPOPS::Iterator::WrapList->new({ ! object_list => $items }); ! $tmpl_params{total_hits} = scalar @{ $items }; $tmpl_params{page_num} = 1; $tmpl_params{total_pages} = 1; |
From: Chris W. <la...@us...> - 2005-02-26 03:43:15
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28934 Modified Files: CommonSearch.pm Log Message: OIN-122: so we can provide a common interface, run through the iterator once and collect the objects so we can count them up, then wrap the collection in another iterator so the final page doesn't know the difference Index: CommonSearch.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action/CommonSearch.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** CommonSearch.pm 25 Feb 2005 00:01:06 -0000 1.19 --- CommonSearch.pm 26 Feb 2005 03:43:05 -0000 1.20 *************** *** 10,13 **** --- 10,14 ---- use OpenInteract2::Exception qw( oi_error ); use OpenInteract2::ResultsManage; + use SPOPS::Iterator::WrapList; $OpenInteract2::Action::CommonSearch::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/); *************** *** 56,68 **** # If we're not using paged results, then just run the normal ! # search and get back an iterator else { $log->is_debug && $log->debug( "Search results not paged, using basic iterator" ); ! $tmpl_params{iterator} = eval { ! $self->_search_build_and_run( \%tmpl_params ) }; $self->_search_catch_errors( "$@" ); } --- 57,77 ---- # If we're not using paged results, then just run the normal ! # search and get back an iterator, but run through it once so we ! # can count up the results else { $log->is_debug && $log->debug( "Search results not paged, using basic iterator" ); ! my $iter = eval { ! $self->_search_build_and_run(); }; $self->_search_catch_errors( "$@" ); + my @items = $iter->get_all; + $tmpl_params{iterator} = SPOPS::Iterator::WrapList->new({ + object_list => \@items + }); + $tmpl_params{total_hits} = scalar @items; + $tmpl_params{page_num} = 1; + $tmpl_params{total_pages} = 1; } *************** *** 98,102 **** $log->debug( "Running search for the first time" ); my $iterator = eval { ! $self->_search_build_and_run({ is_paged => 'yes' }) }; $self->_search_catch_errors( "$@" ); --- 107,111 ---- $log->debug( "Running search for the first time" ); my $iterator = eval { ! $self->_search_build_and_run(); }; $self->_search_catch_errors( "$@" ); *************** *** 252,256 **** } $log->is_info && ! $log->info( "Got iterator from '$object_class' given query params" ); return $iter; } --- 261,265 ---- } $log->is_info && ! $log->info( "Got iterator from '$object_class' ok" ); return $iter; } |
From: Chris W. <la...@us...> - 2005-02-25 05:43:43
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25475 Modified Files: MANIFEST Log Message: add new error classes to listing Index: MANIFEST =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/MANIFEST,v retrieving revision 1.115 retrieving revision 1.116 diff -C2 -d -r1.115 -r1.116 *** MANIFEST 17 Feb 2005 05:20:18 -0000 1.115 --- MANIFEST 25 Feb 2005 05:43:34 -0000 1.116 *************** *** 90,93 **** --- 90,95 ---- lib/OpenInteract2/Datasource/LDAP.pm lib/OpenInteract2/DatasourceManager.pm + lib/OpenInteract2/Error.pm + lib/OpenInteract2/ErrorStorage.pm lib/OpenInteract2/Exception.pm lib/OpenInteract2/Exception/Parameter.pm |
From: Chris W. <la...@us...> - 2005-02-25 05:43:01
|
Update of /cvsroot/openinteract/OpenInteract2/doc/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25228 Removed Files: arch_apache_adapter Log Message: no longer needed --- arch_apache_adapter DELETED --- |
From: Chris W. <la...@us...> - 2005-02-25 05:42:32
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25075/Manual Modified Files: Architecture.pod Log Message: inline the apache adapter; add reference to FCGI Index: Architecture.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Architecture.pod,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Architecture.pod 30 Nov 2004 03:11:37 -0000 1.10 --- Architecture.pod 25 Feb 2005 05:42:06 -0000 1.11 *************** *** 181,185 **** 1.x: ! [% INCLUDE examples/arch_apache_adapter | indent(2) %] Very easy -- it's only about 15 lines if you remove the logging! This --- 181,222 ---- 1.x: ! package Apache::OpenInteract2; ! ! use strict; ! use Log::Log4perl qw( get_logger ); ! use OpenInteract2::Auth; ! use OpenInteract2::Constants qw( :log ); ! use OpenInteract2::Context qw( CTX ); ! use OpenInteract2::Request; ! use OpenInteract2::Response; ! ! sub handler($$) { ! my ( $class, $r ) = @_; ! my $log = get_logger( LOG_OI ); ! ! $log->is_info && ! $log->info( scalar( localtime ), ": request from ", ! "[", $r->connection->remote_ip, "] for URL ", ! "[", $r->uri, '?', scalar( $r->args ), "]" ); ! ! 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; ! } ! ! 1; Very easy -- it's only about 15 lines if you remove the logging! This *************** *** 234,238 **** =item * ! B<cgi>: For CGI processes. =item * --- 271,276 ---- =item * ! B<cgi>: For CGI processes; also usable under FastCGI (see the script ! C<cgi-bin/oi2.fcgi> for the easy setup). =item * *************** *** 253,272 **** [request] ... ! fastcgi = OpenInteract2::Request::FastCGI [response] ... ! fastcgi = OpenInteract2::Response::FastCGI You can also programmatically register the adapters in your server startup : OpenInteract2::Request->register_factory_type( ! fastcgi => 'OpenInteract2::Request::FastCGI' ); OpenInteract2::Response->register_factory_type( ! fastcgi => 'OpenInteract2::Response::FastCGI' ); No matter which you choose, all calls to 'assign_request_type' and ! 'assign_response_type' will have 'fastcgi' available. =item * --- 291,310 ---- [request] ... ! myenv = OpenInteract2::Request::MyEnvironment [response] ... ! myenv = OpenInteract2::Response::MyEnvironment You can also programmatically register the adapters in your server startup : OpenInteract2::Request->register_factory_type( ! myenv => 'OpenInteract2::Request::MyEnvironment' ); OpenInteract2::Response->register_factory_type( ! myenv => 'OpenInteract2::Response::MyEnvironment' ); No matter which you choose, all calls to 'assign_request_type' and ! 'assign_response_type' will have 'myenv' available. =item * |
From: Chris W. <la...@us...> - 2005-02-25 05:42:27
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25133/Manual Modified Files: Changes.pod Log Message: latest changes Index: Changes.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Changes.pod,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** Changes.pod 8 Feb 2005 13:00:09 -0000 1.66 --- Changes.pod 25 Feb 2005 05:42:19 -0000 1.67 *************** *** 20,25 **** =head1 THE FUTURE ! OI2 is currently at 1.99_05, equivalent to 2.0 beta 5. The next ! release should be a release candidate (1.99_06/2.0 RC1) -- its new features should only be minor; everything else should be bugfixes or pushed off to 2.01. --- 20,25 ---- =head1 THE FUTURE ! OI2 is currently at 1.99_06, equivalent to 2.0 beta 6. The next ! release will be a release candidate (1.99_07/2.0 RC1) -- its new features should only be minor; everything else should be bugfixes or pushed off to 2.01. *************** *** 29,32 **** --- 29,51 ---- =head2 Upgrade Notes + The following all apply to an existing server configuration -- if + you're creating a new site you don't need to worry: + + Modify how two 'action_info' keys are set: + + OLD: + + [action_info none] + redir = page + + [action_info not_found] + redir = page + + NEW: + + [action_info] + none = page + not_found = page + =head2 Major Changes *************** *** 46,49 **** --- 65,73 ---- =item * + OIN-72 - OpenInteract2 packages can now be built into + CPAN-distributable applications. + + =item * + OIN-115 - Break L<OpenInteract2::Setup> into individual tasks and create a framework so that new setup tasks will get discovered at *************** *** 52,59 **** --- 76,143 ---- for more information. + =item * + + OIN-129 - Be able to create a simple application with Create, Update, + Delete and Search functionality based on a database table -- see + L<OpenInteract2::Manage::Package::CreatePackageFromTable>, or: + + oi2_manage task_info --task=easy_app + + =item * + + OIN-54 - Make configuration of your database easier; it's now about as + simple as a DBI-E<gt>connect() call... + + =item * + + Add support for FastCGI -- use /cgi-bin/oi2.fcgi and see + conf/httpd_cgi_solo.conf for tiny configuration change. + =back =head2 Minor Changes + L<OpenInteract2::Action> + + =over 4 + + =item * + + Use L<OpenInteract2::ParamContainer> for C<param()> and related methods. + + =back + + L<OpenInteract2::Action::CommonUpdate> + + =over 4 + + =item * + + Pass C<$object> and C<\%old_data> to C<_update_post_action()> callback + rather than forcing the user to get them from parameters.. + + =back + + L<OpenInteract2::ActionResolver> + + L<OpenInteract2::ActionResolver::NameAndTask> + + L<OpenInteract2::ActionResolver::NotFoundOrEmpty> + + L<OpenInteract2::ActionResolver::UserDir> + + =over 4 + + =item * + + Break down the process of matching a URL (or other identifier) with + the action object that generates its content. The parent class + instantiates all classes under its namespace into a chain of + responsibility. Each link looks at the URL (or other data) and decides + if it should create an action from it; if not the next link is + invoked. + + =back + L<OpenInteract2::Config> *************** *** 73,80 **** =item * ! Add C<language_handle()> method, useful for when we don't have a ! request available from which to pull the language handle. (See L<OpenInteract2::I18N> for what this means.) =back --- 157,183 ---- =item * ! OIN-26: Add C<language_handle()> method, useful for when we don't have ! a request available from which to pull the language handle. (See L<OpenInteract2::I18N> for what this means.) + =item * + + OIN-54: Add C<assign_datasource_config()> so you can create/modify + datasource configurations after the initial configuration. + + =item * + + Add 'last_day_of_month' as option for C<create_date()> + + =back + + L<OpenInteract2::Manage> + + =over 4 + + =item * + + Use L<OpenInteract2::ParamContainer> for C<param()> and related methods. + =back *************** *** 88,91 **** --- 191,205 ---- =back + L<OpenInteract2::Manage::Website::Create> + + =over 4 + + OIN-127: Allow installation of a website into an existing directory, + but first check whether the directory holds any of our expected + subdirectories. If it does we assume we're installing over another + site and die. + + =back + L<OpenInteract2::Package> *************** *** 116,119 **** --- 230,308 ---- =back + L<OpenInteract2::ParamContainer> + + =over 4 + + =item * + + Simple class to provide storage and manipulation of arbitrary + parameters. (Previously four separate classes had implementations of a + 'param' method...) + + =back + + L<OpenInteract2::Request> + + =over 4 + + =item * + + Move URL parsing into action/task to + L<OpenInteract2::ActionResolver::NameAndTask>; also remove + 'action_name' and 'task_name' properties. + + =item * + + Use L<OpenInteract2::ParamContainer> for C<param()> and related methods. + + =item * + + Add C<param_boolean()> to return a 'TRUE' if a parameter value is + defined, 'FALSE' if not. (Similar to C<param_toggled()>, but it seems + like 'TRUE' and 'FALSE' are boolean literals in many databases.) + + =item * + + Remove C<_find_custom_languages()> and the ability to specify a class + to do so. Overdesign, and you can do it other ways. + + =item * + + Renamed internal and previously undocumented method from + C<find_language()> to C<assign_languages()> and allow optional + override values to be passed in. This lets the language be assigned + later in the process. + + =back + + L<OpenInteract2::Setup> + + (Also see the notes under B<Major Changes> for 1.99_06 above.) + + =over 4 + + =item * + + Use L<OpenInteract2::ParamContainer> for C<param()> and related methods. + + =back + + L<OpenInteract2::TT2::Plugin> + + =over 4 + + =item * + + Added C<as_boolean()> for evaluating a boolean value in any of its + case-insensitive forms - 't', 'true', 'y', 'yes', '1'. + + =item * + + Added C<as_boolean_label()> for evaluating a boolean value in any of + its case-insensitive forms - 't', 'true', 'y', 'yes', '1' -- and + returning a localized human label as a result. + + =back + L<OpenInteract2::Util> *************** *** 129,132 **** --- 318,326 ---- Added C<is_same_file( $path_a, $path_b )>. + =item * + + Move C<find_factry_subclasses()> here from L<OpenInteract2::Manage> + and modify it to assume @INC in unless other directories given. + =back |
From: Chris W. <la...@us...> - 2005-02-25 05:41:27
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24950/Manual Modified Files: QuickStart.pod Log Message: get rid of 'source_dir' ref and change dbi config Index: QuickStart.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/QuickStart.pod,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** QuickStart.pod 30 Nov 2004 02:00:29 -0000 1.10 --- QuickStart.pod 25 Feb 2005 05:41:13 -0000 1.11 *************** *** 56,66 **** Next, issue the command to create the website: ! $ oi2_manage create_website --source_dir=/path/to/OpenInteract2-source ! ! (You'll need to use the full path for now, relative paths will fail in ! non-obvious ways.) ! ! The C<--source_dir> must have at least the C<sample/> and C<pkg/> ! directories from the OpenInteract2 distribution. =head2 Configuring Your Site: server.ini --- 56,60 ---- Next, issue the command to create the website: ! $ oi2_manage create_website =head2 Configuring Your Site: server.ini *************** *** 92,104 **** [datasource main] type = DBI ! spops = ! driver_name = ! dsn = username = password = - db_owner = - sql_install = - long_read_len = 65536 - long_trunc_ok = 0 to: --- 86,93 ---- [datasource main] type = DBI ! dbi_type = ! dsn = username = password = to: *************** *** 106,118 **** [datasource main] type = DBI ! spops = SPOPS::DBI::SQLite ! driver_name = SQLite dsn = dbname=/PATH/TO/WEBSITE/oi2test.db username = password = - db_owner = - sql_install = - long_read_len = 65536 - long_trunc_ok = 0 B<Set session handler> --- 95,102 ---- [datasource main] type = DBI ! dbi_type = SQLite dsn = dbname=/PATH/TO/WEBSITE/oi2test.db username = password = B<Set session handler> |
From: Chris W. <la...@us...> - 2005-02-25 05:40:38
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24735/Manual Modified Files: I18N.pod Log Message: get rid of 'language.custom_language_id_class' and show howto do it with an observer Index: I18N.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/I18N.pod,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** I18N.pod 26 Feb 2004 02:42:50 -0000 1.11 --- I18N.pod 25 Feb 2005 05:40:17 -0000 1.12 *************** *** 78,94 **** We also provide the means for you to step in and implement your own -- ! you could parse it from the URL, use L<Geo::IP>, whatever. Just ! declare your class in the server configuration key ! 'language.custom_language_id_class': ! ! [language] ! ... ! custom_language_id_class = MyApp::I18N::LanguageId ! ! And implement the class method 'identify_languages()', which takes a ! single argument of the languages identified so far. Here's a naive ! example: ! package MyApp::I18N::LanguageId; use Geo::IP; --- 78,87 ---- We also provide the means for you to step in and implement your own -- ! you could parse it from the URL, use L<Geo::IP>, whatever. Just create ! an observer for the controller (under ! L<OpenInteract2::Observer::Controller>) and wait for the 'action ! assigned' observation which occurs every request: ! package OpenInteract2::Observer::Controller::LanguageId; use Geo::IP; *************** *** 97,111 **** my $gi = Geo::IP->new( GEOIP_STANDARD ); ! sub identify_languages { ! my ( $class, @oi_langs ) = @_; ! my $country = $gi->country_code_by_addr( CTX->request->remote_host ); ! my @langs_from_country = $class->_some_nifty_method( $country ) ! push @oi_langs, @langs_from_country; ! return @oi_langs; ! } ! Note that if you return a list with entries it B<replaces> what OI has ! so far identified. We took care of this above by first copying all the ! languages previously identified then adding to them with the C<push>. =head1 SETTING UP LOCALIZAION IN YOUR PACKAGE --- 90,105 ---- my $gi = Geo::IP->new( GEOIP_STANDARD ); ! sub update { ! my ( $class, $controller, $type, $action ) = @_; ! return unless ( $type eq 'action assigned' ); ! my $request = CTX->request; ! # get our new languages... ! my $country = $gi->country_code_by_addr( $request->remote_host ); ! my @langs_from_country = $class->_some_nifty_method( $country ); ! ! # assign the new languages after the existing ones ! $request->assign_languages( $request->language(), @langs_from_country ); ! } =head1 SETTING UP LOCALIZAION IN YOUR PACKAGE |
From: Chris W. <la...@us...> - 2005-02-25 05:39:41
|
Update of /cvsroot/openinteract/OpenInteract2/sample/website/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24539/website/conf Modified Files: server.ini Log Message: actually get rid of a configuration key! (language.custom_language_id_class) Index: server.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/sample/website/conf/server.ini,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** server.ini 19 Feb 2005 04:31:25 -0000 1.50 --- server.ini 25 Feb 2005 05:39:16 -0000 1.51 *************** *** 325,338 **** # parameters to see if a particular language has been chosen for this # request; this setting names the parameter we check - # - # custom_language_id_class: Called during the request initialization - # process to identify language(s) for this request. See - # OI2::Manual::I18N - # [language] default_language = en choice_param_name = oi_language - custom_language_id_class = # --- 325,332 ---- |