From d3e0fca93b3b56de9a7a0209f8840c822e3bc173 Mon Sep 17 00:00:00 2001 From: Juri Leino Date: Mon, 20 Jan 2025 13:37:04 +0100 Subject: [PATCH] feat: cache people/by-year and by-name Use the last-modified-date metadatum in the relevant collection to calculate the collection wide last modified date. --- modules/config.xqm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/config.xqm b/modules/config.xqm index 507ce97d..fcf2e710 100644 --- a/modules/config.xqm +++ b/modules/config.xqm @@ -129,9 +129,16 @@ declare variable $config:FRUS_HISTORY_ARTICLES_COL := $config:FRUS_HISTORY_COL | declare variable $config:FRUS_HISTORY_DOCUMENTS_COL := $config:FRUS_HISTORY_COL || '/documents'; declare variable $config:FRUS_HISTORY_EVENTS_COL := $config:FRUS_HISTORY_COL || '/events'; declare variable $config:FRUS_HISTORY_MONOGRAPH_COL := $config:FRUS_HISTORY_COL || '/monograph'; +declare variable $config:POCOM_PEOPLE_COL := '/db/apps/pocom/people'; declare variable $config:IGNORED_DIVS := ("toc"); +declare function config:pocom-people-last-modified() as xs:dateTime { + collection($config:POCOM_PEOPLE_COL)//last-modified-date + => sort() => reverse() => head() + => concat("T00:00:00Z") => xs:dateTime() +}; + declare variable $config:PUBLICATIONS := map { "frus": map { @@ -423,13 +430,15 @@ declare variable $config:PUBLICATIONS := "breadcrumb-title": function($parameters as map(*)) as xs:string? { "Starting with " || upper-case($parameters?letter) - } + }, + "publication-last-modified": config:pocom-people-last-modified#0 }, "people-by-year": map { "title": "Principal Officers and Chiefs of Mission Chronological Listing - Department History", "breadcrumb-title": function($parameters as map(*)) as xs:string? { $parameters?year - } + }, + "publication-last-modified": config:pocom-people-last-modified#0 }, "people-by-role": map { "title": "Principal Officers and Chiefs of Mission Alphabetical Listing - Department History",