GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::OAI::RECORD::DOCUMENTHELPER (3)

.ds Aq ’

NAME

Net::OAI::Record::DocumentHelper - filter class for fine tuning document events and collecting processing results

CONTENTS

SYNOPSIS



 $filter = Net::OAI::Record::DocumentHelper->new(
    Handler => XML::SAX::Writer
    provideDocumentEvents => 1,
# since XML::SAX::Writer->new() returns objects of a differentClass
    dontVerifyHandler => 1,
  );
 $records = $harvester->listRecords(
        metadataPrefix  => oai_dc,
        metadataHandler => $filter;
 );


 $builder = XML::LibXML::SAX::Builder->new();
 $helper = Net::OAI::Recrd::DocumentHelper->new(
    Handler => $builder,
    provideDocumentEvents => 1,
    finalizeHook => sub { return $_[0]->finalize()->serialize() }
   );
 $records = $harvester->listRecords(
        metadataPrefix  => oai_dc,
        metadataHandler => $helper;
 );



DESCRIPTION

This helper class acts as a SAX filter and can be used as recordHandler or metadataHandler for Net::OAI::Harvester->listRecord() or getRecord() requests or within a SAX filter chain.

The Handler may be a class name, in which case a new object of that class is created on instantiation of a DocumentHelper object, or an existing SAX filter which then will be reused. (In this case it is your responsibility to use only filters which support the processing of multiple documents by one instance.)

If the option provideDocumentEvents is set to a true value, the filter will generate start_document() and end_document() events.

If the (exlusive to the previous) option suppressDocumentEvents is set to a true value, the filter will stop start_document() and end_document() events from propagating up the chain.

If the option dontVerifyHandler is set to a true value, class sanity checks for existing or freshly created ones are skipped.

The option finalizeHook may specify a callback for postprocessing the result just after an end_document() event has been forwarded. It is called with two arguments, the handler object and the result of the forwarded end_document() and should return something suitable for processing with Storable.

METHODS

new( CW%options )

Creates a Handler suitable as recordHandler or metadataHandler or intermediate filter.

    result ( )

Returns the result of the last end_document() forwarded to the handler, usually this is the result of some sort of finalizing process.

AUTHOR

Thomas Berger <ThB@gymel.com>
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::OAI::RECORD::DOCUMENTHELPER (3) 2016-01-24

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.