RecordWriter

OAI-PMH Record Writer

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\RecordWriterStrategy\RecordWriterStrategyInterface $strategy, \VuFindHarvest\OaiPmh\RecordXmlFormatter $formatter, array $settings = array()) 

Arguments

$formatter

\VuFindHarvest\OaiPmh\RecordXmlFormatter

XML record formatter

$settings

array

Configuration settings

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

extractID(object $record) : string

Arguments

$record

object

SimpleXML record.

Response

string

The ID value.

Get base path for writes.

getBasePath() : string

Response

string

Normalize a date to a Unix timestamp.

normalizeDate(string $date) : integer

Arguments

$date

string

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

Response

integer

Unix timestamp (or false if $date invalid)

Save harvested records to disk and return the end date.

write(object $records) : integer

Arguments

$records

object

SimpleXML records.

Response

integer

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

writeHarvestedIdsLog(array $harvestedIds) : void
Throws
\Exception

Arguments

$harvestedIds

array

Harvested IDs

Properties

Filename for logging harvested IDs (false for none)

harvestedIdLog : string|boolean
var

Type(s)

string|boolean

OAI prefix to strip from ID values

idPrefix : string
var

Type(s)

string

Regular expression searches

idSearch : array
var

Type(s)

array

Replacements for regular expression matches

idReplace : array
var

Type(s)

array

XML record formatter

recordFormatter : \VuFindHarvest\OaiPmh\RecordXmlFormatter

Writer strategy

strategy : \VuFindHarvest\RecordWriterStrategy\RecordWriterStrategyInterface