Skip to content
Browse files

temporary controller for annotation API

  • Loading branch information...
1 parent 3500087 commit 18f47252aea4ca46f7dc781e3825834dc7387262 @EfraimFeinstein EfraimFeinstein committed Jun 24, 2012
Showing with 36 additions and 2 deletions.
  1. +7 −2 code/input-conversion/wlc/wlc2jlptei.xsl2
  2. +29 −0 db/controller.xql
View
9 code/input-conversion/wlc/wlc2jlptei.xsl2
@@ -740,7 +740,10 @@ TODO:
<tei:title type="main" xml:lang="en">Notes from the Westminster Leningrad Codex</tei:title>
</xsl:with-param>
<xsl:with-param name="respons"
- as="element(tei:respons)+" select="$responsGrp-content" />
+ as="element(tei:respons)">
+ <tei:respons type="trc" locus="value"
+ target="#main" resp="/{$contributors-file-name}" />
+ </xsl:with-param>
<xsl:with-param name="annotations"
as="element(j:annotations)">
<j:annotations>
@@ -750,7 +753,9 @@ TODO:
</j:annotations>
</xsl:with-param>
<xsl:with-param name="license" as="element()+" select="$license-content" />
- <xsl:with-param name="bibliography" as="element(tei:link)" select="$bibl-content" />
+ <xsl:with-param name="bibliography" as="element(tei:link)">
+ <tei:link type="bibl" target="#main /data/{$bibliography-file-name}"/>
+ </xsl:with-param>
<xsl:with-param name="links" as="element(j:links)">
<j:links>
<xsl:apply-templates select="$tanach-as-xml//tanach"
View
29 db/controller.xql
@@ -14,6 +14,8 @@ import module namespace dindex="http://jewishliturgy.org/api/data/index"
at "/code/api/data/dindex.xqm";
import module namespace tran="http://jewishliturgy.org/api/transliteration"
at "/code/api/data/transliteration.xqm";
+import module namespace notes="http://jewishliturgy.org/api/data/notes"
+ at "/code/api/data/notes.xqm";
import module namespace orig="http://jewishliturgy.org/api/data/original"
at "/code/api/data/original.xqm";
import module namespace src="http://jewishliturgy.org/api/data/sources"
@@ -91,6 +93,33 @@ declare function local:do-data(
return orig:delete($tokens[4])
default
return $local:disallowed
+ case "notes"
+ return
+ switch (api:get-method())
+ case "GET"
+ return
+ if ($tokens[4])
+ then
+ if ($tokens[5] = "access")
+ then notes:get-access($tokens[4])
+ else notes:get($tokens[4])
+ else
+ let $query := request:get-parameter("q", "")
+ let $start := request:get-parameter("start", 1)
+ let $max-results := request:get-parameter("max-results", 100)
+ return
+ notes:list($query, $start, $max-results)
+ case "PUT"
+ return
+ if ($tokens[5] = "access")
+ then notes:put-access($tokens[4], request:get-data())
+ else notes:put($tokens[4], request:get-data())
+ case "POST"
+ return notes:post(request:get-data())
+ case "DELETE"
+ return notes:delete($tokens[4])
+ default
+ return $local:disallowed
case "transliteration"
return
switch (api:get-method())

0 comments on commit 18f4725

Please sign in to comment.
Something went wrong with that request. Please try again.