Skip to content

Commit 123d721

Browse files
committed
[bugfix] Prefix the elements in the TEI namespace that are returned from the API
1 parent e2b5446 commit 123d721

2 files changed

Lines changed: 26 additions & 24 deletions

File tree

src/main/formGenerator/config-mss.xml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,30 +42,30 @@
4242

4343
<!-- Add lookup options for elements with controlled vocabularly, must have an api already working. Example the Srophe apps person or places api -->
4444
<lookups>
45-
<lookup api="/exist/apps/majlis/api/search/mutual?format=xml&amp;q="
45+
<lookup api="/exist/apps/majlis/api/search/mutual?format=xml&amp;q="
4646
formURL="forms/msSimple/lookup/mutual.xhtml"
4747
elementName="mutual"
4848
formName="mutual"
4949
lookupLabel="Look up mutual relations."/>
50-
<lookup api="/exist/apps/majlis/api/search/active?format=xml&amp;q="
50+
<lookup api="/exist/apps/majlis/api/search/active?format=xml&amp;q="
5151
formURL="forms/msSimple/lookup/mutual.xhtml"
5252
elementName="active"
5353
formName="active"
5454
lookupLabel="Look up subject of relation."/>
55-
<lookup api="/exist/apps/majlis/api/search/passive?format=xml&amp;q="
55+
<lookup api="/exist/apps/majlis/api/search/passive?format=xml&amp;q="
5656
formURL="forms/msSimple/lookup/mutual.xhtml"
5757
elementName="passive"
5858
formName="passive"
5959
lookupLabel="Look up object of relation."/>
6060
<lookup
61-
api="/exist/apps/majlis/api/search/persName?format=xml&amp;q="
61+
api="/exist/apps/majlis/api/search/persName?format=xml&amp;prefixElement=tei&amp;q="
6262
formURL="forms/msSimple/lookup/persName.xhtml"
6363
elementName="persName"
6464
formName="persName"
6565
lookupLabel="Look up persons."/>
6666
<popup formName="personTEI" elementName="persName" label="New person"/>
6767
<lookup
68-
api="/exist/apps/majlis/api/search/placeName?format=xml&amp;q="
68+
api="/exist/apps/majlis/api/search/placeName?format=xml&amp;prefixElement=tei&amp;q="
6969
formURL="forms/msSimple/lookup/placeName.xhtml"
7070
elementName="placeName"
7171
formName="placeName"
@@ -79,7 +79,7 @@
7979
lookupLabel="Look up author record."/>
8080
<popup formName="authorTEI" elementName="author" label="New author"/>
8181
<lookup
82-
api="/exist/apps/majlis/api/search/title?format=xml&amp;collection=works&amp;q="
82+
api="/exist/apps/majlis/api/search/title?format=xml&amp;collection=works&amp;prefixElement=tei&amp;q="
8383
formURL="forms/msSimple/lookup/title.xhtml"
8484
elementName="title"
8585
formName="title"
@@ -88,7 +88,7 @@
8888
<lookup api="/exist/apps/majlis/api/search/title?format=xml&amp;q=" formURL="forms/msSimple/lookup/title.xhtml" xpath="not(parent::*:bibl)" elementName="title" formName="title" lookupLabel="Look up title"/> -->
8989
<popup formName="worksTEI" elementName="title" label="New work"/>
9090
<lookup
91-
api="/exist/apps/majlis/api/search/citation?format=xml&amp;q="
91+
api="/exist/apps/majlis/api/search/citation?format=xml&amp;q="
9292
formURL="forms/msSimple/lookup/bibl.xhtml"
9393
elementName="bibl"
9494
formName="bibl"
@@ -99,6 +99,7 @@
9999
/name of request - usually specifies the type of request or element to be searched.
100100
@format - xml/json/html
101101
@collection - collections to be searched, should match collections in your data directory
102+
@prefixElement - a prefix to use for the returned element e.g. 'tei', mutually exclusive with @wrapElement
102103
@wrapElement - element that will contain the search results, if different from the name of the request
103104
example the following searches all persNames, but returns results wrapped in author element for insertion into TEI record:
104105
/exist/apps/majlis/api/search/persName?format=xml&wrapElement=tei:author&q=
@@ -303,7 +304,7 @@
303304
formName="author"
304305
lookupLabel="Look up author record."/>
305306
<lookup
306-
api="/exist/apps/majlis/api/search/title?format=xml&amp;collection=works&amp;q="
307+
api="/exist/apps/majlis/api/search/title?format=xml&amp;collection=works&amp;prefixElement=tei&amp;q="
307308
formURL="forms/msSimple/lookup/title.xhtml"
308309
elementName="title"
309310
formName="title"
@@ -492,13 +493,13 @@
492493
<globalSchema src="schemas/mss-compiled.odd"/>
493494
<xmlTemplate src="templates/full-mss-template.xml"/>
494495
<lookup
495-
api="/exist/apps/majlis/api/search/persName?format=xml&amp;collection=persons&amp;q="
496+
api="/exist/apps/majlis/api/search/persName?format=xml&amp;collection=persons&amp;prefixElement=tei&amp;q="
496497
formURL="forms/msSimple/lookup/persName.xhtml"
497498
elementName="persName"
498499
formName="persName"
499500
lookupLabel="Look up person record."/>
500501
<lookup
501-
api="/exist/apps/majlis/api/search/placeName?format=xml&amp;collection=places&amp;q="
502+
api="/exist/apps/majlis/api/search/placeName?format=xml&amp;collection=places&amp;prefixElement=tei&amp;q="
502503
formURL="forms/msSimple/lookup/placeName.xhtml"
503504
elementName="placeName"
504505
formName="placeName"
@@ -518,7 +519,7 @@
518519
<globalSchema src="schemas/mss-compiled.odd"/>
519520
<xmlTemplate src="templates/full-mss-template.xml"/>
520521
<lookup
521-
api="/exist/apps/majlis/api/search/citation?format=xml&amp;q="
522+
api="/exist/apps/majlis/api/search/citation?format=xml&amp;q="
522523
formURL="forms/msSimple/lookup/bibl.xhtml"
523524
elementName="bibl"
524525
formName="bibl"
@@ -530,28 +531,28 @@
530531
formName="idno"
531532
lookupLabel="Look up manuscript record."/>
532533
<lookup
533-
api="/exist/apps/majlis/api/search/persName?format=xml&amp;collection=persons&amp;q="
534+
api="/exist/apps/majlis/api/search/persName?format=xml&amp;collection=persons&amp;prefixElement=tei&amp;q="
534535
formURL="forms/msSimple/lookup/persName.xhtml"
535536
elementName="persName"
536537
formName="persName"
537538
lookupLabel="Look up person record."/>
538539
<lookup
539-
api="/exist/apps/majlis/api/search/placeName?format=xml&amp;collection=places&amp;q="
540+
api="/exist/apps/majlis/api/search/placeName?format=xml&amp;collection=places&amp;prefixElement=tei&amp;q="
540541
formURL="forms/msSimple/lookup/placeName.xhtml"
541542
elementName="placeName"
542543
formName="placeName"
543544
lookupLabel="Look up place record."/>
544-
<lookup api="/exist/apps/majlis/api/search/mutual?format=xml&amp;q="
545+
<lookup api="/exist/apps/majlis/api/search/mutual?format=xml&amp;q="
545546
formURL="forms/msSimple/lookup/mutual.xhtml"
546547
elementName="mutual"
547548
formName="mutual"
548549
lookupLabel="Look up mutual relations."/>
549-
<lookup api="/exist/apps/majlis/api/search/active?format=xml&amp;q="
550+
<lookup api="/exist/apps/majlis/api/search/active?format=xml&amp;q="
550551
formURL="forms/msSimple/lookup/mutual.xhtml"
551552
elementName="active"
552553
formName="active"
553554
lookupLabel="Look up subject of relation."/>
554-
<lookup api="/exist/apps/majlis/api/search/passive?format=xml&amp;q="
555+
<lookup api="/exist/apps/majlis/api/search/passive?format=xml&amp;q="
555556
formURL="forms/msSimple/lookup/mutual.xhtml"
556557
elementName="passive"
557558
formName="passive"
@@ -648,13 +649,13 @@
648649
<globalSchema src="schemas/mss-compiled.odd"/>
649650
<xmlTemplate src="templates/full-mss-template.xml"/>
650651
<lookup
651-
api="/exist/apps/majlis/api/search/citation?format=xml&amp;q="
652+
api="/exist/apps/majlis/api/search/citation?format=xml&amp;q="
652653
formURL="forms/msSimple/lookup/bibl.xhtml"
653654
elementName="bibl"
654655
formName="bibl"
655656
lookupLabel="Look up bibliographic record."/>
656657
<lookup
657-
api="/exist/apps/majlis/api/search/persName?format=xml&amp;collection=persons&amp;q="
658+
api="/exist/apps/majlis/api/search/persName?format=xml&amp;collection=persons&amp;prefixElement=tei&amp;q="
658659
formURL="forms/msSimple/lookup/persName.xhtml"
659660
elementName="persName"
660661
formName="persName"
@@ -673,13 +674,13 @@
673674
<localSchema src="schemas/mss-manuscript-history.xml"/>
674675
<globalSchema src="schemas/mss-compiled.odd"/>
675676
<lookup
676-
api="/exist/apps/majlis/api/search/persName?format=xml&amp;collection=persons&amp;q="
677+
api="/exist/apps/majlis/api/search/persName?format=xml&amp;collection=persons&amp;prefixElement=tei&amp;q="
677678
formURL="forms/msSimple/lookup/persName.xhtml"
678679
elementName="persName"
679680
formName="persName"
680681
lookupLabel="Look up person record."/>
681682
<lookup
682-
api="/exist/apps/majlis/api/search/placeName?format=xml&amp;collection=places&amp;q="
683+
api="/exist/apps/majlis/api/search/placeName?format=xml&amp;collection=places&amp;prefixElement=tei&amp;q="
683684
formURL="forms/msSimple/lookup/placeName.xhtml"
684685
elementName="placeName"
685686
formName="placeName"
@@ -704,7 +705,7 @@
704705
<xmlTemplate src="templates/full-mss-template.xml"/>
705706
<lookup elementName="title" suppress="true"/>
706707
<lookup
707-
api="/exist/apps/majlis/api/search/citation?format=xml&amp;q="
708+
api="/exist/apps/majlis/api/search/citation?format=xml&amp;q="
708709
formURL="forms/msSimple/lookup/bibl.xhtml"
709710
elementName="bibl"
710711
formName="bibl"

