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-02 13:06:21
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23317 Modified Files: Context.pm Log Message: oops! by assigning the default language handle before the I18N messages have been read you're effectively telling Locale::Maketext to ignore your default language message handle forever Index: Context.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Context.pm,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** Context.pm 26 Jan 2005 02:35:50 -0000 1.81 --- Context.pm 2 Feb 2005 13:06:01 -0000 1.82 *************** *** 196,203 **** $self->assign_deploy_static_url; $log_init->info( "Assigned constants from server config ok" ); - - $DEFAULT_LANGUAGE_HANDLE = OpenInteract2::I18N->get_handle( - $config->{language}{default_language} - ); } return $self->{server_config}; --- 196,199 ---- *************** *** 766,769 **** --- 762,770 ---- + sub assign_default_language_handle { + my ( $self, $lh ) = @_; + $DEFAULT_LANGUAGE_HANDLE = $lh + } + sub language_handle { my ( $self, $lang ) = @_; |
From: Chris W. <la...@us...> - 2005-02-02 13:06:21
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Setup In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23317/Setup Modified Files: ReadLocalizedMessages.pm Log Message: oops! by assigning the default language handle before the I18N messages have been read you're effectively telling Locale::Maketext to ignore your default language message handle forever Index: ReadLocalizedMessages.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Setup/ReadLocalizedMessages.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReadLocalizedMessages.pm 24 Jan 2005 17:17:31 -0000 1.1 --- ReadLocalizedMessages.pm 2 Feb 2005 13:06:02 -0000 1.2 *************** *** 51,54 **** --- 51,62 ---- } $self->param( classes => $classes ); + + # Don't do this until the I18N initializer has been run, otherwise + # your default language will be excluded forever... + + my $default_language = $ctx->server_config->{language}{default_language}; + $ctx->assign_default_language_handle( + OpenInteract2::I18N->get_handle( $default_language ) + ); } |
From: Chris W. <la...@us...> - 2005-01-31 14:06:56
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11472 Modified Files: BUILDING_FROM_CVS Log Message: add instructions for building brick classes Index: BUILDING_FROM_CVS =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/BUILDING_FROM_CVS,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BUILDING_FROM_CVS 9 Jun 2004 00:53:30 -0000 1.2 --- BUILDING_FROM_CVS 31 Jan 2005 14:06:46 -0000 1.3 *************** *** 9,14 **** --------------- ! > cd /path/to/OpenInteract-CVS/ ! > ./build_docs > cd pkg/ > ./export_all --- 9,15 ---- --------------- ! > cd /path/to/OpenInteract2-CVS/ ! > perl build_docs ! > perl build_bricks > cd pkg/ > ./export_all *************** *** 26,30 **** the same for just about every Perl module: ! > cd /path/to/OpenInteract-CVS > perl Makefile.PL or perl Build.PL > make or ./Build --- 27,31 ---- the same for just about every Perl module: ! > cd /path/to/OpenInteract2-CVS > perl Makefile.PL or perl Build.PL > make or ./Build *************** *** 32,38 **** > make install or ./Build install ! But you'll run into two problems building from CVS vs. from a distribution. The first is related to documentation, the second to ! package distributions. Problem: Docs --- 33,41 ---- > make install or ./Build install ! But you'll run into three problems building from CVS vs. from a distribution. The first is related to documentation, the second to ! inlined resource files used to build packages and websites, and the ! third to package distributions. ! Problem: Docs *************** *** 49,52 **** --- 52,80 ---- to... + + Problem: Bricks + --------------- + + A 'brick' is a set of resources used when creating a new website or + package. Previously we packaged these in a 'sample' directory, but + they're now in classes created at build-time. The first time you + checkout OI2 from CVS these will not be built, so use the + 'build_bricks' script to do this: + + > cd /path/to/OpenInteract2-CVS + > perl build_bricks + + This should output something like: + + Generated lib/OpenInteract2/Brick/Messages.pm with 1 inlined files + Generated lib/OpenInteract2/Brick/WebsiteConfig.pm with 6 inlined files + Generated lib/OpenInteract2/Brick/Daemon.pm with 1 inlined files + Generated lib/OpenInteract2/Brick/Package.pm with 8 inlined files + Generated lib/OpenInteract2/Brick/Apache.pm with 5 inlined files + Generated lib/OpenInteract2/Brick/CGI.pm with 1 inlined files + Generated lib/OpenInteract2/Brick/Widgets.pm with 57 inlined files + Generated lib/OpenInteract2/Brick/Apache2.pm with 2 inlined files + + Problem: Packages --------------- |
From: Chris W. <la...@us...> - 2005-01-28 17:29:28
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29969 Modified Files: build_bricks Log Message: OIN-121: scrap use of Inline::Files since it was throwing a weird error probably based on the same pattern ('__BLAH__') being found in the text of the files inlined), so just use subs instead Index: build_bricks =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/build_bricks,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** build_bricks 28 Jan 2005 16:43:13 -0000 1.3 --- build_bricks 28 Jan 2005 17:07:32 -0000 1.4 *************** *** 141,148 **** use strict; use base qw( OpenInteract2::Brick ); ! use Inline::Files; ! use OpenInteract2::Exception qw( oi_error ); ! my %INLINES = ( [% FOREACH file_info = all_files -%] '[% file_info.name %]' => '[% file_info.inline_name %]', --- 141,147 ---- 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 %]', *************** *** 164,173 **** sub load { my ( $self, $resource_name ) = @_; ! my $inline_name = $INLINES{ $resource_name }; ! unless ( $inline_name ) { ! oi_error "Resource name '$resource_name' not found ", ! "in ", ref( $self ), "; cannot load content."; } ! return join( '', <$inline_name> ); } --- 163,173 ---- 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(); } *************** *** 204,209 **** [% FOREACH file_info = all_files %] ! __[% file_info.inline_name %]__ [% file_info.contents %] ! [% END %] --- 204,211 ---- [% FOREACH file_info = all_files %] ! sub [% file_info.inline_name %] { ! return <<'SOMELONGSTRING'; [% file_info.contents %] ! SOMELONGSTRING ! } [% END %] |
From: Chris W. <la...@us...> - 2005-01-28 16:50:18
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24956 Modified Files: MANIFEST Log Message: OIN-121: remove all sample/* files from distribution; add OI2::Brick files Index: MANIFEST =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/MANIFEST,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** MANIFEST 24 Jan 2005 17:25:14 -0000 1.107 --- MANIFEST 28 Jan 2005 16:49:42 -0000 1.108 *************** *** 27,30 **** --- 27,39 ---- lib/OpenInteract2/Auth/Group.pm lib/OpenInteract2/Auth/User.pm + lib/OpenInteract2/Brick.pm + lib/OpenInteract2/Brick/Apache.pm + lib/OpenInteract2/Brick/Apache2.pm + lib/OpenInteract2/Brick/CGI.pm + lib/OpenInteract2/Brick/Daemon.pm + lib/OpenInteract2/Brick/Messages.pm + lib/OpenInteract2/Brick/Package.pm + lib/OpenInteract2/Brick/WebsiteConfig.pm + lib/OpenInteract2/Brick/Widgets.pm lib/OpenInteract2/Cache.pm lib/OpenInteract2/Cache/File.pm *************** *** 194,295 **** pkg/system_doc-2.08.zip pkg/whats_new-2.10.zip - sample/README - sample/apache/FILES - sample/apache/README - sample/apache/httpd_cgi_solo.conf - sample/apache/httpd_modperl.conf - sample/apache/httpd_modperl_solo.conf - sample/apache/httpd_static.conf - sample/apache/startup.pl - sample/apache2/FILES - sample/apache2/README - sample/apache2/httpd_mp2_solo.conf - sample/apache2/startup_mp2.pl - sample/daemon/FILES - sample/daemon/README - sample/daemon/oi2_daemon.ini - sample/package/FILES - sample/package/README - sample/package/action.ini - sample/package/package.conf - sample/package/package.pod-sample - sample/package/spops.ini - sample/package/sample.tmpl - sample/package/Action.pm-sample - sample/package/MANIFEST.SKIP - sample/package/SQLInstall.pm-sample - sample/website/cgi-bin/FILES - sample/website/cgi-bin/README - sample/website/cgi-bin/oi2.cgi - sample/website/conf/FILES - sample/website/conf/README - sample/website/conf/base.conf - sample/website/conf/log4perl.conf - sample/website/conf/observer.ini - sample/website/conf/sample-action_override.ini - sample/website/conf/sample-spops_override.ini - sample/website/conf/server.ini - sample/website/msg/FILES - sample/website/msg/README - sample/website/msg/global-messages-en.msg - sample/website/template/FILES - sample/website/template/README - sample/website/template/base_main - sample/website/template/base_simple - sample/website/template/common_action_error - sample/website/template/data_cell_begin - sample/website/template/date_select - sample/website/template/error_message - sample/website/template/error_not_found - sample/website/template/error_object_inactive - sample/website/template/error_object_security - sample/website/template/error_task_forbidden - sample/website/template/error_task_no_default - sample/website/template/form_begin - sample/website/template/form_button - sample/website/template/form_checkbox - sample/website/template/form_end - sample/website/template/form_hidden - sample/website/template/form_login - sample/website/template/form_password - sample/website/template/form_radio - sample/website/template/form_radioset - sample/website/template/form_reset - sample/website/template/form_select - sample/website/template/form_select_intro - sample/website/template/form_select_option - sample/website/template/form_select_options_iterator - sample/website/template/form_select_options_list - sample/website/template/form_select_options_plain_list - sample/website/template/form_submit - sample/website/template/form_submit_row - sample/website/template/form_text - sample/website/template/form_textarea - sample/website/template/form_upload - sample/website/template/global_javascript - sample/website/template/header_cell - sample/website/template/header_row - sample/website/template/inactive_object_banner - sample/website/template/label_error_row_extra - sample/website/template/label_form_checkbox_row - sample/website/template/label_form_date_row - sample/website/template/label_form_login_row - sample/website/template/label_form_radio_row - sample/website/template/label_form_select_row - sample/website/template/label_form_text_row - sample/website/template/label_form_textarea_row - sample/website/template/label_form_upload_row - sample/website/template/label_row - sample/website/template/label_row_begin - sample/website/template/label_text_row - sample/website/template/object_updates - sample/website/template/page_count - sample/website/template/row_color - sample/website/template/search_results_page_listing - sample/website/template/show_label - sample/website/template/status_message - sample/website/template/table_bordered_begin - sample/website/template/table_bordered_end - sample/website/template/to_group script/clean_search_results.pl script/oi2_daemon --- 203,206 ---- |
From: Chris W. <la...@us...> - 2005-01-28 16:48:18
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24476 Added Files: Brick.pm Log Message: add base class for resource loader --- NEW FILE: Brick.pm --- package OpenInteract2::Brick; # $Id: Brick.pm,v 1.1 2005/01/28 16:47:44 lachoy Exp $ use strict; use base qw( Class::Factory ); use OpenInteract2::Exception qw( oi_error ); use OpenInteract2::Util; $OpenInteract2::Brick::VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/); sub list_resources { my ( $self ) = @_; my $all_resources = $self->get_resources; return sort @{ $all_resources }; } sub load_resource { my ( $self, $name ) = @_; unless ( $name ) { 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], evaluate => $info->[1], }; } sub get_name { _must_implement( 'get_name', @_ ) } sub get_resources { _must_implement( 'get_resources', @_ ) } sub load { _must_implement( 'load', @_ ) } sub _must_implement { my ( $method, $item ) = @_; my $class = ref( $item ) || $item; oi_error "Class '$class' must implement method '$method'"; } OpenInteract2::Util->find_factory_subclasses( 'OpenInteract2::Brick', @INC ); 1; __END__ =head1 NAME OpenInteract2::Brick - Base class for inlined data packages =head1 SYNOPSIS use OpenInteract2::Brick; my $loader = OpenInteract2::Brick->new( 'apache' ); my @resources = $loader->list_resources; print "Resources available in 'Apache': ", join( ', ', @resources ), "\n"; my $httpd_static_info = $loader->load_resource( 'httpd_static.conf' ); print "File should be stored in: $httpd_static_info->{destination}\n"; print "File contents:\n$httpd_static_info->{content}\n"; =head1 DESCRIPTION Rather than including lots of sample files used to create packages and websites, OI2 has a set of 'bricks'. Each one of these classes has one or more inlined files you can ask for by file name. Each of these files also has associated with it some metadata to determine where it should go and whether it should be evaluated as a template before being stored. (Of course, you're free to ignore these data and do whatever you want with the contents, but other parts of the OI2 framework need them.) =head1 CLASS METHODS B<new( $type )> Returns an instance of the bricks associated with C<$type>, which should always be a lowercased value. =head1 OBJECT METHODS B<list_resources()> Returns an array of all resources defined. These are always simple filenames with no paths, so with the 'apache2' type you would do something like: my $loader = OpenInteract2::Brick->new( 'apache2' ); print "Apache2 resources:\n ", join( "\n ", $loader->list_resources ), "\n"; And get: Apache2 resources: httpd_mp2_solo.conf startup_mp2.pl These resource names are what you use in C<load_resource()>: my $startup_info = $loader->load_resource( 'startup_mp2.pl' ); print "Startup script is:\n", $startup_info->{contents}; B<load_resource( $resource_name > Loads the resource and metdata associated with C<$resource_name>. If C<$resource_name> is empty or no resource is actually associated with it we throw an exception. If the resource is found we return a hashref with the following keys: =over 4 =item * B<content>: Contents of the resource. =item * B<destination>: Space-delimited string of directories where this resource should be copied. Note that the string may have template directives in it. =item * B<evaluate>: Whether you should evaluate the data in 'content' before storing it. =back Regarding template directives. A number of resources have template directives in them so they can be properly named -- for instance, the perl 'package' declaration in the generated action whene you create a new package looks like this: package OpenInteract2::Action::[% class_name %]; When we use this resource we first run it through a template processor (Template Toolkit) so that when we create a package called 'baseball_stats' the above will get translated to: package OpenInteract2::Action::BaseballStats; =head1 SUBCLASSING Since you typically don't create subclasses by hand this is mostly unnecessary. If you're interested in creating a C<::Brick> subclass by hand first look in the C<build_bricks> script found at the root of the OI2 source tree -- it builds the class dynamically based on specifications and files found in the filesystem. That said, subclasses must implement the following methods: B<get_name()> Return the name by which people instantiate this loader. Should be lower-cased. B<get_resources()> Return a hash of data regarding the resources specified by this class. Keys are resource names (generally filenames) and values are arrayrefs with two elements: =over 4 =item 0. String with destination information. This tells the caller where the contents should be stored. Should be space-delimited and may have template directives in it. =item 1. Whether the content can be evaluated by a template processor as 'yes' or 'no'. Generally you should leave this as 'yes' unless the specified resource is actually a TT2 template. =back B<load( $resource_name )> Return the content associated with C<$resource_name>. The caller (L<OpenInteract2::Brick> checks that C<$resource_name> is valid before invoking this method. =head1 SEE ALSO L<Class::Factory> =head1 COPYRIGHT Copyright (c) 2005 Chris Winters. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHORS Chris Winters E<lt>ch...@cw...E<gt> |
From: Chris W. <la...@us...> - 2005-01-28 16:43:48
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23313 Modified Files: build_bricks Log Message: OIN-121: small change to brickbuilder Index: build_bricks =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/build_bricks,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** build_bricks 28 Jan 2005 16:30:21 -0000 1.2 --- build_bricks 28 Jan 2005 16:43:13 -0000 1.3 *************** *** 146,150 **** my %INLINES = ( [% FOREACH file_info = all_files -%] ! '[% file_info.name %]' = '[% file_info.inline_name %]', [% END -%] ); --- 146,150 ---- my %INLINES = ( [% FOREACH file_info = all_files -%] ! '[% file_info.name %]' => '[% file_info.inline_name %]', [% END -%] ); |
From: Chris W. <la...@us...> - 2005-01-28 16:31:10
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19764 Modified Files: build_bricks Log Message: OIN-121: updates to generated ::Brick classes Index: build_bricks =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/build_bricks,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** build_bricks 28 Jan 2005 15:40:04 -0000 1.1 --- build_bricks 28 Jan 2005 16:30:21 -0000 1.2 *************** *** 75,78 **** --- 75,79 ---- my %params = ( brick_name => $brick_name, + lc_brick_name => lc $brick_name, brick_summary => $brick_info->[1], brick_example => $brick_info->[2], *************** *** 81,88 **** all_files => \@brick_files, ); ! my $output_file = "lib/OpenInteract2/Bricks/$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 ok\n"; } } --- 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"; } } *************** *** 132,145 **** __DATA__ ! package OpenInteract2::Bricks::[% brick_name %]; use strict; ! use base qw( OpenInteract2::Bricks ); use Inline::Files; sub get_resources { return ( [% FOREACH file_info = all_files -%] ! '[% file_info.name %]' => [ '[% file_info.inline_name %]', '[% file_info.destination %]', '[% file_info.evaluatable %]' ], [% END -%] ); --- 137,161 ---- __DATA__ ! package OpenInteract2::Brick::[% brick_name %]; use strict; ! use base qw( OpenInteract2::Brick ); use Inline::Files; + use OpenInteract2::Exception qw( oi_error ); + + my %INLINES = ( + [% 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.evaluatable %]' ], [% END -%] ); *************** *** 147,159 **** sub load { ! my ( $class, $name ) = @_; ! return join( '', <$name> ); } =pod =head1 NAME ! OpenInteract2::Bricks::[% brick_name %] - [% brick_summary %] =head1 SYNOPSIS --- 163,182 ---- sub load { ! my ( $self, $resource_name ) = @_; ! my $inline_name = $INLINES{ $resource_name }; ! unless ( $inline_name ) { ! oi_error "Resource name '$resource_name' not found ", ! "in ", ref( $self ), "; cannot load content."; ! } ! return join( '', <$inline_name> ); } + OpenInteract2::Brick->register_factory_type( get_name() => __PACKAGE__ ); + =pod =head1 NAME ! OpenInteract2::Brick::[% brick_name %] - [% brick_summary %] =head1 SYNOPSIS *************** *** 165,168 **** --- 188,193 ---- [% brick_description %] + These resources are associated with OpenInteract2 version [% oi2_version %]. + =head1 COPYRIGHT |
From: Chris W. <la...@us...> - 2005-01-28 15:40:39
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6465 Added Files: build_bricks Log Message: OIN-121: create initial script to generate the '::Bricks' subclasses that will hold the resource files used to build website/package --- NEW FILE: build_bricks --- #!/usr/bin/perl # $Id: build_bricks,v 1.1 2005/01/28 15:40:04 lachoy Exp $ # build_bricks # Generate the various OI2::Bricks::* classes formed by reading in # the various files used for creating a package/website. use strict; use Template; my %SPECS = ( 'sample/package' => [ 'Package', 'All resources used for creating a package', 'oi2_manage create_package --package=foo', 'This class just holds all the static resources used when creating a package.', ], 'sample/apache' => [ 'Apache', 'All resources used for creating Apache 1.x configurations in a new website', 'oi2_manage create_website --website_dir=/path/to/site', 'This class just holds all the static resources used for creating ' . 'Apache configuration files when creating a website.' ], 'sample/apache2' => [ 'Apache2', 'All resources used for creating Apache 2.x configurations in a new website', 'oi2_manage create_website --website_dir=/path/to/site', 'This class just holds all the static resources used for creating ' . 'Apache 2.x configuration files when creating a website.' ], 'sample/daemon' => [ 'Daemon', 'Configuration used for creating the standalone webserver', 'oi2_manage create_website --website_dir=/path/to/site', 'This class holds resources for configuring the standalone webserver daemon.', ], 'sample/website/cgi-bin' => [ 'CGI', 'Script for running OI2 as a CGI', 'oi2_manage create_website --website_dir=/path/to/site', 'This class holds the script for running OI2 as a CGI.', ], 'sample/website/conf' => [ 'WebsiteConfig', 'Various non-server-specific configuration files for OI2 website', 'oi2_manage create_website --website_dir=/path/to/site', 'This class holds various configuration files for running the OI2 website.', ], 'sample/website/msg' => [ 'Messages', 'All global localization messages', 'oi2_manage create_website --website_dir=/path/to/site', 'This class holds all global (non-package) localization messages.', ], 'sample/website/template' => [ 'Widgets', 'All global TT2 template files', 'oi2_manage create_website --website_dir=/path/to/site', 'This class holds all global (non-package) Template Toolkit templates, also known as "widgets".', ], ); { unless ( -d 'sample' ) { die "You must run this from the root of the OI2 source directory\n"; } my $oi2_version = read_version(); my $template = Template->new(); my $brick_template = join( '', <DATA> ); 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_name => $brick_name, brick_summary => $brick_info->[1], brick_example => $brick_info->[2], brick_description => $brick_info->[3], oi2_version => $oi2_version, all_files => \@brick_files, ); my $output_file = "lib/OpenInteract2/Bricks/$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 ok\n"; } } sub read_brick_files { my ( $subdir ) = @_; my $filespec_path = "$subdir/FILES"; unless ( -f $filespec_path ) { die "Directory '$subdir' is not a valid sample directory -- it has no 'FILES' file\n"; } open( FILESPEC, '<', $filespec_path ) || die "Cannot read '$filespec_path': $!"; my @files = (); while ( <FILESPEC> ) { chomp; next if ( /^\s*#/ ); next if ( /^\s*$/ ); my ( $file, $destination ) = split /\s*\-\->\s*/, $_, 2; my $do_evaluate = ( $file =~ s/^\*// ) ? 'no' : 'yes'; my $file_path = "$subdir/$file"; open( FILE, '<', $file_path ) || die "Cannot read '$file_path': $!"; 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, }; } close( FILESPEC ); return @files; } sub read_version { open( VER, '<', 'VERSION' ) || die "Cannot open version doc: $!"; my $version = <VER>; chomp $version; close( VER ); $version =~ s/[^\d\_\.]//g; return $version; } __DATA__ package OpenInteract2::Bricks::[% brick_name %]; use strict; use base qw( OpenInteract2::Bricks ); use Inline::Files; sub get_resources { return ( [% FOREACH file_info = all_files -%] '[% file_info.name %]' => [ '[% file_info.inline_name %]', '[% file_info.destination %]', '[% file_info.evaluatable %]' ], [% END -%] ); } sub load { my ( $class, $name ) = @_; return join( '', <$name> ); } =pod =head1 NAME OpenInteract2::Bricks::[% brick_name %] - [% brick_summary %] =head1 SYNOPSIS [% brick_example | indent(2) %] =head1 DESCRIPTION [% brick_description %] =head1 COPYRIGHT Copyright (c) 2005 Chris Winters. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHORS Chris Winters E<lt>ch...@cw...E<gt> =cut [% FOREACH file_info = all_files %] __[% file_info.inline_name %]__ [% file_info.contents %] [% END %] |
Update of /cvsroot/openinteract/OpenInteract2/sample/package In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5898/package Modified Files: FILES Added Files: Action.pm SQLInstall.pm package.pod Removed Files: Action.pm-sample SQLInstall.pm-sample package.pod-sample Log Message: remove 'sample' from various files since they won't be packaged with OI2 anymore Index: FILES =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/sample/package/FILES,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FILES 3 Jul 2003 03:33:29 -0000 1.4 --- FILES 28 Jan 2005 15:37:09 -0000 1.5 *************** *** 6,15 **** # 'package_name' and 'class_name' template keys replaced. ! package.conf --> package.conf ! package.pod-sample --> doc [% package_name %].pod ! SQLInstall.pm-sample --> OpenInteract2 SQLInstall [% class_name %].pm ! Action.pm-sample --> OpenInteract2 Action [% class_name %].pm ! spops.ini --> conf spops.ini ! action.ini --> conf action.ini ! MANIFEST.SKIP --> MANIFEST.SKIP ! *sample.tmpl --> template sample.tmpl \ No newline at end of file --- 6,15 ---- # 'package_name' and 'class_name' template keys replaced. ! package.conf --> package.conf ! package.pod --> doc [% package_name %].pod ! SQLInstall.pm --> OpenInteract2 SQLInstall [% class_name %].pm ! Action.pm --> OpenInteract2 Action [% class_name %].pm ! spops.ini --> conf spops.ini ! action.ini --> conf action.ini ! MANIFEST.SKIP --> MANIFEST.SKIP ! *sample.tmpl --> template sample.tmpl \ No newline at end of file --- Action.pm-sample DELETED --- --- SQLInstall.pm-sample DELETED --- --- package.pod-sample DELETED --- |
From: Chris W. <la...@us...> - 2005-01-28 15:37:44
|
Update of /cvsroot/openinteract/OpenInteract2/sample/website/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5898/website/conf Modified Files: FILES Added Files: action_override.ini spops_override.ini Removed Files: sample-action_override.ini sample-spops_override.ini Log Message: remove 'sample' from various files since they won't be packaged with OI2 anymore --- NEW FILE: action_override.ini --- # $Id: action_override.ini,v 1.1 2005/01/28 15:37:10 lachoy Exp $ # Sample action override rules. If you decide to use override rules, # save them to '$WEBSITE_DIR/conf/action_override.ini'. # # modify the security for 'news' action [news.security.DEFAULT] action = replace value = NONE # # change a template to use for the 'search' task [news.template_source.search] action = replace value = news::my_search_results --- NEW FILE: spops_override.ini --- # $Id: spops_override.ini,v 1.1 2005/01/28 15:37:10 lachoy Exp $ # Sample SPOPS override rules. If you decide to use override rules, # save them to '$WEBSITE_DIR/conf/spops_override.ini'. # # New objects will get added to "What's new?" [news.rules_from] action = add value = OpenInteract2::WhatsNewTrack type = list # # New objects will get added to the full-text index [news.is_searchable] action = replace value = yes Index: FILES =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/sample/website/conf/FILES,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FILES 26 Sep 2004 18:51:54 -0000 1.6 --- FILES 28 Jan 2005 15:37:10 -0000 1.7 *************** *** 1,6 **** ! base.conf --> conf base.conf ! sample-action_override.ini --> conf sample-action_override.ini ! sample-spops_override.ini --> conf sample-spops_override.ini ! server.ini --> conf server.ini ! log4perl.conf --> conf log4perl.conf ! observer.ini --> conf observer.ini --- 1,6 ---- ! base.conf --> conf base.conf ! action_override.ini --> conf sample-action_override.ini ! spops_override.ini --> conf sample-spops_override.ini ! server.ini --> conf server.ini ! log4perl.conf --> conf log4perl.conf ! observer.ini --> conf observer.ini --- sample-action_override.ini DELETED --- --- sample-spops_override.ini DELETED --- |
From: Chris W. <la...@us...> - 2005-01-28 14:01:17
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16832 Modified Files: Setup.pm Log Message: OIN-123: fall back on good old string eval to create the without() routine Index: Setup.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Setup.pm,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** Setup.pm 26 Jan 2005 02:35:56 -0000 1.57 --- Setup.pm 28 Jan 2005 14:00:25 -0000 1.58 *************** *** 5,9 **** use strict; use base qw( Class::Factory ); - use Algorithm::Dependency; use Algorithm::Dependency::Ordered; use Log::Log4perl qw( get_logger ); --- 5,8 ---- *************** *** 141,154 **** } if ( scalar @skip_actions ) { $ordered_names = $class->remove_skip_actions( @skip_actions ); } ! my @setups = (); foreach my $name ( @{ $ordered_names } ) { ! push @setups, OpenInteract2::Setup->new( $name ); ! } ! $log->info( "Created ", scalar( @setups ), " setup objects ok" ); ! ! foreach my $setup ( @setups ) { $setup->run( $ctx ); } } --- 140,153 ---- } if ( scalar @skip_actions ) { + $log->info( "Removing these actions and dependencies: ", + join( ', ', @skip_actions ) ); $ordered_names = $class->remove_skip_actions( @skip_actions ); } ! $log->info( "Running the following setup actions, in order: ", ! join( ', ', @{ $ordered_names } ) ); foreach my $name ( @{ $ordered_names } ) { ! my $setup = OpenInteract2::Setup->new( $name ); $setup->run( $ctx ); + $log->debug( "Ran setup action '$name' ok" ); } } *************** *** 180,209 **** $DEFAULT_DEPENDENCY = OpenInteract2::Setup::ReadServerConfig->get_name; ! # See about adding this... ! #{ ! # no strict; ! # if ( Algorithm::Dependency->VERSION <= 1.03 ) { ! # *Algorithm::Dependency::without = sub { ! # my $self = shift; ! # my @without = @_; ! # my $all_items = $self->schedule_all(); ! # unless ( scalar @without ) { ! # return $all_items; ! # } ! # my %to_skip = map { $_ => 1 } @without; ! # my @good_items = (); ! # ! # foreach my $item ( @{ $all_items } ) { ! # next if ( $to_skip{ $item } ); ! # my $all_item_dep = $self->depends( $item ); ! # foreach my $item_dep ( @{ $all_item_dep } ) { ! # next if ( $to_skip{ $item_dep } ); ! # } ! # push @good_items, $item; ! # } ! # return \@good_items; ! # }; ! # } ! #} 1; --- 179,216 ---- $DEFAULT_DEPENDENCY = OpenInteract2::Setup::ReadServerConfig->get_name; ! # This subroutine has been submitted as a patch to A::D but not yet ! # accepted/released; once it is we'll just change the dependency ! # version in Build.PL/Makefile.PL and get rid of this. ! ! { ! require Algorithm::Dependency; ! if ( Algorithm::Dependency->VERSION <= 1.03 ) { ! eval <<'WITHOUT'; ! ! sub Algorithm::Dependency::without { ! my $self = shift; ! my @without = @_; ! my $all_items = $self->schedule_all(); ! unless ( scalar @without ) { ! return $all_items; ! } ! my %to_skip = map { $_ => 1 } @without; ! my @good_items = (); ! ! ITEM: ! foreach my $item ( @{ $all_items } ) { ! next ITEM if ( $to_skip{ $item } ); ! my $all_item_dep = $self->depends( $item ); ! foreach my $item_dep ( @{ $all_item_dep } ) { ! next ITEM if ( $to_skip{ $item_dep } ); ! } ! push @good_items, $item; ! } ! return \@good_items; ! } ! WITHOUT ! ! } ! } 1; |
From: Chris W. <ch...@cw...> - 2005-01-28 13:23:18
|
Salve J Nilsen said: > What happened with the Algorithm::Dependency::without fix? > > Currently the tests break both with and without the fix. See #OIN-123 > for the "make test" output. Easy: it wasn't working! My syntax in checking for or assigning the subroutine must be messed up. I'll try to take care of it this AM. C -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
From: Chris W. <la...@us...> - 2005-01-26 02:37:47
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32604/lib/OpenInteract2 Modified Files: Context.pm Manage.pm Setup.pm Log Message: fix website creation problems spawned by recent ::Setup change Index: Context.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Context.pm,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** Context.pm 25 Jan 2005 04:26:43 -0000 1.80 --- Context.pm 26 Jan 2005 02:35:50 -0000 1.81 *************** *** 147,152 **** push @skip, $params->{skip}; } } - my $base_config = $self->base_config; unless ( $base_config and --- 147,152 ---- push @skip, $params->{skip}; } + $log_init->info( "Will skip setup tasks: ", join( ', ', @skip ) ); } my $base_config = $self->base_config; unless ( $base_config and *************** *** 161,165 **** # context in a decent state ! OpenInteract2::Setup->run_all_actions( $self, \@skip ); $log_init->info( "Initialized context ok" ); --- 161,165 ---- # context in a decent state ! OpenInteract2::Setup->run_all_actions( $self, @skip ); $log_init->info( "Initialized context ok" ); Index: Manage.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage.pm,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Manage.pm 24 Jan 2005 16:58:38 -0000 1.42 --- Manage.pm 26 Jan 2005 02:35:55 -0000 1.43 *************** *** 76,87 **** eval { $self->run_task }; my $error = $@; ! if ( $@ ) { $self->notify_observers( progress => 'Failed task' ); ! $self->param( 'task_failed', 'yes' ); } $self->tear_down_task; chdir( $pwd ); if ( $error ) { ! oi_error $@; } $self->notify_observers( progress => 'Task complete' ); --- 76,88 ---- eval { $self->run_task }; my $error = $@; ! if ( $error ) { $self->notify_observers( progress => 'Failed task' ); ! $self->param( task_failed => 'yes' ); ! $self->param( task_error => "$error" ); } $self->tear_down_task; chdir( $pwd ); if ( $error ) { ! oi_error $error; } $self->notify_observers( progress => 'Task complete' ); *************** *** 491,495 **** sub _setup_context { ! my ( $self, @params ) = @_; my $website_dir = $self->param( 'website_dir' ); unless ( -d $website_dir ) { --- 492,500 ---- sub _setup_context { ! my ( $self, $params ) = @_; ! my $log = get_logger(); ! if ( $self->param( 'debug' ) ) { ! $log->level( $DEBUG ); ! } my $website_dir = $self->param( 'website_dir' ); unless ( -d $website_dir ) { *************** *** 497,506 **** "directory '$website_dir'"; } my $base_config = OpenInteract2::Config::Base->new({ ! website_dir => $website_dir }); ! if ( $self->param( 'debug' ) ) { ! get_logger()->level( $DEBUG ); ! } ! OpenInteract2::Context->create( $base_config, @params ); } --- 502,511 ---- "directory '$website_dir'"; } + $log->info( "Website directory '$website_dir' exists, setting up context..." ); my $base_config = OpenInteract2::Config::Base->new({ ! website_dir => $website_dir ! }); ! OpenInteract2::Context->create( $base_config, $params ); ! $log->info( "Context setup for management task(s) ok" ); } Index: Setup.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Setup.pm,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** Setup.pm 24 Jan 2005 17:24:31 -0000 1.56 --- Setup.pm 26 Jan 2005 02:35:56 -0000 1.57 *************** *** 5,8 **** --- 5,9 ---- use strict; use base qw( Class::Factory ); + use Algorithm::Dependency; use Algorithm::Dependency::Ordered; use Log::Log4perl qw( get_logger ); *************** *** 160,171 **** "with 'OpenInteract2::Context->create(...)'"; } ! my $actions = $DEP->schedule( $run_action ); $log->info( "Asked to run setup for '$run_action', will execute ", "actions (including deps): ", join( ', ', @{ $actions } ) ); foreach my $action ( @{ $actions } ) { my $setup = OpenInteract2::Setup->new( $action ); - $setup->run_pre_process( CTX ); $setup->run( CTX ); - $setup->run_post_process( CTX ); } } --- 161,170 ---- "with 'OpenInteract2::Context->create(...)'"; } ! my $actions = $DEP->schedule( $run_action ) || []; $log->info( "Asked to run setup for '$run_action', will execute ", "actions (including deps): ", join( ', ', @{ $actions } ) ); foreach my $action ( @{ $actions } ) { my $setup = OpenInteract2::Setup->new( $action ); $setup->run( CTX ); } } *************** *** 181,209 **** $DEFAULT_DEPENDENCY = OpenInteract2::Setup::ReadServerConfig->get_name; ! { ! no strict; ! if ( Algorithm::Dependency->VERSION <= 1.03 ) { ! *Algorithm::Dependency::without = sub { ! my $self = shift; ! my @without = @_; ! my $all_items = $self->schedule_all(); ! unless ( scalar @without ) { ! return $all_items; ! } ! my %to_skip = map { $_ => 1 } @without; ! my @good_items = (); ! ! foreach my $item ( @{ $all_items } ) { ! next if ( $to_skip{ $item } ); ! my $all_item_dep = $self->depends( $item ); ! foreach my $item_dep ( @{ $all_item_dep } ) { ! next if ( $to_skip{ $item_dep } ); ! } ! push @good_items, $item; ! } ! return \@good_items; ! }; ! } ! } 1; --- 180,209 ---- $DEFAULT_DEPENDENCY = OpenInteract2::Setup::ReadServerConfig->get_name; ! # See about adding this... ! #{ ! # no strict; ! # if ( Algorithm::Dependency->VERSION <= 1.03 ) { ! # *Algorithm::Dependency::without = sub { ! # my $self = shift; ! # my @without = @_; ! # my $all_items = $self->schedule_all(); ! # unless ( scalar @without ) { ! # return $all_items; ! # } ! # my %to_skip = map { $_ => 1 } @without; ! # my @good_items = (); ! # ! # foreach my $item ( @{ $all_items } ) { ! # next if ( $to_skip{ $item } ); ! # my $all_item_dep = $self->depends( $item ); ! # foreach my $item_dep ( @{ $all_item_dep } ) { ! # next if ( $to_skip{ $item_dep } ); ! # } ! # push @good_items, $item; ! # } ! # return \@good_items; ! # }; ! # } ! #} 1; |
From: Chris W. <la...@us...> - 2005-01-26 02:37:35
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32604/t Modified Files: 00_manage_create_website.t utils.pl Log Message: fix website creation problems spawned by recent ::Setup change Index: 00_manage_create_website.t =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/00_manage_create_website.t,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** 00_manage_create_website.t 5 Dec 2004 18:50:11 -0000 1.2 --- 00_manage_create_website.t 26 Jan 2005 02:36:12 -0000 1.3 *************** *** 30,34 **** 'create_website', { website_dir => $website_dir, ! source_dir => $source_dir }) }; --- 30,34 ---- 'create_website', { website_dir => $website_dir, ! source_dir => $source_dir, }) }; *************** *** 43,47 **** my @status = eval { $task->execute }; ! ok( ! $@, 'Task executed' ) || diag "Error: $@"; is( scalar @status, 109, 'Number of status messages' ); --- 43,47 ---- my @status = eval { $task->execute }; ! ok( ! $@, 'Task executed' ) || diag "Execution error: $@"; is( scalar @status, 109, 'Number of status messages' ); Index: utils.pl =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/utils.pl,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** utils.pl 16 Dec 2004 13:33:46 -0000 1.86 --- utils.pl 26 Jan 2005 02:36:14 -0000 1.87 *************** *** 275,279 **** my ( $website_dir ) = @_; modify_server_config(); ! CTX->setup({ skip => 'activate spops' }); OpenInteract2::Manage->new( 'install_sql', { --- 275,279 ---- my ( $website_dir ) = @_; modify_server_config(); ! CTX->setup({ skip => 'initialize spops' }); OpenInteract2::Manage->new( 'install_sql', { *************** *** 281,285 **** package => [ 'SYSTEM' ], })->execute(); ! OpenInteract2::Setup->activate_spops_classes; } --- 281,285 ---- package => [ 'SYSTEM' ], })->execute(); ! OpenInteract2::Setup->run_setup_for( 'initialize spops' ); } |
From: Chris W. <la...@us...> - 2005-01-26 02:37:35
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32604/lib/OpenInteract2/Manage/Website Modified Files: Create.pm Log Message: fix website creation problems spawned by recent ::Setup change Index: Create.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/Create.pm,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Create.pm 24 Jan 2005 17:01:23 -0000 1.24 --- Create.pm 26 Jan 2005 02:36:11 -0000 1.25 *************** *** 120,128 **** $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( --- 120,125 ---- *************** *** 164,168 **** eval { mkdir( $full_subdir, $perm ) || die $! }; if ( $@ ) { ! oi_error "Cannot create subdirectory in [$full_subdir]: $@"; } $self->_add_status({ --- 161,165 ---- eval { mkdir( $full_subdir, $perm ) || die $! }; if ( $@ ) { ! oi_error "Cannot create subdirectory in '$full_subdir': $@"; } $self->_add_status({ |
From: Chris W. <la...@us...> - 2005-01-26 02:37:10
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Package In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32604/lib/OpenInteract2/Manage/Package Modified Files: Export.pm Log Message: fix website creation problems spawned by recent ::Setup change Index: Export.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Package/Export.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Export.pm 25 Jan 2005 02:47:24 -0000 1.13 --- Export.pm 26 Jan 2005 02:36:10 -0000 1.14 *************** *** 85,90 **** } else { ! $filename = sprintf( 'Exported package %s-%s to %s', ! $package->name, $package->version, $filename ); } my %status = ( --- 85,90 ---- } else { ! $msg = sprintf( 'Exported package %s-%s to %s', ! $package->name, $package->version, $filename ); } my %status = ( |
From: Chris W. <la...@us...> - 2005-01-25 13:23:38
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12729 Modified Files: VERSION Log Message: bump version Index: VERSION =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/VERSION,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** VERSION 1 Jun 2004 14:57:02 -0000 1.9 --- VERSION 25 Jan 2005 13:23:26 -0000 1.10 *************** *** 1 **** ! $VERSION = '1.99_05'; \ No newline at end of file --- 1 ---- ! $VERSION = '1.99_06'; \ No newline at end of file |
From: Chris W. <la...@us...> - 2005-01-25 04:26:53
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1120/OpenInteract2 Modified Files: Context.pm Log Message: OIN-26: ensure we always have a localization handle available Index: Context.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Context.pm,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** Context.pm 24 Jan 2005 17:17:15 -0000 1.79 --- Context.pm 25 Jan 2005 04:26:43 -0000 1.80 *************** *** 26,29 **** --- 26,31 ---- sub DEPLOY_STATIC_URL { return $DEPLOY_STATIC_URL } + my ( $DEFAULT_LANGUAGE_HANDLE ); + # This is the only copy of the context that should be around. We might # modify this later so we can have multiple copies of the context *************** *** 49,52 **** --- 51,55 ---- require OpenInteract2::Exception; require OpenInteract2::Setup; + require OpenInteract2::I18N; my @CORE_FIELDS = qw( base_config repository packages cache *************** *** 171,174 **** --- 174,178 ---- } + ######################################## # CONFIGURATION ASSIGNMENTS *************** *** 192,195 **** --- 196,203 ---- $self->assign_deploy_static_url; $log_init->info( "Assigned constants from server config ok" ); + + $DEFAULT_LANGUAGE_HANDLE = OpenInteract2::I18N->get_handle( + $config->{language}{default_language} + ); } return $self->{server_config}; *************** *** 275,278 **** --- 283,287 ---- } + ######################################## # DATE FACTORY *************** *** 300,303 **** --- 309,313 ---- } + ######################################## # ACTION LOOKUP *************** *** 319,322 **** --- 329,333 ---- } + sub lookup_action_info { my ( $self, $action_name ) = @_; *************** *** 463,466 **** --- 474,478 ---- } + ######################################## # FULLTEXT INDEXING LOOKUP *************** *** 502,505 **** --- 514,518 ---- } + ######################################## # CONTENT GENERATOR LOOKUP *************** *** 513,516 **** --- 526,530 ---- } + ######################################## # OBSERVERS *************** *** 541,544 **** --- 555,559 ---- } + ######################################## # DIRECTORY/FILE LOOKUPS *************** *** 573,576 **** --- 588,592 ---- } + ######################################## # LOOKUPS, OTHER *************** *** 616,619 **** --- 632,636 ---- } + ######################################## # CLASS LOOKUP *************** *** 628,631 **** --- 645,649 ---- } + # Config shortcut *************** *** 664,667 **** --- 682,686 ---- } + # Config shortcut *************** *** 746,749 **** --- 765,782 ---- } + + sub language_handle { + my ( $self, $lang ) = @_; + if ( $self->request and my $h = $self->request->language_handle ) { + return $h; + } + elsif ( $lang ) { + return OpenInteract2::I18N->get_handle( $lang ); + } + else { + return $DEFAULT_LANGUAGE_HANDLE; + } + } + sub cleanup_request { my ( $self ) = @_; *************** *** 856,859 **** --- 889,896 ---- # XXX: Add a cleanup handler (NOT DONE) #CTX->add_handler( 'cleanup', \&my_cleanup ); + + # Get a language handle if you're not sure whether the request will + # be around + my $handle = CTX->language_handle( $some_lang ); =head1 DESCRIPTION *************** *** 1489,1492 **** --- 1526,1543 ---- Looks up the configuration for boxes, found in the 'box' section. + =head2 Object Methods: Localization + + B<language_handle( [ $language_spec ] )> + + Typically we store the language handle in the + L<OpenInteract2::Request> object -- every user provides us with a set + of useful languages and we create a handle from that. If a request is + available then we call that for the language handle. + + But sometimes you need to access localization resources when you don't + have a request available. For that, you can call this method. If you + don't provide a language we use the one referenced in the server + configuration key 'language.default_language'. + =head1 PROPERTIES |
From: Chris W. <la...@us...> - 2005-01-25 04:14:44
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/I18N In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28817/OpenInteract2/I18N Modified Files: Initializer.pm Log Message: OIN-105: check name of all message files in a package in 'check()'; move language extraction code to I18N initialization module Index: Initializer.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/I18N/Initializer.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Initializer.pm 24 Jan 2005 17:03:20 -0000 1.9 --- Initializer.pm 25 Jan 2005 04:03:20 -0000 1.10 *************** *** 22,25 **** --- 22,38 ---- } + # This may be really naive... + # should match: en | en-US | en_US + + sub is_valid_message_file { + my ( $class, $filename ) = @_; + $log ||= get_logger( LOG_OI ); + my ( $lang ) = $filename =~ m/\b(\w\w|\w\w\-\w+|\w\w_\w+)\.\w+$/; + $log->is_debug && + $log->debug( "Pulled language '$lang' from file '$filename'" ); + return $lang; + + } + sub add_message_files { my ( $self, @files ) = @_; *************** *** 59,73 **** MSGFILE: foreach my $msg_file ( @{ $self->{_files} } ) { ! $log->is_info && ! $log->info( "Reading messages from file '$msg_file'" ); ! ! # This may throw an exception, let it bubble up... ! my $messages = $self->_read_messages( $msg_file ); ! ! # This may be really naive... ! # en | en-US | en_US ! my ( $lang ) = $msg_file =~ m/\b(\w\w|\w\w\-\w+|\w\w_\w+)\.\w+$/; ! $log->is_debug && ! $log->debug( "Using language '$lang' for file '$msg_file'" ); unless ( $lang ) { oi_error "Cannot identify language from message file ", --- 72,76 ---- MSGFILE: foreach my $msg_file ( @{ $self->{_files} } ) { ! my $lang = $self->is_valid_message_file( $msg_file ); unless ( $lang ) { oi_error "Cannot identify language from message file ", *************** *** 76,79 **** --- 79,88 ---- "'myapp-en.msg', 'MyReallyBigApp-es-MX.dat'"; } + $log->is_info && + $log->info( "Reading messages from file '$msg_file'" ); + + # This may throw an exception, let it bubble up... + my $messages = $self->_read_messages( $msg_file ); + $lang_msg{ $lang } ||= {}; foreach my $msg_key ( keys %{ $messages } ) { *************** *** 103,106 **** --- 112,116 ---- } + ######################################## # private methods below here *************** *** 259,262 **** --- 269,295 ---- Return a new object. Any parameters are ignored. + B<is_valid_message_file( $filename )> + + If C<$filename> is a valid message file this returns the language from + the filename, otherwise it returns false. + + The language must be the last distinct set of characters before the + file extension. (Distinct in the '\b' regex sense.) The following are + ok: + + myapp-en.msg + myotherapp-en-MX.dat + messages_en-HK.msg + + The following are not: + + english-messages.msg + messages-en-part2.msg + messagesen.msg + + Currently we assume the base language identifier is two characters + (e.g., 'en', 'jp', 'ru') and the extension (e.g., 'US', 'CA', 'MX') + can by any number of characters. This may be wildly naive. + =head1 OBJECT METHODS *************** *** 323,339 **** =item * ! Cannot discern a language from the given filename. The language must ! be the last distinct set of characters before the file extension. The ! following are ok: ! ! myapp-en.msg ! myotherapp-en-MX.dat ! messages_en-HK.msg ! ! The following are not: ! ! english-messages.msg ! messages-en-part2.msg ! messagesen.msg =item * --- 356,361 ---- =item * ! Cannot discern a language from the given filename. See ! C<is_valid_message_file()> for more. =item * |
From: Chris W. <la...@us...> - 2005-01-25 04:14:15
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28817/OpenInteract2 Modified Files: Package.pm Log Message: OIN-105: check name of all message files in a package in 'check()'; move language extraction code to I18N initialization module Index: Package.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Package.pm,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** Package.pm 25 Jan 2005 03:09:16 -0000 1.43 --- Package.pm 25 Jan 2005 04:03:19 -0000 1.44 *************** *** 22,25 **** --- 22,26 ---- use OpenInteract2::Config::TransferSample; use OpenInteract2::Exception qw( oi_error ); + use OpenInteract2::I18N::Initializer; use OpenInteract2::Repository; use OpenInteract2::Util; *************** *** 487,490 **** --- 488,494 ---- push @status, $self->_check_templates( \@template_files ); + my $message_files = $self->get_message_files; + push @status, $self->_check_message_files( $message_files ); + chdir( $pwd ); return @status; *************** *** 1146,1149 **** --- 1150,1175 ---- } + sub _check_message_files { + my ( $self, $message_files ) = @_; + my @status = (); + my $action = 'Check localization filename'; + foreach my $message_file ( @{ $message_files } ) { + my $full_file = $self->find_file( $message_file ); + $log->is_debug && $log->debug( "Checking message file '$full_file'" ); + my $lang = OpenInteract2::I18N::Initializer + ->is_valid_message_file( $full_file ); + my $msg = ( $lang ) + ? "Extracted language '$lang' from '$message_file'" + : "File '$message_file' is invalid"; + push @status, { + action => $action, + is_ok => ( $lang ) ? 'yes' : 'no', + message => $msg, + filename => $message_file, + }; + } + return @status; + } + # Ensure that the package config has all necessary fields |
From: Chris W. <la...@us...> - 2005-01-25 03:09:30
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18735 Modified Files: Package.pm Log Message: OIN-102: ensure we do not get multiple errors when a module declared in the package.conf cannot be brought in Index: Package.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Package.pm,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Package.pm 25 Jan 2005 02:47:20 -0000 1.42 --- Package.pm 25 Jan 2005 03:09:16 -0000 1.43 *************** *** 463,473 **** push @status, $self->_check_manifest; ! push @status, $self->_check_package_config; my @ini_files = grep /^conf.*\.ini$/, @{ $pkg_files }; push @status, $self->_check_ini_files( \@ini_files ); ! my @pm_files = grep /\.pm$/, @{ $pkg_files }; ! push @status, $self->_check_pm_files( \@pm_files ); my @data_files = grep /^data\/.*\.dat$/, @{ $pkg_files }; --- 463,483 ---- push @status, $self->_check_manifest; ! my ( $c_required, $c_modules ) = $self->_check_package_config; ! push @status, $c_required, $c_modules; my @ini_files = grep /^conf.*\.ini$/, @{ $pkg_files }; push @status, $self->_check_ini_files( \@ini_files ); ! if ( $c_modules->{is_ok} eq 'no' ) { ! push @status, { ! action => 'Check package modules', ! is_ok => 'no', ! message => 'Skipped module checks since dependencies failed', ! }; ! } ! else { ! my @pm_files = grep /\.pm$/, @{ $pkg_files }; ! push @status, $self->_check_pm_files( \@pm_files ); ! } my @data_files = grep /^data\/.*\.dat$/, @{ $pkg_files }; |
From: Chris W. <la...@us...> - 2005-01-25 02:48:25
|
Update of /cvsroot/openinteract/OpenInteract2/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14875 Modified Files: oi2_manage Log Message: debugging updates Index: oi2_manage =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/script/oi2_manage,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** oi2_manage 5 Dec 2004 19:33:13 -0000 1.29 --- oi2_manage 25 Jan 2005 02:48:10 -0000 1.30 *************** *** 78,82 **** if ( $OPT_debug ) { ! my $log_level = ( $OPT_debug == 1 ) ? $DEBUG : $INFO; $log->level( $log_level ); } --- 78,82 ---- if ( $OPT_debug ) { ! my $log_level = ( $OPT_debug ) ? $DEBUG : $INFO; $log->level( $log_level ); } *************** *** 164,179 **** eval { $task->execute }; if ( $@ ) { ! my $error = $@; ! $log->error( "Caught exception during task execution: $error" ); ! for ( 0..10 ) { ! my ( $pkg, $file, $line, $sub ) = caller( $_ ); ! $log->error( "Call $_: $pkg, $file, $line, $sub" ); } outl( 'Caught exception during task execution.' ); ! if ( $error->isa( 'OpenInteract2::Exception::Parameter' ) ) { ! outl( show_parameter_error( $error ) ); } else { ! outl( "$error\n" ); } exit(1); --- 164,181 ---- eval { $task->execute }; if ( $@ ) { ! my $task_error = $@; ! $log->error( "Caught exception during task execution: $task_error" ); ! $log->error( "Contents of task:\n", Dumper( $task ) ); ! foreach my $step ( 0..10 ) { ! my ( $pkg, $file, $line, $sub ) = caller( $step ); ! next unless ( $pkg ); ! $log->error( "Call $step: $pkg, $file, $line, $sub" ); } outl( 'Caught exception during task execution.' ); ! if ( ref $task_error and $task_error->isa( 'OpenInteract2::Exception::Parameter' ) ) { ! outl( show_parameter_error( $task_error ) ); } else { ! outl( "$task_error\n" ); } exit(1); |
From: Chris W. <la...@us...> - 2005-01-25 02:47:35
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14635/OpenInteract2 Modified Files: Package.pm Log Message: OIN-111: ensure every package exported through management task is associated with a status message, even if it fails Index: Package.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Package.pm,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Package.pm 5 Dec 2004 20:06:35 -0000 1.41 --- Package.pm 25 Jan 2005 02:47:20 -0000 1.42 *************** *** 67,75 **** } elsif ( $params->{directory} ) { ! unless ( -d $params->{directory} ) { oi_error "Cannot initialize package with non-existent package ", "directory. (Given $params->{directory})"; ! } ! $self->directory( rel2abs( $params->{directory} ) ); $to_read++; } --- 67,78 ---- } elsif ( $params->{directory} ) { ! my $full_directory = rel2abs( $params->{directory} ); ! unless ( -d $full_directory ) { oi_error "Cannot initialize package with non-existent package ", "directory. (Given $params->{directory})"; ! } ! $log->is_debug && ! $log->debug( "Reading package from directory '$full_directory'" ); ! $self->directory( $full_directory ); $to_read++; } *************** *** 146,152 **** "directory '$dir'"; } - - $log->is_debug && - $log->debug( "Reading package info from '$dir'" ); $self->config( OpenInteract2::Config::Package->new({ directory => $dir }) ); $self->name( $self->config->name ); --- 149,152 ---- *************** *** 409,414 **** }; if ( $@ ) { $class->_remove_directory_tree( $full_skeleton_dir ); ! oi_error $@; } my $created_package = $class->new({ directory => $full_skeleton_dir }); --- 409,415 ---- }; if ( $@ ) { + my $error = $@; $class->_remove_directory_tree( $full_skeleton_dir ); ! oi_error $error; } my $created_package = $class->new({ directory => $full_skeleton_dir }); *************** *** 430,438 **** $self->config->check_required_fields; $self->_export_check_manifest; ! my $archive_filename = eval { $self->_export_archive_package }; ! if ( $@ ) { ! oi_error $@; ! } ! return $archive_filename; } --- 431,435 ---- $self->config->check_required_fields; $self->_export_check_manifest; ! return $self->_export_archive_package; } *************** *** 935,939 **** }; my $error = $@; ! $self->_remove_directory_tree( $export_dir ); oi_error $error if ( $error ); return $filename; --- 932,938 ---- }; my $error = $@; ! eval { ! $self->_remove_directory_tree( $export_dir ) ! }; oi_error $error if ( $error ); return $filename; *************** *** 951,961 **** my ( $self, $dir, $base_filename, @files ) = @_; unless ( -d $dir and $base_filename and scalar @files ) { ! oi_error "Insufficient parameters to create archive ", ! "[Dir: $dir] [File: $base_filename] [@files]"; } ! my $zip_filename = catfile( $dir, join( '.', $base_filename, 'zip' ) ); if ( -f $zip_filename ) { ! oi_error "Cannot create ZIP archive: '$zip_filename' already exists"; } --- 950,960 ---- my ( $self, $dir, $base_filename, @files ) = @_; unless ( -d $dir and $base_filename and scalar @files ) { ! die "Insufficient parameters to create archive ", ! "in directory '$dir', file '$base_filename'\n"; } ! my $zip_filename = catfile( $dir, "$base_filename.zip" ); if ( -f $zip_filename ) { ! die "Cannot create ZIP archive: file '$zip_filename' already exists\n"; } *************** *** 970,974 **** $msg = 'There was an IO error.' if ( $rv == AZ_IO_ERROR ); $msg ||= 'Unknown error'; ! oi_error "Failed to create ZIP archive '$zip_filename': $msg"; } return $zip_filename; --- 969,973 ---- $msg = 'There was an IO error.' if ( $rv == AZ_IO_ERROR ); $msg ||= 'Unknown error'; ! die "Failed to create ZIP archive '$zip_filename': $msg\n"; } return $zip_filename; |
From: Chris W. <la...@us...> - 2005-01-25 02:47:35
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14635/OpenInteract2/Config Modified Files: Package.pm Log Message: OIN-111: ensure every package exported through management task is associated with a status message, even if it fails Index: Package.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Config/Package.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Package.pm 26 Sep 2004 16:06:30 -0000 1.19 --- Package.pm 25 Jan 2005 02:47:24 -0000 1.20 *************** *** 5,14 **** use strict; use base qw( Class::Accessor::Fast ); ! use File::Basename (); ! use File::Spec; use OpenInteract2::Exception qw( oi_error ); $OpenInteract2::Config::Package::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/); use constant DEFAULT_FILENAME => 'package.conf'; --- 5,18 ---- use strict; use base qw( Class::Accessor::Fast ); ! use File::Basename qw( dirname ); ! use File::Spec::Functions qw( catfile rel2abs ); ! use Log::Log4perl qw( get_logger ); ! use OpenInteract2::Constants qw( :log ); use OpenInteract2::Exception qw( oi_error ); $OpenInteract2::Config::Package::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/); + my ( $log ); + use constant DEFAULT_FILENAME => 'package.conf'; *************** *** 55,58 **** --- 59,63 ---- sub new { my ( $class, $params ) = @_; + $log ||= get_logger( LOG_OI ); my $self = bless( {}, $class ); my $filename = $params->{filename}; *************** *** 60,63 **** --- 65,71 ---- if ( ! $filename and $directory ) { $filename = $self->create_filename( $directory ); + $log->is_debug && + $log->debug( "Will read package config from '$filename' ", + "given directory '$directory'" ); } if ( $filename and -f $filename ) { *************** *** 65,69 **** $params->{ $_ } = $new_params->{ $_ } for ( keys %{ $new_params } ); $self->filename( $filename ); ! $self->package_dir( File::Spec->rel2abs( File::Basename::dirname( $filename ) ) ); } return $self->init( $params ); --- 73,77 ---- $params->{ $_ } = $new_params->{ $_ } for ( keys %{ $new_params } ); $self->filename( $filename ); ! $self->package_dir( rel2abs( dirname( $filename ) ) ); } return $self->init( $params ); *************** *** 75,79 **** oi_error "Must pass in directory to create package config filename"; } ! return File::Spec->catfile( $dir, DEFAULT_FILENAME ); } --- 83,87 ---- oi_error "Must pass in directory to create package config filename"; } ! return catfile( $dir, DEFAULT_FILENAME ); } |