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...> - 2004-09-26 01:48:43
|
Update of /cvsroot/openinteract/OpenInteract2/sample/website/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25789 Modified Files: page_count Log Message: fix URL for page count Index: page_count =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/sample/website/template/page_count,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** page_count 6 Jun 2004 19:57:31 -0000 1.3 --- page_count 26 Sep 2004 01:48:33 -0000 1.4 *************** *** 17,32 **** [%- MSG( 'page_count.page_label' ) %] [ [%- IF current_pagenum != 1 -%] ! <a href="[% url %];pagenum=1"><<</a> ! <a href="[% url %];pagenum=[% current_pagenum - 1 %]"><</a> [%- END -%] [%- FOREACH page_count = [ 1 .. total_pages ] -%] [%- IF page_count == current_pagenum %][% page_count %] ! [%- ELSE %]<a href="[% url %];pagenum=[% page_count %]">[% page_count %]</a> [%- END -%] [%- IF page_count mod break_count == 0 -%]<br>[% ELSE %] [% END -%] [%- END -%] [%- IF current_pagenum != total_pages -%] ! <a href="[% url %];pagenum=[% current_pagenum + 1 %]">></a> ! <a href="[% url %];pagenum=[% total_pages%]">>></a> [%- END -%] --- 17,32 ---- [%- MSG( 'page_count.page_label' ) %] [ [%- IF current_pagenum != 1 -%] ! <a href="[% url %];page=1"><<</a> ! <a href="[% url %];page=[% current_pagenum - 1 %]"><</a> [%- END -%] [%- FOREACH page_count = [ 1 .. total_pages ] -%] [%- IF page_count == current_pagenum %][% page_count %] ! [%- ELSE %]<a href="[% url %];page=[% page_count %]">[% page_count %]</a> [%- END -%] [%- IF page_count mod break_count == 0 -%]<br>[% ELSE %] [% END -%] [%- END -%] [%- IF current_pagenum != total_pages -%] ! <a href="[% url %];page=[% current_pagenum + 1 %]">></a> ! <a href="[% url %];page=[% total_pages%]">>></a> [%- END -%] |
From: Chris W. <la...@us...> - 2004-09-26 01:48:09
|
Update of /cvsroot/openinteract/OpenInteract2/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25689 Modified Files: oi2_manage Log Message: modify status display messages (cosmetic) Index: oi2_manage =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/script/oi2_manage,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** oi2_manage 12 Jun 2004 19:23:18 -0000 1.25 --- oi2_manage 26 Sep 2004 01:47:59 -0000 1.26 *************** *** 342,348 **** my ( $task, $type, $status ) = @_; return unless ( $type eq 'status' ); ! my $show_ok = ( $status->{is_ok} eq 'yes' ) ? 'OK' : 'FAILED'; ! my $show_file = ( $status->{filename} ) ? "-- $status->{filename} " : ''; ! warn "STATUS: $status->{action} $show_file-- $show_ok \n $status->{message}\n"; } --- 342,351 ---- my ( $task, $type, $status ) = @_; return unless ( $type eq 'status' ); ! my $show_ok = ( $status->{is_ok} eq 'yes' ) ! ? 'OK' : 'FAILED'; ! my $show_file = ( $status->{filename} ) ! ? "-- $status->{filename} " : ''; ! warn "STATUS: $status->{action} $show_file-- ", ! "$show_ok \n $status->{message}\n"; } |
From: Chris W. <la...@us...> - 2004-09-26 01:46:00
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/I18N In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25309/OpenInteract2/I18N Modified Files: Initializer.pm Log Message: ensure the classes are generated properly (old changes...) Index: Initializer.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/I18N/Initializer.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Initializer.pm 26 Feb 2004 02:25:17 -0000 1.7 --- Initializer.pm 26 Sep 2004 01:45:51 -0000 1.8 *************** *** 168,178 **** my @lang_class_pieces = @base_class_pieces; if ( my @pieces = split( /[\-\_]/, $lang ) ) { ! push @lang_class_pieces, @pieces; pop @pieces; ! push @base_class_pieces, @pieces; } else { ! push @lang_class_pieces, $lang; } my $base_class = join( '::', @base_class_pieces ); --- 168,182 ---- my @lang_class_pieces = @base_class_pieces; + unless ( $lang eq 'en' ) { + push @base_class_pieces, 'en'; + } + if ( my @pieces = split( /[\-\_]/, $lang ) ) { ! push @lang_class_pieces, @pieces; # 'es', 'mx'; pop @pieces; ! push @base_class_pieces, @pieces; # 'es' } else { ! push @lang_class_pieces, $lang; # 'es' } my $base_class = join( '::', @base_class_pieces ); *************** *** 193,197 **** $TEMPLATE->error(); $log->is_debug && ! $log->debug( "Processed template okay. Now eval'ing class..." ); eval $gen_class; if ( $@ ) { --- 197,202 ---- $TEMPLATE->error(); $log->is_debug && ! $log->debug( "Processed template okay. Now eval'ing class with ", ! "these contents: ", $gen_class ); eval $gen_class; if ( $@ ) { *************** *** 211,218 **** use strict; - use base qw( [% base_class %] ); use vars qw( %Lexicon ); sub get_oi2_lang { return '[% lang %]' } --- 216,224 ---- use strict; use vars qw( %Lexicon ); + @[% lang_class %]::ISA = qw( [% base_class %] ); + sub get_oi2_lang { return '[% lang %]' } |
From: Chris W. <la...@us...> - 2004-09-26 00:59:26
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15809/t Modified Files: utils.pl Log Message: update package versions Index: utils.pl =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/utils.pl,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** utils.pl 14 Jul 2004 13:27:27 -0000 1.65 --- utils.pl 26 Sep 2004 00:59:16 -0000 1.66 *************** *** 45,49 **** return ( base => '2.10', ! base_box => '2.12', base_error => '2.10', base_group => '2.14', --- 45,49 ---- return ( base => '2.10', ! base_box => '2.13', base_error => '2.10', base_group => '2.14', *************** *** 54,63 **** base_user => '2.32', comments => '1.14', ! full_text => '2.56', lookup => '2.06', ! news => '2.18', object_activity => '2.11', system_doc => '2.07', ! whats_new => '2.08', ); } --- 54,63 ---- base_user => '2.32', comments => '1.14', ! full_text => '2.57', lookup => '2.06', ! news => '2.19', object_activity => '2.11', system_doc => '2.07', ! whats_new => '2.09', ); } |
From: Chris W. <la...@us...> - 2004-09-26 00:59:26
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15809 Modified Files: MANIFEST Log Message: update package versions Index: MANIFEST =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/MANIFEST,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** MANIFEST 14 Jul 2004 13:27:27 -0000 1.85 --- MANIFEST 26 Sep 2004 00:59:05 -0000 1.86 *************** *** 157,161 **** lib/OpenInteract2/Util.pm pkg/base-2.10.zip ! pkg/base_box-2.12.zip pkg/base_error-2.10.zip pkg/base_group-2.14.zip --- 157,161 ---- lib/OpenInteract2/Util.pm pkg/base-2.10.zip ! pkg/base_box-2.13.zip pkg/base_error-2.10.zip pkg/base_group-2.14.zip *************** *** 166,175 **** pkg/base_user-2.32.zip pkg/comments-1.14.zip ! pkg/full_text-2.56.zip pkg/lookup-2.06.zip ! pkg/news-2.18.zip pkg/object_activity-2.11.zip pkg/system_doc-2.07.zip ! pkg/whats_new-2.08.zip sample/README sample/apache/FILES --- 166,175 ---- pkg/base_user-2.32.zip pkg/comments-1.14.zip ! pkg/full_text-2.57.zip pkg/lookup-2.06.zip ! pkg/news-2.19.zip pkg/object_activity-2.11.zip pkg/system_doc-2.07.zip ! pkg/whats_new-2.09.zip sample/README sample/apache/FILES |
From: Chris W. <la...@us...> - 2004-09-25 18:22:33
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/tips_quotes_cw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22487/extra_packages/tips_quotes_cw Modified Files: package.conf MANIFEST Changes Log Message: add the shaolin principles to the mix Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/tips_quotes_cw/package.conf,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** package.conf 3 Jun 2004 13:04:41 -0000 1.1 --- package.conf 25 Sep 2004 18:22:23 -0000 1.2 *************** *** 1,4 **** name tips_quotes_cw ! version 1.01 author Chris Winters <ch...@cw...> template_plugin Quote OpenInteract2::QuotePlugin --- 1,4 ---- name tips_quotes_cw ! version 1.02 author Chris Winters <ch...@cw...> template_plugin Quote OpenInteract2::QuotePlugin Index: MANIFEST =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/tips_quotes_cw/MANIFEST,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MANIFEST 3 Jun 2004 13:04:41 -0000 1.1 --- MANIFEST 25 Sep 2004 18:22:23 -0000 1.2 *************** *** 11,13 **** OpenInteract2/QuotePlugin.pm OpenInteract2/RandomQuote.pm ! --- 11,13 ---- OpenInteract2/QuotePlugin.pm OpenInteract2/RandomQuote.pm ! OpenInteract2/ShaolinPrinciples.pm Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/tips_quotes_cw/Changes,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Changes 3 Jun 2004 13:04:41 -0000 1.1 --- Changes 25 Sep 2004 18:22:23 -0000 1.2 *************** *** 1,4 **** --- 1,8 ---- Revision history for OpenInteract package tips_quotes_cw. + 1.02 Thu Jul 15 00:15:05 EDT 2004 + + Add 100 shaolin principles. + 1.01 Fri May 21 11:35:37 EDT 2004 |
From: Chris W. <la...@us...> - 2004-09-25 18:22:33
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/tips_quotes_cw/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22487/extra_packages/tips_quotes_cw/OpenInteract2 Modified Files: QuotePlugin.pm Added Files: ShaolinPrinciples.pm Log Message: add the shaolin principles to the mix --- NEW FILE: ShaolinPrinciples.pm --- package OpenInteract2::ShaolinPrinciples; # $Id: ShaolinPrinciples.pm,v 1.1 2004/09/25 18:22:22 lachoy Exp $ use strict; use base qw( OpenInteract2::Action ); use HTML::Entities; use Text::Wrap qw( wrap ); my @QUOTES = (); BEGIN: { local $/ = undef; my $raw = <DATA>; my @raw_quotes = split( "%%\n", $raw ); foreach my $quote ( @raw_quotes ) { chomp $quote; push @QUOTES, [ $lines[0], $quote ]; } } sub get { return @{ $QUOTES[ int( rand( scalar @QUOTES ) ) ] }; } sub get_wrapped { my ( $advice, $source ) = get(); local $Text::Wrap::columns = 60; return ( wrap( undef, undef, $advice ), $source ); } sub get_html { my ( $advice, $source ) = get(); return HTML::Entities::encode( $advice ); } sub get_full_html { return get_html(); } 1; =pod =head1 NAME OpenInteract2::ShaolinPrinciples - Choose a random shaolin priciple =head1 SYNOPSIS use OpenInteract2::ShaolinPrinciples; my ( $advice, $source, $advice_num ) = OpenInteract2::ShaolinPrinciple->get; print "In HTML: ", OpenInteract2::ShaolinPrinciple->get_html(); =head1 DESCRIPTION This returns a random Shaolin Action Principle from the book by Bill Fitzpatrick. =head1 SEE ALSO 100 Action Principles of the Shaolin by Bill Fitzpatrick http://www.amazon.com/exec/obidos/tg/detail/-/1884864104/ =head1 COPYRIGHT Copyright (c) 1998 Bill Fitzpatrick (for the actual words) Copyright (c) 2004 Chris Winters (for putting it in this format) =cut __DATA__ 1 Set Goals %% 2 Develop Winning Strategies %% 3 Be Decisive %% 4 Maintain a Positive Attitude %% 5 Relax Your Body %% 6 Look in the Mirror %% 7 Enjoy Your Own Company %% 8 Share the Credit %% 9 Make Everyone Feel Important %% 10 Build Networks %% 11 Think About Selling %% 12 Understand Courage %% 13 Stay Fit and Healthy %% 14 Write a Personal Mission Statement %% 15 Be the Warrior %% 16 Build Your Team %% 17 Have Faith %% 18 Ask Yourself %% 19 Seize the Moment %% 20 Set the Example %% 21 Act As If %% 22 Act Independently %% 23 Seek Change %% 24 Give Freely %% 25 Communicate With Ease %% 26 Invest in Your Future %% 27 Appreciate Your Students %% 28 Ask a Lot of Questions %% 29 Run the Short Road %% 30 March the Long Road %% 31 Don`t Allways Apologize %% 32 Find Beauty Everywhere %% 33 Accept Differences %% 34 Blame No One %% 35 Be Outwardly Focused %% 36 Face Fear %% 37 Challenge Yourself %% 38 Follow Through %% 39 Choose Your Master First %% 40 Do What You Love Doing %% 41 How to Wear a Green Belt %% 42 How to Wear a Brown Belt %% 43 How to Wear a Black Belt %% 44 Allow Your Opponent to Save Face %% 45 Don t be a Perfectionist %% 46 Applaud the Courage of the White Belt %% 47 Read Bibliographys %% 48 Give Yourself the Gift of Self Reliance %% 49 Focus on Your Priorities %% 50 Don t Complicate Matters %% 51 Assume Leadership %% 52 Listen to Your Instincts %% 53 Accept Hard Work %% 54 Remain Flexible %% 55 Play to the Winners %% 56 Be Open to New Ideas %% 57 Heed the Warnings %% 58 Set the Bar High %% 59 Practice Your Katas %% 60 Define Integrity %% 61 Follow Your Code of Honor %% 62 Stay Centered %% 63 Commit to Self Dicipline %% 64 Accept Your Limitations %% 65 Be Grateful to Your Sensei %% 66 Retire Early %% 67 Observe and Be Aware %% 68 Go Ahead %% 69 Love Many Things %% 70 Live Simply %% 71 Make Today Special %% 72 Record Your Thoughts %% 73 Be of No Mind %% 74 Forget Everybody %% 75 Maintain Your Sai %% 76 Count the Time %% 77 Imagine %% 78 Walk Away %% 79 Work at Work %% 80 Inch Forward %% 81 Stop Talking %% 82 Look Forward to Tommorow %% 83 Pass Along the Secret %% 84 Give Generously %% 85 Build a Business %% 86 Develop Your Special Talent %% 87 Appreciate Your Appeal %% 88 Remember these Words %% 89 Teach Yourself %% 90 Form Your Day %% 91 Do What Others Can t %% 92 Build Upon Your Basics %% 93 Avoid Thinking That ... %% 94 Be the Monk %% 95 Use the Power of Patience %% 96 Develop Your Sense of Humor %% 97 Control Conflict %% 98 Take the Punch %% 99 Become Grateful %% 100 Rejoice in the Day Index: QuotePlugin.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/tips_quotes_cw/OpenInteract2/QuotePlugin.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QuotePlugin.pm 3 Jun 2004 13:04:41 -0000 1.1 --- QuotePlugin.pm 25 Sep 2004 18:22:22 -0000 1.2 *************** *** 9,17 **** $OpenInteract2::QuotePlugin::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/); ! my @QC = qw( OpenInteract2::JHIQuote ! OpenInteract2::LarryWallQuote ! OpenInteract2::MJDAdvice ! OpenInteract2::PPTip ! OpenInteract2::RandomQuote ); _init(); --- 9,20 ---- $OpenInteract2::QuotePlugin::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/); ! my @QC = qw( ! OpenInteract2::JHIQuote ! OpenInteract2::LarryWallQuote ! OpenInteract2::MJDAdvice ! OpenInteract2::PPTip ! OpenInteract2::RandomQuote ! OpenInteract2::ShaolinPrinciples ! ); _init(); *************** *** 69,72 **** --- 72,79 ---- } + sub shaolin { + return OpenInteract2::ShaolinPrinciples->get_full_html; + } + sub _init { for ( @QC ) { *************** *** 87,118 **** =head1 SYNOPSIS ! [% USE Quote %] ! Return fully-attributed quote from any source: ! [% Quote.any() %] ! Return fully-attributed quote from Larry: ! [% Quote.lwall() %] ! Return fully-attributed quote from MJD: ! [% Quote.mjd() %] ! Return fully-attributed quote from "The Pragmatic Programmer": ! [% Quote.pptip() %] ! Return quote from the random pile (not from any of the above): ! [% Quote.random() %] ! Return brief quote (already atributed) ! A word of advice from <a href="...">MJD</a>:<br> [% Quote.mjd( 'brief' ) %] ! A tip from "The Pragmatic Programmer":<br> [% Quote.pptip( 'brief' ) %] --- 94,129 ---- =head1 SYNOPSIS ! [% USE Quote %] ! Return fully-attributed quote from any source: ! [% Quote.any() %] ! Return fully-attributed quote from Larry: ! [% Quote.lwall() %] ! Return fully-attributed quote from MJD: ! [% Quote.mjd() %] ! Return fully-attributed quote from "The Pragmatic Programmer": ! [% Quote.pptip() %] ! Return quote from the random pile (not from any of the above): ! [% Quote.random() %] ! ! Return quote from the shaolin principles: ! ! [% Quote.shaolin() %] ! Return brief quote (already atributed) ! A word of advice from <a href="...">MJD</a>:<br> [% Quote.mjd( 'brief' ) %] ! A tip from "The Pragmatic Programmer":<br> [% Quote.pptip( 'brief' ) %] |
From: Chris W. <la...@us...> - 2004-09-25 18:21:59
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22357/doc/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.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** Changes.pod 14 Jun 2004 11:29:33 -0000 1.45 --- Changes.pod 25 Sep 2004 18:21:49 -0000 1.46 *************** *** 27,30 **** --- 27,55 ---- =head1 1.99_05 + =head2 Upgrade Notes + + The following keys were added to the server configuration with these + default values. These are mandatory. + + [Global] + timezone = America/New_York + + [fulltext] + default = DBI + + [fulltext DBI] + class = OpenInteract2::FullTextIndexer::DBI + datasource = main + column_group = listing + min_word_length = 3 + max_word_length = 30 + index_table = full_text_index + class_map_table = full_text_index_class + stem_locale = en + + [system_class] + setup = OpenInteract2::Setup + ini_reader = OpenInteract2::Config::Ini + =head2 Major Changes *************** *** 34,39 **** Searching framework overhauled. Some of the classes are now in the ! main distribution (L<OpenInteract2::FullTextIndexer> and ! L<OpenInteract2::FullTextIterator>) and the 'full_text' package now contains one implementation of the search engine. This opens the door for someone to write a 'full_text_plucene' or something similar. --- 59,65 ---- Searching framework overhauled. Some of the classes are now in the ! main distribution (L<OpenInteract2::FullTextIndexer>, ! L<OpenInteract2::FullTextIterator> and ! L<OpenInteract2::FullTextRules>) and the 'full_text' package now contains one implementation of the search engine. This opens the door for someone to write a 'full_text_plucene' or something similar. *************** *** 41,47 **** =item * ! Two new management tasks: ! L<OpenInteract2::Manage::Website::ExportData> and ! L<OpenInteract2::Manage::Website::UpdatePackageFromWebsite> =item * --- 67,82 ---- =item * ! New management task L<OpenInteract2::Manage::Website::ExportData> will ! export data into SQL statements, XML or different types of Perl data ! structures, including one that's used in the OI2 data import ! process. So you can move data between databases really easily. ! ! =item * ! ! New management task ! L<OpenInteract2::Manage::Website::UpdatePackageFromWebsite> allows you ! to work in short iterations on a 'live' package -- one deployed to a ! website -- then port those changes back to your development package in ! one fell swoop. =item * *************** *** 53,56 **** --- 88,106 ---- =item * + All common actions that modify persistent data + (L<OpenInteract2::Action::CommonAdd>, + L<OpenInteract2::Action::CommonUpdate>, + L<OpenInteract2::Action::CommonRemove>) now throw pre and post storage + observations ('pre add', 'post add', etc.). So you can attach external + observers to an action to, for instance, post a new use.perl journal + entry with the contents of the object just created. + + =item * + + Default session manager now uses the filesystem rather than the + database. + + =item * + Lots of changes to the packages included in the distribution. *************** *** 59,62 **** --- 109,161 ---- =head2 Minor Changes + L<OpenInteract2::Action> + + =over 4 + + =item * + + Be able to use shorthand to specify minutes, hours or days in + 'cache_expire' key. + + =item * + + If you use a single value for 'cache_expire' it will be applied to all + tasks within the action. + + =back + + L<OpenInteract2::Action::CommonAdd> + + =over 4 + + =item * + + Add 'pre add' and 'post add' observations fired from the action in the + C<add()> method. + + =back + + L<OpenInteract2::Action::CommonRemove> + + =over 4 + + =item * + + Add 'pre remove' and 'post remove' observations fired from the action in the + C<remove()> method. + + =back + + L<OpenInteract2::Action::CommonUpdate> + + =over 4 + + =item * + + Add 'pre update' and 'post update' observations fired from the action in the + C<update()> method. + + =back + L<OpenInteract2::Config::Ini> *************** *** 99,102 **** --- 198,214 ---- =back + L<OpenInteract2::Config::Initializer|OpenInteract2::Config::Initializer> + + =over 4 + + =item * + + Add new observer '_spops_set_hasa' to munge the 'has_a' section within + an SPOPS object and allow for more complex configuration. Thanks to + Antti for the spot. + + =back + + L<OpenInteract2::Config::PackageChanges> *************** *** 140,143 **** --- 252,259 ---- timezone. + =item * + + Add 'lookup_box_config()' to return the global box configuration. + =back *************** *** 238,241 **** --- 354,368 ---- =back + L<OpenInteract::Response> and L<OpenInteract::Request>, plus subclasses + + =over 4 + + =item * + + OIN-62: Parent class no longer has a notion of the 'current' + request/response. Just get them from the CTX object. + + =back + L<OpenInteract2::Response::CGI> *************** *** 332,360 **** =back - =head2 Upgrade Notes - - The following keys were added to the server configuration with these - default values. - - [Global] - timezone = America/New_York - - [fulltext] - default = DBI - - [fulltext DBI] - class = OpenInteract2::FullTextIndexer::DBI - datasource = main - column_group = listing - min_word_length = 3 - max_word_length = 30 - index_table = full_text_index - class_map_table = full_text_index_class - stem_locale = en - - [system_class] - setup = OpenInteract2::Setup - ini_reader = OpenInteract2::Config::Ini - =head2 Package Updates --- 459,462 ---- *************** *** 366,384 **** ----------------------------------- base: 2.10 -> 2.10 ! base_box: 2.11 -> 2.11 base_error: 2.10 -> 2.10 ! base_group: 2.11 -> 2.11 ! base_page: 2.21 -> 2.21 ! base_security: 2.13 -> 2.13 base_template: 3.11 -> 3.11 base_theme: 2.09 -> 2.09 ! base_user: 2.27 -> 2.27 ! comments: 1.10 -> 1.10 ! full_text: 2.09 -> 2.09 ! lookup: 2.04 -> 2.04 ! news: 2.13 -> 2.13 object_activity: 2.11 -> 2.11 ! system_doc: 2.05 -> 2.05 ! whats_new: 2.04 -> 2.04 --- 468,486 ---- ----------------------------------- base: 2.10 -> 2.10 ! base_box: 2.11 -> 2.12 base_error: 2.10 -> 2.10 ! base_group: 2.11 -> 2.14 ! base_page: 2.21 -> 2.23 ! base_security: 2.13 -> 2.16 base_template: 3.11 -> 3.11 base_theme: 2.09 -> 2.09 ! base_user: 2.27 -> 2.32 ! comments: 1.10 -> 1.14 ! full_text: 2.09 -> 2.56 ! lookup: 2.04 -> 2.06 ! news: 2.13 -> 2.18 object_activity: 2.11 -> 2.11 ! system_doc: 2.05 -> 2.07 ! whats_new: 2.04 -> 2.08 *************** *** 482,485 **** --- 584,594 ---- bit of time spent on this operation). + =item * + + Modify the cache key we create when an action requests caching. It now + includes the action name instead of the class name, otherwise we'd get + some crazy behavior with action types (since they share the same + class). + =back |
From: Chris W. <la...@us...> - 2004-09-25 18:20:47
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/whats_new/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22101/whats_new/template Modified Files: form.tmpl list.tmpl Log Message: general cleanup Index: form.tmpl =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/whats_new/template/form.tmpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** form.tmpl 16 Feb 2004 18:04:14 -0000 1.2 --- form.tmpl 25 Sep 2004 18:20:32 -0000 1.3 *************** *** 2,7 **** PROCESS error_message; PROCESS status_message; ! task = new_item.is_saved ? 'update' : 'add'; ! title = new_item.is_saved ? MSG( 'whats_new.form.title_update' ) : MSG( 'whats_new.form.title_new' ); --- 2,7 ---- PROCESS error_message; PROCESS status_message; ! task = whats_new.is_saved ? 'update' : 'add'; ! title = whats_new.is_saved ? MSG( 'whats_new.form.title_update' ) : MSG( 'whats_new.form.title_new' ); *************** *** 9,13 **** [%- remove_url = OI.make_url( ACTION = 'new', TASK = 'remove', ! new_id = new_item.id ) -%] <p align="right"> [% MSG( 'whats_new.form.remove_link', remove_url ) %] --- 9,13 ---- [%- remove_url = OI.make_url( ACTION = 'new', TASK = 'remove', ! new_id = whats_new.id ) -%] <p align="right"> [% MSG( 'whats_new.form.remove_link', remove_url ) %] *************** *** 25,50 **** [%- count = count + 1 -%] ! [% INCLUDE label_form_text_row( label_key = 'whats_new.info.type', is_required = 1, ! name = 'listing_type', ! value = new_item.listing_type, size = 20 ) -%] [%- count = count + 1 -%] ! [% INCLUDE label_form_text_row( label_key = 'whats_new.info.description', is_required = 1, ! name = 'title', value = new_item.title, size = 40, maxlength = 150 ) -%] [%- count = count + 1 -%] ! [% INCLUDE label_form_text_row( label_key = 'whats_new.info.url', is_required = 1, ! name = 'url', value = new_item.url, size = 40, maxlength = 150 ) -%] [%- count = count + 1 -%] ! [%- post_date_string = new_item.posted_on || 'now'; post_date_object = OI.date_into_object( post_date_string ) -%] ! [% INCLUDE label_form_date_row( label_key = 'whats_new.info.posted_on', name = 'posted_on', date_object = post_date_object ) -%] --- 25,52 ---- [%- count = count + 1 -%] ! [% INCLUDE label_form_text_row( label_key = 'whats_new.info.type', is_required = 1, ! name = 'listing_type', ! value = whats_new.listing_type, size = 20 ) -%] [%- count = count + 1 -%] ! [% INCLUDE label_form_text_row( label_key = 'whats_new.info.description', is_required = 1, ! name = 'title', ! value = whats_new.title, size = 40, maxlength = 150 ) -%] [%- count = count + 1 -%] ! [% INCLUDE label_form_text_row( label_key = 'whats_new.info.url', is_required = 1, ! name = 'url', ! value = whats_new.url, size = 40, maxlength = 150 ) -%] [%- count = count + 1 -%] ! [%- post_date_string = whats_new.posted_on || 'now'; post_date_object = OI.date_into_object( post_date_string ) -%] ! [% INCLUDE label_form_date_row( label_key = 'whats_new.info.posted_on', name = 'posted_on', date_object = post_date_object ) -%] *************** *** 52,61 **** [%- count = count + 1 -%] [% INCLUDE label_form_text_row( label_key = 'whats_new.info.class', ! name = 'class', value = new_item.class, size = 40, maxlength = 150 ) -%] [%- count = count + 1 -%] [% INCLUDE label_form_text_row( label_key = 'whats_new.info.object_id', ! name = 'object_id', value = new_item.object_id, size = 40, maxlength = 150 ) -%] --- 54,64 ---- [%- count = count + 1 -%] [% INCLUDE label_form_text_row( label_key = 'whats_new.info.class', ! name = 'class', ! value = whats_new.class, size = 40, maxlength = 150 ) -%] [%- count = count + 1 -%] [% INCLUDE label_form_text_row( label_key = 'whats_new.info.object_id', ! name = 'object_id', value = whats_new.object_id, size = 40, maxlength = 150 ) -%] *************** *** 63,67 **** [% INCLUDE label_form_checkbox_row( label_key = 'whats_new.info.active', name = 'active', value = 'yes', ! picked = new_item.active, field_label = MSG( 'global.label.yes' ) ) -%] --- 66,70 ---- [% INCLUDE label_form_checkbox_row( label_key = 'whats_new.info.active', name = 'active', value = 'yes', ! picked = whats_new.active, field_label = MSG( 'global.label.yes' ) ) -%] *************** *** 71,75 **** [% PROCESS table_bordered_end -%] ! [% INCLUDE form_hidden( name = 'new_id', value = new_item.id ) -%] [% PROCESS form_end %] --- 74,78 ---- [% PROCESS table_bordered_end -%] ! [% INCLUDE form_hidden( name = 'new_id', value = whats_new.id ) -%] [% PROCESS form_end %] Index: list.tmpl =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/whats_new/template/list.tmpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** list.tmpl 16 Feb 2004 18:04:14 -0000 1.2 --- list.tmpl 25 Sep 2004 18:20:32 -0000 1.3 *************** *** 24,28 **** <td><a href="[% new_item.url %]">[% new_item.title %]</a></td> [%- IF new_item.tmp_security_level >= OI.security_level.write -%] ! [% edit_url = OI.make_url( ACTION = 'new' task = 'display_form', new_id = new_item.id ) %] <td><a href="[% edit_url %]">[% MSG( 'global.label.edit' ) %]</a></td> --- 24,28 ---- <td><a href="[% new_item.url %]">[% new_item.title %]</a></td> [%- IF new_item.tmp_security_level >= OI.security_level.write -%] ! [% edit_url = OI.make_url( ACTION = 'new' TASK = 'display_form', new_id = new_item.id ) %] <td><a href="[% edit_url %]">[% MSG( 'global.label.edit' ) %]</a></td> |
From: Chris W. <la...@us...> - 2004-09-25 18:20:47
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/whats_new/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22101/whats_new/conf Modified Files: action.ini Log Message: general cleanup Index: action.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/whats_new/conf/action.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** action.ini 12 Jun 2004 23:39:34 -0000 1.3 --- action.ini 25 Sep 2004 18:20:32 -0000 1.4 *************** *** 15,23 **** c_update_return_url = /new/search/ @,c_add_fields = class, object_id, listing_type, title, url c_add_fields_date = posted_on c_add_fields_toggled = active c_add_fail_task = display_add ! c_add_return_url = /new/search/ [new security] --- 15,26 ---- c_update_return_url = /new/search/ + c_display_add_template = whats_new::form + @,c_add_fields = class, object_id, listing_type, title, url c_add_fields_date = posted_on c_add_fields_toggled = active + c_add_task = display c_add_fail_task = display_add ! c_add_return_url = /new/ [new security] |
From: Chris W. <la...@us...> - 2004-09-25 18:20:46
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/full_text In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22101/full_text Modified Files: Changes package.conf Log Message: general cleanup Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/full_text/Changes,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Changes 9 Jun 2004 02:22:50 -0000 1.15 --- Changes 25 Sep 2004 18:20:31 -0000 1.16 *************** *** 1,4 **** --- 1,9 ---- Revision history for OpenInteract package full_text. + 2.57 Sat Sep 25 14:19:21 EDT 2004 + + Ensure that 'search_id' is passed to the template; other + cosmetic items. + 2.56 Tue Jun 8 22:21:21 EDT 2004 Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/full_text/package.conf,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** package.conf 9 Jun 2004 02:22:50 -0000 1.14 --- package.conf 25 Sep 2004 18:20:31 -0000 1.15 *************** *** 1,4 **** name full_text ! version 2.56 author Chris Winters (ch...@cw...) url http://www.openinteract.org/ --- 1,4 ---- name full_text ! version 2.57 author Chris Winters (ch...@cw...) url http://www.openinteract.org/ |
From: Chris W. <la...@us...> - 2004-09-25 18:20:46
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/whats_new In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22101/whats_new Modified Files: Changes package.conf Log Message: general cleanup Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/whats_new/Changes,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Changes 12 Jun 2004 23:39:34 -0000 1.10 --- Changes 25 Sep 2004 18:20:32 -0000 1.11 *************** *** 1,4 **** --- 1,8 ---- Revision history for OpenInteract package whats_new. + 2.09 Sun Jun 20 00:10:03 EDT 2004 + + Modify the DateTime calls to use the CTX->create_date() + 2.08 Sat Jun 12 16:54:24 EDT 2004 Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/whats_new/package.conf,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** package.conf 12 Jun 2004 23:39:34 -0000 1.9 --- package.conf 25 Sep 2004 18:20:32 -0000 1.10 *************** *** 1,4 **** name whats_new ! version 2.08 author Chris Winters (ch...@cw...) url http://www.openinteract.org/ --- 1,4 ---- name whats_new ! version 2.09 author Chris Winters (ch...@cw...) url http://www.openinteract.org/ |
From: Chris W. <la...@us...> - 2004-09-25 18:20:46
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/news/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22101/news/OpenInteract2/Action Modified Files: News.pm Log Message: general cleanup Index: News.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/news/OpenInteract2/Action/News.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** News.pm 9 Jun 2004 02:18:50 -0000 1.9 --- News.pm 25 Sep 2004 18:20:31 -0000 1.10 *************** *** 121,131 **** $log->is_info && $log->info( "Given search begin/end dates of ", ! "'", $begin_date->strftime( '%Y-%m-%d' ), "'", "'", $end_date->strftime( '%Y-%m-%d' ), "'" ); ! $where .= 'AND ( posted_on >= ? AND posted_on < ? )'; push @values, $begin_date->strftime( '%Y-%m-%d' ), $end_date->strftime( '%Y-%m-%d' ); } my $news_class = CTX->lookup_object( 'news' ); my $items = eval { --- 121,134 ---- $log->is_info && $log->info( "Given search begin/end dates of ", ! "'", $begin_date->strftime( '%Y-%m-%d' ), "' and ", "'", $end_date->strftime( '%Y-%m-%d' ), "'" ); ! $where .= ' AND ( posted_on >= ? AND posted_on <= ? ) '; push @values, $begin_date->strftime( '%Y-%m-%d' ), $end_date->strftime( '%Y-%m-%d' ); } + $log->is_debug && + $log->debug( "Quering news objects with: $where\n", + "and values: ", join( ', ', @values ) ); my $news_class = CTX->lookup_object( 'news' ); my $items = eval { *************** *** 218,226 **** "[expires_on: ", _ds( $news->{expires_on} ), "] " ); ! $news->{active_on} ||= DateTime->now; ! $news->{posted_on} ||= DateTime->now; unless ( $news->{expires_on} ) { my $expire_days = $self->param( 'default_expire' ); ! $news->{expires_on} = DateTime->now->add( days => $expire_days ); } --- 221,229 ---- "[expires_on: ", _ds( $news->{expires_on} ), "] " ); ! $news->{active_on} ||= CTX->create_date; ! $news->{posted_on} ||= CTX->create_date; unless ( $news->{expires_on} ) { my $expire_days = $self->param( 'default_expire' ); ! $news->{expires_on} = CTX->create_date->add( days => $expire_days ); } |
From: Chris W. <la...@us...> - 2004-09-25 18:20:46
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/news In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22101/news Modified Files: Changes package.conf Log Message: general cleanup Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/news/Changes,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Changes 12 Jun 2004 23:22:35 -0000 1.18 --- Changes 25 Sep 2004 18:20:31 -0000 1.19 *************** *** 1,4 **** --- 1,9 ---- Revision history for OpenInteract package news. + 2.19 Sun Jun 20 00:07:22 EDT 2004 + + Use the CTX create_date() helper method so the timezone gets + used properly. + 2.18 Sat Jun 12 19:07:35 EDT 2004 Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/news/package.conf,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** package.conf 12 Jun 2004 23:22:35 -0000 1.17 --- package.conf 25 Sep 2004 18:20:31 -0000 1.18 *************** *** 1,4 **** name news ! version 2.18 author Chris Winters (ch...@cw...) url http://www.openinteract.org/ --- 1,4 ---- name news ! version 2.19 author Chris Winters (ch...@cw...) url http://www.openinteract.org/ |
From: Chris W. <la...@us...> - 2004-09-25 18:20:46
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/whats_new/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22101/whats_new/OpenInteract2/Action Modified Files: WhatsNew.pm Log Message: general cleanup Index: WhatsNew.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/whats_new/OpenInteract2/Action/WhatsNew.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WhatsNew.pm 7 Jun 2004 04:59:13 -0000 1.4 --- WhatsNew.pm 25 Sep 2004 18:20:32 -0000 1.5 *************** *** 28,32 **** my $format = '%Y-%m-%d %H:%M'; ! my $now = DateTime->now(); my $then = $now->clone()->subtract( days => $num_weeks * 7 ); my @where = ( 'posted_on >= ?', 'posted_on <= ?' ); --- 28,32 ---- my $format = '%Y-%m-%d %H:%M'; ! my $now = CTX->create_date(); my $then = $now->clone()->subtract( days => $num_weeks * 7 ); my @where = ( 'posted_on >= ?', 'posted_on <= ?' ); *************** *** 67,71 **** } else { ! $new_item->{posted_on} = DateTime->now(); } } --- 67,71 ---- } else { ! $new_item->{posted_on} = CTX->create_date(); } } |
From: Chris W. <la...@us...> - 2004-09-25 18:20:45
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/full_text/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22101/full_text/OpenInteract2/Action Modified Files: SiteSearch.pm Log Message: general cleanup Index: SiteSearch.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/full_text/OpenInteract2/Action/SiteSearch.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** SiteSearch.pm 9 Jun 2004 02:27:48 -0000 1.14 --- SiteSearch.pm 25 Sep 2004 18:20:31 -0000 1.15 *************** *** 46,52 **** || $self->param( 'default_per_page' ); # Run the search for the first time and save the results ! unless ( $search_id ) { my $search_type = $request->param( 'search_type' ) || $self->param( 'default_search_type' ); --- 46,56 ---- || $self->param( 'default_per_page' ); + if ( $search_id ) { + $params{search_id} = $search_id; + } + # Run the search for the first time and save the results ! else { my $search_type = $request->param( 'search_type' ) || $self->param( 'default_search_type' ); *************** *** 106,110 **** $log->is_info && $log->info( "Retrieving search results for ID ", ! "'$params{search_id}'" ); my $results = OpenInteract2::ResultsManage->new({ search_id => $params{search_id}, --- 110,115 ---- $log->is_info && $log->info( "Retrieving search results for ID ", ! "'$params{search_id}' on page '$current_page' ", ! "with '$hits_per_page' items per page" ); my $results = OpenInteract2::ResultsManage->new({ search_id => $params{search_id}, *************** *** 113,116 **** --- 118,124 ---- # This sets 'min' and 'max' properties $results->set_page_boundaries( $current_page, $hits_per_page ); + $log->is_info && + $log->info( "Set page boundaries: ", $results->min, + " - ", $results->max ); $params{search_iterator} = $results->retrieve({ return_type => 'iterator' }); |
From: Chris W. <la...@us...> - 2004-09-25 18:18:32
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_box In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21739/base_box Modified Files: package.conf Changes Log Message: general cleanup Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_box/package.conf,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** package.conf 7 Jun 2004 04:29:57 -0000 1.12 --- package.conf 25 Sep 2004 18:18:23 -0000 1.13 *************** *** 1,4 **** name base_box ! version 2.12 author Chris Winters <ch...@cw...> url http://www.openinteract.org/ --- 1,4 ---- name base_box ! version 2.13 author Chris Winters <ch...@cw...> url http://www.openinteract.org/ Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_box/Changes,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Changes 7 Jun 2004 04:29:57 -0000 1.13 --- Changes 25 Sep 2004 18:18:23 -0000 1.14 *************** *** 1,4 **** --- 1,8 ---- Revision history for OpenInteract package base_box. + 2.13 Sat Sep 25 14:17:34 EDT 2004 + + Cleanup the box handler and fix examples. + 2.12 Mon Jun 7 00:28:10 EDT 2004 |
From: Chris W. <la...@us...> - 2004-09-25 18:18:32
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_box/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21739/base_box/OpenInteract2/Action Modified Files: Box.pm Log Message: general cleanup Index: Box.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_box/OpenInteract2/Action/Box.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Box.pm 7 Jun 2004 04:29:57 -0000 1.9 --- Box.pm 25 Sep 2004 18:18:23 -0000 1.10 *************** *** 28,32 **** $log ||= get_logger( LOG_APP ); ! $BOX_CONFIG ||= CTX->server_config->{box}; my @base_actions = $self->_create_box_actions; --- 28,32 ---- $log ||= get_logger( LOG_APP ); ! $BOX_CONFIG ||= CTX->lookup_box_config; my @base_actions = $self->_create_box_actions; *************** *** 178,182 **** foreach my $param_name ( keys %{ $use_info->{params} } ) { $log->is_debug && ! $log->debug( "Adding parameter to box: '$param_name' '$use_info->{params}{ $param_name }'" ); $box_action->param( $param_name, $use_info->{params}{ $param_name } ); } --- 178,183 ---- foreach my $param_name ( keys %{ $use_info->{params} } ) { $log->is_debug && ! $log->debug( "Adding parameter to box: '$param_name' ", ! "'$use_info->{params}{ $param_name }'" ); $box_action->param( $param_name, $use_info->{params}{ $param_name } ); } *************** *** 273,278 **** # Deposit all boxes in the current location on the page: [% OI.action_execute( 'boxes' ) %] ! ! # Define global box information in your server.ini [box] handler = MyWebsite::Handler::Box --- 274,281 ---- # Deposit all boxes in the current location on the page: [% OI.action_execute( 'boxes' ) %] ! ! # Define global box information in server configuration ! # ($WEBSITE/conf/server.ini) ! [box] handler = MyWebsite::Handler::Box *************** *** 284,290 **** custom_box_handler = custom_box_method = ! ! # Define an OI action (in conf/action.ini) to be used for a box with ! # a class and method: [current_weather_box] class = OpenInteract2::Action::Weather --- 287,294 ---- custom_box_handler = custom_box_method = ! ! # Define an OI action (in mypkg/conf/action.ini) to be used for a box ! # with a class and method: ! [current_weather_box] class = OpenInteract2::Action::Weather *************** *** 294,297 **** --- 298,302 ---- # Add a box ('name' maps to the above OI action): + my $zip = CTX->request->auth_user->{zipcode}; my $box = { name => 'current_weather_box', *************** *** 302,305 **** --- 307,311 ---- # Add the same box from a template: + [% user_zip = OI.login.zip_code; OI.box_add( 'current_weather_box', *************** *** 310,313 **** --- 316,320 ---- # Define an OI action (in conf/action.ini) to be used for a # template-only box: + [frequent_links_box] name = frequent_links_box *************** *** 318,321 **** --- 325,329 ---- # Add a template-only box, overriding weight and title: + my $box = { name => 'frequent_links_box', weight => 2, *************** *** 324,334 **** --- 332,345 ---- # Add the same box from a template, overriding title: + [% OI.box_add( 'frequent_links_box', title = 'Most visited sites' ) %] # Remove a box added in another part of the system + CTX->controller->remove_box( 'motd' ); # Remove the same box from a template + [% OI.box_remove( 'motd' ) %] *************** *** 354,358 **** But you can create your own shell by defining the key 'box_template' in your theme to be a particular template (in the ! 'package::template_name' format). =head1 CONFIGURATION --- 365,370 ---- But you can create your own shell by defining the key 'box_template' in your theme to be a particular template (in the ! 'package::template_name' format) or by setting the global ! configuration key 'box.default_template'. =head1 CONFIGURATION *************** *** 406,415 **** B<default_template> ($) (optional) ! This is the template into which the box content gets put. Normally this is defined in the theme, but if for some reason someone blanked the template out this will fill in. The default template is C<base_box::main_box_shell>, which as the name ! would indicate is installed with this package. =item * --- 418,427 ---- B<default_template> ($) (optional) ! This is the template into which every box content gets put. Normally this is defined in the theme, but if for some reason someone blanked the template out this will fill in. The default template is C<base_box::main_box_shell>, which as the name ! would indicate is installed with this package. =item * *************** *** 478,482 **** The simplest case is a call: ! push @{ $R->{boxes} }, 'my_box_template'; Which simply uses the scalar passed in as the template name and the --- 490,494 ---- The simplest case is a call: ! CTX->controller->add_box( 'mypkg::my_box_template' ); Which simply uses the scalar passed in as the template name and the *************** *** 486,493 **** Another example: ! push @{ $R->{boxes} }, { name => 'mybox', ! template => 'mypkg::mybox', ! weight => 1, ! title => 'My First Box' }; Each box can define the following parameters: --- 498,504 ---- Another example: ! CTX->controller->add_box({ template => 'mypkg::mybox', ! weight => 1, ! title => 'My First Box' }); Each box can define the following parameters: *************** *** 497,518 **** =item * ! B<name> ($) (mandatory) ! ! Just used to identify the box. ! ! =item * ! ! B<remove> ($) (optional) ! ! If you use this parameter you are telling the box handler to remove a ! box with name 'name'. This box does not have to be added by you or in ! your package -- for instance, you might want to always get rid of the ! 'user_info' and 'login' boxes that come with OI: ! ! push @{ $R->{boxes} }, { name => 'user_info_box', remove => 'yes' }, ! { name => 'login_box', remove => 'yes' }; ! This does require you to know the name, but that should not be too ! onerous a burden. =item * --- 508,515 ---- =item * ! B<name> ($) ! Just used to identify the box; if not provided we use the 'template' ! parameter. =item * *************** *** 562,569 **** =back - =head1 BUGS - - None known. - =head1 TO DO --- 559,562 ---- *************** *** 581,586 **** =head1 SEE ALSO ! L<OpenInteract::SiteTemplate|OpenInteract::SiteTemplate>, ! L<OpenInteract::Theme|OpenInteract::Theme> =head1 COPYRIGHT --- 574,579 ---- =head1 SEE ALSO ! L<OpenInteract2::SiteTemplate|OpenInteract2::SiteTemplate>, ! L<OpenInteract2::Theme|OpenInteract2::Theme> =head1 COPYRIGHT |
From: Chris W. <la...@us...> - 2004-09-25 18:15:46
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21256/Manage/Website Modified Files: InstallPackage.pm Log Message: cleanup Index: InstallPackage.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/InstallPackage.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** InstallPackage.pm 13 Jun 2004 18:19:54 -0000 1.13 --- InstallPackage.pm 25 Sep 2004 18:15:37 -0000 1.14 *************** *** 78,88 **** $installed_package->name, $installed_package->version, $self->param( 'website_dir' ) ); ! } ! eval { ! $self->_create_temp_lib_refresh( $installed_package->name ) ! }; ! if ( $@ ) { ! $status{message} .= "\nNOTE: Could not create temp lib refresh " . ! "file, so you may need to delete it manually."; } } --- 78,88 ---- $installed_package->name, $installed_package->version, $self->param( 'website_dir' ) ); ! eval { ! $self->_create_temp_lib_refresh( $installed_package->name ) ! }; ! if ( $@ ) { ! $status{message} .= "\nNOTE: Could not create temp lib refresh " . ! "file, so you may need to delete it manually."; ! } } } |
From: Chris W. <la...@us...> - 2004-09-25 18:14:01
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20855 Modified Files: Filter.pm Log Message: allow filters listed in 'filter.ini' to be simple key/value pairs rather than a nested hashref with a 'class' key; the latter still works, but the former is more common and easier to read Index: Filter.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Filter.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Filter.pm 13 Jun 2004 04:54:37 -0000 1.6 --- Filter.pm 25 Sep 2004 18:13:50 -0000 1.7 *************** *** 13,22 **** my ( $log ); - sub create_filter_filename { - my ( $class ) = @_; - my $conf_dir = CTX->lookup_directory( 'config' ); - return File::Spec->catfile( $conf_dir, 'filter.ini' ); - } - # Note: $action_item can be a name or an object --- 13,16 ---- *************** *** 50,54 **** $log->info( "Trying to register filter '$filter_name'" ); my ( $observer, $filter_type ); ! if ( my $filter_class = $filter_info->{class} ) { my $error = $class->_require_module( $filter_class ); unless ( $error ) { --- 44,53 ---- $log->info( "Trying to register filter '$filter_name'" ); my ( $observer, $filter_type ); ! ! my $filter_class = ( ref $filter_info ) ! ? $filter_info->{class} ! : $filter_info; ! ! if ( $filter_class ) { my $error = $class->_require_module( $filter_class ); unless ( $error ) { *************** *** 132,135 **** --- 131,140 ---- } + sub create_filter_filename { + my ( $class ) = @_; + my $conf_dir = CTX->lookup_directory( 'config' ); + return File::Spec->catfile( $conf_dir, 'filter.ini' ); + } + sub _register_initial_filters { my ( $class, $ini_filters, $packages ) = @_; *************** *** 155,167 **** # Now cycle through the INI ! while ( my ( $filter_name, $filter_info ) = each %{ $ini_filters } ) { $log_init->is_info && $log_init->info( "Registering filter '$filter_name' from ", "server config" ); if ( $filter_map{ $filter_name } ) { ! $log_init->warn( "WARNING: Overwriting previously registered ", ! "filter '$filter_name'" ); } ! $filter_map{ $filter_name } = $filter_info; } --- 160,172 ---- # Now cycle through the INI ! while ( my ( $filter_name, $filter_class ) = each %{ $ini_filters } ) { $log_init->is_info && $log_init->info( "Registering filter '$filter_name' from ", "server config" ); if ( $filter_map{ $filter_name } ) { ! $log_init->warn( "WARNING: Overwriting filter '$filter_name', ", ! "previously '$filter_map{ $filter_name }'" ); } ! $filter_map{ $filter_name } = $filter_class; } *************** *** 171,177 **** # require/reference/instantiate each ! while ( my ( $filter_name, $filter_info ) = each %filter_map ) { $class->register_filter( $filter_name, ! $filter_info, \%filter_registry ); } --- 176,182 ---- # require/reference/instantiate each ! while ( my ( $filter_name, $filter_class ) = each %filter_map ) { $class->register_filter( $filter_name, ! $filter_class, \%filter_registry ); } *************** *** 209,214 **** # File: $WEBSITE_DIR/conf/filter.ini ! [filters allcaps] ! class = OpenInteract2::Filter::AllCaps # You can also declare it in your package's package.conf file --- 214,219 ---- # File: $WEBSITE_DIR/conf/filter.ini ! [filters] ! allcaps = OpenInteract2::Filter::AllCaps # You can also declare it in your package's package.conf file |
From: Chris W. <la...@us...> - 2004-09-25 17:49:01
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15134/OpenInteract2/Action Modified Files: CommonUpdate.pm CommonRemove.pm CommonAdd.pm Log Message: add pre/post action observations Index: CommonUpdate.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action/CommonUpdate.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** CommonUpdate.pm 15 Jun 2004 00:02:21 -0000 1.17 --- CommonUpdate.pm 25 Sep 2004 17:48:51 -0000 1.18 *************** *** 93,96 **** --- 93,98 ---- my %save_options = (); $self->_update_customize( $object, $old_data, \%save_options ); + $self->notify_observers( 'pre update', $object, $old_data, \%save_options ); + eval { $object->save( \%save_options ) }; if ( $@ ) { *************** *** 103,106 **** --- 105,110 ---- $self->param( c_object_old_data => $old_data ); $self->_update_post_action; + $self->notify_observers( 'post update', $object, $old_data ); + my $success_task = $self->param( 'c_update_task' ); $log->is_debug && *************** *** 300,303 **** --- 304,343 ---- configured C<c_update_task>. + =head1 OBSERVATIONS FIRED + + The C<update()> method fires two observations: + + B<pre update> C<( $action, 'pre update', $object, \%old_data, \%save_options )> + + This is fired just before the object is update, which means that the + C<_update_customize()> method described above has already run. + + This gets passed the object to be updated, a hashref of the data in + the old object, and the options being sent to the C<save()> method: + + package My::Observer; + + sub update { + my ( $class, $action, $type, $object, $old_data, $save_opts ) = @_ + return unless ( $type eq 'pre update' ); + ... + } + + B<post update> C<( $action, 'post update', $object, \%old_data )> + + This is fired after the object is updated as well as after the + C<_update_post_action()> described above. + + This gets passed the object to be updated and a hashref with the data + from the old object: + + package My::Observer; + + sub update { + my ( $class, $action, $type, $object, $old_data ) = @_; + return unless ( $type eq 'post update' ); + ... + } + =head1 CONFIGURATION FOR 'update' Index: CommonRemove.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action/CommonRemove.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** CommonRemove.pm 15 Jun 2004 00:02:21 -0000 1.15 --- CommonRemove.pm 25 Sep 2004 17:48:51 -0000 1.16 *************** *** 42,45 **** --- 42,46 ---- $self->_remove_customize; + $self->notify_observers( 'pre remove', $object ); eval { $object->remove }; *************** *** 51,54 **** --- 52,57 ---- } + $self->notify_observers( 'post remove', $object ); + my $title = "'" . $object->object_description->{title} . "'" || 'Object'; $self->param_add( status_msg => "$title successfully removed." ); *************** *** 139,142 **** --- 142,178 ---- inspections, time of day checking, etc. + =head1 OBSERVATIONS FIRED + + The C<remove()> method fires two observations: + + B<pre remove> C<( $action, 'pre remove', $object )> + + This is fired just before the object is removed, which means that the + C<_remove_customize()> method described above has already run. + + This gets passed the object to be removed: + + package My::Observer; + + sub update { + my ( $class, $action, $type, $object ) = @_ + return unless ( $type eq 'pre remove' ); + ... + } + + B<post remove> C<( $action, 'post remove', $object )> + + This is fired after the object is removed. This gets passed the object + that was removed -- if you try to call C<save()> on this object you + will get an exception. + + package My::Observer; + + sub update { + my ( $class, $action, $type, $object ) = @_; + return unless ( $type eq 'post remove' ); + ... + } + =head1 CONFIGURATION FOR 'remove' Index: CommonAdd.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action/CommonAdd.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** CommonAdd.pm 15 Jun 2004 00:02:21 -0000 1.18 --- CommonAdd.pm 25 Sep 2004 17:48:51 -0000 1.19 *************** *** 67,70 **** --- 67,71 ---- $self->_add_customize( $object, \%save_options ); + $self->notify_observers( 'pre add', $object, \%save_options ); eval { $object->save( \%save_options ) }; if ( $@ ) { *************** *** 79,82 **** --- 80,85 ---- $self->param( status_msg => "$title created properly" ); $self->_add_post_action; + $self->notify_observers( 'post add', $object ); + my $success_task = $self->param( 'c_add_task' ); return $self->execute({ task => $success_task }); *************** *** 209,213 **** Called just before the C<save()> operation which creates the object in ! your datastore. You have three opportunities to affect the operation: =over 4 --- 212,218 ---- Called just before the C<save()> operation which creates the object in ! your datastore. (Note that it is also before the 'pre add' observation ! is posted, see below.) You have three opportunities to affect the ! operation: =over 4 *************** *** 237,244 **** if ( $self->widget_type eq 'Frobozz' and $self->size ne 'Large' ) { ! # First set an error message to tell the user what's wrong... $self->add_view_message( ! size => "Only large widgets of type Frobozz are allowed' ); # Next, provide the object with its values to the form so we --- 242,249 ---- if ( $self->widget_type eq 'Frobozz' and $self->size ne 'Large' ) { ! # First set an error message to tell the user what is wrong... $self->add_view_message( ! size => "Only large widgets of type Frobozz are allowed" ); # Next, provide the object with its values to the form so we *************** *** 256,265 **** This method is called after the object has been successfully created ! -- you'll find the object in the C<c_object> action parameter. You can ! perform any action you like in this method. Similar to C<_add_customize()>, if you throw a C<die> with content it will be displayed to the user rather than moving to the configured C<c_add_task>. =head1 CONFIGURATION FOR 'add' --- 261,305 ---- This method is called after the object has been successfully created ! -- you will find the object in the C<c_object> action parameter. You ! can perform any action you like in this method. Similar to C<_add_customize()>, if you throw a C<die> with content it will be displayed to the user rather than moving to the configured C<c_add_task>. + =head1 OBSERVATIONS FIRED + + The C<add()> method fires two observations: + + B<pre add> C<( $action, 'pre add', $object, \%save_options )> + + This is fired just before the object is added, which means that the + C<_add_customize()> method described above has already run. + + This gets passed the object to be saved and the options being sent to + the C<save()> method: + + package My::Observer; + + sub update { + my ( $class, $action, $type, $object, $save_opts ) = @_ + return unless ( $type eq 'pre add' ); + ... + } + + B<post add> C<( $action, 'post add', $object )> + + This is fired after the object is added as well as after the + C<_add_post_action()> described above. + + This gets passed the object to be saved: + + package My::Observer; + + sub update { + my ( $class, $action, $type, $object ) = @_; + return unless ( $type eq 'post add' ); + ... + } + =head1 CONFIGURATION FOR 'add' |
From: Chris W. <la...@us...> - 2004-09-25 17:40:59
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13335 Modified Files: Action.pm Log Message: allow cache_expire to be set for all tasks within action if it is not set with a hashref Index: Action.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action.pm,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** Action.pm 25 Sep 2004 17:27:26 -0000 1.52 --- Action.pm 25 Sep 2004 17:40:48 -0000 1.53 *************** *** 541,544 **** --- 541,577 ---- sub initialize_cache_params { return undef } + # Just ensure that every value is a number; also allow simple time + # substitutions (e.g., '180m' or '3h' instead of '10800' seconds). + + sub cache_expire { + my ( $self, $cache_info ) = @_; + if ( ref $cache_info eq 'HASH' ) { + foreach my $task ( keys %{ $cache_info } ) { + my $time_spec = $cache_info->{ $task }; + $cache_info->{ $task } = $self->_translate_cache_time( $time_spec ); + } + $self->{cache_expire} = $cache_info; + } + elsif ( $cache_info ) { + my $cache_time = $self->_translate_cache_time( $cache_info ); + $self->{cache_expire} = { '_ALL_' => $cache_time }; + } + return $self->{cache_expire}; + } + + 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 *************** *** 566,571 **** my $keys = $tracking->{ $class } || []; foreach my $cache_key ( @{ $keys } ) { ! $log->is_debug && ! $log->debug( "Clearing key [$cache_key]" ); $cache->clear({ key => $cache_key }); $num_cleared++; --- 599,603 ---- my $keys = $tracking->{ $class } || []; foreach my $cache_key ( @{ $keys } ) { ! $log->is_debug && $log->debug( "Clearing key '$cache_key'" ); $cache->clear({ key => $cache_key }); $num_cleared++; *************** *** 574,581 **** $cache->set({ key => CACHE_CLASS_KEY, data => $tracking }); ! $log->is_debug && ! $log->debug( "Tracking data saved back" ); ! $log->is_info && ! $log->info( "Finished clearing cache for [$class]" ); return $num_cleared; } --- 606,611 ---- $cache->set({ key => CACHE_CLASS_KEY, data => $tracking }); ! $log->is_debug && $log->debug( "Tracking data saved back" ); ! $log->is_info && $log->info( "Finished clearing cache for '$class'" ); return $num_cleared; } *************** *** 584,589 **** sub _is_using_cache { my ( $self ) = @_; ! my $expire = $self->cache_expire || {}; ! return ( $expire ) ? $expire->{ $self->task } : undef; } --- 614,620 ---- sub _is_using_cache { my ( $self ) = @_; ! my $expire = $self->cache_expire; ! return unless ( $expire ); ! return $expire->{ $self->task } || $expire->{'_ALL_'}; } *************** *** 741,768 **** - # Just ensure that every value is a number; also allow simple time - # substitutions (e.g., '180m' or '3h' instead of '10800' seconds). - - sub cache_expire { - my ( $self, $cache_info ) = @_; - if ( $cache_info ) { - foreach my $task ( keys %{ $cache_info } ) { - my $cache_time = $cache_info->{ $task }; - next 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' ); - } - $cache_info->{ $task } = $cache_secs; - $self->{cache_expire} = $cache_info; - } - } - return $self->{cache_expire}; - } - # Do a generic set if property and value given; return a hashref of # all properties --- 772,775 ---- *************** *** 2016,2020 **** print "Tasks not allowed for action: ", join( ', ', @{ $bad_tasks } ), "\n"; ! B<cache_expire> (\%) Mapping of task name to expiration time for cached data in --- 2023,2027 ---- print "Tasks not allowed for action: ", join( ', ', @{ $bad_tasks } ), "\n"; ! B<cache_expire> ($ or \%) Mapping of task name to expiration time for cached data in *************** *** 2025,2028 **** --- 2032,2052 ---- 1d == 1 day + If you specify a single value it will be used for B<all> tasks within + the action. Otherwise you can specify a per-task value using a + hashref. + + # default for all actions + [myaction] + class = MyPackage::Action::Foo + cache_expire = 2h + + # different values for 'display' and 'listing' tasks + [myaction] + class = MyPackage::Action::Foo + + [myaction cache_expire] + display = 2h + listing = 15m + B<cache_param> (\%) |
From: Chris W. <la...@us...> - 2004-09-25 17:28:07
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10892 Modified Files: action.t Log Message: add tests for shorthand time specification in cache_expire Index: action.t =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/action.t,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** action.t 25 May 2004 00:13:30 -0000 1.15 --- action.t 25 Sep 2004 17:27:55 -0000 1.16 *************** *** 7,11 **** require 'utils.pl'; use SPOPS::Secure qw( :level ); ! use Test::More tests => 66; require_ok( 'OpenInteract2::Action' ); --- 7,11 ---- require 'utils.pl'; use SPOPS::Secure qw( :level ); ! use Test::More tests => 72; require_ok( 'OpenInteract2::Action' ); *************** *** 103,114 **** '...got is_secure (false) via accessor' ); # Create a non-named object with parameters and properties, check my $empty_p = eval { ! OpenInteract2::Action->new( undef, ! { task => 'foo', ! method => 'bar', ! username => 'mario', ! city => 'Pittsburgh' } ); }; ok( ! $@, 'Create action with no info but props/params' ) || diag "Error: $@"; --- 103,129 ---- '...got is_secure (false) via accessor' ); + # cache_expire is special + + ok( $empty->cache_expire({ foo => 90, bar => '10m', baz => '2h', lox => '2d' }), + '...set cache_expiration for multiple tasks in multiple formats' ); + is( $empty->cache_expire->{foo}, 90, + '...got expiration set in seconds' ); + is( $empty->cache_expire->{bar}, 600, + '...got expiration set in minutes' ); + is( $empty->cache_expire->{baz}, 7200, + '...got expiration set in hours' ); + is( $empty->cache_expire->{lox}, 172800, + '...got expiration set in days' ); + # Create a non-named object with parameters and properties, check my $empty_p = eval { ! OpenInteract2::Action->new( undef, { ! task => 'foo', ! method => 'bar', ! username => 'mario', ! city => 'Pittsburgh', ! cache_expire => { foo => '10m' } ! } ) }; ok( ! $@, 'Create action with no info but props/params' ) || diag "Error: $@"; *************** *** 123,126 **** --- 138,143 ---- is( $empty_p->param( 'city' ), 'Pittsburgh', '...got param "city"' ); + is( $empty_p->cache_expire->{foo}, 600, + '...got cache expiration in seconds (set in minutes)' ); |
From: Chris W. <la...@us...> - 2004-09-25 17:27:38
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10773 Modified Files: Action.pm Log Message: modify 'cache_expire' to take time in shorthand (10m, 2h, etc.) in addition to specifying in seconds Index: Action.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action.pm,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** Action.pm 30 Jun 2004 12:45:41 -0000 1.51 --- Action.pm 25 Sep 2004 17:27:26 -0000 1.52 *************** *** 37,41 **** url_alt url_none template_source ! cache_expire cache_param ); --- 37,41 ---- url_alt url_none template_source ! cache_param ); *************** *** 584,588 **** sub _is_using_cache { my ( $self ) = @_; ! my $expire = $self->cache_expire; return ( $expire ) ? $expire->{ $self->task } : undef; } --- 584,588 ---- sub _is_using_cache { my ( $self ) = @_; ! my $expire = $self->cache_expire || {}; return ( $expire ) ? $expire->{ $self->task } : undef; } *************** *** 724,739 **** } ! # ...neither is this ! elsif ( $field eq 'name' ) { ! $self->name( $value ); ! } ! # ...this is, but we do something special ! elsif ( $field eq 'cache_expire' ) { ! $self->_property_assign_cache( $value ); } # ...everything else with a defined value (use property_clear # to set to undef) elsif ( $PROPS{ $field } and defined $value ) { $self->$field( $value ); --- 724,736 ---- } ! # ...neither are these ! elsif ( $field =~ /^(name|cache_expire)$/ ) { ! $self->$field( $value ); } # ...everything else with a defined value (use property_clear # to set to undef) + elsif ( $PROPS{ $field } and defined $value ) { $self->$field( $value ); *************** *** 744,756 **** ! # Just ensure that every value is a number ! sub _property_assign_cache { ! my ( $self, $cache ) = @_; ! $cache ||= {}; ! foreach my $task ( keys %{ $cache } ) { ! $cache->{ $task } = int( $cache->{ $task } ); } ! $self->cache_expire( $cache ); } --- 741,766 ---- ! # Just ensure that every value is a number; also allow simple time ! # substitutions (e.g., '180m' or '3h' instead of '10800' seconds). ! sub cache_expire { ! my ( $self, $cache_info ) = @_; ! if ( $cache_info ) { ! foreach my $task ( keys %{ $cache_info } ) { ! my $cache_time = $cache_info->{ $task }; ! next 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' ); ! } ! $cache_info->{ $task } = $cache_secs; ! $self->{cache_expire} = $cache_info; ! } } ! return $self->{cache_expire}; } *************** *** 965,974 **** content_generator = TT ! # The tasks 'listing' and 'latest' can be cached, for 600 and 300 ! # seconds respectively. [news cache_expire] ! listing = 600 ! latest = 300 # Cached content depends on these parameters (multiple ok) --- 975,985 ---- content_generator = TT ! # The tasks 'listing', 'latest' and 'display' can be cached, for 90 ! # seconds, 10 minutes, and 1 day, respectively. [news cache_expire] ! listing = 90 ! latest = 10m ! display = 1d # Cached content depends on these parameters (multiple ok) *************** *** 978,981 **** --- 989,993 ---- listing = language latest = num_items + display = news_id # You can declare security levels in the action configuration, or you *************** *** 984,988 **** [news security] default = write ! show = read listing = read latest = read --- 996,1000 ---- [news security] default = write ! display = read listing = read latest = read *************** *** 1001,1006 **** [newsuk cache_expire] ! listing = 600 ! latest = 600 # Future: Use the same code to generate a SOAP response; at server --- 1013,1018 ---- [newsuk cache_expire] ! listing = 10m ! latest = 300 # Future: Use the same code to generate a SOAP response; at server *************** *** 1015,1024 **** [news_rpc cache_expire] ! listing = 600 latest = 300 [news_rpc security] default = write ! show = read # Dispatch a request to the action by looking up the action in the --- 1027,1036 ---- [news_rpc cache_expire] ! listing = 10m latest = 300 [news_rpc security] default = write ! display = read # Dispatch a request to the action by looking up the action in the *************** *** 1031,1040 **** # ...specifying a task my $action = CTX->lookup_action( 'news' ); ! $action->task( 'show' ); return $action->execute; # ...specifying a task and passing parameters my $action = CTX->lookup_action( 'news' ); ! $action->task( 'show' ); $action->param( news => $news ); $action->param( grafs => 3 ); --- 1043,1052 ---- # ...specifying a task my $action = CTX->lookup_action( 'news' ); ! $action->task( 'display' ); return $action->execute; # ...specifying a task and passing parameters my $action = CTX->lookup_action( 'news' ); ! $action->task( 'display' ); $action->param( news => $news ); $action->param( grafs => 3 ); *************** *** 1048,1056 **** # ...specifying a task ! my $action = OpenInteract2::Action->new( 'news', { task => 'show' } ); # ...specifying a task and passing parameters my $action = OpenInteract2::Action->new( 'news', ! { task => 'show', news => $news, grafs => 3 } ); --- 1060,1068 ---- # ...specifying a task ! my $action = OpenInteract2::Action->new( 'news', { task => 'display' } ); # ...specifying a task and passing parameters my $action = OpenInteract2::Action->new( 'news', ! { task => 'display', news => $news, grafs => 3 } ); *************** *** 1191,1195 **** sub list_russian { return "Lots of russian news in the last week" } sub list_english { return "Lots of english news in the last week" } ! sub show { return "This is the show task!" } sub edit { return "Editing..." } --- 1203,1207 ---- sub list_russian { return "Lots of russian news in the last week" } sub list_english { return "Lots of english news in the last week" } ! sub display { return "This is the display task!" } sub edit { return "Editing..." } *************** *** 1289,1297 **** # OpenInteract 1.x ! return $class->show({ object => $foo, ! error_msg => $error_msg, ! status_msg => $status_msg }); ! sub show { my ( $class, $params ) = @_; if ( $params->{error_msg} ) { --- 1301,1309 ---- # OpenInteract 1.x ! return $class->display({ object => $foo, ! error_msg => $error_msg, ! status_msg => $status_msg }); ! sub display { my ( $class, $params ) = @_; if ( $params->{error_msg} ) { *************** *** 1303,1307 **** # OpenInteract 2.x ! $action->task( 'show' ); $action->param( object => $foo ); $action->param_add( error_msg => $error_msg ); --- 1315,1319 ---- # OpenInteract 2.x ! $action->task( 'display' ); $action->param( object => $foo ); $action->param_add( error_msg => $error_msg ); *************** *** 1311,1315 **** # also: assign parameters in one call ! $action->task( 'show' ); $action->param_assign({ object => $foo, error_msg => $error_msg, --- 1323,1327 ---- # also: assign parameters in one call ! $action->task( 'display' ); $action->param_assign({ object => $foo, error_msg => $error_msg, *************** *** 1319,1323 **** # also: pass parameters in last statement ! $action->task( 'show' ); return $action->execute({ object => $foo, error_msg => $error_msg, --- 1331,1335 ---- # also: pass parameters in last statement ! $action->task( 'display' ); return $action->execute({ object => $foo, error_msg => $error_msg, *************** *** 1329,1335 **** error_msg => $error_msg, status_msg => $status_msg, ! task => 'show' }); ! sub show { my ( $self ) = @_; if ( $self->param( 'error_msg' ) ) { --- 1341,1347 ---- error_msg => $error_msg, status_msg => $status_msg, ! task => 'display' }); ! sub display { my ( $self ) = @_; if ( $self->param( 'error_msg' ) ) { *************** *** 1418,1422 **** part of the cache. ! Here's an example: package OpenInteract2::WikiFilter; --- 1430,1434 ---- part of the cache. ! Here is an example: package OpenInteract2::WikiFilter; *************** *** 1657,1661 **** Generally, your handler can just call C<generate_content()>: ! sub show { my ( $self ) = @_; my $request = CTX->request; --- 1669,1673 ---- Generally, your handler can just call C<generate_content()>: ! sub display { my ( $self ) = @_; my $request = CTX->request; *************** *** 1678,1687 **** [shownews] class = OpenInteract2::Action::News ! task = show return_parameter = news content_generator = SOAP ! If the URL 'http://foo/news/show/?news_id=45' comes in from a browser we will pass the news object to the Template Toolkit generator which will display the news object in some sort of HTML page. --- 1690,1699 ---- [shownews] class = OpenInteract2::Action::News ! task = display return_parameter = news content_generator = SOAP ! If the URL 'http://foo/news/display/?news_id=45' comes in from a browser we will pass the news object to the Template Toolkit generator which will display the news object in some sort of HTML page. *************** *** 1972,1976 **** my $action = OpenInteract2::Action->new({ name => 'bleeble', ! task => 'show' }); return $action->execute; --- 1984,1988 ---- my $action = OpenInteract2::Action->new({ name => 'bleeble', ! task => 'display' }); return $action->execute; *************** *** 1980,1984 **** my $action = OpenInteract2::Action->new({ name => 'bleeble', ! task => 'show', security_level => SEC_LEVEL_WRITE }); return $action->execute; --- 1992,1996 ---- my $action = OpenInteract2::Action->new({ name => 'bleeble', ! task => 'display', security_level => SEC_LEVEL_WRITE }); return $action->execute; *************** *** 2006,2010 **** B<cache_expire> (\%) ! Mapping of task name to expiration time for cached data, in seconds. B<cache_param> (\%) --- 2018,2027 ---- B<cache_expire> (\%) ! Mapping of task name to expiration time for cached data in ! seconds. You can also use shorthand to specify minutes, hours or days: ! ! 10m == 10 minutes ! 3h == 3 hours ! 1d == 1 day B<cache_param> (\%) *************** *** 2070,2074 **** my $action = OpenInteract2::Action->new( 'news' ); ! $action->task( 'show' ); $action->execute; --- 2087,2091 ---- my $action = OpenInteract2::Action->new( 'news' ); ! $action->task( 'display' ); $action->execute; *************** *** 2083,2087 **** my $action = OpenInteract2::Action->new( 'news' ); ! $action->task( 'show' ); $action->param( soda => 'coke' ); --- 2100,2104 ---- my $action = OpenInteract2::Action->new( 'news' ); ! $action->task( 'display' ); $action->param( soda => 'coke' ); *************** *** 2248,2262 **** callbacks in C<execute()>. The one part that cannot be easily specified is when objects change. If your action is using caching then ! you'll probably need to call C<clear_cache()> whenever you modify objects whose content may be cached. "Probably" because your app may not care that some stale data is served up for a little while. ! For instance, if you're caching the latest news items and add a new ! one you don't want your 'latest' listing to miss the entry you just added. So you clear out the old cache entries and let them get rebuilt on demand. ! Since we don't want to create a crazy dependency graph of data that is ! eventually going to expire anyway, we just remove all cache entries generated by this class. --- 2265,2279 ---- callbacks in C<execute()>. The one part that cannot be easily specified is when objects change. If your action is using caching then ! you will probably need to call C<clear_cache()> whenever you modify objects whose content may be cached. "Probably" because your app may not care that some stale data is served up for a little while. ! For instance, if you are caching the latest news items and add a new ! one you do not want your 'latest' listing to miss the entry you just added. So you clear out the old cache entries and let them get rebuilt on demand. ! Since we do not want to create a crazy dependency graph of data that ! is eventually going to expire anyway, we just remove all cache entries generated by this class. |
From: Chris W. <la...@us...> - 2004-09-22 03:09:43
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Request In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv363/lib/OpenInteract2/Request Modified Files: CGI.pm LWP.pm Standalone.pm Log Message: OIN-82: remove get_current() and clear_current() where implemented and from the interface, plus all doc references in these classes Index: CGI.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Request/CGI.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** CGI.pm 17 May 2004 14:19:50 -0000 1.18 --- CGI.pm 22 Sep 2004 03:09:34 -0000 1.19 *************** *** 19,24 **** OpenInteract2::Request::CGI->mk_accessors( @FIELDS ); - my ( $CURRENT ); - sub init { my ( $self, $params ) = @_; --- 19,22 ---- *************** *** 65,74 **** $log->is_info && $log->info( "Finished creating CGI request" ); ! return $CURRENT = $self; } - sub get_current { return $CURRENT } - sub clear_current { $CURRENT = undef } - sub _assign_params_from_cgi { my ( $self, $cgi ) = @_; --- 63,69 ---- $log->is_info && $log->info( "Finished creating CGI request" ); ! return $self; } sub _assign_params_from_cgi { my ( $self, $cgi ) = @_; Index: LWP.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Request/LWP.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** LWP.pm 22 May 2004 15:57:25 -0000 1.19 --- LWP.pm 22 Sep 2004 03:09:34 -0000 1.20 *************** *** 21,26 **** OpenInteract2::Request::LWP->mk_accessors( @FIELDS ); - my ( $CURRENT ); - sub init { my ( $self, $params ) = @_; --- 21,24 ---- *************** *** 52,63 **** $log->is_debug && $log->debug( "Parsed request ok" ); - $CURRENT = $self; return $self; } - sub get_current { return $CURRENT } - sub clear_current { $CURRENT = undef } - - sub _parse_request { my ( $self ) = @_; --- 50,56 ---- Index: Standalone.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Request/Standalone.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Standalone.pm 7 Jun 2004 01:19:18 -0000 1.11 --- Standalone.pm 22 Sep 2004 03:09:34 -0000 1.12 *************** *** 17,22 **** my ( $log ); - my ( $CURRENT ); - sub init { my ( $self, $props ) = @_; --- 17,20 ---- *************** *** 82,92 **** $log->is_info && $log->info( "Finished creating Standalone request" ); ! ! return $CURRENT = $self; } - sub get_current { return $CURRENT } - sub clear_current { $CURRENT = undef } - sub _set_property_defaults { my ( $self, $props ) = @_; --- 80,86 ---- $log->is_info && $log->info( "Finished creating Standalone request" ); ! return $self; } sub _set_property_defaults { my ( $self, $props ) = @_; |