Skip to content

Migrate Scottish Government Yearbooks (IOG) collection from Skylight#63

Draft
sevenpointsix wants to merge 7 commits into
stagingfrom
feature/iog-migration
Draft

Migrate Scottish Government Yearbooks (IOG) collection from Skylight#63
sevenpointsix wants to merge 7 commits into
stagingfrom
feature/iog-migration

Conversation

@sevenpointsix

@sevenpointsix sevenpointsix commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Ports the Scottish Government Yearbooks site from legacy Skylight into Skylark as a no-reskin DSpace collection (internal key iog). Implements the plan in iog_collection_migration_efec4bea.plan.md and follows Open Books / Points of Arrival conventions for dual URL modes (prefix + dedicated host).

  • Config + env: config/collections/iog.php merges defaults/dspace.php with ported Solr/UI settings (Author/Subject/Year filters, results_per_page=10, oaipmhcollection=hdl_10683_22746). New env vars IOG_CONTAINER_ID, IOG_GA_CODE, SCOTGOVYEARBOOKS_HOST documented in .env.example and wired into phpunit.xml as scottishgovernmentyearbooks.testing for dedicated-host tests.
  • Year facet: adds YeardateIssued.year sidebar facet (Solr-verified; standard DSpace datetemporal_filter is empty for this collection). facet_limit raised to 20 so all 16 publication years (1976, 1978–1992) appear without a browse page.
  • Routes + controller: CollectionRouteRegistrar::registerDspacePrefixedCollection block added in routes/web.php (with feedback=false and extra /history route). Iog\\PageController provides home() and history(). Shared about/licensing/takedown/accessibility come from PageController::resolveSharedPage() resolving iog.pages.*.
  • Views (legacy port, no reskin): layouts/iog.blade.php mirrors the Skylight header (UoE link, Blog/ERA/SPS/History/About menu, collection title, search box + advanced link) and footer; subject-grid home, search results, and PDF-viewer record page all live under resources/views/iog/. All links use $collectionUrl() so they work in both /iog prefix and dedicated-host modes.
  • Sidebar facets composer: new IogLayoutComposer registered in AppServiceProvider injects sidebar_facets into layouts.iog so Author/Subject/Year filters render on the home page (matches the Open Books pattern; without this the right-hand column is empty on home/static pages).
  • Docs / future agents: added a new "Sidebar facets (gotcha)" section to docs/collection-migration.md covering the composer pattern and facet URL double-encoding. Also added a git-ignored AGENTS.local.md scratchpad with the same gotchas plus dual-host wiring notes.

Test plan

  • php artisan test --compact tests/Feature/IogCollectionTest.php → 35 passed (route registration, prefix-mode home + static pages, dedicated-host home + base href, carousel facet links, legacy nav text, col-sidebar shell on home, Year facet config/rendering/Solr fq forwarding).
  • vendor/bin/pint --dirty --format agent passes.
  • Locally set IOG_CONTAINER_ID=e99d9f85-ef2f-4de4-820b-9561cb759fec (dev UUID) in .env, visit https://skylark.test/iog, confirm subject carousel + sidebar Author/Subject/Year facets.
  • Click a Year facet (e.g. 1980) and confirm results filter correctly.
  • Run a search (e.g. click a subject tile), open a record, confirm PDF viewer loads.
  • Optionally set SCOTGOVYEARBOOKS_HOST=scottishgovernmentyearbooks.test + Herd link and verify production-parity URLs at the root.

Out of scope

  • Tailwind / V2 reskin.
  • Renaming the internal collection key from iog to scottishgovernmentyearbooks (would fight existing config/assets naming).
  • /scottishgovernmentyearbooks URL alias (can be a follow-up redirect).
  • Year-range buckets / from-to month+year picker (year-level facet is sufficient given Solr metadata).

Port the iog DSpace collection to Skylark with no reskin: shared
defaults/dspace.php config, Iog\PageController (home, history),
layouts/iog.blade.php (legacy nav, search box, base href, dual prefix +
SCOTGOVYEARBOOKS_HOST routing), home subject carousel, search results,
record show with PDF viewer iframe, and ported about/history/licensing/
takedown/accessibility static pages.

Register an IogLayoutComposer so the right-hand Author/Subject facet
sidebar populates on the home page — a step that's caught us out on
previous migrations. Documented in docs/collection-migration.md plus a
new git-ignored AGENTS.local.md with collection-migration gotchas
(sidebar composer, facet URL double-encoding, dual-host wiring).
Matches the Points of Arrival pattern: config/collections/iog.php falls
back to the dev community UUID so a fresh local Skylark serves /iog
without needing IOG_CONTAINER_ID set in .env. Production explicitly
overrides to the prod UUID via env.
…aging).

We only read from Solr and want the latest data everywhere by default, so
ship prod as the fallback and let dev/staging override IOG_CONTAINER_ID
in their .env (legacy dev UUID e99d9f85-ef2f-4de4-820b-9561cb759fec is
in .env.example for reference).

Reverts the dev-default introduced in 9ebbc0f to align with every other
prefixed DSpace collection's container_id pattern.
CollectionRouteRegistrar already registers /iog/advanced{,/form,/post,
/search/{filters?}}, but no iog.search.advanced view existed so the form
endpoint 500'd. Port the Skylight legacy markup (same pattern as the
openbooks advanced form) into resources/views/iog/search/advanced.blade.php,
driven by config('skylight.search_fields') (Keywords, Subject, Type,
Author, Series) and POSTing to {collectionUrl}/advanced/post.

Tests cover the advanced* route names and assert the form renders with
every configured search field, the operator select, and the correct
POST target.
The advanced search form was passing every user-supplied field/value pair
straight through as an `fq` filter, e.g. `fq=text:test`. DSpace's generic
`text` copy field rarely matches single tokens that way, so even queries
that worked from the basic search box returned no results.

`advancedSearch()` now parses the URL filter segments, maps the friendly
labels (Keywords/Title/Author/...) to the underlying Solr fields, and
combines them into a Lucene-style `q` string using the user's chosen
operator. The `Keywords` field defers to the default `text` search so it
matches the basic search behaviour, and multi-word values are wrapped
in parens so the boolean operator parses correctly.

Also update the "no results" message on the IOG results template to echo
back the actual query when it isn't a wildcard fetch, and add tests
covering both the single-field and multi-field operator cases.
`SearchController::buildPaginationLinks()` emits Bootstrap-style
`<ul class="pagination"><li>...</li></ul>` markup. Layouts that don't
include Bootstrap (the IOG legacy theme and any Tailwind-only v2 skin)
were rendering the page numbers stacked vertically because `<li>`
defaults to `display: list-item`.

* Add `public/collections/iog/css/skylark.css` (loaded after the legacy
  `style.css`) with the minimum rules to lay the pagination out inline
  without bullets, matching the look of the original CodeIgniter site.
* Add a shared `ul.pagination` component layer in `resources/css/app.css`
  so every Tailwind-based collection layout (geddes-v2, public-art-v2,
  eerc-v2, ...) gets a sensibly styled horizontal pagination strip out
  of the box.

Includes tests that assert the IOG override stylesheet is loaded and
that the compiled Vite CSS bundle includes the shared pagination rules.
Solr indexes publication years on dateIssued.year (not datetemporal_filter).
Raise facet_limit to 20 so all 16 years appear without a browse page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant