VuFindHarvest API Documentation

RecordWriter
in package

OAI-PMH Record Writer

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

license

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

link

Wiki

Table of Contents

$harvestedIdLog  : string|bool
Filename for logging harvested IDs (false for none)
$idPrefix  : string
OAI prefix to strip from ID values
$idReplace  : array<string|int, mixed>
Replacements for regular expression matches
$idSearch  : array<string|int, mixed>
Regular expression searches
$recordFormatter  : RecordXmlFormatter
XML record formatter
$strategy  : RecordWriterStrategyInterface
Writer strategy
__construct()  : mixed
Constructor
getBasePath()  : string
Get base path for writes.
write()  : int
Save harvested records to disk and return the end date.
extractID()  : string
Extract the ID from a record object (support method for processRecords()).
normalizeDate()  : int
Normalize a date to a Unix timestamp.
writeHarvestedIdsLog()  : void
Write a log file of harvested IDs (if configured to do so).

Properties

$harvestedIdLog

Filename for logging harvested IDs (false for none)

protected string|bool $harvestedIdLog = false

$idPrefix

OAI prefix to strip from ID values

protected string $idPrefix = ''

$idReplace

Replacements for regular expression matches

protected array<string|int, mixed> $idReplace = []

$idSearch

Regular expression searches

protected array<string|int, mixed> $idSearch = []

Methods

getBasePath()

Get base path for writes.

public getBasePath() : string
Return values
string

write()

Save harvested records to disk and return the end date.

public write(object $records) : int
Parameters
$records : object

SimpleXML records.

Return values
int

extractID()

Extract the ID from a record object (support method for processRecords()).

protected extractID(object $record) : string
Parameters
$record : object

SimpleXML record.

Return values
string

The ID value.

normalizeDate()

Normalize a date to a Unix timestamp.

protected normalizeDate(string $date) : int
Parameters
$date : string

Date (ISO-8601 or YYYY-MM-DD HH:MM:SS)

Return values
int

Unix timestamp (or false if $date invalid)

writeHarvestedIdsLog()

Write a log file of harvested IDs (if configured to do so).

protected writeHarvestedIdsLog(array<string|int, mixed> $harvestedIds) : void
Parameters
$harvestedIds : array<string|int, mixed>

Harvested IDs

Tags
throws
Exception
Return values
void

Search results