Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve cacheing of frus volumes and bibliographies #470

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions modules/config.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import module namespace frus-history = "http://history.state.gov/ns/site/hsg/fru

import module namespace pm-frus='http://www.tei-c.org/pm/models/frus/web/module' at "../transform/frus-web-module.xql";

import module namespace frus-lm = "http://history.state.gov/ns/site/frus/last-modified" at "/db/apps/frus/modules/frus.xqm";

declare namespace templates="http://exist-db.org/xquery/html-templating";

declare namespace expath="http://expath.org/ns/pkg";
Expand Down Expand Up @@ -138,28 +140,26 @@ declare variable $config:PUBLICATIONS :=
"collection": $config:FRUS_VOLUMES_COL,
"document-last-modified": function($document-id) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rewrite to use a single function

(
xmldb:last-modified($config:FRUS_VOLUMES_COL, $document-id || '.xml'),
(: for volumes that we do not have as TEI yet, fall back on volume metadata :)
xmldb:last-modified($config:FRUS_METADATA_COL, $document-id || '.xml')
$frus-lm:lm?('volumes/' || $document-id || '.xml'),
$frus-lm:lm?('bibliography/' ||$document-id || '.xml')
)[1]
},
"section-last-modified": function($document-id, $section-id) {
(
xmldb:last-modified($config:FRUS_VOLUMES_COL, $document-id || '.xml'),
xmldb:last-modified($config:FRUS_METADATA_COL, $document-id || '.xml')
$frus-lm:lm?('volumes/' || $document-id || '.xml'),
$frus-lm:lm?('bibliography/' ||$document-id || '.xml')
)[1]
},
"document-created": function($document-id) {
(
xmldb:created($config:FRUS_VOLUMES_COL, $document-id || '.xml'),
(: for volumes that we do not have as TEI yet, fall back on volume metadata :)
xmldb:created($config:FRUS_METADATA_COL, $document-id || '.xml')
$frus-lm:lm?('volumes/' || $document-id || '.xml'),
$frus-lm:lm?('bibliography/' ||$document-id || '.xml')
)[1]
},
"section-created": function($document-id, $section-id) {
(
xmldb:created($config:FRUS_VOLUMES_COL, $document-id || '.xml'),
xmldb:created($config:FRUS_METADATA_COL, $document-id || '.xml')
$frus-lm:lm?('volumes/' || $document-id || '.xml'),
$frus-lm:lm?('bibliography/' ||$document-id || '.xml')
)[1]
},
"select-document": function($document-id) { doc($config:FRUS_VOLUMES_COL || '/' || $document-id || '.xml') },
Expand Down
Loading