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-08 01:06:51
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18645/lib/OpenInteract2 Modified Files: Brick.pm Log Message: OIN-121: add list_bricks(); move the template to generate new bricks into this class Index: Brick.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Brick.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Brick.pm 2 Feb 2005 13:16:26 -0000 1.2 --- Brick.pm 8 Feb 2005 01:06:40 -0000 1.3 *************** *** 6,9 **** --- 6,10 ---- use base qw( Class::Factory ); use File::Basename qw( basename dirname ); + use File::Path qw( mkpath ); use File::Spec::Functions qw( catfile ); use Log::Log4perl qw( get_logger ); *************** *** 20,23 **** --- 21,29 ---- my ( $log ); + sub list_bricks { + my ( $class ) = @_; + return $class->get_registered_types; + } + sub list_resources { my ( $self ) = @_; *************** *** 64,68 **** NAME: foreach my $name ( @resource_names ) { ! my $info = $self->load_resource( $name ); my ( $final_dest_spec ); $TEMPLATE->process( \$info->{destination}, $template_vars, \$final_dest_spec ) --- 70,76 ---- NAME: foreach my $name ( @resource_names ) { ! my $info = $self->load_resource( $name ); ! ! # First process any template keys in the destination... my ( $final_dest_spec ); $TEMPLATE->process( \$info->{destination}, $template_vars, \$final_dest_spec ) *************** *** 83,86 **** --- 91,95 ---- } + # ...next, evaluate the content if we're supposed to my $content = $info->{content}; unless ( 'no' eq lc $info->{evaluate} ) { *************** *** 101,104 **** --- 110,117 ---- } + my $dest_dir = dirname( $full_dest_file ); + unless ( -d $dest_dir ) { + mkpath( $dest_dir ); + } open( OUT, '>', $full_dest_file ) || oi_error "Cannot write resource '$name' to '$full_dest_file': $!"; *************** *** 155,158 **** --- 168,267 ---- ); + ######################################## + # GENERATING NEW BRICKS + + sub get_brick_class_template { + return <<'TEMPLATE'; + package OpenInteract2::Brick::[% brick_name %]; + + use strict; + use base qw( OpenInteract2::Brick ); + use OpenInteract2::Exception; + + my %INLINED_SUBS = ( + [% FOREACH file_info = all_files -%] + '[% file_info.name %]' => '[% file_info.inline_name %]', + [% END -%] + ); + + sub get_name { + return '[% lc_brick_name %]'; + } + + sub get_resources { + return ( + [% FOREACH file_info = all_files -%] + '[% file_info.name %]' => [ '[% file_info.destination %]', '[% file_info.evaluate %]' ], + [% END -%] + ); + } + + sub load { + my ( $self, $resource_name ) = @_; + my $inline_sub_name = $INLINED_SUBS{ $resource_name }; + unless ( $inline_sub_name ) { + OpenInteract2::Exception->throw( + "Resource name '$resource_name' not found ", + "in ", ref( $self ), "; cannot load content." ); + } + return $self->$inline_sub_name(); + } + + OpenInteract2::Brick->register_factory_type( get_name() => __PACKAGE__ ); + + =pod + + =head1 NAME + + OpenInteract2::Brick::[% brick_name %] - [% brick_summary %] + + =head1 SYNOPSIS + + [% brick_example | indent(2) %] + + =head1 DESCRIPTION + + [% brick_description %] + + =head2 Resources + + You can grab resources individually using the names below and + C<load_resource()> and C<copy_resources_to()>, or you can copy all the + resources at once using C<copy_all_resources_to()> -- see + L<OpenInteract2::Brick> for details. + + =over 4 + + [% FOREACH file_info = all_files %] + =item B<[% file_info.name %]> + [% END %] + + =back + + =head1 COPYRIGHT + + Copyright (c) 2005 [% author_names.join( ', ' ) %]. 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 + + [% FOREACH author_info = authors %] + [% author_info.name %] E<lt>[% author_info.email %]E<gt> + [% END %] + + =cut + + [% FOREACH file_info = all_files %] + sub [% file_info.inline_name %] { + return <<'SOMELONGSTRING'; + [% file_info.contents %] + SOMELONGSTRING + } + [% END %] + TEMPLATE + } + 1; *************** *** 194,197 **** --- 303,318 ---- should always be a lowercased value. + B<list_bricks()> + + Returns a sorted list of all available brick names. With the name you + can instantiate a new brick: + + my @brick_names = OpenInteract2::Brick->list_bricks; + foreach my $name ( @brick_names ) { + my $brick = OpenInteract2::Brick->new( $name ); + print "Resources in brick '$name': ", + join( ", ", $brick->list_resources ), "\n"; + } + =head1 OBJECT METHODS |
From: Chris W. <la...@us...> - 2005-02-03 02:15:06
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7648/t Removed Files: config_transfer_sample.t Log Message: OIN-121: remove class and test for transfer sample, no longer necessary --- config_transfer_sample.t DELETED --- |
From: Chris W. <la...@us...> - 2005-02-03 02:15:05
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7648/lib/OpenInteract2/Config Removed Files: TransferSample.pm Log Message: OIN-121: remove class and test for transfer sample, no longer necessary --- TransferSample.pm DELETED --- |
From: Chris W. <la...@us...> - 2005-02-03 02:13:33
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Package In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7297/lib/OpenInteract2/Manage/Package Modified Files: CreatePackage.pm Log Message: OIN-121: modify package creation task to not require source_dir Index: CreatePackage.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Package/CreatePackage.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CreatePackage.pm 13 Jun 2004 18:19:54 -0000 1.13 --- CreatePackage.pm 3 Feb 2005 02:13:24 -0000 1.14 *************** *** 29,36 **** do_validate => 'yes', }, - source_dir => { - description => $self->get_param_description( 'source_dir' ), - is_required => 'yes', - }, }; } --- 29,32 ---- *************** *** 50,60 **** # TASK - sub setup_task { - my ( $self ) = @_; - my $sample_dir = File::Spec->catdir( $self->param( 'source_dir' ), - 'sample', 'package' ); - $self->param( sample_dir => $sample_dir ); - } - sub run_task { my ( $self ) = @_; --- 46,49 ---- *************** *** 64,69 **** my $package_name = $self->param( 'package' )->[0]; my $package = OpenInteract2::Package->create_skeleton({ ! name => $package_name, ! sample_dir => $self->param( 'sample_dir' ) }); my $msg = sprintf( 'Package %s created ok in %s', --- 53,57 ---- my $package_name = $self->param( 'package' )->[0]; my $package = OpenInteract2::Package->create_skeleton({ ! name => $package_name, }); my $msg = sprintf( 'Package %s created ok in %s', *************** *** 92,99 **** my $package_dir = '/home/me/work/pkg'; my $package_name = 'dev_package'; - my $source_dir = '/home/httpd/OpenInteract-2.0'; my $task = OpenInteract2::Manage->new( 'create_package', { package_dir => $package_dir, - source_dir => $source_dir, package => $package_name } ); my @status = $task->execute; --- 80,85 ---- |
From: Chris W. <la...@us...> - 2005-02-02 16:17:37
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv662/Website Modified Files: UpdatePackageFromWebsite.pm Log Message: explicitly use File::DirSync Index: UpdatePackageFromWebsite.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/UpdatePackageFromWebsite.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UpdatePackageFromWebsite.pm 13 Jun 2004 18:19:54 -0000 1.2 --- UpdatePackageFromWebsite.pm 2 Feb 2005 16:17:27 -0000 1.3 *************** *** 5,8 **** --- 5,9 ---- use strict; use base qw( OpenInteract2::Manage::Website ); + use File::DirSync; use File::Spec::Functions qw( catfile ); use OpenInteract2::Context qw( CTX ); |
From: Chris W. <la...@us...> - 2005-02-02 16:17:05
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv521/Website Modified Files: Create.pm Upgrade.pm Log Message: modify website upgrade to use OI2::Brick framework and move common code to parent class Index: Create.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/Create.pm,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Create.pm 2 Feb 2005 13:58:37 -0000 1.27 --- Create.pm 2 Feb 2005 16:16:52 -0000 1.28 *************** *** 195,213 **** } - sub _install_packages_from_bricks { - my ( $self, $website_dir, $package_names ) = @_; - foreach my $name ( @{ $package_names } ) { - my $brick_name = 'pkg_' . $name; - my $brick = OpenInteract2::Brick->new( $brick_name ); - foreach my $pkg_name ( $brick->list_resources ) { - my $pkg_info = $brick->load_resource( $pkg_name ); - my $pkg_file = OpenInteract2::Util->decode_base64_and_store( - \$pkg_info->{content} - ); - $self->_install_package_file( undef, $pkg_file, $website_dir ); - } - } - } - # Create nowrite flags for HTML and widget dirs --- 195,198 ---- Index: Upgrade.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/Upgrade.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Upgrade.pm 5 Dec 2004 20:01:35 -0000 1.15 --- Upgrade.pm 2 Feb 2005 16:16:52 -0000 1.16 *************** *** 7,11 **** use File::Spec::Functions qw( catdir ); use OpenInteract2::Manage qw( SYSTEM_PACKAGES ); - use OpenInteract2::Config::TransferSample; $OpenInteract2::Manage::Website::Upgrade::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/); --- 7,10 ---- *************** *** 28,32 **** return { website_dir => $self->_get_website_dir_param, - source_dir => $self->_get_source_dir_param, skip_packages => { description => 'Indicates that we should not update the packages', --- 27,30 ---- *************** *** 38,42 **** sub run_task { my ( $self ) = @_; ! my $source_dir = $self->param( 'source_dir' ); if ( $self->param( 'skip_packages' ) ) { $self->_ok( 'install package', --- 36,40 ---- sub run_task { my ( $self ) = @_; ! my $website_dir = $self->param( 'website_dir' ); if ( $self->param( 'skip_packages' ) ) { $self->_ok( 'install package', *************** *** 46,58 **** $self->notify_observers( progress => 'Upgrading packages', { long => 'yes' } ); ! $self->_install_packages( $source_dir, SYSTEM_PACKAGES ); $self->notify_observers( progress => 'Package upgrade complete' ); } ! my $widget_dir = catdir( $source_dir, 'sample', 'website', 'template' ); ! my $website_dir = $self->param( 'website_dir' ); ! my $transfer = OpenInteract2::Config::TransferSample->new( $widget_dir ); ! $transfer->run( $website_dir ); ! foreach my $file ( @{ $transfer->files_copied } ) { $self->_ok( 'copy updated template files', --- 44,54 ---- $self->notify_observers( progress => 'Upgrading packages', { long => 'yes' } ); ! $self->_install_packages_from_bricks( $website_dir, SYSTEM_PACKAGES ); $self->notify_observers( progress => 'Package upgrade complete' ); } ! my $brick = OpenInteract2::Brick->new( 'widgets' ); ! my $status = $brick->copy_all_resources_to( $website_dir ); ! foreach my $file ( @{ $status->{copied} } ) { $self->_ok( 'copy updated template files', *************** *** 61,65 **** ); } ! foreach my $file ( @{ $transfer->files_skipped } ) { $self->_ok( 'copy updated template files', --- 57,61 ---- ); } ! foreach my $file ( @{ $status->{skipped} } ) { $self->_ok( 'copy updated template files', *************** *** 68,72 **** ); } ! foreach my $file ( @{ $transfer->files_same } ) { $self->_ok( 'copy updated template files', --- 64,68 ---- ); } ! foreach my $file ( @{ $status->{same} } ) { $self->_ok( 'copy updated template files', |
From: Chris W. <la...@us...> - 2005-02-02 16:17:05
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv521 Modified Files: Website.pm Log Message: modify website upgrade to use OI2::Brick framework and move common code to parent class Index: Website.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Website.pm 2 Feb 2005 13:08:47 -0000 1.22 --- Website.pm 2 Feb 2005 16:16:51 -0000 1.23 *************** *** 90,93 **** --- 90,108 ---- } + sub _install_packages_from_bricks { + my ( $self, $website_dir, $package_names ) = @_; + foreach my $name ( @{ $package_names } ) { + my $brick_name = 'pkg_' . $name; + my $brick = OpenInteract2::Brick->new( $brick_name ); + foreach my $pkg_name ( $brick->list_resources ) { + my $pkg_info = $brick->load_resource( $pkg_name ); + my $pkg_file = OpenInteract2::Util->decode_base64_and_store( + \$pkg_info->{content} + ); + $self->_install_package_file( undef, $pkg_file, $website_dir ); + } + } + } + # Find all distribution packages in $source_dir/pkg |
From: Chris W. <la...@us...> - 2005-02-02 16:15:46
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32753 Modified Files: MANIFEST Log Message: remove transfer sample and test (no longer needed) Index: MANIFEST =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/MANIFEST,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** MANIFEST 2 Feb 2005 13:23:53 -0000 1.110 --- MANIFEST 2 Feb 2005 16:15:35 -0000 1.111 *************** *** 64,68 **** lib/OpenInteract2/Config/PerlFile.pm lib/OpenInteract2/Config/Readonly.pm - lib/OpenInteract2/Config/TransferSample.pm lib/OpenInteract2/Constants.pm lib/OpenInteract2/ContentGenerator.pm --- 64,67 ---- *************** *** 97,101 **** lib/OpenInteract2/Log/OIAppender.pm lib/OpenInteract2/Manage.pm - lib/OpenInteract2/Manage/CreateSourceDirectory.pm lib/OpenInteract2/Manage/Package.pm lib/OpenInteract2/Manage/Package/Check.pm --- 96,99 ---- *************** *** 236,240 **** t/config_perl.t t/config_readonly.t - t/config_transfer_sample.t t/context.t t/controller.t --- 234,237 ---- |
From: Chris W. <la...@us...> - 2005-02-02 15:47:31
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26573 Modified Files: Package.pm Log Message: OIN-121: update package creation to use OI2::Brick instead of sample/ files Index: Package.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Package.pm,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** Package.pm 2 Feb 2005 13:14:35 -0000 1.45 --- Package.pm 2 Feb 2005 15:47:21 -0000 1.46 *************** *** 20,24 **** use OpenInteract2::Config::PackageChanges; use OpenInteract2::Config::Readonly; - use OpenInteract2::Config::TransferSample; use OpenInteract2::Exception qw( oi_error ); use OpenInteract2::I18N::Initializer; --- 20,23 ---- *************** *** 383,389 **** } ! # Both of these will throw an error on failure ! ! my $sample_dir = $class->_skel_get_sample_dir( $params ); $name = $class->_skel_clean_package_name( $name ); --- 382,386 ---- } ! # dies on failure $name = $class->_skel_clean_package_name( $name ); *************** *** 403,414 **** eval { ! $class->_skel_create_subdirectories( ! $full_skeleton_dir ); ! $class->_skel_copy_sample_files( ! $name, $sample_dir, $full_skeleton_dir ); $class->_skel_create_changelog( $name, $full_skeleton_dir, 'Changes' ); ! $class->_skel_create_manifest( ! $full_skeleton_dir ); }; if ( $@ ) { --- 400,408 ---- eval { ! $class->_skel_create_subdirectories( $full_skeleton_dir ); ! $class->_skel_copy_resources( $name, $full_skeleton_dir ); $class->_skel_create_changelog( $name, $full_skeleton_dir, 'Changes' ); ! $class->_skel_create_manifest( $full_skeleton_dir ); }; if ( $@ ) { *************** *** 842,859 **** ! # Copies over the sample skeleton files from the sample directory in ! # the OI2 source to a new package directory, making some simple ! # variable substitutions along the way. ! sub _skel_copy_sample_files { ! my ( $class, $name, $sample_dir, $dest_dir ) = @_; my $class_name = ucfirst $name; $class_name =~ s/_(\w)/\U$1\U/g; ! my %vars = ( package_name => $name, ! class_name => $class_name ); ! ! return OpenInteract2::Config::TransferSample ! ->new( $sample_dir ) ! ->run( $dest_dir, \%vars ); } --- 836,851 ---- ! # Copies over all resources from the 'package' brick ! sub _skel_copy_resources { ! my ( $class, $name, $dest_dir ) = @_; ! require OpenInteract2::Brick; ! my $brick = OpenInteract2::Brick->new( 'package' ); my $class_name = ucfirst $name; $class_name =~ s/_(\w)/\U$1\U/g; ! return $brick->copy_all_resources_to( $dest_dir, { ! package_name => $name, ! class_name => $class_name ! }); } |
From: Chris W. <la...@us...> - 2005-02-02 13:59:00
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2965/lib/OpenInteract2/Manage/Website Modified Files: Create.pm Log Message: OIN-121: remove source dir from required params Index: Create.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/Create.pm,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Create.pm 2 Feb 2005 13:08:01 -0000 1.26 --- Create.pm 2 Feb 2005 13:58:37 -0000 1.27 *************** *** 52,56 **** my ( $self ) = @_; return { - source_dir => $self->_get_source_dir_param, website_dir => { description => --- 52,55 ---- *************** *** 107,111 **** my ( $self ) = @_; my $website_dir = $self->param( 'website_dir' ); - my $source_dir = $self->param( 'source_dir' ); $self->_create_directories( $website_dir ); --- 106,109 ---- *************** *** 130,134 **** $self->notify_observers( progress => 'Packages installed' ); ! $self->_set_nowrite_files( $website_dir, $source_dir ); $self->_add_status_head({ action => 'create website', --- 128,132 ---- $self->notify_observers( progress => 'Packages installed' ); ! $self->_set_nowrite_files( $website_dir ); $self->_add_status_head({ action => 'create website', *************** *** 291,298 **** my $website_dir = '/home/httpd/mysite'; - my $source_dir = '/usr/local/src/OpenInteract-2.01'; my $task = OpenInteract2::Manage->new( ! 'create_website', { website_dir => $website_dir, ! source_dir => $source_dir } ); my @status = $task->execute; foreach my $s ( @status ) { --- 289,294 ---- my $website_dir = '/home/httpd/mysite'; my $task = OpenInteract2::Manage->new( ! 'create_website', { website_dir => $website_dir } ); my @status = $task->execute; foreach my $s ( @status ) { |
From: Chris W. <la...@us...> - 2005-02-02 13:24:22
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27480/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.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Changes.pod 5 Dec 2004 20:41:39 -0000 1.63 --- Changes.pod 2 Feb 2005 13:24:08 -0000 1.64 *************** *** 25,28 **** --- 25,110 ---- pushed off to 2.01. + =head1 1.99_06 + + =head2 Upgrade Notes + + =head2 Major Changes + + =over 4 + + =item * + + OIN-121 - You can now create an OI2 website without a 'source_dir' -- + all our resources are held as data in class files under + L<OpenInteract2::Brick>, and the parent class has methods to write + these resources to the filesystem after an optional initial + evaluation. + + This includes packages which are stored in Base64-encoding in the + class. + + =item * + + OIN-115 - Break L<OpenInteract2::Setup> into individual tasks and + create a framework so that new setup tasks will get discovered at + runtime. We get a name from each task and its dependencies and + determine the order they should be run. See L<OpenInteract2::Setup> + for more information. + + =back + + =head2 Minor Changes + + L<OpenInteract2::Context> + + =over 4 + + =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 + + L<OpenInteract2::Manage::Package::Export + + =over 4 + + OIN-111: Ensure that every package we try to export gets a useful + error message if the export fails. + + =back + + L<OpenInteract2::Package> + + =over 4 + + =item * + + OIN-102: Ensure that if any modules declared in the package.conf fail + we don't read in any perl modules. The errors found when bringing in + the module with a bad 'use' are confusing. + + =item * + + OIN-105: Add check to package validation to ensure that all message + files are formatted so we can extract a language from them. + + =back + + L<OpenInteract2::Util> + + =over 4 + + =item * + + Added C<digest_content( $content )> to calculate the MD5 digest of + arbitrary data. + + =back + + + =head1 1.99_05 (2.0 beta 5), 5 Dec 2004 |
From: Chris W. <la...@us...> - 2005-02-02 13:24:07
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27367 Modified Files: MANIFEST Log Message: add brick test Index: MANIFEST =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/MANIFEST,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** MANIFEST 2 Feb 2005 13:19:17 -0000 1.109 --- MANIFEST 2 Feb 2005 13:23:53 -0000 1.110 *************** *** 225,228 **** --- 225,229 ---- t/auth_group.t t/auth_user.t + t/brick.t t/cache.t t/cache_file.t |
From: Chris W. <la...@us...> - 2005-02-02 13:20:56
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26472/t Added Files: brick.t Log Message: just a require test for now... --- NEW FILE: brick.t --- # -*-perl-*- # $Id: brick.t,v 1.1 2005/02/02 13:20:42 lachoy Exp $ use strict; use lib 't/'; require 'utils.pl'; use Test::More; plan tests => 1; require_ok( 'OpenInteract2::Brick' ); |
From: Chris W. <la...@us...> - 2005-02-02 13:20:16
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26281 Modified Files: build_bricks Log Message: add code to generate the package brick classes Index: build_bricks =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/build_bricks,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** build_bricks 28 Jan 2005 17:07:32 -0000 1.4 --- build_bricks 2 Feb 2005 13:20:03 -0000 1.5 *************** *** 7,10 **** --- 7,12 ---- use strict; + use File::Basename qw( basename ); + use MIME::Base64 qw( encode_base64 ); use Template; *************** *** 70,77 **** --- 72,82 ---- my $brick_template = join( '', <DATA> ); + my @brick_params = (); + while ( my ( $brick_dir, $brick_info ) = each %SPECS ) { my @brick_files = read_brick_files( $brick_dir ); my $brick_name = $brick_info->[0]; my %params = ( + brick_dir => $brick_dir, brick_name => $brick_name, lc_brick_name => lc $brick_name, *************** *** 82,93 **** all_files => \@brick_files, ); ! my $brick_lib_dir = 'lib/OpenInteract2/Brick'; ! unless ( -d $brick_lib_dir ) { ! mkdir( $brick_lib_dir ); ! } my $output_file = "$brick_lib_dir/$brick_name.pm"; ! $template->process( \$brick_template, \%params, $output_file ) ! || die "Cannot process files from '$brick_dir' -> '$output_file': ", $template->error(); ! print "Generated $output_file with ", scalar( @brick_files ), " inlined files\n"; } } --- 87,142 ---- all_files => \@brick_files, ); ! push @brick_params, \%params; ! } ! ! # Now do the same with packages, but base64 them first... ! ! my $pkg_desc = 'This class holds the Base64-encoded versions of ' . ! 'package file "%s" shipped with OpenInteract2. Once you ' . ! 'decode them you should store them as a ZIP file ' . ! 'and then read them in with Archive::Zip or some ' . ! 'other utility.'; ! my %pkg_brick_base = ( ! brick_dir => 'pkg', ! brick_name => 'App%s', ! lc_brick_name => 'pkg_%s', ! brick_summary => "Base-64 encoded OI2 package '%s' shipped with distribution", ! brick_example => 'oi2_manage create_website --website_dir=/path/to/site', ! brick_description => $pkg_desc, ! oi2_version => $oi2_version, ! ); ! foreach my $pkg_file ( read_package_files( 'pkg/' ) ) { ! my %pkg_brick = %pkg_brick_base; ! my $base_name = $pkg_file->{name}; ! $base_name =~ s/^([^-]+).*/$1/; ! my $cc_base_name = ucfirst( $base_name ); ! $cc_base_name =~ s/_(\w)/uc($1)/ge; ! $pkg_brick{brick_name} = sprintf( ! $pkg_brick{brick_name}, $cc_base_name ); ! $pkg_brick{lc_brick_name} = sprintf( ! $pkg_brick{lc_brick_name}, $base_name ); ! $pkg_brick{brick_summary} = sprintf( ! $pkg_brick{brick_summary}, $pkg_file->{name} ); ! $pkg_brick{brick_description} = sprintf( ! $pkg_brick{brick_description}, $pkg_file->{name} ); ! $pkg_brick{all_files} = [ $pkg_file ]; ! push @brick_params, \%pkg_brick; ! } ! ! ! my $brick_lib_dir = 'lib/OpenInteract2/Brick'; ! unless ( -d $brick_lib_dir ) { ! mkdir( $brick_lib_dir ); ! } ! ! foreach my $brick_param ( @brick_params ) { ! my $brick_name = $brick_param->{brick_name}; my $output_file = "$brick_lib_dir/$brick_name.pm"; ! $template->process( \$brick_template, $brick_param, $output_file ) ! || die "Cannot process files from '$brick_param->{brick_dir}' ", ! "-> '$output_file': ", $template->error(); ! print "Generated $output_file with ", ! scalar( @{ $brick_param->{all_files} } ), " ", ! "inlined files\n"; } } *************** *** 113,123 **** my $contents = join( '', <FILE> ); close( FILE ); - my $inline_name = uc $file; - $inline_name =~ s/\W//g; push @files, { name => $file, ! inline_name => $inline_name, destination => $destination, ! evaluatable => $do_evaluate, contents => $contents, }; --- 162,170 ---- my $contents = join( '', <FILE> ); close( FILE ); push @files, { name => $file, ! inline_name => create_inline_name( $file ), destination => $destination, ! evaluate => $do_evaluate, contents => $contents, }; *************** *** 127,130 **** --- 174,211 ---- } + sub read_package_files { + my ( $subdir ) = @_; + my @specs = (); + opendir( ZIPS, $subdir ) + || die "Cannot read zips from '$subdir': $!"; + my @zips = map { "$subdir/$_" } grep /\.zip$/, readdir( ZIPS ); + closedir( ZIPS ); + foreach my $zipfile ( @zips ) { + open( ZIP, '<', $zipfile ) + || die "Cannot read '$zipfile': $!"; + my ( $buf, $content ); + while ( read( ZIP, $buf, 60*57 ) ) { + $content .= encode_base64( $buf ); + } + close( ZIP ); + my $base_filename = basename( $zipfile ); + push @specs, { + name => $base_filename, + inline_name => create_inline_name( $base_filename ), + destination => "pkg $base_filename", + evaluate => 'no', + contents => $content, + }; + } + return @specs; + } + + sub create_inline_name { + my ( $file ) = @_; + my $inline_name = uc $file; + $inline_name =~ s/\W//g; + return $inline_name; + } + sub read_version { open( VER, '<', 'VERSION' ) || die "Cannot open version doc: $!"; *************** *** 156,160 **** return ( [% FOREACH file_info = all_files -%] ! '[% file_info.name %]' => [ '[% file_info.destination %]', '[% file_info.evaluatable %]' ], [% END -%] ); --- 237,241 ---- return ( [% FOREACH file_info = all_files -%] ! '[% file_info.name %]' => [ '[% file_info.destination %]', '[% file_info.evaluate %]' ], [% END -%] ); |
From: Chris W. <la...@us...> - 2005-02-02 13:19:30
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26132 Modified Files: MANIFEST Log Message: remove all pkg/*.zip files and replace with OI2/Brick/App* classes Index: MANIFEST =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/MANIFEST,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** MANIFEST 28 Jan 2005 16:49:42 -0000 1.108 --- MANIFEST 2 Feb 2005 13:19:17 -0000 1.109 *************** *** 30,33 **** --- 30,49 ---- lib/OpenInteract2/Brick/Apache.pm lib/OpenInteract2/Brick/Apache2.pm + lib/OpenInteract2/Brick/AppBase.pm + lib/OpenInteract2/Brick/AppBaseBox.pm + lib/OpenInteract2/Brick/AppBaseError.pm + lib/OpenInteract2/Brick/AppBaseGroup.pm + lib/OpenInteract2/Brick/AppBasePage.pm + lib/OpenInteract2/Brick/AppBaseSecurity.pm + lib/OpenInteract2/Brick/AppBaseTemplate.pm + lib/OpenInteract2/Brick/AppBaseTheme.pm + lib/OpenInteract2/Brick/AppBaseUser.pm + lib/OpenInteract2/Brick/AppComments.pm + lib/OpenInteract2/Brick/AppFullText.pm + lib/OpenInteract2/Brick/AppLookup.pm + lib/OpenInteract2/Brick/AppNews.pm + lib/OpenInteract2/Brick/AppObjectActivity.pm + lib/OpenInteract2/Brick/AppSystemDoc.pm + lib/OpenInteract2/Brick/AppWhatsNew.pm lib/OpenInteract2/Brick/CGI.pm lib/OpenInteract2/Brick/Daemon.pm *************** *** 187,206 **** lib/OpenInteract2/Upload.pm lib/OpenInteract2/Util.pm - pkg/base-2.11.zip - pkg/base_box-2.17.zip - pkg/base_error-2.10.zip - pkg/base_group-2.16.zip - pkg/base_page-2.28.zip - pkg/base_security-2.18.zip - pkg/base_template-3.15.zip - pkg/base_theme-2.10.zip - pkg/base_user-2.35.zip - pkg/comments-1.19.zip - pkg/full_text-2.58.zip - pkg/lookup-2.07.zip - pkg/news-2.20.zip - pkg/object_activity-2.11.zip - pkg/system_doc-2.08.zip - pkg/whats_new-2.10.zip script/clean_search_results.pl script/oi2_daemon --- 203,206 ---- |
From: Chris W. <la...@us...> - 2005-02-02 13:17:15
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25624 Modified Files: I18N.pm Log Message: cosmetic Index: I18N.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/I18N.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** I18N.pm 6 Jun 2004 04:42:25 -0000 1.7 --- I18N.pm 2 Feb 2005 13:17:03 -0000 1.8 *************** *** 12,18 **** my ( $log ); - # This is the Locale::Maketext project file. Add any customizations here... - - # Override so we can add the message key to the output as required # TODO: This may be a performance bottleneck... --- 12,15 ---- |
From: Chris W. <la...@us...> - 2005-02-02 13:16:41
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25468 Modified Files: Brick.pm Log Message: OIN-121: add functionality to evaluate and copy brick resources to a directory Index: Brick.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Brick.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Brick.pm 28 Jan 2005 16:47:44 -0000 1.1 --- Brick.pm 2 Feb 2005 13:16:26 -0000 1.2 *************** *** 5,17 **** use strict; use base qw( Class::Factory ); use OpenInteract2::Exception qw( oi_error ); use OpenInteract2::Util; $OpenInteract2::Brick::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/); sub list_resources { my ( $self ) = @_; ! my $all_resources = $self->get_resources; ! return sort @{ $all_resources }; } --- 5,27 ---- use strict; use base qw( Class::Factory ); + use File::Basename qw( basename dirname ); + use File::Spec::Functions qw( catfile ); + use Log::Log4perl qw( get_logger ); + use OpenInteract2::Config::Readonly; + use OpenInteract2::Constants qw( :log ); use OpenInteract2::Exception qw( oi_error ); use OpenInteract2::Util; + use Template; $OpenInteract2::Brick::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/); + my $TEMPLATE = Template->new(); + + my ( $log ); + sub list_resources { my ( $self ) = @_; ! my %all_resources = $self->get_resources; ! return sort keys %all_resources; } *************** *** 21,32 **** oi_error "You must specify a resource name to load."; } ! my $all_resources = $self->get_resources; ! my $info = $all_resources->{ $name }; unless ( $info ) { oi_error "Resource '$name' is invalid. Valid resources are: ", ! join( ', ', sort keys %{ $all_resources } ); } $info->[1] ||= 'yes'; ! return { content => $self->load( $name ), destination => $info->[0], --- 31,42 ---- oi_error "You must specify a resource name to load."; } ! my %all_resources = $self->get_resources; ! my $info = $all_resources{ $name }; unless ( $info ) { oi_error "Resource '$name' is invalid. Valid resources are: ", ! join( ', ', sort keys %all_resources ); } $info->[1] ||= 'yes'; ! return { content => $self->load( $name ), destination => $info->[0], *************** *** 35,38 **** --- 45,144 ---- } + sub copy_all_resources_to { + my ( $self, $dest_dir, $template_vars ) = @_; + return $self->copy_resources_to( + $dest_dir, $template_vars, $self->list_resources + ); + } + + sub copy_resources_to { + my ( $self, $dest_dir, $template_vars, @resource_names ) = @_; + $log ||= get_logger( LOG_INIT ); + + $template_vars ||= {}; + + my @copied = (); + my @skipped = (); + my @same = (); + + NAME: + foreach my $name ( @resource_names ) { + my $info = $self->load_resource( $name ); + my ( $final_dest_spec ); + $TEMPLATE->process( \$info->{destination}, $template_vars, \$final_dest_spec ) + || oi_error "Cannot process destination '$info->{destination}': ", + $TEMPLATE->error(); + $log->is_info && $log->info( "Translated '$info->{destination}' ", + "-> $final_dest_spec" ); + my @dest_spec = split( /\s+/, $final_dest_spec ); + my $relative_dest = join( '/', @dest_spec ); + my $full_dest_file = catfile( $dest_dir, @dest_spec ); + + if ( $self->_is_readonly( $full_dest_file ) ) { + $log->is_info && + $log->info( "Skipping '$full_dest_file', marked ", + "as readonly in the destination directory" ); + push @skipped, $full_dest_file; + next NAME; + } + + my $content = $info->{content}; + unless ( 'no' eq lc $info->{evaluate} ) { + my ( $new_content ); + $TEMPLATE->process( \$content, $template_vars, \$new_content ) + || oi_error "Cannot copy and replace tokens from resource ", + $TEMPLATE->error(); + $log->is_info && $log->info( "Processed template ok" ); + $content = $new_content; + } + + if ( $self->_is_same( $full_dest_file, $content ) ) { + $log->is_info && + $log->info( "Skipping '$full_dest_file', content and ", + "destination file are the same" ); + push @same, $full_dest_file; + next NAME; + } + + open( OUT, '>', $full_dest_file ) + || oi_error "Cannot write resource '$name' to '$full_dest_file': $!"; + print OUT $content; + close( OUT ); + $log->is_info && + $log->info( "Copied resource '$name' to '$full_dest_file' ok" ); + push @copied, $full_dest_file; + } + return { + copied => \@copied, + skipped => \@skipped, + same => \@same, + }; + } + + sub _is_readonly { + my ( $self, $dest_file ) = @_; + return 0 unless ( -f $dest_file ); + my $base_dest_file = basename( $dest_file ); + my $full_dest_dir = dirname( $dest_file ); + my $ro_check = OpenInteract2::Config::Readonly->new( $full_dest_dir ); + return ( ! $ro_check->is_writeable( $base_dest_file ) ); + } + + sub _is_same { + my ( $self, $dest_file, $content ) = @_; + return 0 unless ( -f $dest_file ); + my $source_size = length $content; + my $dest_file_size = (stat $dest_file)[7]; + return 0 unless ( $source_size == $dest_file_size ); + my $source_digest = + OpenInteract2::Util->digest_content( $content ); + my $dest_digest = + OpenInteract2::Util->digest_file( $dest_file ); + return ( $source_digest eq $dest_digest ); + } + + ######################################## + # SUBCLASSES + sub get_name { _must_implement( 'get_name', @_ ) } sub get_resources { _must_implement( 'get_resources', @_ ) } *************** *** 45,49 **** } - OpenInteract2::Util->find_factory_subclasses( 'OpenInteract2::Brick', @INC --- 151,154 ---- *************** *** 152,155 **** --- 257,285 ---- package OpenInteract2::Action::BaseballStats; + B<copy_all_resources_to( $destination_dir, [ \%token_replacements ] )> + + Copies all resources from this brick to C<$destination_dir>. See + L<copy_resources_to()> for more. + + Returns: hashref with keys 'copied', 'skipped', 'same' each of which + has as its value an arrayref of the relevant files. + + B<copy_resources_to( $destination_dir, \%token_replacements, @resource_names )> + + Copies the resources with C<@resource_names> to the given + C<$destination_dir>. For those resources that are evaluatable use the + C<\%token_replacements> when evaluating as Template Toolkit templates. + + If the source and destination are the same -- checked by the content + size and MD5 digest -- we don't do a copy. + + We also don't do a copy if the resource is specified in the + directory's has a '.no_overwrite' file. (See + L<OpenInteract2::Config::Readonly> for this file's format and how we + use it.) + + Returns: hashref with keys 'copied', 'skipped', 'same' each of which + has as its value an arrayref of the relevant files. + =head1 SUBCLASSING |
From: Chris W. <la...@us...> - 2005-02-02 13:15:19
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25272 Modified Files: Manage.pm Log Message: don't recreate the context with every call -- first check if it already exists Index: Manage.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage.pm,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** Manage.pm 26 Jan 2005 02:35:55 -0000 1.43 --- Manage.pm 2 Feb 2005 13:15:04 -0000 1.44 *************** *** 493,496 **** --- 493,501 ---- sub _setup_context { my ( $self, $params ) = @_; + + # don't recreate the context every time + eval { OpenInteract2::Context->instance }; + return unless ( $@ ); + my $log = get_logger(); if ( $self->param( 'debug' ) ) { |
From: Chris W. <la...@us...> - 2005-02-02 13:14:47
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25164 Modified Files: Package.pm Log Message: we cannot depend on the package ZIP containing the name + version Index: Package.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Package.pm,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** Package.pm 25 Jan 2005 04:03:19 -0000 1.44 --- Package.pm 2 Feb 2005 13:14:35 -0000 1.45 *************** *** 72,76 **** oi_error "Cannot initialize package with non-existent package ", "directory. (Given $params->{directory})"; ! } $log->is_debug && $log->debug( "Reading package from directory '$full_directory'" ); --- 72,76 ---- oi_error "Cannot initialize package with non-existent package ", "directory. (Given $params->{directory})"; ! } $log->is_debug && $log->debug( "Reading package from directory '$full_directory'" ); *************** *** 106,110 **** $log ||= get_logger( LOG_OI ); ! my $tmp_dir = tempdir( 'OIPKGXXXX', TMPDIR => 1, CLEANUP => 1 ); unless ( -d $tmp_dir and -w $tmp_dir ) { oi_error "Cannot find writeable temp dir"; --- 106,110 ---- $log ||= get_logger( LOG_OI ); ! my $tmp_dir = tempdir( 'OIPKGXXXXXX', TMPDIR => 1, CLEANUP => 1 ); unless ( -d $tmp_dir and -w $tmp_dir ) { oi_error "Cannot find writeable temp dir"; *************** *** 117,125 **** $log->debug( "Reading package info from '$package_file'" ); eval { ! my $filename = basename( $self->package_file ); ! my $ext = '.' . DISTRIBUTION_EXTENSION; ! my ( $subdir ) = $filename =~ /^(.*)$ext$/; ! $self->_extract_archive( $self->package_file ); ! my $extracted_dir = catdir( $tmp_dir, $subdir ); $self->_read_info_from_dir( $extracted_dir ); $self->_read_manifest( $extracted_dir ); --- 117,129 ---- $log->debug( "Reading package info from '$package_file'" ); eval { ! my $extracted = $self->_extract_archive( $self->package_file ); ! unless ( scalar @{ $extracted } ) { ! oi_error "Failed to extract any files from package ", ! "file ", $self->package_file; ! } ! my @sample_path = split( '/', $extracted->[0]->fileName() ); ! my $extracted_dir = catdir( $tmp_dir, $sample_path[0] ); ! $log->is_debug && ! $log->debug( "Package unpacked to directory '$extracted_dir'" ); $self->_read_info_from_dir( $extracted_dir ); $self->_read_manifest( $extracted_dir ); *************** *** 156,160 **** } - ######################################## # PROPERTIES --- 160,163 ---- |
From: Chris W. <la...@us...> - 2005-02-02 13:14:01
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25036 Modified Files: Request.pm Log Message: cosmetic debugging additions/modifications Index: Request.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Request.pm,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** Request.pm 28 Nov 2004 17:50:46 -0000 1.48 --- Request.pm 2 Feb 2005 13:13:50 -0000 1.49 *************** *** 403,407 **** elsif ( my @param_lang = $self->param( $lang_config->{choice_param_name} ) ) { $log->is_debug && ! $log->debug( "Added language from parameter: $session_lang" ); push @lang, @param_lang; } --- 403,408 ---- elsif ( my @param_lang = $self->param( $lang_config->{choice_param_name} ) ) { $log->is_debug && ! $log->debug( "Added language from request parameter ", ! "'$lang_config->{choice_param_name}'" ); push @lang, @param_lang; } *************** *** 412,415 **** --- 413,417 ---- } + if ( my @browser_lang = $self->_find_browser_languages ) { $log->is_debug && *************** *** 425,428 **** --- 427,433 ---- $self->{_user_language} = \@lang; } + $log->is_debug && + $log->debug( "Request property 'language' now: ", + join( ', ', @{ $self->{_user_language} } ) ); } *************** *** 446,450 **** sort { $b->[1] <=> $a->[1] } @lang_data; $log->is_debug && ! $log->debug( "Found the following languages from the browser: ", join( ', ', @langs ) ); return @langs; --- 451,455 ---- sort { $b->[1] <=> $a->[1] } @lang_data; $log->is_debug && ! $log->debug( "Parsed browser header into following language tags: ", join( ', ', @langs ) ); return @langs; *************** *** 478,482 **** $log ||= get_logger( LOG_REQUEST ); my @langs = $self->language; ! $log->info( "Retrieved languages for request: ", join( ', ', @langs ) ); $self->{_lang_handle} = OpenInteract2::I18N->get_handle( @langs ); if ( $log->is_debug ) { --- 483,487 ---- $log ||= get_logger( LOG_REQUEST ); my @langs = $self->language; ! $log->info( "Languages for this request: ", join( ', ', @langs ) ); $self->{_lang_handle} = OpenInteract2::I18N->get_handle( @langs ); if ( $log->is_debug ) { *************** *** 484,488 **** no strict 'refs'; my @parents = @{ $type . '::ISA' }; ! $log->debug( "Language handle is of type: $type with parents: ", join( ', ', @parents ) ); } --- 489,493 ---- no strict 'refs'; my @parents = @{ $type . '::ISA' }; ! $log->debug( "Language handle is of type '$type' with parents: ", join( ', ', @parents ) ); } *************** *** 510,514 **** # Initialize new object ! sub init { oi_error 'Subclass must implement init()' } 1; --- 515,519 ---- # Initialize new object ! sub init { oi_error 'Subclass must implement init()' } 1; |
From: Chris W. <la...@us...> - 2005-02-02 13:12:23
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24737 Modified Files: Util.pm Log Message: add digest_content() (calc MD5 digest for content vs file) and decode_base64_and_store() Index: Util.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Util.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Util.pm 24 Jan 2005 17:00:43 -0000 1.17 --- Util.pm 2 Feb 2005 13:12:14 -0000 1.18 *************** *** 7,13 **** use Digest::MD5; use File::Spec::Functions qw( catdir catfile ); use Log::Log4perl qw( get_logger ); ! use Mail::Sendmail (); ! use MIME::Lite (); use OpenInteract2::Constants qw( :log ); use OpenInteract2::Context qw( CTX ); --- 7,15 ---- use Digest::MD5; use File::Spec::Functions qw( catdir catfile ); + use File::Temp qw( tempfile ); use Log::Log4perl qw( get_logger ); ! use Mail::Sendmail (); ! use MIME::Base64 qw( decode_base64 ); ! use MIME::Lite (); use OpenInteract2::Constants qw( :log ); use OpenInteract2::Context qw( CTX ); *************** *** 112,115 **** --- 114,144 ---- } + sub digest_content { + my ( $class, $content ) = @_; + my $md5 = Digest::MD5->new(); + $md5->add( $content ); + return $md5->hexdigest; + } + + + sub decode_base64_and_store { + my ( $class, $encoded_content, $output_file ) = @_; + my ( $fh ); + if ( $output_file ) { + open( $fh, '>', $output_file ) + || oi_error "Cannot write decoded base 64 content ", + "to '$output_file': $!"; + } + else { + ( $fh, $output_file ) = tempfile( 'OIPKGXXXXXX', UNLINK => 1 ); + unless ( $fh ) { + oi_error "Cannot open writeable temp file"; + } + } + print $fh decode_base64( $$encoded_content ); + close( $fh ); + return $output_file; + } + ######################################## # EMAIL ROUTINES *************** *** 254,257 **** --- 283,288 ---- my ( $class, $factory_class, @dirs ) = @_; + %FACTORY_FILES = (); + foreach my $lib_dir ( @dirs ) { next unless ( $lib_dir ); *************** *** 387,390 **** --- 418,438 ---- L<Digest::MD5> for restrictions, notably regarding unicode.) + B<digest_content( $content )> + + Returns the hex MD5 digest of C<$content>. (See L<Digest::MD5> for + restrictions, notably regarding unicode.) + + B<decode_base64_and_store( \$base64_content, [ $output_file ] )> + + Decodes C<$base64_content> (a scalar ref) and stores the decoded + content in either C<$output_file> (if specified) or in a new temp + file. Note that while the temp file is marked for deletion once the + program exits you should remove it once you're done. + + Throws exception if we cannot write to C<$output_file> or generate a + temporary file according to L<File::Temp>. + + Returns: filename with decoded content + =head1 MAIL METHODS |
From: Chris W. <la...@us...> - 2005-02-02 13:10:51
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/I18N In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24506/I18N Modified Files: Initializer.pm Log Message: the I18N subclass is returned from a subroutine rather than in __DATA__ Index: Initializer.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/I18N/Initializer.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Initializer.pm 25 Jan 2005 04:03:20 -0000 1.10 --- Initializer.pm 2 Feb 2005 13:10:42 -0000 1.11 *************** *** 68,72 **** $TEMPLATE ||= Template->new(); ! $BASE_CLASS = join( '', <DATA> ); MSGFILE: --- 68,72 ---- $TEMPLATE ||= Template->new(); ! $BASE_CLASS = $self->_get_lang_template(); MSGFILE: *************** *** 178,181 **** --- 178,184 ---- my @lang_class_pieces = @base_class_pieces; + # 'en' is always the default language no matter what your + # website's default language is + unless ( $lang eq 'en' ) { push @base_class_pieces, 'en'; *************** *** 207,212 **** $TEMPLATE->error(); $log->is_debug && ! $log->debug( "Processed template okay. Now eval'ing class with ", ! "these contents: ", $gen_class ); eval $gen_class; if ( $@ ) { --- 210,215 ---- $TEMPLATE->error(); $log->is_debug && ! $log->debug( "Class generated ok; now eval'ing class with\n", ! $gen_class ); eval $gen_class; if ( $@ ) { *************** *** 215,226 **** } $log->is_debug && ! $log->debug( "Evaluated class okay" ); return $lang_class; } ! 1; ! ! ! __DATA__ package [% lang_class %]; --- 218,227 ---- } $log->is_debug && ! $log->debug( "Evaluated class $lang_class ok" ); return $lang_class; } ! sub _get_lang_template { ! return <<'TEMPLATE'; package [% lang_class %]; *************** *** 234,244 **** %Lexicon = ( ! [% FOREACH msg_key = messages.keys %] '[% msg_key %]' => qq{[% messages.$msg_key %]}, ! [% END %] ); 1; __END__ --- 235,250 ---- %Lexicon = ( ! [% FOREACH msg_key = messages.keys -%] '[% msg_key %]' => qq{[% messages.$msg_key %]}, ! [% END -%] ); 1; + TEMPLATE + } + + 1; + __END__ |
From: Chris W. <la...@us...> - 2005-02-02 13:09:03
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24063/Manage Modified Files: Website.pm Log Message: separate out the actual package installation so we can call that from elsewhere Index: Website.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Website.pm 5 Dec 2004 18:50:11 -0000 1.21 --- Website.pm 2 Feb 2005 13:08:47 -0000 1.22 *************** *** 51,76 **** my @files = (); - PACKAGE: foreach my $package_name ( @{ $package_names } ) { my $package_file = $package_dist->{ $package_name }; ! return unless ( $package_file ); ! my $install_task = OpenInteract2::Manage->new( ! 'install_package', { package_file => $package_file, ! website_dir => $website_dir } ! ); ! ! # The package install fires a 'progress' observation that it's done ! # installing the package, which is useful for *our* observers ! # to know ! ! $self->copy_observers( $install_task ); ! ! eval { $install_task->execute }; ! if ( $@ ) { ! $self->_fail( 'install package', ! "Failed to install $package_name: $@" ); ! } ! else { ! $self->_add_status( $install_task->get_status ); push @files, $package_file; } --- 51,60 ---- my @files = (); foreach my $package_name ( @{ $package_names } ) { my $package_file = $package_dist->{ $package_name }; ! next unless ( $package_file ); ! my $rv = $self->_install_package_file( ! $package_name, $package_file, $website_dir ); ! if ( $rv ) { push @files, $package_file; } *************** *** 79,82 **** --- 63,93 ---- } + sub _install_package_file { + my ( $self, $package_name, $package_file, $website_dir ) = @_; + my $install_task = OpenInteract2::Manage->new( + 'install_package', { + package_file => $package_file, + website_dir => $website_dir, + }); + + # The package install fires a 'progress' observation that it's done + # installing the package, which is useful for *our* observers + # to know + + $self->copy_observers( $install_task ); + + eval { $install_task->execute }; + if ( $@ ) { + $package_name ||= $package_file; + $self->_fail( 'install package', + "Failed to install $package_name: $@" ); + return undef; + } + else { + $self->_add_status( $install_task->get_status ); + return $package_file; + } + } + # Find all distribution packages in $source_dir/pkg |
From: Chris W. <la...@us...> - 2005-02-02 13:08:11
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23852/Manage/Website Modified Files: Create.pm Log Message: use functionality from OI2::Brick to do the resource copying for us Index: Create.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/Create.pm,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Create.pm 26 Jan 2005 02:36:11 -0000 1.25 --- Create.pm 2 Feb 2005 13:08:01 -0000 1.26 *************** *** 7,10 **** --- 7,11 ---- use File::Spec::Functions qw( catdir ); use File::Path qw( rmtree ); + use OpenInteract2::Brick; use OpenInteract2::Config::Readonly; use OpenInteract2::Context qw( CTX ); *************** *** 111,128 **** $self->notify_observers( progress => 'Directories created' ); ! $self->_copy_widgets( $website_dir, $source_dir ); ! $self->notify_observers( ! progress => 'Global templates copied' ); ! ! $self->_copy_cgi( $website_dir, $source_dir ); ! $self->notify_observers( ! progress => 'CGI interface copied' ); ! ! $self->_copy_messages( $website_dir, $source_dir ); ! $self->_copy_server_conf( $website_dir, $source_dir ); ! $self->_copy_apache_conf( $website_dir, $source_dir ); ! $self->_copy_daemon_conf( $website_dir, $source_dir ); $self->notify_observers( ! progress => 'OI2 and web server configuration copied' ); # This will initialize the context to our new website... --- 112,120 ---- $self->notify_observers( progress => 'Directories created' ); ! $self->_copy_from_bricks( $website_dir, ! 'apache', 'apache2', 'cgi', 'daemon', ! 'messages', 'websiteconfig', 'widgets' ); $self->notify_observers( ! progress => 'All files from sample website copied' ); # This will initialize the context to our new website... *************** *** 135,139 **** $self->notify_observers( progress => 'Installing packages', { long => 'yes' } ); ! $self->_install_packages( $source_dir, SYSTEM_PACKAGES ); $self->notify_observers( progress => 'Packages installed' ); --- 127,131 ---- $self->notify_observers( progress => 'Installing packages', { long => 'yes' } ); ! $self->_install_packages_from_bricks( $website_dir, SYSTEM_PACKAGES ); $self->notify_observers( progress => 'Packages installed' ); *************** *** 172,286 **** } ! sub _copy_widgets { ! my ( $self, $website_dir, $source_dir ) = @_; ! my $source_widget_dir = ! catdir( $source_dir, 'sample', 'website', 'template' ); ! my $transferred = OpenInteract2::Config::TransferSample ! ->new( $source_widget_dir ) ! ->run( $website_dir ); ! foreach my $copied ( @{ $transferred } ) { ! $self->_add_status({ ! is_ok => 'yes', ! action => 'copy widget', ! message => 'Copied file from sample site', ! filename => $copied, ! }); ! } ! } ! ! sub _copy_messages { ! my ( $self, $website_dir, $source_dir ) = @_; ! my $source_msg_dir = catdir( $source_dir, 'sample', 'website', 'msg' ); ! my %vars = ( website_dir => $website_dir ); ! my $transferred = OpenInteract2::Config::TransferSample ! ->new( $source_msg_dir ) ! ->run( $website_dir, \%vars ); ! foreach my $copied ( @{ $transferred } ) { ! $self->_add_status({ ! is_ok => 'yes', ! action => 'copy localized messages', ! message => 'Copied file from sample site', ! filename => $copied, ! }); ! } ! } ! ! sub _copy_server_conf { ! my ( $self, $website_dir, $source_dir ) = @_; ! my $source_conf_dir = catdir( $source_dir, 'sample', 'website', 'conf' ); ! my %vars = ( website_dir => $website_dir ); ! my $transferred = OpenInteract2::Config::TransferSample ! ->new( $source_conf_dir ) ! ->run( $website_dir, \%vars ); ! foreach my $copied ( @{ $transferred } ) { ! $self->_add_status({ ! is_ok => 'yes', ! action => 'copy server config', ! message => 'Copied file from sample site', ! filename => $copied, ! }); ! } ! } ! ! sub _copy_cgi { ! my ( $self, $website_dir, $source_dir ) = @_; ! my $source_cgi_dir = catdir( $source_dir, 'sample', 'website', 'cgi-bin' ); my %vars = ( website_dir => $website_dir ); ! my $transferred = OpenInteract2::Config::TransferSample ! ->new( $source_cgi_dir ) ! ->run( $website_dir, \%vars ); ! foreach my $copied ( @{ $transferred } ) { ! $self->_add_status( { is_ok => 'yes', ! action => 'copy CGI', ! message => 'Copied file from sample site', ! filename => $copied } ); ! # OIN-10: hack just to ensure we get the right perms ! if ( $copied =~ /cgi$/ ) { ! chmod( 0755, $copied ); } } } ! ! sub _copy_apache_conf { ! my ( $self, $website_dir, $source_dir ) = @_; ! $self->_copy_webserver_conf( $website_dir, $source_dir, ! 'apache', 'apache 1.x' ); ! $self->_copy_webserver_conf( $website_dir, $source_dir, ! 'apache2', 'apache 2.x' ); ! } ! ! sub _copy_webserver_conf { ! my ( $self, $website_dir, $source_dir, $type, $desc ) = @_; ! my $source_apache_dir = catdir( $source_dir, 'sample', $type ); ! my %vars = ( website_dir => $website_dir ); ! my $transferred = OpenInteract2::Config::TransferSample ! ->new( $source_apache_dir ) ! ->run( $website_dir, \%vars ); ! foreach my $copied ( @{ $transferred } ) { ! $self->_add_status({ ! is_ok => 'yes', ! action => "copy $desc config", ! message => 'Copied file from sample site', ! filename => $copied, ! }); ! } ! ! } ! ! sub _copy_daemon_conf { ! my ( $self, $website_dir, $source_dir ) = @_; ! my $source_daemon_dir = catdir( $source_dir, 'sample', 'daemon' ); ! my %vars = ( website_dir => $website_dir ); ! my $transferred = OpenInteract2::Config::TransferSample ! ->new( $source_daemon_dir ) ! ->run( $website_dir, \%vars ); ! foreach my $copied ( @{ $transferred } ) { ! $self->_add_status({ ! is_ok => 'yes', ! action => 'copy standalone daemon config', ! message => 'Copied file from sample site', ! filename => $copied, ! }); } } --- 164,212 ---- } ! sub _copy_from_bricks { ! my ( $self, $website_dir, @brick_names ) = @_; my %vars = ( website_dir => $website_dir ); ! foreach my $brick_name ( @brick_names ) { ! my $brick = OpenInteract2::Brick->new( $brick_name ); ! my $status = $brick->copy_all_resources_to( $website_dir, \%vars ); ! foreach my $file_copied ( @{ $status->{copied} } ) { ! $self->_add_status({ ! is_ok => 'yes', ! action => "copy '$brick_name'", ! message => 'Copied file from class resource', ! filename => $file_copied, ! }); ! } ! foreach my $file_skipped ( @{ $status->{skipped} } ) { ! $self->_add_status({ ! is_ok => 'yes', ! action => "copy '$brick_name'", ! message => 'Skipped copying file from class resource - marked as readonly', ! filename => $file_skipped, ! }); ! } ! foreach my $file_same ( @{ $status->{same} } ) { ! $self->_add_status({ ! is_ok => 'yes', ! action => "copy '$brick_name'", ! message => 'Skippe copying file from class resource - resources same', ! filename => $file_same, ! }); } } } ! sub _install_packages_from_bricks { ! my ( $self, $website_dir, $package_names ) = @_; ! foreach my $name ( @{ $package_names } ) { ! my $brick_name = 'pkg_' . $name; ! my $brick = OpenInteract2::Brick->new( $brick_name ); ! foreach my $pkg_name ( $brick->list_resources ) { ! my $pkg_info = $brick->load_resource( $pkg_name ); ! my $pkg_file = OpenInteract2::Util->decode_base64_and_store( ! \$pkg_info->{content} ! ); ! $self->_install_package_file( undef, $pkg_file, $website_dir ); ! } } } *************** *** 411,422 **** feedback. - =head1 BUGS - - None known. - - =head1 TO DO - - Nothing known. - =head1 COPYRIGHT --- 337,340 ---- |
From: Chris W. <la...@us...> - 2005-02-02 13:07:23
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23702/Manage/Website Modified Files: InstallPackage.pm Log Message: add the package installed as a parameter to the task; cosmetic fixes Index: InstallPackage.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/InstallPackage.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** InstallPackage.pm 25 Sep 2004 18:15:37 -0000 1.14 --- InstallPackage.pm 2 Feb 2005 13:07:12 -0000 1.15 *************** *** 5,8 **** --- 5,9 ---- use strict; use base qw( OpenInteract2::Manage::Website ); + use File::Spec::Functions qw( catfile ); use OpenInteract2::Context qw( CTX ); use OpenInteract2::Repository; *************** *** 47,52 **** filename => $package_file, ); ! my $package = OpenInteract2::Package->new( ! { package_file => $package_file }); my $repository = CTX->repository; my $rep_package = $repository->fetch_package( $package->name ); --- 48,54 ---- filename => $package_file, ); ! my $package = OpenInteract2::Package->new({ ! package_file => $package_file ! }); my $repository = CTX->repository; my $rep_package = $repository->fetch_package( $package->name ); *************** *** 64,68 **** OpenInteract2::Package->install({ package_file => $package_file, ! repository => CTX->repository }) }; if ( $@ ) { --- 66,71 ---- OpenInteract2::Package->install({ package_file => $package_file, ! repository => CTX->repository ! }) }; if ( $@ ) { *************** *** 86,89 **** --- 89,93 ---- } } + $self->param( package => $installed_package ); } $self->notify_observers( *************** *** 101,110 **** my $temp_lib_dir = CTX->lookup_temp_lib_directory; return unless ( -d $temp_lib_dir ); # nothing to refresh! ! my $refresh_file = ! File::Spec->catfile( $temp_lib_dir, ! CTX->lookup_temp_lib_refresh_filename ); return if ( -f $refresh_file ); # someone already refreshed! open( REFRESH, '>', $refresh_file ) ! || die "Cannot open refresh file: $!"; print REFRESH "Forced refresh from package '$package_name' ", "installed on ", scalar( localtime ); --- 105,114 ---- my $temp_lib_dir = CTX->lookup_temp_lib_directory; return unless ( -d $temp_lib_dir ); # nothing to refresh! ! my $refresh_file = catfile( ! $temp_lib_dir, CTX->lookup_temp_lib_refresh_filename ! ); return if ( -f $refresh_file ); # someone already refreshed! open( REFRESH, '>', $refresh_file ) ! || die "Cannot open refresh file: $!"; print REFRESH "Forced refresh from package '$package_name' ", "installed on ", scalar( localtime ); |