Skip to content

Commit

Permalink
support wega iconography images for orgs
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed Mar 5, 2024
1 parent 3a0111d commit cb93e79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions modules/img.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ declare %private function img:wega-images($model as map(*), $lang as xs:string)
for $fig in core:getOrCreateColl('iconography', $model('docID'), true())//tei:figure[tei:graphic]
let $docType :=
if($fig/tei:figDesc/tei:listPlace) then 'places'
else if($fig/tei:figDesc/tei:listOrg) then 'orgs'
else 'persons'
let $iiifURI := $iiifImageApi || encode-for-uri(string-join(($docType, substring($model('docID'), 1, 5) || 'xx', $model('docID'), $fig/tei:graphic/@url), '/'))
order by $fig/@n (: markup with <figure n="portrait"> takes precedence :)
Expand Down
10 changes: 7 additions & 3 deletions modules/wdt.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,14 @@ declare function wdt:iconography($item as item()*) as map(*) {
else false()
},
'filter' : function() as document-node()* {
$item/root()/descendant::tei:person[@corresp]/root() | $item/root()/descendant::tei:place[@corresp]/root()
$item/root()/descendant::tei:person[@corresp]/root() |
$item/root()/descendant::tei:place[@corresp]/root() |
$item/root()/descendant::tei:org[@corresp]/root()
},
'filter-by-person' : function($personID as xs:string) as document-node()* {
$item/root()/descendant::tei:person[@corresp = $personID]/root() | $item/root()/descendant::tei:place[@corresp = $personID]/root()
$item/root()/descendant::tei:person[@corresp = $personID]/root() |
$item/root()/descendant::tei:place[@corresp = $personID]/root() |
$item/root()/descendant::tei:org[@corresp = $personID]/root()
},
'filter-by-date' : function($dateFrom as xs:date?, $dateTo as xs:date?) as document-node()* {
()
Expand All @@ -555,7 +559,7 @@ declare function wdt:iconography($item as item()*) as map(*) {
for $i in wdt:iconography($item)('filter')() order by sort:index('iconography', $i) descending return $i
},
'init-collection' : function() as document-node()* {
crud:data-collection('iconography')//(tei:place|tei:person)[@corresp]/root()
crud:data-collection('iconography')//(tei:place|tei:person|tei:org)[@corresp]/root()
},
'init-sortIndex' : function() as item()* {
sort:create-index-callback('iconography', wdt:iconography(())('init-collection')(), function($node) { $node//data(@corresp) }, ())
Expand Down

0 comments on commit cb93e79

Please sign in to comment.