Skip to content

Commit

Permalink
moved dev modules to extra dev collection
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed May 30, 2014
1 parent 51143b5 commit 7d8da79
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 122 deletions.
30 changes: 16 additions & 14 deletions webapp/controller.xql
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,6 @@ else if (matches($exist:path, concat('^/', $lang, '/', wega:getVarURL('A070009',
else if (matches($exist:path, concat('^/', $lang,'/', $bibliography, '(/(', $literature, '|', $discography, '|', $scores, '))?$'))) then
local:forwardIndices('bibliography', $lang)

(: Tools :)
else if ($config:isDevelopment and matches($exist:path, concat('^/', $lang, '/', $tools, '/?$'))) then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{concat($exist:controller, '/modules/tools.xql')}">
<add-parameter name="lang" value="{$lang}"/>
</forward>
</dispatch>

(: Personen - Weiterleitung :)
else if (matches($exist:path, '^/A00\d{4}/?$')) then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
Expand Down Expand Up @@ -559,12 +551,6 @@ else if ($exist:path eq '/favicon.ico') then
<redirect url="resources/pix/weber_favicon.ico"/>
</dispatch>

(: ANT interface for development :)
else if ($config:isDevelopment and $exist:resource eq 'ant-calls.xql') then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<ignore/>
</dispatch>

(: Schemata zum Download :)
(: Redirect latest to Github :)
else if (matches($exist:path, '^/schema/latest/')) then
Expand All @@ -582,6 +568,22 @@ else if (matches($exist:path, '^/schema/v\d+\.\d+\.\d+/')) then
</error-handler>
</dispatch>

(: general forwarding of folder 'dev' for development :)
else if($config:isDevelopment and starts-with($exist:path, '/dev/')) then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{concat($exist:controller, '/modules/dev/', $exist:resource)}"/>
<error-handler>
{$error404/exist:forward}
</error-handler>
</dispatch>

(: Tools :)
else if ($config:isDevelopment and matches($exist:path, concat('^/', $lang, '/', $tools, '/?$'))) then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{concat($exist:controller, '/modules/dev/tools.xql')}">
<add-parameter name="lang" value="{$lang}"/>
</forward>
</dispatch>

else $error404
)
29 changes: 0 additions & 29 deletions webapp/modules/ID-List.xql

This file was deleted.

67 changes: 0 additions & 67 deletions webapp/modules/createNewFffiID.xql

This file was deleted.

32 changes: 32 additions & 0 deletions webapp/modules/dev/ID-List.xql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
(:~
: XQuery for use with the JUnit Test
:
: @author Peter Stadler
: @version 1.0
:)

xquery version "3.0" encoding "UTF-8";
declare namespace exist="http://exist.sourceforge.net/NS/exist";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace request="http://exist-db.org/xquery/request";
declare namespace util="http://exist-db.org/xquery/util";
declare namespace mei="http://www.music-encoding.org/ns/mei";
import module namespace config="http://xquery.weber-gesamtausgabe.de/modules/config" at "../config.xqm";
import module namespace core="http://xquery.weber-gesamtausgabe.de/modules/core" at "../core.xqm";

declare option exist:serialize "method=text media-type=text/plain indent=no omit-xml-declaration=yes encoding=utf-8";

declare function local:randomize($seq as item()*) as item()* {
for $i in $seq
let $rand := util:random()
order by $rand
return $i
};

let $docType := request:get-parameter('type','persons')
let $maxLen := number(request:get-parameter('maxLen','10'))
let $random := request:get-parameter('random','true')
let $ids := core:getOrCreateColl($docType, 'indices', true())/*/data(@xml:id)
let $ids := if($random eq 'true') then local:randomize($ids) else $ids
return
string-join(subsequence($ids, 1, $maxLen), '&#10;')
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ declare namespace exist="http://exist.sourceforge.net/NS/exist";
declare namespace xmldb="http://exist-db.org/xquery/xmldb";

import module namespace functx="http://www.functx.com";
import module namespace config="http://xquery.weber-gesamtausgabe.de/modules/config" at "config.xqm";
import module namespace core="http://xquery.weber-gesamtausgabe.de/modules/core" at "core.xqm";
import module namespace config="http://xquery.weber-gesamtausgabe.de/modules/config" at "../config.xqm";
import module namespace core="http://xquery.weber-gesamtausgabe.de/modules/core" at "../core.xqm";
(:import module namespace lang="http://xquery.weber-gesamtausgabe.de/modules/lang" at "lang.xqm";
import module namespace img="http://xquery.weber-gesamtausgabe.de/modules/img" at "img.xqm";
import module namespace norm="http://xquery.weber-gesamtausgabe.de/modules/norm" at "norm.xqm";:)
Expand Down
8 changes: 4 additions & 4 deletions webapp/modules/dev.xqm → webapp/modules/dev/dev.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ declare namespace cache = "http://exist-db.org/xquery/cache";
declare namespace util="http://exist-db.org/xquery/util";
declare namespace request="http://exist-db.org/xquery/request";
import module namespace functx="http://www.functx.com";
import module namespace wega="http://xquery.weber-gesamtausgabe.de/modules/wega" at "wega.xqm";
import module namespace facets="http://xquery.weber-gesamtausgabe.de/modules/facets" at "facets.xqm";
import module namespace config="http://xquery.weber-gesamtausgabe.de/modules/config" at "config.xqm";
import module namespace core="http://xquery.weber-gesamtausgabe.de/modules/core" at "core.xqm";
import module namespace wega="http://xquery.weber-gesamtausgabe.de/modules/wega" at "../wega.xqm";
import module namespace facets="http://xquery.weber-gesamtausgabe.de/modules/facets" at "../facets.xqm";
import module namespace config="http://xquery.weber-gesamtausgabe.de/modules/config" at "../config.xqm";
import module namespace core="http://xquery.weber-gesamtausgabe.de/modules/core" at "../core.xqm";

(:~
: Show tools tab
Expand Down
10 changes: 5 additions & 5 deletions webapp/modules/tools.xql → webapp/modules/dev/tools.xql
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ declare namespace transform="http://exist-db.org/xquery/transform";
declare namespace util="http://exist-db.org/xquery/util";
(:declare namespace cache="http://exist-db.org/xquery/cache";:)
(:declare namespace datetime="http://exist-db.org/xquery/datetime";:)
import module namespace wega="http://xquery.weber-gesamtausgabe.de/modules/wega" at "wega.xqm";
import module namespace xho="http://xquery.weber-gesamtausgabe.de/modules/xho" at "xho.xqm";
import module namespace wega="http://xquery.weber-gesamtausgabe.de/modules/wega" at "../wega.xqm";
import module namespace xho="http://xquery.weber-gesamtausgabe.de/modules/xho" at "../xho.xqm";
(:import module namespace functx="http://www.functx.com";:)
import module namespace dev="http://xquery.weber-gesamtausgabe.de/modules/dev" at "dev.xqm";
import module namespace config="http://xquery.weber-gesamtausgabe.de/modules/config" at "config.xqm";
import module namespace core="http://xquery.weber-gesamtausgabe.de/modules/core" at "core.xqm";
import module namespace lang="http://xquery.weber-gesamtausgabe.de/modules/lang" at "lang.xqm";
import module namespace config="http://xquery.weber-gesamtausgabe.de/modules/config" at "../config.xqm";
import module namespace core="http://xquery.weber-gesamtausgabe.de/modules/core" at "../core.xqm";
import module namespace lang="http://xquery.weber-gesamtausgabe.de/modules/lang" at "../lang.xqm";

declare option exist:serialize "method=xhtml media-type=text/html indent=no omit-xml-declaration=yes encoding=utf-8 doctype-public=-//W3C//DTD&#160;XHTML&#160;1.0&#160;Strict//EN doctype-system=http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";

Expand Down
2 changes: 1 addition & 1 deletion webapp/modules/getAjax.xql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ declare namespace session="http://exist-db.org/xquery/session";
declare namespace util="http://exist-db.org/xquery/util";
import module namespace ajax="http://xquery.weber-gesamtausgabe.de/modules/ajax" at "ajax.xqm";
import module namespace wega="http://xquery.weber-gesamtausgabe.de/modules/wega" at "wega.xqm";
import module namespace dev="http://xquery.weber-gesamtausgabe.de/modules/dev" at "dev.xqm";
import module namespace dev="http://xquery.weber-gesamtausgabe.de/modules/dev" at "dev/dev.xqm";
import module namespace facets="http://xquery.weber-gesamtausgabe.de/modules/facets" at "facets.xqm";
import module namespace config="http://xquery.weber-gesamtausgabe.de/modules/config" at "config.xqm";
import module namespace core="http://xquery.weber-gesamtausgabe.de/modules/core" at "core.xqm";
Expand Down

0 comments on commit 7d8da79

Please sign in to comment.