Apache-Wyrd
view release on metacpan or search on metacpan
Wyrd/SQLForm.pm view on Meta::CPAN
=item (scalar) C<default_update_ok> (void)
Format the log entry that occurs when there has been a successful update
command.
=cut
sub default_update_ok {
my ($self) = @_;
return "<BR>The record was successfully updated";
}
=item (scalar) C<primary_delete_error> (void)
Format the log entry that occurs when the edited record cannot be
deleted. The error is the argument.
=cut
sub primary_delete_error {
Wyrd/SQLForm.pm view on Meta::CPAN
Like the _deleted_hook above.
=cut
sub _added_hook {
my ($self, $spec) = @_;
$self->_logger_hook($spec, 'added');
}
=item (scalar) C<_updated_hook> (hashref)
Like the _deleted_hook above.
=cut
sub _updated_hook {
my ($self, $spec) = @_;
$self->_logger_hook($spec, 'updated');
}
=item C<_sets>, C<_join_sets>, C<_split_sets>
Hook methods for dealing with data which may arrive from CGI as an array, but is submitted in the form of a comma-joined set of values. These are usually data in a SET or ENUM column within an SQL database table.
=over
=item (array) C<_sets> (void)
Wyrd/SQLForm.pm view on Meta::CPAN
}
if ($must_update) {#Perform an update, not an insert
my $sh = $self->do_query("update $table set " . set_clause(keys(%var)) . " where $index=\$:$index", \%var);
my $err = $sh->errstr;
if ($err) {
$log_title = $self->default_error;
$log .= $self->default_update_error($err);
} else {
$log .= $self->default_update_ok;
}
$self->_updated_hook({table=>$table,column=>$index,value=>$var{$index}});
} else {#Perform an insert
delete($var{$index}) unless ($self->_flags->check_index);
my $sh = $self->do_query("insert into $table set " . set_clause(keys(%var)), \%var);
my $err = $sh->errstr;
if ($err) {
$log_title = $self->default_error;
$log .= $self->default_insert_error($err);
} else {
$self->{'_variables'}->{$index} = $self->_insert_id($sh);
$log .= $self->default_insert_ok;
Wyrd/Services/Index.pm view on Meta::CPAN
=item (scalar) C<update_entry> (Apache::Wyrd::Interfaces::Indexable ref)
Called by an indexable object, passing itself as the argument, in order to
update it's entry in the index. This method calls C<index_foo> for every
attribute B<foo> in the index, storing that value under the attribute entry for
that object. The function always returns a message about the process.
update_entry will always check index_timestamp and index_digest. If the stored
value and the returned value agree on either attribute, the index will not be
updated. This behavior can be overridden by returning a true value from method
C<force_update>.
Index will also check for an C<index_runtime_flags> method and call it to
determine if the indexed object is attempting to modify the behavior of the
update during the process of updating for debugging purposes. Currently, it
recognizes the following flags:
=over
=item debug/nodebug
Wyrd/Services/Index.pm view on Meta::CPAN
my $wordcount = $self->index_words($id, $data);
$self->update_key("\x03\%$id", "\x00:$current_key");
$self->update_key("\x05\%$id", $wordcount);
}
return;
}
$self->update_key("\x03\%$id", $data);
my $wordcount = $self->index_words($id, $data);
$self->update_key("\x05\%$id", $wordcount);
#warn "\x03\%$id updated to $data";
return;
}
sub extract_html {
my ($self, $id) = @_;
$self->db->db_get("\x03\%$id", my $data);
if ($data =~ s/^\x00:(.+)//) {
$self->db_big->db_get($1, $data);
}
return $data;
Wyrd/Site/IndexBot.pm view on Meta::CPAN
my $file = $entry->{'file'};
if (-f ($root . $file)) {
push @no_skip, $entry;
if ($document =~ /^\//) {
print "purging $document, since it's been deleted, but <span class=\"error\">you need to delete the proxy page $file</span>: ". $instance->purge_entry($id);
} else {
print "keeping $document, since it's off-site but the proxy ($file) exists";
}
} elsif ($document eq '<DELETED>') {
if ($self->{'realclean'}) {
print"purging dirty reference to an updated document: ". $instance->purge_entry($id);
} else {
print"skipping dirty reference to a previously deleted document";
}
} elsif ($document =~ /^\//) {
print "purging proxy reference to deleted document $root$document: ". $instance->purge_entry($id);
} else {
print "purging reference to a dropped proxy to $document ($file): ". $instance->purge_entry($id);
}
}
}
( run in 0.273 second using v1.01-cache-2.11-cpan-05444aca049 )