# heroesoebekti/slims-oai-pmh-harvester architecture

> Architecture diagram of the GitHub repository heroesoebekti/slims-oai-pmh-harvester, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/heroesoebekti/slims-oai-pmh-harvester
- Repository: https://github.com/heroesoebekti/slims-oai-pmh-harvester

## Overview

This is a SLiMS plugin for harvesting OAI-PMH repository records into the library catalog. An administrator opens its bibliography menu, manages repository-node settings, and starts an append or fresh harvest; the process streams progress while fetching OAI-DC records, parsing metadata, saving catalog and harvest-link data, and indexing bibliographies. The sampled code supports the main control flow and parsing; node management, catalog persistence and integrations are only partly visible in excerpts.

Main entry points: [`harvesting_process.php`](https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php) (Harvest process), [`harvesting.php`](https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting.php) (Repository management), [`plugin.php`](https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/plugin.php) (Plugin menu), [`oai_parser_helper.php`](https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/oai_parser_helper.php) (Metadata parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Administration"]
  node_plugin["Plugin menu<br/>[plugin.php]"]
  node_nodeui["Repository management<br/>[harvesting.php]"]
  node_settings[("Harvest node settings<br/>[harvesting.php]")]
end

subgraph group_harvest["Harvesting"]
  node_process["Harvest process"]
  node_oailib["OAI-PMH client"]
  node_sse["Progress stream"]
end

subgraph group_catalog["Catalog ingestion"]
  node_parser["Metadata parser"]
  node_bibliography[("Bibliography records")]
  node_relationships[("Harvest relationships")]
  node_relateddata[("Authors and topics")]
  node_externalfiles[("External links")]
  node_indexer["Bibliography indexer"]
end

node_admin(("SLiMS administrator"))
node_oai["OAI-PMH repository"]
node_slims["SLiMS services"]

node_admin -->|"opens menu"| node_plugin
node_plugin -->|"registers page"| node_nodeui
node_admin -->|"manages nodes"| node_nodeui
node_nodeui -->|"saves and deletes"| node_settings
node_nodeui -->|"starts harvest"| node_process
node_process -->|"loads node"| node_settings
node_process -->|"creates client"| node_oailib
node_oailib -.->|"fetches records"| node_oai
node_process -->|"parses metadata"| node_parser
node_process -->|"writes records"| node_bibliography
node_process -->|"tracks harvested IDs"| node_relationships
node_process -->|"writes authors/topics"| node_relateddata
node_process -->|"stores external URLs"| node_externalfiles
node_process -->|"constructs indexer"| node_indexer
node_process -->|"emits progress"| node_sse
node_nodeui -->|"receives events"| node_sse
node_parser -->|"looks up IDs"| node_slims

click node_plugin "https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/plugin.php"
click node_nodeui "https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting.php"
click node_settings "https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting.php"
click node_process "https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php"
click node_oailib "https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php"
click node_sse "https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php"
click node_parser "https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/oai_parser_helper.php"
click node_bibliography "https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php"
click node_relationships "https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php"
click node_relateddata "https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php"
click node_externalfiles "https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php"
click node_indexer "https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_plugin,node_nodeui,node_settings toneBlue
class node_process,node_oailib,node_sse toneAmber
class node_parser,node_bibliography,node_relationships,node_relateddata,node_externalfiles,node_indexer toneMint
class node_admin,node_oai,node_slims toneIndigo
```

## Components

### Administration

- [Plugin menu](https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/plugin.php): `plugin.php`
- [Repository management](https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting.php): `harvesting.php`
- [Harvest node settings](https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting.php): `harvesting.php`

### Harvesting

- [Harvest process](https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php): `harvesting_process.php`
- [OAI-PMH client](https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php): `harvesting_process.php`
- [Progress stream](https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php): `harvesting_process.php`

### Catalog ingestion

- [Metadata parser](https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/oai_parser_helper.php): `oai_parser_helper.php`
- [Bibliography records](https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php): `harvesting_process.php`
- [Harvest relationships](https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php): `harvesting_process.php`
- [Authors and topics](https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php): `harvesting_process.php`
- [External links](https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php): `harvesting_process.php`
- [Bibliography indexer](https://github.com/heroesoebekti/slims-oai-pmh-harvester/blob/main/harvesting_process.php): `harvesting_process.php`

### Other components

- **SLiMS administrator**
- **OAI-PMH repository**
- **SLiMS services**

## Connections

- SLiMS administrator → Plugin menu: opens menu (evidence: `plugin.php`)
- Plugin menu → Repository management: registers page (evidence: `plugin.php`)
- SLiMS administrator → Repository management: manages nodes (evidence: `harvesting.php`)
- Repository management → Harvest node settings: saves and deletes (evidence: `harvesting.php`)
- Repository management → Harvest process: starts harvest (evidence: `harvesting.php`)
- Harvest process → Harvest node settings: loads node (evidence: `harvesting_process.php`)
- Harvest process → OAI-PMH client: creates client (evidence: `harvesting_process.php`)
- OAI-PMH client → OAI-PMH repository: fetches records
- Harvest process → Metadata parser: parses metadata (evidence: `harvesting_process.php`)
- Harvest process → Bibliography records: writes records (evidence: `harvesting_process.php`)
- Harvest process → Harvest relationships: tracks harvested IDs (evidence: `harvesting_process.php`)
- Harvest process → Authors and topics: writes authors/topics (evidence: `harvesting_process.php`)
- Harvest process → External links: stores external URLs (evidence: `harvesting_process.php`)
- Harvest process → Bibliography indexer: constructs indexer (evidence: `harvesting_process.php`)
- Harvest process → Progress stream: emits progress (evidence: `harvesting_process.php`)
- Repository management → Progress stream: receives events (evidence: `harvesting.php`)
- Metadata parser → SLiMS services: looks up IDs (evidence: `oai_parser_helper.php`)
