|
From: Chris W. <la...@us...> - 2001-10-24 23:08:05
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract/Page
In directory usw-pr-cvs1:/tmp/cvs-serv22705/OpenInteract/Page
Modified Files:
Database.pm File.pm
Log Message:
more updates (stability! functionality!)
Index: Database.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract/Page/Database.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Database.pm 2001/10/24 20:55:37 1.2
--- Database.pm 2001/10/24 23:04:14 1.3
***************
*** 7,11 ****
--- 7,17 ----
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",
+ SPOPS::Error->get->{system_msg} );
+ }
+ $R->DEBUG && $R->scrib( 1, "Page content location fetched from DB: ($page_content->{location})" );
return $page_content->{content};
}
Index: File.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract/Page/File.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** File.pm 2001/10/24 20:55:37 1.2
--- File.pm 2001/10/24 23:04:15 1.3
***************
*** 16,23 ****
sub load {
my ( $self ) = @_;
- my $full_location = $self->_create_file_location;
- return undef unless ( -f $full_location );
-
my $R = OpenInteract::Request->instance;
$R->DEBUG && $R->scrib( 1, "File ($full_location) exists. Trying to read file." );
--- 16,27 ----
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()..." );
+ return undef;
+ }
+
$R->DEBUG && $R->scrib( 1, "File ($full_location) exists. Trying to read file." );
***************
*** 49,53 ****
my ( $self, $content ) = @_;
my $R = OpenInteract::Request->instance;
! my $full_location = $self->_create_file_location;
$R->DEBUG && $R->scrib( 1, "Trying to save content to ($full_location)" );
--- 53,57 ----
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)" );
***************
*** 78,82 ****
sub remove {
my ( $self ) = @_;
! my $full_location = $self->_create_file_location;
my $R = OpenInteract::Request->instance;
$R->DEBUG && $R->scrib( 1, "Trying to delete content file ($full_location)" );
--- 82,86 ----
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)" );
***************
*** 93,96 ****
--- 97,101 ----
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} );
}
|