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


WWW-Wikipedia-TemplateFiller documentation  | view source Contained in the WWW-Wikipedia-TemplateFiller distribution.

Index


NAME

Top

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

DESCRIPTION

Top

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

Top

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

Top

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

BUGS

Top

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

Top

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

    perldoc WWW::Wikipedia::TemplateFiller::Source

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/WWW-Wikipedia-TemplateFiller-Source

* CPAN Ratings

http://cpanratings.perl.org/d/WWW-Wikipedia-TemplateFiller-Source

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Wikipedia-TemplateFiller-Source

* Search CPAN

http://search.cpan.org/dist/WWW-Wikipedia-TemplateFiller-Source

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


WWW-Wikipedia-TemplateFiller documentation  | view source Contained in the WWW-Wikipedia-TemplateFiller distribution.