| WWW-Wikipedia-TemplateFiller documentation | view source | Contained in the WWW-Wikipedia-TemplateFiller distribution. |
WWW::Wikipedia::TemplateFiller::Source - Base class for data sources
This is an internal base class from which data source classes inherit. From an end-user perspective, there is unlikely any reason to know anything about this module. That said, feel free to poke around.
my $source = new WWW::Wikipedia::TemplateFiller::Source( filler => $filler, %attrs );
Create a new source object with the given filler and attributes
%attrs.
my $search = $source->_search_obj;
(Internal method.) Returns the WWW::Search object used by this
source class. Only useful for source subclasses that define a
search_class() class method, which defines the WWW::Search
module to be used for backend searches.
my $result = $source->_search($id);
(Internal method.) Performs a basic WWW::Search search. Only useful
for source subclasses that define a search_class() class
method. Essentially the same as:
$source->_search->native_query($id); return $source->_search->next_result;
except that a cache may be used internally to speed things up.
Class method only; used by source classes to define the title of the template they will be populating. Example for PubmedId source:
sub template_name { 'cite journal' }
Returns the filler associated with this source.
Returns the url associated with this source data.
my $template = $source->fill;
Fills the appopriate template with data from this source.
my $markup = $source->output( %args );
Returns the filled template output. This is where the magic is.
Used in subclasses. Static class method that returns an ordered hash
of fields to be populated only during the call to fill().
Used in subclasses. Static class method that returns an ordered hash
of fields to be populated only during the call to output().
my $id = $source->get_ref_name;
Returns the ID to be used in the <ref> tag. Wraps around the
template_ref_name() method to provide wiki escaping.
Returns the ID to be used in the <ref> tag. You should be
using get_ref_name() instead, probably.
my $type = $source->type;
Returns the type of source this is.
David J. Iberri, <diberri at cpan.org>
Please report any bugs or feature requests to
bug-www-wikipedia-templatefiller at rt.cpan.org, or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Wikipedia-TemplateFiller.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc WWW::Wikipedia::TemplateFiller::Source
You can also look for information at:
http://annocpan.org/dist/WWW-Wikipedia-TemplateFiller-Source
http://cpanratings.perl.org/d/WWW-Wikipedia-TemplateFiller-Source
http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Wikipedia-TemplateFiller-Source
http://search.cpan.org/dist/WWW-Wikipedia-TemplateFiller-Source
Copyright (c) David J. Iberri, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| WWW-Wikipedia-TemplateFiller documentation | view source | Contained in the WWW-Wikipedia-TemplateFiller distribution. |