From c1ee68e480f03802faf11ff97614d0d64059df69 Mon Sep 17 00:00:00 2001 From: Hizkiel Date: Mon, 2 Dec 2024 12:19:32 +0100 Subject: [PATCH 1/4] Resolving issue #83 and 240 --- add/data/xql/getAnnotationsInText.xql | 9 ++++++--- bootstrap.js | 6 ++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/add/data/xql/getAnnotationsInText.xql b/add/data/xql/getAnnotationsInText.xql index 8b529afc0..5c1624d24 100644 --- a/add/data/xql/getAnnotationsInText.xql +++ b/add/data/xql/getAnnotationsInText.xql @@ -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 ===================================================== :) @@ -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(*)* { @@ -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) diff --git a/bootstrap.js b/bootstrap.js index fd59f4dd2..a7cc2d75a 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -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": [], @@ -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": [], @@ -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": [], @@ -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": [], From d6ac0da875db788205eef5b85272872a380f9ae5 Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 4 Dec 2024 15:47:44 +0100 Subject: [PATCH 2/4] Update add/data/xql/getAnnotationsInText.xql Co-authored-by: Peter Stadler --- add/data/xql/getAnnotationsInText.xql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/add/data/xql/getAnnotationsInText.xql b/add/data/xql/getAnnotationsInText.xql index 5c1624d24..67bfc9e0e 100644 --- a/add/data/xql/getAnnotationsInText.xql +++ b/add/data/xql/getAnnotationsInText.xql @@ -34,7 +34,7 @@ declare option output:media-type "application/json"; 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(eutil:getPreference('edition_path', $edition))//mei:annot[matches(@plist, $uri)] + edition:collection($edition)//mei:annot[matches(@plist, $uri)] }; declare function local:getAnnotations($uriSharp as xs:string, $annotations as element()*) as array(*)* { From 7bca8d4d08f60928cc6666a9e341d76878c8c5e9 Mon Sep 17 00:00:00 2001 From: Hizkiel Date: Wed, 4 Dec 2024 15:53:51 +0100 Subject: [PATCH 3/4] checkout bootrap.com from develop branch --- bootstrap.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/bootstrap.js b/bootstrap.js index a7cc2d75a..fd59f4dd2 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -45,7 +45,6 @@ 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": [], @@ -79,7 +78,6 @@ 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": [], @@ -958,7 +956,6 @@ 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": [], @@ -1019,9 +1016,6 @@ 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": [], From f25e6a6b1aa64b1d9b468833d94920682c82c2ce Mon Sep 17 00:00:00 2001 From: Hizkiel Date: Fri, 6 Dec 2024 16:49:34 +0100 Subject: [PATCH 4/4] Removing the line at line 70 and add space between the function and varibale declaration at line 69 --- add/data/xql/getAnnotationsInText.xql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/add/data/xql/getAnnotationsInText.xql b/add/data/xql/getAnnotationsInText.xql index 67bfc9e0e..cdb9ee6ed 100644 --- a/add/data/xql/getAnnotationsInText.xql +++ b/add/data/xql/getAnnotationsInText.xql @@ -66,8 +66,8 @@ declare function local:getAnnotations($uriSharp as xs:string, $annotations as el } } }; -let $edition := request:get-parameter('edition', '') +let $edition := request:get-parameter('edition', '') let $uri := request:get-parameter('uri', '') let $uriSharp := concat($uri, '#') let $annotations := local:findAnnotations($uri,$edition)