Harvester

OAI-PMH Harvest Tool

category

VuFind

package

Harvest_Tools

author

Demian Katz demian.katz@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Methods

Constructor.

__construct(\VuFindHarvest\OaiPmh\Communicator $communicator, \VuFindHarvest\OaiPmh\RecordWriter $writer, \VuFindHarvest\OaiPmh\StateManager $stateManager, array $settings = array()) 

Arguments

$communicator

\VuFindHarvest\OaiPmh\Communicator

Low-level API client

$writer

\VuFindHarvest\OaiPmh\RecordWriter

Record writer

$stateManager

\VuFindHarvest\OaiPmh\StateManager

State manager

$settings

array

OAI-PMH settings

Check an OAI-PMH response for errors that need to be handled.

checkResponseForErrors(object $result) : void
Throws
\Exception

Arguments

$result

object

OAI-PMH response (SimpleXML object)

Harvest records using OAI-PMH.

getRecords(array $params) : mixed

Arguments

$params

array

GET parameters for ListRecords method.

Response

mixed

Resumption token if provided, false if finished

Harvest records via OAI-PMH using date and set.

getRecordsByDate(string $from = null, string $set = null, string $until = null) : mixed

Arguments

$from

string

Harvest start date (null for no specific start).

$set

string

Set to harvest (null for all records).

$until

string

Harvest end date (null for no specific end).

Response

mixed

Resumption token if provided, false if finished

Harvest records via OAI-PMH using resumption token.

getRecordsByToken(string $token) : mixed

Arguments

$token

string

Resumption token.

Response

mixed

Resumption token if provided, false if finished

Harvest all available documents.

launch() : void

Load date granularity from the server.

loadGranularity() : void

Make an OAI-PMH request. Die if there is an error; return a SimpleXML object on success.

sendRequest(string $verb, array $params = array()) : object

Arguments

$verb

string

OAI-PMH verb to execute.

$params

array

GET parameters for ListRecords method.

Response

object

SimpleXML-formatted response.

Set an end date for the harvest (only harvest records BEFORE this date).

setEndDate(string $date) : void

Arguments

$date

string

End date (YYYY-MM-DD format).

Set an object to accept console output messages.

setOutputWriter(\VuFindHarvest\ConsoleOutput\WriterInterface $writer) : void
inherited

Arguments

Set a start date for the harvest (only harvest records AFTER this date).

setStartDate(string $date) : void

Arguments

$date

string

Start date (YYYY-MM-DD format).

Set date range configuration (support method for constructor).

storeDateSettings(array $settings) : void

Arguments

$settings

array

Configuration

Set miscellaneous configuration (support method for constructor).

storeMiscSettings(array $settings) : void

Arguments

$settings

array

Configuration

Write a string to the console output writer (if set).

write(string $str) : void
inherited

Arguments

$str

string

String to write.

Write a string w/newline to the console output writer (if set).

writeLine(string $str) : void
inherited

Arguments

$str

string

String to write.

Properties

Record writer

writer : \VuFindHarvest\OaiPmh\RecordWriter

Low-level OAI-PMH communicator

communicator : \VuFindHarvest\OaiPmh\Communicator

State manager

stateManager : \VuFindHarvest\OaiPmh\StateManager

Target set(s) to harvest (null for all records)

set : string|array
var

Type(s)

string|array

Metadata type to harvest

metadataPrefix : string
var

Type(s)

string

Harvest end date (null for no specific end)

harvestEndDate : string
var

Type(s)

string

Harvest start date (null for no specific start)

startDate : string
var

Type(s)

string

Date granularity ('auto' to autodetect)

granularity : string
var

Type(s)

string

Writer helper

outputWriter : \VuFindHarvest\ConsoleOutput\WriterInterface
inherited