src/main/formGenerator/config-persons.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@
3232
<template name="Institutions template" src="/forms/templates/org-fulltemplate.xml"/>
3333
</blankTemplates>
3434
<lookups>
35-
<lookup api="/exist/apps/majlis/api/search/placeName?format=xml&amp;q=" formURL="forms/mssTEI/lookup/placeName.xhtml" elementName="placeName" formName="placeName" lookupLabel="Look up places"/>
35+
<lookup api="/exist/apps/majlis/api/search/placeName?format=xml&amp;prefixElement=tei&amp;q=" formURL="forms/mssTEI/lookup/placeName.xhtml" elementName="placeName" formName="placeName" lookupLabel="Look up places"/>
3636
<popup formName="placeTEI" elementName="placeName" label="New Places"/>
3737
<!--
3838
formatting a request to the lookup api
3939
api: formats the request, parameters:
4040
/name of request - usually specifies the type of request or element to be searched.
4141
@format - xml/json/html
4242
@collection - collections to be searched, should match collections in your data directory
43+
@prefixElement - a prefix to use for the returned element e.g. 'tei', mutually exclusive with @wrapElement
4344
@wrapElement - element that will contain the search results, if different from the name of the request
4445
example the following searches all persNames, but returns results wrapped in author element for insertion into TEI record:
4546
/exist/apps/majlis/api/search/persName?format=xml&wrapElement=author&q=
@@ -103,7 +104,7 @@
103104
<localSchema src="schemas/person-schema.xml"/>
104105
<localSchema src="schemas/person-schema.xml"/>
105106
<xmlTemplate src="templates/persons-template.xml"/>
106-
<lookup api="/exist/apps/majlis/api/search/placeName?format=xml&amp;collection=places&amp;q="
107+
<lookup api="/exist/apps/majlis/api/search/placeName?format=xml&amp;collection=places&amp;prefixElement=tei&amp;q="
107108
formURL="forms/msSimple/lookup/placeName.xhtml"
108109
elementName="placeName"
109110
formName="placeName"
@@ -202,7 +203,7 @@
202203
<localSchema src="schemas/org-schema.xml"/>
203204
<localSchema src="schemas/org-schema.xml"/>
204205
<xmlTemplate src="templates/org-template.xml"/>
205-
<lookup api="/exist/apps/majlis/api/search/placeName?format=xml&amp;collection=places&amp;q="
206+
<lookup api="/exist/apps/majlis/api/search/placeName?format=xml&amp;collection=places&amp;prefixElement=tei&amp;q="
206207
formURL="forms/msSimple/lookup/placeName.xhtml"
207208
elementName="placeName"
208209
formName="placeName"

0 commit comments

Comments
 (0)