NAME

WWW::Wikipedia::TemplateFiller::Source - Base class for data sources

DESCRIPTION

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.

METHODS

new

my $source = new WWW::Wikipedia::TemplateFiller::Source( filler => $filler, %attrs );

Create a new source object with the given filler and attributes %attrs.

_search_obj

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.

template_name

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' }

filler

Returns the filler associated with this source.

source_url

Returns the url associated with this source data.

fill

my $template = $source->fill;

Fills the appopriate template with data from this source.

output

my $markup = $source->output( %args );

Returns the filled template output. This is where the magic is.

template_basic_fields

Used in subclasses. Static class method that returns an ordered hash of fields to be populated only during the call to fill().

template_output_fields

Used in subclasses. Static class method that returns an ordered hash of fields to be populated only during the call to output().

get_ref_name

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.

template_ref_name

Returns the ID to be used in the <ref> tag. You should be using get_ref_name() instead, probably.

type

my $type = $source->type;

Returns the type of source this is.

AUTHOR

David J. Iberri, <diberri at cpan.org>

BUGS

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.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc WWW::Wikipedia::TemplateFiller::Source

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

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.