Update of /cvsroot/openinteract/SPOPS/SPOPS
In directory usw-pr-cvs1:/tmp/cvs-serv8815/SPOPS
Modified Files:
DBI.pm GDBM.pm HashFile.pm Initialize.pm Iterator.pm
SQLInterface.pm Tie.pm Utility.pm
Log Message:
lots of cosmetic changes (extra spaces, moving L<blah> to L<blah|blah> format, ...)
Index: DBI.pm
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/SPOPS/DBI.pm,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** DBI.pm 2001/10/07 14:39:57 1.49
--- DBI.pm 2001/10/11 13:09:26 1.50
***************
*** 856,860 ****
As you can see, all the methods are optional. Along with
! L<SPOPS::ClassFactory>, you can create an entirely virtual class
consisting only of configuration information. So you can actually
create the implementation for a new object in two steps:
--- 856,860 ----
As you can see, all the methods are optional. Along with
! L<SPOPS::ClassFactory|SPOPS::ClassFactory>, you can create an entirely virtual class
consisting only of configuration information. So you can actually
create the implementation for a new object in two steps:
***************
*** 1155,1159 ****
Uses the same parameters as C<fetch_group()> but instead of returning
an arrayref with all the objects, it returns an
! L<SPOPS::Iterator::DBI> object. You can use this object to step
through the objects one at a time, which can be an enormous resource
savings if you are retrieving large groups of objects.
--- 1155,1159 ----
Uses the same parameters as C<fetch_group()> but instead of returning
an arrayref with all the objects, it returns an
! L<SPOPS::Iterator::DBI|SPOPS::Iterator::DBI> object. You can use this object to step
through the objects one at a time, which can be an enormous resource
savings if you are retrieving large groups of objects.
***************
*** 1230,1234 ****
to tell SPOPS to treat the request as a creation rather than an update.
! One other thing to note if you are using L<SPOPS::Secure> for
security: SPOPS assumes that your application determines whether a
user can create an object. That is, all requests to create an object
--- 1230,1234 ----
to tell SPOPS to treat the request as a creation rather than an update.
! One other thing to note if you are using L<SPOPS::Secure|SPOPS::Secure> for
security: SPOPS assumes that your application determines whether a
user can create an object. That is, all requests to create an object
***************
*** 1288,1292 ****
This class supports lazy loading, available in SPOPS 0.40 and
later. All you need to do is define one or more 'column_group' entries
! in the configuration of your object and L<SPOPS> will do the rest.
If you are interested: the method C<perform_lazy_load()> does the
--- 1288,1292 ----
This class supports lazy loading, available in SPOPS 0.40 and
later. All you need to do is define one or more 'column_group' entries
! in the configuration of your object and L<SPOPS|SPOPS> will do the rest.
If you are interested: the method C<perform_lazy_load()> does the
***************
*** 1302,1306 ****
Like all SPOPS classes, any errors encountered will be tossed up to
the application using a die() and a simple string as a message. We
! also set more detailed information in a number of L<SPOPS::Error>
package variables; see that module for more details.
--- 1302,1306 ----
Like all SPOPS classes, any errors encountered will be tossed up to
the application using a die() and a simple string as a message. We
! also set more detailed information in a number of L<SPOPS::Error|SPOPS::Error>
package variables; see that module for more details.
***************
*** 1330,1334 ****
Chris Winters <ch...@cw...>
! See the L<SPOPS> module for the full author list.
=cut
--- 1330,1334 ----
Chris Winters <ch...@cw...>
! See the L<SPOPS|SPOPS> module for the full author list.
=cut
Index: GDBM.pm
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/SPOPS/GDBM.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** GDBM.pm 2001/08/22 10:51:45 1.11
--- GDBM.pm 2001/10/11 13:09:26 1.12
***************
*** 44,48 ****
my ( $self, $p ) = @_;
return unless ( ref $p and scalar keys %{ $p } );
!
# Set the GDBM filename if it was passed
--- 44,48 ----
my ( $self, $p ) = @_;
return unless ( ref $p and scalar keys %{ $p } );
!
# Set the GDBM filename if it was passed
***************
*** 75,79 ****
my ( $item, $p ) = @_;
return $p->{db} if ( ref $p->{db} );
!
my $gdbm_filename = $p->{filename};
unless ( $gdbm_filename ) {
--- 75,79 ----
my ( $item, $p ) = @_;
return $p->{db} if ( ref $p->{db} );
!
my $gdbm_filename = $p->{filename};
unless ( $gdbm_filename ) {
***************
*** 138,143 ****
my $data = undef;
{
! no strict 'vars';
! $data = eval $item_info;
}
die "Cannot rebuild object! Error: $@" if ( $@ );
--- 138,143 ----
my $data = undef;
{
! no strict 'vars';
! $data = eval $item_info;
}
die "Cannot rebuild object! Error: $@" if ( $@ );
***************
*** 175,179 ****
foreach my $key ( @object_keys ) {
my $data = eval { $class->_return_structure_for_key( $key, { db => $db } ) };
! next unless ( $data );
push @objects, $class->fetch( undef, { data => $data } );
}
--- 175,179 ----
foreach my $key ( @object_keys ) {
my $data = eval { $class->_return_structure_for_key( $key, { db => $db } ) };
! next unless ( $data );
push @objects, $class->fetch( undef, { data => $data } );
}
***************
*** 400,408 ****
GDBM software:
! http://www.fsf.org/gnulist/production/gdbm.html
! GDBM on Perl/Win32:
! http://www.roth.net/perl/GDBM/
=head1 COPYRIGHT
--- 400,408 ----
GDBM software:
! http://www.fsf.org/gnulist/production/gdbm.html
! GDBM on Perl/Win32:
! http://www.roth.net/perl/GDBM/
=head1 COPYRIGHT
***************
*** 417,421 ****
Chris Winters <ch...@cw...>
! See the L<SPOPS> module for the full author/helper list.
=cut
--- 417,421 ----
Chris Winters <ch...@cw...>
! See the L<SPOPS|SPOPS> module for the full author/helper list.
=cut
Index: HashFile.pm
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/SPOPS/HashFile.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** HashFile.pm 2001/08/22 10:51:45 1.9
--- HashFile.pm 2001/10/11 13:09:26 1.10
***************
*** 58,62 ****
}
if ( -f $obj->{filename} ) {
! rename( $obj->{filename}, "$obj->{filename}.old" )
|| die "Cannot rename old file to make room for new one. Error: $!";
}
--- 58,62 ----
}
if ( -f $obj->{filename} ) {
! rename( $obj->{filename}, "$obj->{filename}.old" )
|| die "Cannot rename old file to make room for new one. Error: $!";
}
***************
*** 65,72 ****
$p->{dumper_level} ||= 2;
local $Data::Dumper::Indent = $p->{dumper_level};
! my $string = Data::Dumper->Dump( [ \%data ], [ 'data' ] );
eval { open( INFO, "> $obj->{filename}" ) || die $! };
if ( $@ ) {
! rename( "$obj->{filename}.old", $obj->{filename} )
|| die "Cannot open file for writing (reason: $@ ) and ",
"cannot move backup file to original place. Reason: $!";
--- 65,72 ----
$p->{dumper_level} ||= 2;
local $Data::Dumper::Indent = $p->{dumper_level};
! my $string = Data::Dumper->Dump( [ \%data ], [ 'data' ] );
eval { open( INFO, "> $obj->{filename}" ) || die $! };
if ( $@ ) {
! rename( "$obj->{filename}.old", $obj->{filename} )
|| die "Cannot open file for writing (reason: $@ ) and ",
"cannot move backup file to original place. Reason: $!";
***************
*** 76,80 ****
close( INFO );
if ( -f "$obj->{filename}.old" ) {
! unlink( "$obj->{filename}.old" )
|| warn "Cannot remove the old data file. It still lingers in $obj->{filename}.old....\n";
}
--- 76,80 ----
close( INFO );
if ( -f "$obj->{filename}.old" ) {
! unlink( "$obj->{filename}.old" )
|| warn "Cannot remove the old data file. It still lingers in $obj->{filename}.old....\n";
}
***************
*** 106,110 ****
my ( $self, $p ) = @_;
$p->{filename} ||= tied %{ $self }->{filename};
! my $new = $self->new( { filename => $p->{filename}, perm => $p->{perm} } );
while ( my ( $k, $v ) = each %{ $self } ) {
$new->{ $k } = $p->{ $k } || $v;
--- 106,110 ----
my ( $self, $p ) = @_;
$p->{filename} ||= tied %{ $self }->{filename};
! my $new = $self->new( { filename => $p->{filename}, perm => $p->{perm} } );
while ( my ( $k, $v ) = each %{ $self } ) {
$new->{ $k } = $p->{ $k } || $v;
***************
*** 148,153 ****
}
}
! if ( $perm eq 'write-new' ) { $perm = 'write' }
!
my $data = undef;
if ( $file_exists ) {
--- 148,153 ----
}
}
! $perm = 'write' if ( $perm eq 'write-new' );
!
my $data = undef;
if ( $file_exists ) {
***************
*** 160,164 ****
# messages that might be sent to STDERR; we want to capture the
# message and send it along in a 'die' instead
!
{
local $SIG{__WARN__} = sub { return undef };
--- 160,164 ----
# messages that might be sent to STDERR; we want to capture the
# message and send it along in a 'die' instead
!
{
local $SIG{__WARN__} = sub { return undef };
***************
*** 178,206 ****
! sub FETCH {
my ( $self, $key ) = @_;
return undef unless $key;
! return $self->{data}->{ $key };
}
! sub STORE {
! my ( $self, $key, $value ) = @_;
! return undef unless $key;
! return $self->{data}->{ $key } = $value;
}
sub EXISTS {
! my ( $self, $key ) = @_;
! return undef unless $key;
! return exists $self->{data}->{ $key };
}
! sub DELETE {
! my ( $self, $key ) = @_;
! return undef unless $key;
! return delete $self->{data}->{ $key };
}
--- 178,206 ----
! sub FETCH {
my ( $self, $key ) = @_;
return undef unless $key;
! return $self->{data}->{ $key };
}
! sub STORE {
! my ( $self, $key, $value ) = @_;
! return undef unless $key;
! return $self->{data}->{ $key } = $value;
}
sub EXISTS {
! my ( $self, $key ) = @_;
! return undef unless $key;
! return exists $self->{data}->{ $key };
}
! sub DELETE {
! my ( $self, $key ) = @_;
! return undef unless $key;
! return delete $self->{data}->{ $key };
}
***************
*** 214,218 ****
die "Cannot remove $self->{filename}; permission set to read-only.\n";
}
! unlink( $self->{filename} )
|| die "Cannot remove file $self->{filename}. Reason: $!";
$self->{data} = undef;
--- 214,218 ----
die "Cannot remove $self->{filename}; permission set to read-only.\n";
}
! unlink( $self->{filename} )
|| die "Cannot remove file $self->{filename}. Reason: $!";
$self->{data} = undef;
***************
*** 309,313 ****
the object.
! B<clone( { filename =E<gt> $, [ perm =E<gt> $ ] } )>
Create a new object from the old, but you can change the filename and
--- 309,313 ----
the object.
! B<clone( { filename =E<gt> $, [ perm =E<gt> $ ] } )>
Create a new object from the old, but you can change the filename and
***************
*** 337,341 ****
merry way.
! However, since we recently changed L<SPOPS::Tie> to make
field-checking optional we might be able to use it.
--- 337,341 ----
merry way.
! However, since we recently changed L<SPOPS::Tie|SPOPS::Tie> to make
field-checking optional we might be able to use it.
***************
*** 344,348 ****
=head1 SEE ALSO
! L<SPOPS>, L<Data::Dumper>
=head1 COPYRIGHT
--- 344,350 ----
=head1 SEE ALSO
! L<SPOPS|SPOPS>
!
! L<Data::Dumper|Data::Dumper>
=head1 COPYRIGHT
Index: Initialize.pm
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/SPOPS/Initialize.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Initialize.pm 2001/08/22 11:10:04 1.11
--- Initialize.pm 2001/10/11 13:09:26 1.12
***************
*** 209,213 ****
=item 3.
! Build the SPOPS class, using L<SPOPS::ClassFactory>.
=item 4.
--- 209,213 ----
=item 3.
! Build the SPOPS class, using L<SPOPS::ClassFactory|SPOPS::ClassFactory>.
=item 4.
***************
*** 303,307 ****
=head1 SEE ALSO
! L<SPOPS::ClassFactory>
=head1 COPYRIGHT
--- 303,307 ----
=head1 SEE ALSO
! L<SPOPS::ClassFactory|SPOPS::ClassFactory>
=head1 COPYRIGHT
Index: Iterator.pm
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/SPOPS/Iterator.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Iterator.pm 2001/09/20 20:14:53 1.10
--- Iterator.pm 2001/10/11 13:09:26 1.11
***************
*** 490,505 ****
Subclasses generally need to maintain the position themselves, which
! can be irritating.
B<Relationship calls return iterators>
Relationship calls (for relationships created by
! L<SPOPS::ClassFactory> and/or one of its utilized behaviors) should be
! modified to optionally return an C<SPOPS::Iterator> object. So you
! could do:
my $iter = $user->group({ iterator => 1 });
while ( my $group = $iter->get_next ) {
! print "User is in group: $group->{name}\n";
}
--- 490,505 ----
Subclasses generally need to maintain the position themselves, which
! can be irritating.
B<Relationship calls return iterators>
Relationship calls (for relationships created by
! L<SPOPS::ClassFactory|SPOPS::ClassFactory> and/or one of its utilized
! behaviors) should be modified to optionally return an
! C<SPOPS::Iterator> object. So you could do:
my $iter = $user->group({ iterator => 1 });
while ( my $group = $iter->get_next ) {
! print "User is in group: $group->{name}\n";
}
***************
*** 511,517 ****
=head1 SEE ALSO
! L<SPOPS>
! L<Template::Iterator>
Talks and papers by Mark-Jason Dominus on infinite lists and
--- 511,517 ----
=head1 SEE ALSO
! L<SPOPS|SPOPS>
! L<Template::Iterator|Template::Iterator>
Talks and papers by Mark-Jason Dominus on infinite lists and
Index: SQLInterface.pm
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/SPOPS/SQLInterface.pm,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** SQLInterface.pm 2001/10/04 13:13:52 1.23
--- SQLInterface.pm 2001/10/11 13:09:26 1.24
***************
*** 760,764 ****
in. Return value is true is insert was successful -- the exact value
is whatever is returned from the C<execute()> statement handle
! call from your database. (See L<DBI> and your driver docs.)
Parameters:
--- 760,764 ----
in. Return value is true is insert was successful -- the exact value
is whatever is returned from the C<execute()> statement handle
! call from your database. (See L<DBI|DBI> and your driver docs.)
Parameters:
***************
*** 832,841 ****
is whatever is returned from the C<execute()> statement handle call
from your database, which many times is the number of rows affected by
! the update. (See L<DBI> and your driver docs -- in particular, note
! that the return value from an UPDATE can vary depending on the
database being used as well as the number of records B<actually>
updated versus those that matched the criteria but were not updated
because they already matched the value(s). In particular, see the
! discussion in L<DBD::mysql> under 'mysql_client_found_rows'.)
Parameters:
--- 832,842 ----
is whatever is returned from the C<execute()> statement handle call
from your database, which many times is the number of rows affected by
! the update. (See L<DBI|DBI> and your driver docs -- in particular,
! note that the return value from an UPDATE can vary depending on the
database being used as well as the number of records B<actually>
updated versus those that matched the criteria but were not updated
because they already matched the value(s). In particular, see the
! discussion in L<DBD::mysql|DBD::mysql> under
! 'mysql_client_found_rows'.)
Parameters:
***************
*** 894,898 ****
value is true is delete was successful -- the exact value is whatever
is returned from the C<execute()> statement handle call from your
! database. (See L<DBI>)
Parameters:
--- 895,899 ----
value is true is delete was successful -- the exact value is whatever
is returned from the C<execute()> statement handle call from your
! database. (See L<DBI|DBI>)
Parameters:
***************
*** 962,967 ****
package lexical that all routines here can access.
! If a DBD driver does not support the {TYPE} attribute of the statement
! handle, you have to specify some simple types in your class
configuration or provide them somehow. This is still slightly tied to
SPOPS implementations in OpenInteract, but only slightly.
--- 963,968 ----
package lexical that all routines here can access.
! If a DBD driver does not support the C<{TYPE}> attribute of the
! statement handle, you have to specify some simple types in your class
configuration or provide them somehow. This is still slightly tied to
SPOPS implementations in OpenInteract, but only slightly.
***************
*** 1030,1035 ****
Like other classes in SPOPS, all errors encountered will result in the
! error information saved in L<SPOPS::Error> and a die() being
! thrown. (More later.)
=head1 TO DO
--- 1031,1036 ----
Like other classes in SPOPS, all errors encountered will result in the
! error information saved in L<SPOPS::Error|SPOPS::Error> and a die()
! being thrown. (More later.)
=head1 TO DO
***************
*** 1052,1056 ****
=head1 SEE ALSO
! L<DBI>
=head1 COPYRIGHT
--- 1053,1057 ----
=head1 SEE ALSO
! L<DBI|DBI>
=head1 COPYRIGHT
***************
*** 1065,1069 ****
Chris Winters <ch...@cw...>
! See the L<SPOPS> module for the full author list.
=cut
--- 1066,1070 ----
Chris Winters <ch...@cw...>
! See the L<SPOPS|SPOPS> module for the full author list.
=cut
Index: Tie.pm
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/SPOPS/Tie.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Tie.pm 2001/08/22 10:51:45 1.16
--- Tie.pm 2001/10/11 13:09:26 1.17
***************
*** 333,337 ****
Note that this state is automatically tracked based on whether you set
any property of the object, so you should never need to do this. See
! L<SPOPS> for more information about the I<changed> methods.
=head2 Tracking Temporary Variables
--- 333,337 ----
Note that this state is automatically tracked based on whether you set
any property of the object, so you should never need to do this. See
! L<SPOPS|SPOPS> for more information about the I<changed> methods.
=head2 Tracking Temporary Variables
***************
*** 383,389 ****
information for display rather than internal use.
! For example, the L<SPOPS::DBI> module could allow you to create
! validating subroutines to ensure that your data conform to some sort
! of specification:
push @{ $obj->{_internal_validate} }, \&ensure_consistent_date;
--- 383,389 ----
information for display rather than internal use.
! For example, the L<SPOPS::DBI|SPOPS::DBI> module could allow you to
! create validating subroutines to ensure that your data conform to some
! sort of specification:
push @{ $obj->{_internal_validate} }, \&ensure_consistent_date;
***************
*** 410,415 ****
classification => 'CLSF' } };
! (See the L<SPOPS> documentation for how to declare this in your SPOPS
! configuration.)
So your web designers can use the objects:
--- 410,415 ----
classification => 'CLSF' } };
! (See the L<SPOPS|SPOPS> documentation for how to declare this in your
! SPOPS configuration.)
So your web designers can use the objects:
***************
*** 419,423 ****
But the data are actually stored in the object (and retrieved by an
! L<each> query on the object -- be careful) using the old, ugly names
'AUTH', 'TTL', 'PNUM' and 'CLSF'.
--- 419,423 ----
But the data are actually stored in the object (and retrieved by an
! C<each> query on the object -- be careful) using the old, ugly names
'AUTH', 'TTL', 'PNUM' and 'CLSF'.
***************
*** 559,564 ****
=head1 METHODS
! See L<Tie::Hash> or L<perltie> for details of what the different
! methods do.
=head1 TO DO
--- 559,564 ----
=head1 METHODS
! See L<Tie::Hash|Tie::Hash> or L<perltie> for details of what the
! different methods do.
=head1 TO DO
***************
*** 574,578 ****
=head1 SEE ALSO
! L<perltie>
=head1 COPYRIGHT
--- 574,578 ----
=head1 SEE ALSO
! L<perltie|perltie>
=head1 COPYRIGHT
Index: Utility.pm
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/SPOPS/Utility.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Utility.pm 2001/09/06 18:12:23 1.10
--- Utility.pm 2001/10/11 13:09:26 1.11
***************
*** 70,74 ****
sub now_between_dates {
my ( $class, $p ) = @_;
! return undef unless ( $p->{begin} or $p->{end} );
my @now = Date::Calc::Today();
my ( $begin_days, $end_days ) = undef;
--- 70,74 ----
sub now_between_dates {
my ( $class, $p ) = @_;
! return undef unless ( $p->{begin} or $p->{end} );
my @now = Date::Calc::Today();
my ( $begin_days, $end_days ) = undef;
***************
*** 199,205 ****
Return the current time, formatted: yyyy-mm-dd hh:mm:ss. Since we use
! the L<Date::Format> module (which in turn uses standard strftime
! formatting strings), you can pass in a format for the date/time to fit
! your needs.
Parameters:
--- 199,205 ----
Return the current time, formatted: yyyy-mm-dd hh:mm:ss. Since we use
! the L<Date::Format|Date::Format> module (which in turn uses standard
! strftime formatting strings), you can pass in a format for the
! date/time to fit your needs.
Parameters:
***************
*** 233,237 ****
Examples:
!
# Today is '2000-10-31' in all examples
--- 233,237 ----
Examples:
!
# Today is '2000-10-31' in all examples
***************
*** 271,275 ****
Chris Winters <ch...@cw...>
! See the L<SPOPS> module for the full author list.
=cut
--- 271,275 ----
Chris Winters <ch...@cw...>
! See the L<SPOPS|SPOPS> module for the full author list.
=cut
|