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...> - 2001-11-27 13:20:50
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract
In directory usw-pr-cvs1:/tmp/cvs-serv2587/OpenInteract
Modified Files:
Page.pm
Log Message:
bring in the storage classes in _class_initialize rather than by 'use' statements
Index: Page.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract/Page.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Page.pm 2001/11/27 12:07:52 1.6
--- Page.pm 2001/11/27 13:20:47 1.7
***************
*** 6,16 ****
use Data::Dumper qw( Dumper );
use File::Basename qw();
- use OpenInteract::Page::Database;
- use OpenInteract::Page::File;
- use OpenInteract::Page::Http;
$OpenInteract::Page::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
-
my %STORAGE_CLASS = (
database => 'OpenInteract::Page::Database',
--- 6,12 ----
***************
*** 19,22 ****
--- 15,24 ----
);
+
+ sub _class_initialize {
+ my ( $class ) = @_;
+ eval "require $_" for ( values %STORAGE_CLASS );
+ }
+
########################################
# CLASS METHODS
***************
*** 48,57 ****
my ( $MAGIC );
sub mime_type_file {
my ( $class, $filename ) = @_;
return undef unless ( -f $filename );
! require File::MMagic;
! $MAGIC ||= File::MMagic->new;
return $MAGIC->checktype_filename( $filename );
}
--- 50,74 ----
my ( $MAGIC );
+ sub init_magic {
+ my ( $class ) = @_;
+ return if ( $MAGIC );
+ require File::MMagic;
+ $MAGIC = File::MMagic->new;
+ }
+
+
sub mime_type_file {
my ( $class, $filename ) = @_;
return undef unless ( -f $filename );
! $class->init_magic;
return $MAGIC->checktype_filename( $filename );
+ }
+
+
+ sub mime_type_content {
+ my ( $class, $content ) = @_;
+ return undef unless ( $content );
+ $class->init_magic;
+ return $MAGIC->checktype_contents( $content );
}
|
|
From: Chris W. <la...@us...> - 2001-11-27 13:20:18
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page
In directory usw-pr-cvs1:/tmp/cvs-serv2422
Modified Files:
Changes package.conf
Log Message:
meta
Index: Changes
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/Changes,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Changes 2001/11/27 05:16:09 1.13
--- Changes 2001/11/27 13:20:15 1.14
***************
*** 1,4 ****
--- 1,17 ----
Revision history for OpenInteract package base_page.
+ 0.38 Tue Nov 27 08:37:59 EST 2001
+
+ Minor form template change.
+
+ 0.37 Tue Nov 27 08:33:51 EST 2001
+
+ Use _class_initialize() in OpenInteract::Page rather than BEGIN{}
+
+ 0.36 Tue Nov 27 08:29:50 EST 2001
+
+ Add 'mime_type_content' class method to OpenInteract::Page, and
+ add docs to script/static_page2base_page.pl.
+
0.35 Mon Nov 26 23:58:45 EST 2001
Index: package.conf
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/package.conf,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** package.conf 2001/11/27 12:07:15 1.13
--- package.conf 2001/11/27 13:20:16 1.14
***************
*** 1,4 ****
name base_page
! version 0.35
author Chris Winters <ch...@cw...>
module File::Basename
--- 1,4 ----
name base_page
! version 0.38
author Chris Winters <ch...@cw...>
module File::Basename
|
|
From: Chris W. <la...@us...> - 2001-11-27 13:16:43
|
Update of /cvsroot/openinteract/OpenInteract/template
In directory usw-pr-cvs1:/tmp/cvs-serv1629
Modified Files:
show_label
Log Message:
cosmetic
Index: show_label
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/template/show_label,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** show_label 2001/10/17 12:07:43 1.3
--- show_label 2001/11/27 13:16:39 1.4
***************
*** 12,14 ****
[%- req = required_display -%]
[% END %]
! [% pre_label %]<b>[% label %][% req %][% post_label %]</b>
\ No newline at end of file
--- 12,14 ----
[%- req = required_display -%]
[% END %]
! [% pre_label %]<b>[% label %]</b>[% req %][% post_label %]
\ No newline at end of file
|
|
From: Chris W. <la...@us...> - 2001-11-27 12:28:48
|
Update of /cvsroot/openinteract/SPOPS
In directory usw-pr-cvs1:/tmp/cvs-serv20687
Modified Files:
SPOPS.pm
Log Message:
check for existence of $id_field in clone() first to remove warnings triggered by having none
Index: SPOPS.pm
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/SPOPS.pm,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** SPOPS.pm 2001/11/27 12:25:00 1.58
--- SPOPS.pm 2001/11/27 12:28:45 1.59
***************
*** 183,187 ****
while ( my ( $k, $v ) = each %{ $self } ) {
next unless ( $k );
! next if ( $k eq $id_field );
$initial_data{ $k } = $p->{ $k } || $v;
}
--- 183,187 ----
while ( my ( $k, $v ) = each %{ $self } ) {
next unless ( $k );
! next if ( $id_field and $k eq $id_field );
$initial_data{ $k } = $p->{ $k } || $v;
}
|
|
From: Chris W. <la...@us...> - 2001-11-27 12:25:05
|
Update of /cvsroot/openinteract/SPOPS In directory usw-pr-cvs1:/tmp/cvs-serv19628 Modified Files: SPOPS.pm Log Message: bump version Index: SPOPS.pm =================================================================== RCS file: /cvsroot/openinteract/SPOPS/SPOPS.pm,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** SPOPS.pm 2001/11/26 16:27:19 1.57 --- SPOPS.pm 2001/11/27 12:25:00 1.58 *************** *** 15,19 **** @SPOPS::ISA = qw( Exporter Storable ); @SPOPS::EXPORT_OK = qw( _w _wm DEBUG ); ! $SPOPS::VERSION = '0.53'; $SPOPS::Revision = substr(q$Revision$, 10); --- 15,19 ---- @SPOPS::ISA = qw( Exporter Storable ); @SPOPS::EXPORT_OK = qw( _w _wm DEBUG ); ! $SPOPS::VERSION = '0.54'; $SPOPS::Revision = substr(q$Revision$, 10); |
|
From: Chris W. <la...@us...> - 2001-11-27 12:24:34
|
Update of /cvsroot/openinteract/SPOPS In directory usw-pr-cvs1:/tmp/cvs-serv19468 Modified Files: Changes RELEASE Log Message: modify for 0.54 Index: Changes =================================================================== RCS file: /cvsroot/openinteract/SPOPS/Changes,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** Changes 2001/11/26 16:27:19 1.73 --- Changes 2001/11/27 12:24:31 1.74 *************** *** 1,9 **** Revision history for Perl extension SPOPS. ! 0.54 Overall: ! - Fix bug introduced by 0.53 in the clone() method Individual: --- 1,10 ---- Revision history for Perl extension SPOPS. ! 0.54 Tue Nov 27 07:42:59 EST 2001 Overall: ! - Fix bug introduced by 0.53 in the clone() method. (Thanks to Ray ! Zimmerman for spotting.) Individual: Index: RELEASE =================================================================== RCS file: /cvsroot/openinteract/SPOPS/RELEASE,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RELEASE 2001/11/25 01:38:13 1.10 --- RELEASE 2001/11/27 12:24:31 1.11 *************** *** 2,5 **** --- 2,10 ---- ========================= + 0.54 Tue Nov 27 07:42:59 EST 2001 + + * Fix bug in clone() method. + + 0.53 Sat Nov 24 20:50:32 EST 2001 |
|
From: Chris W. <la...@us...> - 2001-11-27 12:09:39
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract/Page
In directory usw-pr-cvs1:/tmp/cvs-serv16072/OpenInteract/Page
Modified Files:
Database.pm File.pm Http.pm
Log Message:
change to class methods
Index: Database.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract/Page/Database.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Database.pm 2001/10/25 14:58:50 1.4
--- Database.pm 2001/11/27 12:09:36 1.5
***************
*** 6,12 ****
sub load {
! my ( $self ) = @_;
my $R = OpenInteract::Request->instance;
! my $page_content = eval { $self->page_content };
if ( $@ ) {
$R->scrib( 0, "Error retrieving content from database. Error: $@\n",
--- 6,12 ----
sub load {
! my ( $class, $page ) = @_;
my $R = OpenInteract::Request->instance;
! my $page_content = eval { $page->page_content };
if ( $@ ) {
$R->scrib( 0, "Error retrieving content from database. Error: $@\n",
***************
*** 19,26 ****
sub save {
! my ( $self, $content ) = @_;
my $R = OpenInteract::Request->instance;
! my $page_content = eval { $self->page_content } || $R->page_content->new;
! $page_content->{location} = $self->{location};
if ( ! ref $content ) {
--- 19,26 ----
sub save {
! my ( $class, $page, $content ) = @_;
my $R = OpenInteract::Request->instance;
! my $page_content = eval { $page->page_content } || $R->page_content->new;
! $page_content->{location} = $page->{location};
if ( ! ref $content ) {
***************
*** 42,47 ****
sub remove {
! my ( $self ) = @_;
! my $page_content = eval { $self->page_content };
return $page_content->remove;
}
--- 42,47 ----
sub remove {
! my ( $class, $page ) = @_;
! my $page_content = eval { $page->page_content };
return $page_content->remove;
}
Index: File.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract/Page/File.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** File.pm 2001/10/25 14:58:50 1.4
--- File.pm 2001/11/27 12:09:36 1.5
***************
*** 17,24 ****
sub load {
! my ( $self ) = @_;
my $R = OpenInteract::Request->instance;
! my $full_location = _create_file_location( $self );
unless ( -f $full_location ) {
$R->scrib( 1, "File ($full_location) does not exist! Bailing on load()..." );
--- 17,24 ----
sub load {
! my ( $class, $page ) = @_;
my $R = OpenInteract::Request->instance;
! my $full_location = $class->_create_file_location( $page );
unless ( -f $full_location ) {
$R->scrib( 1, "File ($full_location) does not exist! Bailing on load()..." );
***************
*** 43,47 ****
# between them
! $content =~ s|<body>(.*)?</body>|$1|i;
return $content;
--- 43,47 ----
# between them
! $content =~ s|<body>(.*?)</body>|$1|i;
return $content;
***************
*** 53,59 ****
sub save {
! my ( $self, $content ) = @_;
my $R = OpenInteract::Request->instance;
! my $full_location = _create_file_location( $self );
$R->DEBUG && $R->scrib( 1, "Trying to save content to ($full_location)" );
--- 53,59 ----
sub save {
! my ( $class, $page, $content ) = @_;
my $R = OpenInteract::Request->instance;
! my $full_location = $class->_create_file_location( $page );
$R->DEBUG && $R->scrib( 1, "Trying to save content to ($full_location)" );
***************
*** 69,73 ****
# Ensure the directory where this will go exists
! _create_location_path( $full_location );
open( NEW, "> $tmp_location" ) || die "Cannot open temp file for writing: $!";
--- 69,73 ----
# Ensure the directory where this will go exists
! $class->_create_location_path( $full_location );
open( NEW, "> $tmp_location" ) || die "Cannot open temp file for writing: $!";
***************
*** 106,111 ****
sub remove {
! my ( $self ) = @_;
! my $full_location = _create_file_location( $self );
my $R = OpenInteract::Request->instance;
$R->DEBUG && $R->scrib( 1, "Trying to delete content file ($full_location)" );
--- 106,111 ----
sub remove {
! my ( $class, $page ) = @_;
! my $full_location = $class->_create_file_location( $page );
my $R = OpenInteract::Request->instance;
$R->DEBUG && $R->scrib( 1, "Trying to delete content file ($full_location)" );
***************
*** 118,131 ****
sub _create_file_location {
! my ( $self ) = @_;
my $R = OpenInteract::Request->instance;
my $html_dir = $R->CONFIG->get_dir( 'html' );
$html_dir =~ s|/$||;
! $R->DEBUG && $R->scrib( 1, "Trying to find filesystem location for ($html_dir) ($self->{location})" );
! return join( '', $html_dir, $self->{location} );
}
sub _create_location_path {
! my ( $location ) = @_;
my $R = OpenInteract::Request->instance;
$R->DEBUG && $R->scrib( 1, "See if ($location) exists or needs created" );
--- 118,131 ----
sub _create_file_location {
! my ( $class, $page ) = @_;
my $R = OpenInteract::Request->instance;
my $html_dir = $R->CONFIG->get_dir( 'html' );
$html_dir =~ s|/$||;
! $R->DEBUG && $R->scrib( 1, "Trying to find filesystem location for ($html_dir) ($page->{location})" );
! return join( '', $html_dir, $page->{location} );
}
sub _create_location_path {
! my ( $class, $location ) = @_;
my $R = OpenInteract::Request->instance;
$R->DEBUG && $R->scrib( 1, "See if ($location) exists or needs created" );
Index: Http.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract/Page/Http.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Http.pm 2001/11/26 06:30:14 1.1
--- Http.pm 2001/11/27 12:09:36 1.2
***************
*** 9,13 ****
my ( $AGENT );
-
BEGIN {
$AGENT = LWP::UserAgent->new();
--- 9,12 ----
***************
*** 16,45 ****
sub load {
! my ( $self ) = @_;
! unless ( $self->{content_location} ) {
return "Cannot retrieve content -- no URL specified.";
}
! unless ( $self->{content_location} =~ /^http/ ) {
return "Cannot retrieve content -- invalid URL specified.";
}
my $request = HTTP::Request->new(
! GET => $self->{content_location} );
my $response = $AGENT->request( $request );
if ( $response->is_success ) {
my $content = $response->content;
! $content =~ s|^.*<body||ism;
$content =~ s|</body>.*$||ism;
! }
! else {
! return 'Cannot retrieve content -- code ' .
! $response->code . ' returned.';
}
}
sub save {
! my ( $self ) = @_;
! warn "--Location $self->{location} cannot be saved, since it's ",
"using HTTP storage.\n";
return 1;
--- 15,47 ----
sub load {
! my ( $class, $page ) = @_;
! my $R = OpenInteract::Request->instance;
! unless ( $page->{content_location} ) {
! $R->scrib( 0, "No content location available -- cannot display" );
return "Cannot retrieve content -- no URL specified.";
}
! unless ( $page->{content_location} =~ /^http/ ) {
! $R->scrib( 0, "Content location invalid ($page->{content_location})" );
return "Cannot retrieve content -- invalid URL specified.";
}
+ $R->scrib( 1, "Trying to fetch URL ($page->{content_location})" );
my $request = HTTP::Request->new(
! GET => $page->{content_location} );
my $response = $AGENT->request( $request );
if ( $response->is_success ) {
my $content = $response->content;
! $content =~ s|^.*<body.*?>||ism;
$content =~ s|</body>.*$||ism;
! return $class->rewrite_content( $content );
}
+ return 'Cannot retrieve content -- code ' . $response->code . ' returned.';
}
+ sub rewrite_content { return $_[1] }
sub save {
! my ( $class, $page ) = @_;
! warn "--Location $page->{location} cannot be saved, since it's ",
"using HTTP storage.\n";
return 1;
***************
*** 48,53 ****
sub remove {
! my ( $self ) = @_;
! warn "--Location $self->{location} cannot be removed, since it's ",
"using HTTP storage.\n";
return 1;
--- 50,55 ----
sub remove {
! my ( $class, $page ) = @_;
! warn "--Location $page->{location} cannot be removed, since it's ",
"using HTTP storage.\n";
return 1;
|
|
From: Chris W. <la...@us...> - 2001-11-27 12:09:25
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page/template
In directory usw-pr-cvs1:/tmp/cvs-serv16019/template
Modified Files:
page_form.tmpl
Log Message:
ensure everything is named properly
Index: page_form.tmpl
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/template/page_form.tmpl,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** page_form.tmpl 2001/11/26 06:29:31 1.7
--- page_form.tmpl 2001/11/27 12:09:22 1.8
***************
*** 117,121 ****
[% INCLUDE label_form_text_row( label = 'Content Location',
post_label = cl_label,
! name = content_location,
value = page.content_location ) -%]
--- 117,121 ----
[% INCLUDE label_form_text_row( label = 'Content Location',
post_label = cl_label,
! name = 'content_location',
value = page.content_location ) -%]
|
|
From: Chris W. <la...@us...> - 2001-11-27 12:09:07
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page/script
In directory usw-pr-cvs1:/tmp/cvs-serv15946/script
Modified Files:
static_page2base_page.pl
Log Message:
set 'storage' instead of 'is_file'
Index: static_page2base_page.pl
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/script/static_page2base_page.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** static_page2base_page.pl 2001/10/29 05:15:20 1.1
--- static_page2base_page.pl 2001/11/27 12:09:03 1.2
***************
*** 57,64 ****
if ( $AS_FILE eq 'yes' ) {
! $page->{is_file} = 'yes';
}
else {
! $page->{is_file} = 'no';
}
--- 57,64 ----
if ( $AS_FILE eq 'yes' ) {
! $page->{storage} = 'file';
}
else {
! $page->{storage} = 'database';
}
|
|
From: Chris W. <la...@us...> - 2001-11-27 12:08:50
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page/doc In directory usw-pr-cvs1:/tmp/cvs-serv15845/doc Modified Files: base_page.pod Log Message: modify docs Index: base_page.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/doc/base_page.pod,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** base_page.pod 2001/11/26 06:55:54 1.4 --- base_page.pod 2001/11/27 12:08:47 1.5 *************** *** 14,27 **** This module displays pages. ! Well, ok, it does more than that. Each page can optionally be a ! template in its own right and you can store the content of the pages ! in the database or the filesystem, or both. The database always stores ! page metadata. ! So a request like: http://www.mysite.com/reports/q1/sales ! Can be mapped to an object which has the content in the database, but to your users it looks like a static HTML page. --- 14,36 ---- This module displays pages. ! Well, ok, it does more than that. Each 'page' consists of two pieces: ! a record of metadata always stored in the database, and the content of ! the page which can be stored in one of several media. ! The content can be displayable in a web browser, but it doesn't have ! to be. Additionally, the 'page' can itself have no content at all and ! exist merely as a pointer to content stored elsewhere. If the page can ! be displayed in a browser then you can embed the various template ! directives used elsewhere in OpenInteract. ! ! This package -- more specifically, the 'Page' handler in this package ! -- generally deals with all requests for which a handler is not ! found. This means a request like: http://www.mysite.com/reports/q1/sales ! will get passed to the 'Page' handler and that page object ! ('/reports/q1/sales') fetched. (More on this below.) Again, the ! content for that object can exist in the database or the filesystem, but to your users it looks like a static HTML page. *************** *** 35,39 **** But you can manage these files through the web interface and even intermingle (for instance) your PDFs and tarballs along with your HTML ! files. =head2 Handling all unspecified requests --- 44,48 ---- But you can manage these files through the web interface and even intermingle (for instance) your PDFs and tarballs along with your HTML ! files, keeping the same security settings for all of them. =head2 Handling all unspecified requests *************** *** 49,53 **** redir = page - This means if no action is found (an 'empty request') it will be serviced by the 'page' action, which is defined in this module's --- 58,61 ---- *************** *** 70,104 **** 'basic_page' SPOPS object. No longer. You can now display HTML pages from the filesystem as well as objects from the database, and refer to ! them in the exact same way. ! There are a few differences. Objects ! For instance, say you have database records representing HTML pages ! identified by the following locations: ! /mytest/test1 ! /mytest/test2 ! And HTML pages in the filesystem at the following locations: ! $SITE_HOME/html/mytest/test3.html ! $SITE_HOME/html/mytest/test4.html ! Then the following applies: ! Request Result ! =============== ========================= ! /mytest/test1 Served by SPOPS object from database ! /mytest/test3.html Served by filesystem ! /mytest/test4 File not found! ! /mytest/test2.html Served by SPOPS object from database ! The first three are pretty easy to understand, but the fourth is ! odd. When searching for files in the database, we take the requests ! and, if a file extension exists, chop it off as another name to ! check. This could lead to a nasty 'error' where you have a file in the ! filesystem '$SITE_HOME/html/mytest/test2.html' and a database object ! '/mytest/test2' -- if the database is being checked first, then the ! filesystem file will B<never be displayed>. =head1 SECURITY --- 78,114 ---- 'basic_page' SPOPS object. No longer. You can now display HTML pages from the filesystem as well as objects from the database, and refer to ! them in the exact same way. And people using the browser interface to ! edit browser-displayable content should be able to edit the content no ! matter where it is stored. ! Also, you can mix-and-match whether a particular page is stored in the ! filesystem or database. Each object knows where its content is stored, ! and that setting is independent of all other objects. ! Here's an example: ! my $page = $R->page->fetch( '/reports/q1/sales' ); ! The variable C<$page> now contains metadata about the page to be ! displayed -- title, author, keywords, MIME type, size (optional), and ! other information. The content has not yet been put into the object. ! To get the content, you just need to call: ! $page->fetch_content; ! And it will be retrieved into the object under the key 'content'. ! =head1 ALIASES ! ! You can define a page to be an alias for another page. An alias won't ! have any content of its own, it just acts as a pointer to the other ! page. This can be useful if you find that people are mistyping a ! particular page name, or if you've accidentally botched a page ! spelling in an advertisement, or for whatever reason. ! ! Note that an alias isn't a B<real> pointer to the other page. The ! C<show()> method in the handler just has some extra logic to deal with ! it. =head1 SECURITY *************** *** 154,178 **** docs. - =item * - - See that we handle file extensions (or lack thereof) consistently no - matter whether we're requesting an object from the database or a file - from the filesystem. - =back =head1 TO DO ! B<Map multiple URLs to one 'file'> ! Sometimes you might accidentally give out the wrong URL, or you might ! find that people constantly misspell the correct URL. It should be ! pretty simple to have a separate table of URL -> real URL mappings ! which we consult if we don't find a page. ! B<Map requests to URL fetches from other sites> ! It would be kind of interesting to map certain URLs to grab pages (or ! sections of pages) from other sites. (Probably illegal, but whatever.) =head1 SEE ALSO --- 164,181 ---- docs. =back =head1 TO DO ! B<Indexes> ! Be able to whip up a directory index on the fly, listing all files ! within that directory. ! B<Rewrite content> ! Allow subclasses for the storage facility so that developers can ! create a custom storage facility to do things like content rewriting, ! etc. =head1 SEE ALSO |
|
From: Chris W. <la...@us...> - 2001-11-27 12:08:39
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract/Handler
In directory usw-pr-cvs1:/tmp/cvs-serv15764/OpenInteract/Handler
Modified Files:
Page.pm
Log Message:
add the 'storage' and 'content_location' fields to be edited, other related changes
Index: Page.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract/Handler/Page.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** Page.pm 2001/11/26 13:44:31 1.12
--- Page.pm 2001/11/27 12:08:36 1.13
***************
*** 41,46 ****
sub MY_EDIT_DISPLAY_TASK { return 'show' }
sub MY_EDIT_FIELDS { return qw( location title author keywords
! boxes main_template notes content ) }
! sub MY_EDIT_FIELDS_TOGGLED { return qw( is_active is_file template_parse ) }
sub MY_EDIT_FIELDS_DATE { return qw( active_on expires_on ) }
sub MY_ALLOW_SEARCH_FORM { return 1 }
--- 41,47 ----
sub MY_EDIT_DISPLAY_TASK { return 'show' }
sub MY_EDIT_FIELDS { return qw( location title author keywords
! boxes main_template notes content
! storage content_location ) }
! sub MY_EDIT_FIELDS_TOGGLED { return qw( is_active template_parse ) }
sub MY_EDIT_FIELDS_DATE { return qw( active_on expires_on ) }
sub MY_ALLOW_SEARCH_FORM { return 1 }
***************
*** 220,225 ****
# mark it as non-editable to the form
if ( $class->_is_displayable( $page->{mime_type} ) ) {
! $page->content;
}
else {
--- 221,227 ----
# mark it as non-editable to the form
+ $page->{storage} ||= 'file';
if ( $class->_is_displayable( $page->{mime_type} ) ) {
! $page->fetch_content;
}
else {
***************
*** 227,231 ****
}
$R->DEBUG && $R->scrib( 1, "This page should be in an editable form" );
- $page->{is_file} ||= 'yes' if ( $page->CONFIG->{default_storage} eq 'file' );
$params->{page} = $page;
$R->{page}{title} = 'Edit a Document';
--- 229,232 ----
***************
*** 258,262 ****
}
! $page->content;
# Otherwise, ensure the page is active, set metadata and send it
--- 259,263 ----
}
! $page->fetch_content;
# Otherwise, ensure the page is active, set metadata and send it
|
|
From: Chris W. <la...@us...> - 2001-11-27 12:07:57
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract
In directory usw-pr-cvs1:/tmp/cvs-serv15542/OpenInteract
Modified Files:
Page.pm
Log Message:
separate out the storage classes so we don't have the several if/then ladders
Index: Page.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract/Page.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Page.pm 2001/11/26 06:55:14 1.5
--- Page.pm 2001/11/27 12:07:52 1.6
***************
*** 13,16 ****
--- 13,22 ----
+ my %STORAGE_CLASS = (
+ database => 'OpenInteract::Page::Database',
+ file => 'OpenInteract::Page::File',
+ http => 'OpenInteract::Page::Http',
+ );
+
########################################
# CLASS METHODS
***************
*** 69,83 ****
# Fetch the content from either the filesystem or database, depending.
! sub content {
my ( $self ) = @_;
! if ( $self->{storage} eq 'file' ) {
! return $self->{content} = OpenInteract::Page::File::load( $self );
! }
! if ( $self->{storage} eq 'database' ) {
! return $self->{content} = OpenInteract::Page::Database::load( $self );
! }
! if ( $self->{storage} eq 'http' ) {
! return $self->{content} = OpenInteract::Page::Http::load( $self );
}
}
--- 75,85 ----
# Fetch the content from either the filesystem or database, depending.
! sub fetch_content {
my ( $self ) = @_;
! my $storage_class = $STORAGE_CLASS{ $self->{storage} };
! unless ( $storage_class ) {
! return "Cannot retrieve content -- no storage type specified";
}
+ return $self->{content} = $storage_class->load( $self );
}
***************
*** 109,115 ****
my ( $self, $p ) = @_;
return 1 unless ( $self->{content} );
! return ( $self->{is_file} eq 'yes' )
! ? OpenInteract::Page::File::save( $self, $self->{content} )
! : OpenInteract::Page::Database::save( $self, $self->{content} );
}
--- 111,116 ----
my ( $self, $p ) = @_;
return 1 unless ( $self->{content} );
! my $storage_class = $STORAGE_CLASS{ $self->{storage} };
! return $self->{content} = $storage_class->save( $self );
}
***************
*** 117,123 ****
sub remove_content {
my ( $self, $p ) = @_;
! return ( $self->{is_file} eq 'yes' )
! ? OpenInteract::Page::File::remove( $self )
! : OpenInteract::Page::Database::remove( $self );
}
--- 118,123 ----
sub remove_content {
my ( $self, $p ) = @_;
! my $storage_class = $STORAGE_CLASS{ $self->{storage} };
! return $self->{content} = $storage_class->remove( $self );
}
***************
*** 169,173 ****
directory.
! B<content()>
Retrieve content for this page. Note that we do not make this a
--- 169,173 ----
directory.
! B<fetch_content()>
Retrieve content for this page. Note that we do not make this a
***************
*** 182,186 ****
to simply be the location of the basic page.
! =head1 RULESETS
B<pre_save_action>
--- 182,186 ----
to simply be the location of the basic page.
! =head1 RULES
B<pre_save_action>
|
|
From: Chris W. <la...@us...> - 2001-11-27 12:07:18
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page In directory usw-pr-cvs1:/tmp/cvs-serv15361 Modified Files: package.conf Log Message: meta Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/package.conf,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** package.conf 2001/11/26 13:43:11 1.12 --- package.conf 2001/11/27 12:07:15 1.13 *************** *** 1,4 **** name base_page ! version 0.30 author Chris Winters <ch...@cw...> module File::Basename --- 1,4 ---- name base_page ! version 0.35 author Chris Winters <ch...@cw...> module File::Basename *************** *** 6,9 **** --- 6,11 ---- module File::Path module Class::Date + module HTTP::Request + module LWP::UserAgent template_plugin url http://www.openinteract.org/ |
|
From: Chris W. <la...@us...> - 2001-11-27 05:16:13
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page
In directory usw-pr-cvs1:/tmp/cvs-serv18281
Modified Files:
Changes
Log Message:
latest changes
Index: Changes
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/Changes,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** Changes 2001/11/26 13:43:11 1.12
--- Changes 2001/11/27 05:16:09 1.13
***************
*** 1,4 ****
--- 1,24 ----
Revision history for OpenInteract package base_page.
+ 0.35 Mon Nov 26 23:58:45 EST 2001
+
+ Okay, really, this time it's ready.
+
+ 0.34 Mon Nov 26 23:40:40 EST 2001
+
+ Various small fixes, cleaned up and (hopefully ready to go).
+
+ 0.33 Mon Nov 26 23:16:36 EST 2001
+
+ Make storage class handling more flexible.
+
+ 0.32 Mon Nov 26 23:01:03 EST 2001
+
+ Fixed the http content fetch, other stuff.
+
+ 0.31 Mon Nov 26 22:39:55 EST 2001
+
+ Doc and other updates.
+
0.30 Mon Nov 26 08:48:38 EST 2001
***************
*** 112,115 ****
'static_page' package to OI::CommonHandler, cleaned it up and
extended it so we can use the filesystem or the database to
! store page objects.
!
--- 132,134 ----
'static_page' package to OI::CommonHandler, cleaned it up and
extended it so we can use the filesystem or the database to
! store page objects.
\ No newline at end of file
|
|
From: Chris W. <la...@us...> - 2001-11-26 16:27:23
|
Update of /cvsroot/openinteract/SPOPS
In directory usw-pr-cvs1:/tmp/cvs-serv32210
Modified Files:
Changes SPOPS.pm TODO
Log Message:
fixed behavior in clone() method -- multifield checks are now
generated by the multifield class factory behavior, and the previous
clone() behavior has been restored. (Thanks to Ray Z for catching.)
Index: Changes
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/Changes,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -d -r1.72 -r1.73
*** Changes 2001/11/25 01:34:42 1.72
--- Changes 2001/11/26 16:27:19 1.73
***************
*** 1,4 ****
--- 1,28 ----
Revision history for Perl extension SPOPS.
+ 0.54
+
+ Overall:
+
+ - Fix bug introduced by 0.53 in the clone() method
+
+ Individual:
+
+ * SPOPS.pm:
+
+ - Modify clone() method to behave as previous -- the
+ multifield-specific behavior is now in a separate method
+
+ * SPOPS/ClassFactory/DBI.pm:
+
+ - Generate clone() method for classes using multifield primary
+ keys
+
+ * t/31_dbi_multifield.t:
+
+ - Modify clone save() test (#12) to specify one value of the ID in
+ the clone() call and set the other one afterward.
+
+
0.53 Sat Nov 24 20:50:32 EST 2001
Index: SPOPS.pm
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/SPOPS.pm,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** SPOPS.pm 2001/11/25 01:23:37 1.56
--- SPOPS.pm 2001/11/26 16:27:19 1.57
***************
*** 173,191 ****
my $class = $p->{_class} || ref $self;
DEBUG() && _w( 1, "Cloning new object of class ($class) from old ",
! "object of class (", ref $self, ")" );
my %initial_data = ();
while ( my ( $k, $v ) = each %{ $self } ) {
$initial_data{ $k } = $p->{ $k } || $v;
}
! my $cloned = $class->new({ %initial_data, skip_default_values => 1 });
!
! # Take care of the ID value AFTER the object has been instantiated
! # so we can rely on its id() method to take care of any funky
! # assignment needs
!
! $cloned->id( $p->{id} ) if ( $p->{id} );
! return $cloned;
}
--- 173,191 ----
my $class = $p->{_class} || ref $self;
DEBUG() && _w( 1, "Cloning new object of class ($class) from old ",
! "object of class (", ref $self, ")" );
my %initial_data = ();
+ my $id_field = $class->id_field;
+ if ( $id_field ) {
+ $initial_data{ $id_field } = $p->{ $id_field } || $p->{id};
+ }
+
while ( my ( $k, $v ) = each %{ $self } ) {
+ next unless ( $k );
+ next if ( $k eq $id_field );
$initial_data{ $k } = $p->{ $k } || $v;
}
! return $class->new({ %initial_data, skip_default_values => 1 });
}
Index: TODO
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/TODO,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TODO 2001/10/09 01:54:37 1.6
--- TODO 2001/11/26 16:27:19 1.7
***************
*** 2,18 ****
========================================
! 0.5x
!
! - (API) Figure out what configuration object/hashref is supposed to
! be passed to the 'class_initialize' method.
!
! - User/Group API (doc) (SF ID: 468906)
- creation security - variable group ID (SF ID: 468907)
- - Run a process to transform L<Blah::Blah> to
- L<Blah::Blah|Blah::Blah>.
-
- Export generated SPOPS class to file (SF ID: 468902)
0.55
--- 2,12 ----
========================================
! 0.54
- creation security - variable group ID (SF ID: 468907)
- Export generated SPOPS class to file (SF ID: 468902)
+
+ - Create SPOPS::DBI::MultiDatasource
0.55
|
|
From: Chris W. <la...@us...> - 2001-11-26 16:27:23
|
Update of /cvsroot/openinteract/SPOPS/t
In directory usw-pr-cvs1:/tmp/cvs-serv32210/t
Modified Files:
30_dbi.t 31_dbi_multifield.t
Log Message:
fixed behavior in clone() method -- multifield checks are now
generated by the multifield class factory behavior, and the previous
clone() behavior has been restored. (Thanks to Ray Z for catching.)
Index: 30_dbi.t
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/t/30_dbi.t,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** 30_dbi.t 2001/11/04 17:54:26 1.4
--- 30_dbi.t 2001/11/26 16:27:19 1.5
***************
*** 101,105 ****
{
my $obj = eval { $SPOPS_CLASS->fetch( 42, { db => $db, skip_cache => 1 } ) };
! my $new_obj = eval { $obj->clone({ spops_name => 'YourProject',
spops_goop => 'this n that',
spops_id => 1792 } ) };
--- 101,105 ----
{
my $obj = eval { $SPOPS_CLASS->fetch( 42, { db => $db, skip_cache => 1 } ) };
! my $new_obj = eval { $obj->clone({ spops_name => 'YourProject',
spops_goop => 'this n that',
spops_id => 1792 } ) };
***************
*** 117,123 ****
# field and see if the default comes through
{
! my $obj = $SPOPS_CLASS->new({ spops_id => 1588,
! spops_goop => 'here we go!',
! spops_name => 'AnotherProject' });
eval { $obj->save({ is_add => 1, db => $db, skip_cache => 1 }) };
ok( $obj->{spops_num} == 2, 'Fetch object (correct data with default' );
--- 117,123 ----
# field and see if the default comes through
{
! my $obj = $SPOPS_CLASS->new({ spops_id => 1588,
! spops_goop => 'here we go!',
! spops_name => 'AnotherProject' });
eval { $obj->save({ is_add => 1, db => $db, skip_cache => 1 }) };
ok( $obj->{spops_num} == 2, 'Fetch object (correct data with default' );
Index: 31_dbi_multifield.t
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/t/31_dbi_multifield.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** 31_dbi_multifield.t 2001/11/25 01:26:47 1.2
--- 31_dbi_multifield.t 2001/11/26 16:27:19 1.3
***************
*** 30,38 ****
# Ensure we can get to SPOPS::Initialize
!
require_ok( 'SPOPS::Initialize' );
# Create the class using SPOPS::Initialize
!
my $spops_config = {
tester => {
--- 30,38 ----
# Ensure we can get to SPOPS::Initialize
! # TEST: 1
require_ok( 'SPOPS::Initialize' );
# Create the class using SPOPS::Initialize
! # TEST: 2-3
my $spops_config = {
tester => {
***************
*** 61,64 ****
--- 61,65 ----
# Create an object
+ # TEST: 4-5
{
my $obj = eval { $SPOPS_CLASS->new({ spops_name => 'MyProject',
***************
*** 79,82 ****
--- 80,84 ----
# Fetch an object, then update it
+ # TEST: 6-9
{
my $obj = eval { $SPOPS_CLASS->fetch( "$obj_time,$obj_user", { db => $db, skip_cache => 1 } ) };
***************
*** 101,104 ****
--- 103,107 ----
# Fetch an object then clone it and save it
+ # TEST: 10-12
{
my $obj = eval { $SPOPS_CLASS->fetch( "$obj_time,$obj_user", { db => $db, skip_cache => 1 } ) };
***************
*** 108,111 ****
--- 111,115 ----
ok( ! $@, 'Clone object (perform)' );
ok( $new_obj->{spops_name} ne $obj->{spops_name}, 'Clone object (correct data)');
+ $new_obj->{spops_user} = 12;
eval { $new_obj->save( { is_add => 1, db => $db, skip_cache => 1 } ) };
***************
*** 118,121 ****
--- 122,126 ----
# Create another object, but this time don't define the spops_num
# field and see if the default comes through
+ # TEST: 13
{
my $obj = $SPOPS_CLASS->new({ spops_time => 1004897292,
***************
*** 128,131 ****
--- 133,137 ----
# Fetch the three objects in the db and be sure we got them all
+ # TEST: 14-15
{
my $obj_list = eval { $SPOPS_CLASS->fetch_group({ db => $db, skip_cache => 1 } ) };
***************
*** 139,142 ****
--- 145,149 ----
# Fetch a count of the objects in the database
+ # TEST: 16
{
my $obj_count = eval { $SPOPS_CLASS->fetch_count({ db => $db }) };
***************
*** 145,148 ****
--- 152,156 ----
# Create an iterator and run through the objects
+ # TEST: 17-18
{
my $iter = eval { $SPOPS_CLASS->fetch_iterator({ db => $db, skip_cache => 1 }) };
|
|
From: Chris W. <la...@us...> - 2001-11-26 16:27:23
|
Update of /cvsroot/openinteract/SPOPS/SPOPS/ClassFactory
In directory usw-pr-cvs1:/tmp/cvs-serv32210/SPOPS/ClassFactory
Modified Files:
DBI.pm
Log Message:
fixed behavior in clone() method -- multifield checks are now
generated by the multifield class factory behavior, and the previous
clone() behavior has been restored. (Thanks to Ray Z for catching.)
Index: DBI.pm
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/SPOPS/ClassFactory/DBI.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** DBI.pm 2001/11/25 01:26:13 1.13
--- DBI.pm 2001/11/26 16:27:19 1.14
***************
*** 66,69 ****
--- 66,96 ----
my $generic_multifield_etc = <<'MFETC';
+ sub %%CLASS%%::clone {
+ my ( $self, $p ) = @_;
+ my $class = $p->{_class} || ref $self;
+ DEBUG() && _w( 1, "Cloning new object of class ($class) from old ",
+ "object of class (", ref $self, ")" );
+ my %initial_data = ();
+
+ my %id_field = map { $_ => 1 } $class->id_field;
+
+ while ( my ( $k, $v ) = each %{ $self } ) {
+ next unless ( $k );
+ next if ( $id_field{ $k } );
+ $initial_data{ $k } = $p->{ $k } || $v;
+ }
+
+ my $cloned = $class->new({ %initial_data, skip_default_values => 1 });
+ if ( $p->{id} ) {
+ $cloned->id( $p->{id} );
+ }
+ else {
+ foreach my $field ( keys %id_field ) {
+ $cloned->{ $field } = $p->{ $field } if ( $p->{ $field } );
+ }
+ }
+ return $cloned;
+ }
+
sub %%CLASS%%::id_field {
return wantarray ? %%ID_FIELD_NAME_LIST%%
|
|
From: Chris W. <la...@us...> - 2001-11-26 13:44:57
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page/struct In directory usw-pr-cvs1:/tmp/cvs-serv15334/struct Modified Files: page.sql Log Message: add 'size' as field Index: page.sql =================================================================== RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/struct/page.sql,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** page.sql 2001/11/26 06:28:56 1.3 --- page.sql 2001/11/26 13:44:54 1.4 *************** *** 14,17 **** --- 14,18 ---- storage varchar(10) default 'database', mime_type varchar(30) null, + size int default 0, notes text null, primary key ( location ) |
|
From: Chris W. <la...@us...> - 2001-11-26 13:44:47
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page/script
In directory usw-pr-cvs1:/tmp/cvs-serv15258/script
Modified Files:
scan_for_new.pl
Log Message:
works now
Index: scan_for_new.pl
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/script/scan_for_new.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** scan_for_new.pl 2001/11/26 06:55:39 1.2
--- scan_for_new.pl 2001/11/26 13:44:45 1.3
***************
*** 8,17 ****
use OpenInteract::Startup;
! use constant DEBUG => 1;
my $NOW = now;
my $DATE_PATTERN = '%Y-%m-%d';
my $DEFAULT_ACTIVE_DAYS = 365;
!
my ( %EXISTING, %NEW );
my ( @OPT_skip );
--- 8,17 ----
use OpenInteract::Startup;
! use constant DEBUG => 0;
my $NOW = now;
my $DATE_PATTERN = '%Y-%m-%d';
my $DEFAULT_ACTIVE_DAYS = 365;
! my @ALWAYS_SKIP = ( "~\$", 'pod2', 'tmp', 'bak', 'old', '^/images', '^/oi_docs' );
my ( %EXISTING, %NEW );
my ( @OPT_skip );
***************
*** 26,36 ****
$OPT_root ||= $R->CONFIG->get_dir( 'html' );
! unless ( $OPT_root =~ m|/$| ) { $OPT_root = "$OPT_root/" }
$OPT_active_days ||= $DEFAULT_ACTIVE_DAYS;
$OPT_debug ||= DEBUG;
%EXISTING = map { $_ => 1 }
@{ $R->page->db_select({ select => [ 'location' ],
return => 'single-list' }) };
find( \&descend, $OPT_root );
--- 26,39 ----
$OPT_root ||= $R->CONFIG->get_dir( 'html' );
! $OPT_root =~ s|/$||;
$OPT_active_days ||= $DEFAULT_ACTIVE_DAYS;
$OPT_debug ||= DEBUG;
+ push @OPT_skip, @ALWAYS_SKIP;
+
%EXISTING = map { $_ => 1 }
@{ $R->page->db_select({ select => [ 'location' ],
+ from => [ $R->page->table_name ],
return => 'single-list' }) };
find( \&descend, $OPT_root );
***************
*** 47,55 ****
sub descend {
my $filename = $_;
my $full_dir = $File::Find::dir;
$full_dir =~ s/^$OPT_root//;
! for ( @OPT_skip ) { return if ( $full_dir =~ /$_/ ) }
! my $location = '/' . join( '/', $full_dir, $filename );
return if ( $EXISTING{ $location } );
$NEW{ $location }++;
}
--- 50,66 ----
sub descend {
my $filename = $_;
+ return if ( $filename =~ /^\.+$/ );
+ return unless ( -f $filename );
my $full_dir = $File::Find::dir;
$full_dir =~ s/^$OPT_root//;
! $full_dir =~ s|/$||;
!
! foreach my $pattern ( @OPT_skip ) {
! return if ( $full_dir =~ /$pattern/ );
! }
! my $location = join( '/', $full_dir, $filename );
! $location = "/$location" unless ( $location =~ m|^/| );
return if ( $EXISTING{ $location } );
+ $OPT_debug && warn "--Adding ($location) as new file\n";
$NEW{ $location }++;
}
***************
*** 58,65 ****
sub get_page_info {
my ( $R, $location ) = @_;
! my %info = ();
! my $full_filename = join( '/', $OPT_root, $location );
! open( FILE, $full_filename ) || die "Cannot open ($full_filename): $!";
while ( <FILE> ) {
$info{title} = $1 if ( m|<title>(.*?)</title>| );
--- 69,81 ----
sub get_page_info {
my ( $R, $location ) = @_;
! my $full_filename = join( '', $OPT_root, $location );
! my $mime_type = $R->page->mime_type_file( $full_filename ) ||
! 'text/html';
! my %info = ( mime_type => $mime_type,
! size => (stat $full_filename)[7] );
! $OPT_debug && warn "--MIME type found for ($location): $mime_type\n";
! return %info unless ( $mime_type eq 'text/html' );
+ open( FILE, $full_filename ) || die "Cannot open ($full_filename): $!";
while ( <FILE> ) {
$info{title} = $1 if ( m|<title>(.*?)</title>| );
***************
*** 73,85 ****
my ( $R, $location, $page_info ) = @_;
my $expire_date = $NOW + "${OPT_active_days}D";
- my $full_filename = join( '/', $OPT_root, $location );
- my $mime_type = $R->page->mime_type_file( $full_filename ) ||
- 'text/html'
$R->page->new({ location => $location,
! mime_type => $mime_type,
title => $page_info->{title},
is_active => 'yes',
active_on => $NOW->strftime( $DATE_PATTERN ),
! expires_on => $expire_date->strftime( $DATE_PATTERN ) })
->save();
}
--- 89,100 ----
my ( $R, $location, $page_info ) = @_;
my $expire_date = $NOW + "${OPT_active_days}D";
$R->page->new({ location => $location,
! mime_type => $page_info->{mime_type},
title => $page_info->{title},
is_active => 'yes',
active_on => $NOW->strftime( $DATE_PATTERN ),
! expires_on => $expire_date->strftime( $DATE_PATTERN ),
! size => $page_info->{size},
! storage => 'file' })
->save();
}
|
|
From: Chris W. <la...@us...> - 2001-11-26 13:44:34
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract/Handler
In directory usw-pr-cvs1:/tmp/cvs-serv15191/OpenInteract/Handler
Modified Files:
Page.pm
Log Message:
get/set the 'size' attribute of the page metadata object (generally
only needed if we're uploading and working with non-HTML files )
Index: Page.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract/Handler/Page.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Page.pm 2001/11/26 06:26:42 1.11
--- Page.pm 2001/11/26 13:44:31 1.12
***************
*** 142,145 ****
--- 142,146 ----
"Filename: (", $upload->filename, ") Size: (",
$upload->size, ") Type: (", $upload->type, ")" );
+ $page->{size} = $upload->size;
$page->{mime_type} = $upload->type;
if ( $class->_is_displayable( $page->{mime_type} ) ) {
***************
*** 237,242 ****
unless ( $class->_is_displayable( $page->{mime_type} ) ) {
! $R->{page}{content_type} = $page->{mime_type};
! $R->{page}{send_file} = join( '', $R->CONFIG->get_dir( 'html' ), $page->{location} );
$R->DEBUG && $R->scrib( 1, "File being retrieved is not directly displayable.",
"Set 'send_file' to ($page->{location})" );
--- 238,244 ----
unless ( $class->_is_displayable( $page->{mime_type} ) ) {
! $R->{page}{content_type} = $page->{mime_type};
! $R->{page}{send_file} = join( '', $R->CONFIG->get_dir( 'html' ), $page->{location} );
! $R->{page}{send_file_size} = $page->{size};
$R->DEBUG && $R->scrib( 1, "File being retrieved is not directly displayable.",
"Set 'send_file' to ($page->{location})" );
|
|
From: Chris W. <la...@us...> - 2001-11-26 13:43:14
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page In directory usw-pr-cvs1:/tmp/cvs-serv14825 Modified Files: Changes package.conf Log Message: meta Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/Changes,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Changes 2001/11/26 06:56:07 1.11 --- Changes 2001/11/26 13:43:11 1.12 *************** *** 1,4 **** --- 1,9 ---- Revision history for OpenInteract package base_page. + 0.30 Mon Nov 26 08:48:38 EST 2001 + + Add 'size' field to table, and modify 'script/scan_as_new.pl' so + it actually works. + 0.29 Mon Nov 26 01:29:33 EST 2001 Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/package.conf,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** package.conf 2001/11/26 06:56:07 1.11 --- package.conf 2001/11/26 13:43:11 1.12 *************** *** 1,4 **** name base_page ! version 0.29 author Chris Winters <ch...@cw...> module File::Basename --- 1,4 ---- name base_page ! version 0.30 author Chris Winters <ch...@cw...> module File::Basename |
|
From: Chris W. <la...@us...> - 2001-11-26 13:42:29
|
Update of /cvsroot/openinteract/OpenInteract
In directory usw-pr-cvs1:/tmp/cvs-serv14465
Modified Files:
OpenInteract.pm
Log Message:
set the content-length when sending a non-displayable file
Index: OpenInteract.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/OpenInteract.pm,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** OpenInteract.pm 2001/11/15 05:19:08 1.21
--- OpenInteract.pm 2001/11/26 13:42:25 1.22
***************
*** 335,345 ****
sub send_static_file {
my ( $class, $R ) = @_;
- my $static_file = $R->{page}{send_file};
my $fh = Apache->gensym;
! eval { open( $fh, $static_file ) || die $!; };
if ( $@ ) {
! $R->scrib( 0, "Cannot open static file from filesystem ($static_file): $@" );
return NOT_FOUND;
}
$R->apache->send_http_header( $R->{page}{content_type} );
$R->apache->send_fd( $fh );
--- 335,351 ----
sub send_static_file {
my ( $class, $R ) = @_;
my $fh = Apache->gensym;
! eval { open( $fh, $R->{page}{send_file} ) || die $!; };
if ( $@ ) {
! $R->scrib( 0, "Cannot open static file from filesystem ($R->{page}{send_file}): $@" );
return NOT_FOUND;
}
+ unless ( $R->{page}{send_file_size} ) {
+ $R->{page}{send_file_size} = (stat $R->{page}{send_file})[7];
+ }
+ $R->apache->headers_out->{'Content-Length'} = $R->{page}{send_file_size};
+ $R->DEBUG && $R->scrib( 1, "Sending file ($R->{page}{send_file}) of size",
+ "($R->{page}{send_file_size}) and type",
+ "($R->{page}{content_type})" );
$R->apache->send_http_header( $R->{page}{content_type} );
$R->apache->send_fd( $fh );
|
|
From: Chris W. <la...@us...> - 2001-11-26 13:18:35
|
Update of /cvsroot/openinteract/OpenInteract/OpenInteract
In directory usw-pr-cvs1:/tmp/cvs-serv7388
Modified Files:
SPOPS.pm
Log Message:
update so that we only check for parameters if the apache handler exists
Index: SPOPS.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/OpenInteract/SPOPS.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** SPOPS.pm 2001/10/29 14:58:33 1.18
--- SPOPS.pm 2001/11/26 13:18:32 1.19
***************
*** 130,134 ****
my $now = SPOPS::Utility->now;
my $class = ref $self || $self;
! my $log_msg = $R->apache->param( '_log_message' );
$R->DEBUG && $R->scrib( 1, "Entering action $action to $class ($id) by $uid on $now" );
eval { $self->db_insert({ db => $R->db,
--- 130,137 ----
my $now = SPOPS::Utility->now;
my $class = ref $self || $self;
! my ( $log_msg );
! if ( my $apr = $R->apache ) {
! $log_msg = $apr->param( '_log_message' );
! }
$R->DEBUG && $R->scrib( 1, "Entering action $action to $class ($id) by $uid on $now" );
eval { $self->db_insert({ db => $R->db,
|
|
From: Chris W. <la...@us...> - 2001-11-26 13:13:25
|
Update of /cvsroot/openinteract/OpenInteract/OpenInteract
In directory usw-pr-cvs1:/tmp/cvs-serv5862
Modified Files:
Package.pm
Log Message:
make copying of many types of files conditional, depending on the
contents of the .no_overwrite file in the directory
Index: Package.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/OpenInteract/Package.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** Package.pm 2001/10/11 03:15:26 1.25
--- Package.pm 2001/11/26 13:13:21 1.26
***************
*** 17,24 ****
use SPOPS::HashFile ();
use SPOPS::Utility ();
! @OpenInteract::Package::ISA = qw();
$OpenInteract::Package::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
# Define the subdirectories present in a package
--- 17,28 ----
use SPOPS::HashFile ();
use SPOPS::Utility ();
+ require Exporter;
! @OpenInteract::Package::ISA = qw( Exporter );
$OpenInteract::Package::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+ @OpenInteract::Package::EXPORT_OK = qw( READONLY_FILE );
+ use constant READONLY_FILE => '.no_overwrite';
+
# Define the subdirectories present in a package
***************
*** 1130,1148 ****
sub _copy_action_config_file {
my ( $class, $info, $CONFIG ) = @_;
! my $interact_pkg_dir = join( '/', $info->{base_dir}, $info->{package_dir} );
! my $website_pkg_dir = join( '/', $info->{website_dir}, $info->{package_dir} );
! DEBUG && _w( 1, "Coping action info from ($interact_pkg_dir) to ($website_pkg_dir)" );
my $action_conf = 'conf/action.perl';
my $base_config_file = "$interact_pkg_dir/$action_conf";
! my $action_base = eval { SPOPS::HashFile->new({ filename => $base_config_file }) };
if ( $@ ) {
! DEBUG && _w( 1, "No action info for $info->{name}-$info->{version} (generally ok: $@)" );
return undef;
}
my $new_config_file = "$website_pkg_dir/$action_conf";
! my $action_pkg = eval { SPOPS::HashFile->new({ filename => $new_config_file,
! perm => 'new' }) };
# Go through all of the actions and all of the keys and copy them
--- 1134,1158 ----
sub _copy_action_config_file {
my ( $class, $info, $CONFIG ) = @_;
! my $interact_pkg_dir = join( '/', $info->{base_dir},
! $info->{package_dir} );
! my $website_pkg_dir = join( '/', $info->{website_dir},
! $info->{package_dir} );
! DEBUG && _w( 1, "Coping action info from ($interact_pkg_dir)",
! "to ($website_pkg_dir)" );
my $action_conf = 'conf/action.perl';
my $base_config_file = "$interact_pkg_dir/$action_conf";
! my $action_base = eval { SPOPS::HashFile->new({
! filename => $base_config_file }) };
if ( $@ ) {
! DEBUG && _w( 1, "No action info for $info->{name}-$info->{version}",
! "(generally ok: $@)" );
return undef;
}
my $new_config_file = "$website_pkg_dir/$action_conf";
! my $action_pkg = eval { SPOPS::HashFile->new({
! filename => $new_config_file,
! perm => 'new' }) };
# Go through all of the actions and all of the keys and copy them
***************
*** 1174,1177 ****
--- 1184,1188 ----
my ( $class, $root_dir, $sub_dir, $file_list ) = @_;
my @copy_file_list = grep /^$sub_dir/, @{ $file_list };
+ my %no_copy = map { $_ => 1 } $class->read_readonly_file( $root_dir );
foreach my $sub_dir_file ( @copy_file_list ) {
***************
*** 1179,1182 ****
--- 1190,1194 ----
$just_filename =~ s|^$sub_dir/||;
my $new_name = join( '/', $root_dir, $just_filename );
+ next if ( $no_copy{ $just_filename } );
eval { $class->_create_full_path( $new_name ) };
if ( $@ ) { die "Cannot create path to file ($new_name): $@" }
***************
*** 1193,1196 ****
--- 1205,1228 ----
+ sub read_readonly_file {
+ my ( $class, $dir ) = @_;
+ my $overwrite_check_file = join( '/', $dir, READONLY_FILE );
+ return () unless ( -f $overwrite_check_file );
+ my ( @no_write );
+ if ( open( NOWRITE, $overwrite_check_file ) ) {
+ while ( <NOWRITE> ) {
+ chomp;
+ next if ( /^\s*$/ );
+ next if ( /^\s*\#/ );
+ s/^\s+//;
+ s/\s+$//;
+ push @no_write, $_;
+ }
+ close( NOWRITE );
+ }
+ return @no_write;
+ }
+
+
# Copy handlers from the base installation to the website directory,
# putting class names into the namespace of the website
***************
*** 1198,1207 ****
sub _copy_handler_files {
my ( $class, $info, $base_files ) = @_;
! my $website_pkg_dir = join( '/', $info->{website_dir}, $info->{package_dir} );
# We're only operating on the files that begin with
# 'OpenInteract/Handler'...
! my @handler_file_list = grep /^OpenInteract\/Handler/, keys %{ $base_files };
foreach my $handler_filename ( @handler_file_list ) {
--- 1230,1241 ----
sub _copy_handler_files {
my ( $class, $info, $base_files ) = @_;
! my $website_pkg_dir = join( '/', $info->{website_dir},
! $info->{package_dir} );
# We're only operating on the files that begin with
# 'OpenInteract/Handler'...
! my @handler_file_list = grep /^OpenInteract\/Handler/,
! keys %{ $base_files };
foreach my $handler_filename ( @handler_file_list ) {
***************
*** 1222,1229 ****
# the 'OpenInteract::Handler::xx' with '$WEBSITE_NAME::Handler::xx'
! open( OLDHANDLER, $handler_filename ) || die "Cannot read handler ($handler_filename): $!";
eval { $class->_create_full_path( $new_filename ) };
! if ( $@ ) { die "Cannot create a directory tree to handler ($new_filename): $@" }
! open( NEWHANDLER, "> $new_filename" ) || die "Cannot write to handler ($new_filename): $!";
while ( <OLDHANDLER> ) {
s/$handler_class/$new_handler_class/g;
--- 1256,1267 ----
# the 'OpenInteract::Handler::xx' with '$WEBSITE_NAME::Handler::xx'
! open( OLDHANDLER, $handler_filename )
! || die "Cannot read handler ($handler_filename): $!";
eval { $class->_create_full_path( $new_filename ) };
! if ( $@ ) {
! die "Cannot create a dir tree to handler ($new_filename): $@";
! }
! open( NEWHANDLER, "> $new_filename" )
! || die "Cannot write to handler ($new_filename): $!";
while ( <OLDHANDLER> ) {
s/$handler_class/$new_handler_class/g;
|
|
From: Chris W. <la...@us...> - 2001-11-26 06:56:10
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page In directory usw-pr-cvs1:/tmp/cvs-serv19878 Modified Files: Changes MANIFEST package.conf Log Message: meta Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/Changes,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Changes 2001/11/06 14:04:30 1.10 --- Changes 2001/11/26 06:56:07 1.11 *************** *** 1,4 **** --- 1,11 ---- Revision history for OpenInteract package base_page. + 0.29 Mon Nov 26 01:29:33 EST 2001 + + Added the fields 'storage' and 'content_location' so we can + implement URL content retrieval and aliases. Also added a script + to scan a directory for new files and add the metadata to the + database. + 0.28 Tue Nov 6 09:20:36 EST 2001 Index: MANIFEST =================================================================== RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/MANIFEST,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MANIFEST 2001/11/06 14:04:30 1.8 --- MANIFEST 2001/11/26 06:56:07 1.9 *************** *** 23,28 **** --- 23,30 ---- OpenInteract/Page/Database.pm OpenInteract/Page/File.pm + OpenInteract/Page/Http.pm OpenInteract/Handler/Page.pm OpenInteract/SQLInstall/Page.pm + script/scan_for_new.pl script/static_page2base_page.pl struct/content_type.sql Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/package.conf,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** package.conf 2001/11/06 14:04:30 1.10 --- package.conf 2001/11/26 06:56:07 1.11 *************** *** 1,6 **** name base_page ! version 0.28 author Chris Winters <ch...@cw...> module File::Basename module File::Path module Class::Date --- 1,7 ---- name base_page ! version 0.29 author Chris Winters <ch...@cw...> module File::Basename + module File::MMagic module File::Path module Class::Date |