VuFindHarvest API Documentation

CombinedRecordWriterStrategy extends AbstractRecordWriterStrategy
in package

Strategy for writing records to disk as a combined file.

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

$basePath  : string
Directory for storing harvested files
$deletedIds  : array<string|int, mixed>
Collection of deleted IDs.
$firstHarvestedId  : string
The ID of the first successfully harvested record.
$innerXML  : array<string|int, mixed>
Collection of XML to include inside final output tag.
$wrappingTag  : string
The wrapping XML tag to be used if combinedRecords is set to true
__construct()  : mixed
Constructor
addDeletedRecord()  : void
Add the ID of a deleted record.
addRecord()  : void
Add a non-deleted record.
beginWrite()  : void
Called before the writing process begins.
endWrite()  : void
Close out the writing process.
getBasePath()  : string
Get base path for writes.
getCombinedXML()  : string
Support method for building combined XML document.
getFilename()  : string
Get the filename for a specific record ID.
saveDeletedRecords()  : void
Create a tracking file to record the deletion of a record.
saveFile()  : void
Save a record to disk.

Properties

$wrappingTag

The wrapping XML tag to be used if combinedRecords is set to true

protected string $wrappingTag = '<collection>'

Methods

__construct()

Constructor

public __construct(string $basePath[, string $tag = null ]) : mixed
Parameters
$basePath : string

Target directory for harvested files

$tag : string = null

Wrapping tag to contain collection (null for default of )

Return values
mixed

addDeletedRecord()

Add the ID of a deleted record.

public addDeletedRecord(string $id) : void
Parameters
$id : string

ID

Return values
void

addRecord()

Add a non-deleted record.

public addRecord(string $id, string $record) : void
Parameters
$id : string

ID

$record : string

Record XML

Return values
void

getCombinedXML()

Support method for building combined XML document.

protected getCombinedXML(string $innerXML) : string
Parameters
$innerXML : string

XML for inside of document.

Return values
string

getFilename()

Get the filename for a specific record ID.

protected getFilename(string $id, string $ext) : string
Parameters
$id : string

ID of record to save.

$ext : string

File extension to use.

Return values
string

Full path + filename.

saveDeletedRecords()

Create a tracking file to record the deletion of a record.

protected saveDeletedRecords(string|array<string|int, mixed> $ids) : void
Parameters
$ids : string|array<string|int, mixed>

ID(s) of deleted record(s).

Return values
void

saveFile()

Save a record to disk.

protected saveFile(string $id, string $xml) : void
Parameters
$id : string

Record ID to use for filename generation.

$xml : string

XML to save.

Return values
void

Search results