Skip to content

Commit

Permalink
Resolving issue #83 and 240
Browse files Browse the repository at this point in the history
  • Loading branch information
hizclick committed Dec 2, 2024
1 parent fc3baf8 commit c1ee68e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 6 additions & 3 deletions add/data/xql/getAnnotationsInText.xql
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare namespace request = "http://exist-db.org/xquery/request";
declare namespace xlink = "http://www.w3.org/1999/xlink";
declare namespace xmldb = "http://exist-db.org/xquery/xmldb";
import module namespace eutil = "http://www.edirom.de/xquery/eutil" at "../xqm/eutil.xqm";


(: OPTION DECLARATIONS ===================================================== :)

Expand All @@ -29,10 +31,10 @@ declare option output:media-type "application/json";
@param $elems The elements to check (most likely measures and zones)
@returns A sequence of annotation elements
:)
declare function local:findAnnotations($uri as xs:string) as element(mei:annot)* {
declare function local:findAnnotations($uri as xs:string, $edition as xs:string) as element(mei:annot)* {

(: TODO: check if annotations hold URIs or IDRefs :)
collection('/db/contents')//mei:annot[matches(@plist, $uri)]
collection(eutil:getPreference('edition_path', $edition))//mei:annot[matches(@plist, $uri)]
};

declare function local:getAnnotations($uriSharp as xs:string, $annotations as element()*) as array(*)* {
Expand Down Expand Up @@ -64,10 +66,11 @@ declare function local:getAnnotations($uriSharp as xs:string, $annotations as el
}
}
};
let $edition := request:get-parameter('edition', '')

let $uri := request:get-parameter('uri', '')
let $uriSharp := concat($uri, '#')
let $annotations := local:findAnnotations($uri)
let $annotations := local:findAnnotations($uri,$edition)

return
local:getAnnotations($uriSharp, $annotations)
6 changes: 6 additions & 0 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Ext.ClassManager.addNameAlternateMappings({
"EdiromOnline.controller.window.SummaryView": [],
"EdiromOnline.controller.window.WindowController": [],
"EdiromOnline.controller.window.XmlView": [],
"EdiromOnline.controller.window.about.AboutWindow": [],
"EdiromOnline.controller.window.audio.AudioView": [],
"EdiromOnline.controller.window.concordanceNavigator.ConcordanceNavigator": [],
"EdiromOnline.controller.window.iFrameView": [],
Expand Down Expand Up @@ -78,6 +79,7 @@ Ext.ClassManager.addNameAlternateMappings({
"EdiromOnline.view.window.View": [],
"EdiromOnline.view.window.Window": [],
"EdiromOnline.view.window.XmlView": [],
"EdiromOnline.view.window.about.AboutWindow": [],
"EdiromOnline.view.window.annotationLayouts.AnnotationLayout1": [],
"EdiromOnline.view.window.annotationLayouts.AnnotationLayout2": [],
"EdiromOnline.view.window.annotationLayouts.AnnotationLayout3": [],
Expand Down Expand Up @@ -956,6 +958,7 @@ Ext.ClassManager.addNameAliasMappings({
"EdiromOnline.controller.window.SummaryView": [],
"EdiromOnline.controller.window.WindowController": [],
"EdiromOnline.controller.window.XmlView": [],
"EdiromOnline.controller.window.about.AboutWindow": [],
"EdiromOnline.controller.window.audio.AudioView": [],
"EdiromOnline.controller.window.concordanceNavigator.ConcordanceNavigator": [],
"EdiromOnline.controller.window.iFrameView": [],
Expand Down Expand Up @@ -1016,6 +1019,9 @@ Ext.ClassManager.addNameAliasMappings({
"EdiromOnline.view.window.XmlView": [
"widget.xmlView"
],
"EdiromOnline.view.window.about.AboutWindow": [
"widget.aboutWindow"
],
"EdiromOnline.view.window.annotationLayouts.AnnotationLayout1": [],
"EdiromOnline.view.window.annotationLayouts.AnnotationLayout2": [],
"EdiromOnline.view.window.annotationLayouts.AnnotationLayout3": [],
Expand Down

0 comments on commit c1ee68e

Please sign in to comment.