HarvesterFactory
in package
Factory for OAI-PMH Harvest Tool
Tags
Table of Contents
- getHarvester() : Harvester
- Get the harvester
- addAutoSslOptions() : void
- Add SSL options to $options if standard files can be autodetected.
- configureClient() : Client
- Configure the HTTP client
- getBasePath() : string
- Set up directory structure for harvesting.
- getClientOptions() : array<string|int, mixed>
- Get HTTP client options from $settings array
- getCommunicator() : Communicator
- Get the communicator.
- getConsoleWriter() : ConsoleWriter
- Get console output writer (if applicable).
- getFormatter() : RecordXmlFormatter
- Get the record XML formatter.
- getResponseProcessor() : SimpleXmlResponseProcessor
- Get XML response processor.
- getSetLoader() : SetLoader
- Get the set loader (used to load set names).
- getStateManager() : StateManager
- Get state manager
- getWriter() : RecordWriter
- Build the writer support object.
- getWriterStrategyFactory() : RecordWriterStrategyFactory
- Get the factory for record writer strategies.
Methods
getHarvester()
Get the harvester
public
getHarvester(string $target, string $harvestRoot[, Client $client = null ][, array<string|int, mixed> $settings = [] ][, OutputInterface $output = null ]) : Harvester
Parameters
- $target : string
-
Name of source being harvested (used as directory name for storing harvested data inside $harvestRoot)
- $harvestRoot : string
-
Root directory containing harvested data.
- $client : Client = null
-
HTTP client
- $settings : array<string|int, mixed> = []
-
Additional settings
- $output : OutputInterface = null
-
Output interface (optional)
Tags
Return values
Harvester —addAutoSslOptions()
Add SSL options to $options if standard files can be autodetected.
protected
addAutoSslOptions(array<string|int, mixed> &$options) : void
Parameters
- $options : array<string|int, mixed>
-
Options to modify.
Return values
void —configureClient()
Configure the HTTP client
protected
configureClient(Client $client, array<string|int, mixed> $settings) : Client
Parameters
- $client : Client
-
HTTP client
- $settings : array<string|int, mixed>
-
Settings
Tags
Return values
Client —getBasePath()
Set up directory structure for harvesting.
protected
getBasePath(string $harvestRoot, string $target) : string
Parameters
- $harvestRoot : string
-
Root directory containing harvested data.
- $target : string
-
The OAI-PMH target directory to create inside $harvestRoot.
Return values
string —getClientOptions()
Get HTTP client options from $settings array
protected
getClientOptions(array<string|int, mixed> $settings) : array<string|int, mixed>
Parameters
- $settings : array<string|int, mixed>
-
Settings
Return values
array<string|int, mixed> —getCommunicator()
Get the communicator.
protected
getCommunicator(Client $client, array<string|int, mixed> $settings, ResponseProcessorInterface $processor, string $target[, OutputInterface $output = null ]) : Communicator
Parameters
- $client : Client
-
HTTP client
- $settings : array<string|int, mixed>
-
Additional settings
- $processor : ResponseProcessorInterface
-
Response processor
- $target : string
-
Target being configured (used for error messages)
- $output : OutputInterface = null
-
Output interface
Return values
Communicator —getConsoleWriter()
Get console output writer (if applicable).
protected
getConsoleWriter(OutputInterface $output, array<string|int, mixed> $settings) : ConsoleWriter
Parameters
- $output : OutputInterface
-
Output interface
- $settings : array<string|int, mixed>
-
OAI-PMH settings
Return values
ConsoleWriter —getFormatter()
Get the record XML formatter.
protected
getFormatter(Communicator $communicator, array<string|int, mixed> $settings[, OutputInterface $output = null ]) : RecordXmlFormatter
Parameters
- $communicator : Communicator
-
Communicator
- $settings : array<string|int, mixed>
-
Additional settings
- $output : OutputInterface = null
-
Output interface
Return values
RecordXmlFormatter —getResponseProcessor()
Get XML response processor.
protected
getResponseProcessor(string $basePath, array<string|int, mixed> $settings) : SimpleXmlResponseProcessor
Parameters
- $basePath : string
-
Base path for harvest
- $settings : array<string|int, mixed>
-
OAI-PMH settings
Return values
SimpleXmlResponseProcessor —getSetLoader()
Get the set loader (used to load set names).
protected
getSetLoader(Communicator $communicator, array<string|int, mixed> $settings) : SetLoader
Parameters
- $communicator : Communicator
-
API communicator
- $settings : array<string|int, mixed>
-
OAI-PMH settings
Return values
SetLoader —getStateManager()
Get state manager
protected
getStateManager(string $basePath) : StateManager
Parameters
- $basePath : string
-
Base path for harvest
Return values
StateManager —getWriter()
Build the writer support object.
protected
getWriter(RecordWriterStrategyInterface $strategy, RecordXmlFormatter $formatter, array<string|int, mixed> $settings) : RecordWriter
Parameters
- $strategy : RecordWriterStrategyInterface
-
Writing strategy
- $formatter : RecordXmlFormatter
-
XML record formatter
- $settings : array<string|int, mixed>
-
Configuration settings
Return values
RecordWriter —getWriterStrategyFactory()
Get the factory for record writer strategies.
protected
getWriterStrategyFactory() : RecordWriterStrategyFactory