Mercurial > hg > mpdl-group
comparison software/eXist/webapp/mpdl/interface/queryResult.xql @ 11:d6f528ad5d96
TEI Unterst?tzung, Fehlerbehebungen, externe Objekte
| author | Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de> |
|---|---|
| date | Fri, 11 Mar 2011 13:34:02 +0100 |
| parents | 5589d865af7a |
| children |
comparison
equal
deleted
inserted
replaced
| 10:59ff47d1e237 | 11:d6f528ad5d96 |
|---|---|
| 4 import module namespace mpdl-lucene = "http://www.mpiwg-berlin.mpg.de/ns/mpdl/lucene/search" at "../lucene/search.xql"; | 4 import module namespace mpdl-lucene = "http://www.mpiwg-berlin.mpg.de/ns/mpdl/lucene/search" at "../lucene/search.xql"; |
| 5 | 5 |
| 6 declare namespace request="http://exist-db.org/xquery/request"; | 6 declare namespace request="http://exist-db.org/xquery/request"; |
| 7 | 7 |
| 8 declare namespace echo="http://www.mpiwg-berlin.mpg.de/ns/echo/1.0/"; | 8 declare namespace echo="http://www.mpiwg-berlin.mpg.de/ns/echo/1.0/"; |
| 9 declare namespace TEI="http://www.tei-c.org/ns/1.0"; | |
| 10 | |
| 9 declare namespace dc="http://purl.org/dc/elements/1.1/"; | 11 declare namespace dc="http://purl.org/dc/elements/1.1/"; |
| 10 declare namespace dct="http://purl.org/dc/terms/1.0/"; | 12 declare namespace dct="http://purl.org/dc/terms/1.0/"; |
| 11 declare namespace rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; | 13 declare namespace rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; |
| 12 | |
| 13 | 14 |
| 14 let $queryType := request:get-parameter("queryType", "") | 15 let $queryType := request:get-parameter("queryType", "") |
| 15 let $docbase := request:get-parameter("docbase", "") | 16 let $docbase := request:get-parameter("docbase", "") |
| 16 let $output := request:get-parameter("output", "html") | 17 let $output := request:get-parameter("output", "html") |
| 17 let $attribute1 := request:get-parameter("attribute1", "") | 18 let $attribute1 := request:get-parameter("attribute1", "") |
| 39 then $docPathMorph | 40 then $docPathMorph |
| 40 else $docPathStandard | 41 else $docPathStandard |
| 41 | 42 |
| 42 let $docBaseArch := "archimedes" | 43 let $docBaseArch := "archimedes" |
| 43 let $docBaseEcho := "echo" | 44 let $docBaseEcho := "echo" |
| 45 let $docBaseTei := "tei" | |
| 44 let $fulltextMorphArchDocPath := concat($docPathMorph, "/", $docBaseArch, "/", $language) | 46 let $fulltextMorphArchDocPath := concat($docPathMorph, "/", $docBaseArch, "/", $language) |
| 45 let $fulltextMorphEchoDocPath := concat($docPathMorph, "/", $docBaseEcho, "/", $language) | 47 let $fulltextMorphEchoDocPath := concat($docPathMorph, "/", $docBaseEcho, "/", $language) |
| 48 let $fulltextMorphTeiDocPath := concat($docPathMorph, "/", $docBaseTei, "/", $language) | |
| 46 let $fulltextMorphCollection := | 49 let $fulltextMorphCollection := |
| 47 if(contains($docbase, $docBaseArch) and contains($docbase, $docBaseEcho)) | 50 if(contains($docbase, $docBaseArch) and contains($docbase, $docBaseEcho) and contains($docbase, $docBaseTei)) |
| 51 then collection($fulltextMorphArchDocPath, $fulltextMorphEchoDocPath, $fulltextMorphTeiDocPath) | |
| 52 else if(contains($docbase, $docBaseArch) and contains($docbase, $docBaseEcho) and not(contains($docbase, $docBaseTei))) | |
| 48 then collection($fulltextMorphArchDocPath, $fulltextMorphEchoDocPath) | 53 then collection($fulltextMorphArchDocPath, $fulltextMorphEchoDocPath) |
| 49 else if(contains($docbase, $docBaseArch) and not(contains($docbase, $docBaseEcho))) | 54 else if(contains($docbase, $docBaseArch) and not(contains($docbase, $docBaseEcho)) and contains($docbase, $docBaseTei)) |
| 55 then collection($fulltextMorphArchDocPath, $fulltextMorphTeiDocPath) | |
| 56 else if(not(contains($docbase, $docBaseArch)) and contains($docbase, $docBaseEcho) and contains($docbase, $docBaseTei)) | |
| 57 then collection($fulltextMorphEchoDocPath, $fulltextMorphTeiDocPath) | |
| 58 else if(contains($docbase, $docBaseArch) and not(contains($docbase, $docBaseEcho)) and not(contains($docbase, $docBaseTei))) | |
| 50 then collection($fulltextMorphArchDocPath) | 59 then collection($fulltextMorphArchDocPath) |
| 51 else if(not(contains($docbase, $docBaseArch)) and contains($docbase, $docBaseEcho)) | 60 else if(not(contains($docbase, $docBaseArch)) and contains($docbase, $docBaseEcho) and not(contains($docbase, $docBaseTei))) |
| 52 then collection($fulltextMorphEchoDocPath) | 61 then collection($fulltextMorphEchoDocPath) |
| 62 else if(not(contains($docbase, $docBaseArch)) and not(contains($docbase, $docBaseEcho)) and contains($docbase, $docBaseTei)) | |
| 63 then collection($fulltextMorphTeiDocPath) | |
| 53 else () | 64 else () |
| 54 | 65 |
| 55 let $fulltextStandardArchDocPath := concat($docPathStandard, "/", $docBaseArch) | 66 let $fulltextStandardArchDocPath := concat($docPathStandard, "/", $docBaseArch) |
| 56 let $fulltextStandardEchoDocPath := concat($docPathStandard, "/", $docBaseEcho) | 67 let $fulltextStandardEchoDocPath := concat($docPathStandard, "/", $docBaseEcho) |
| 68 let $fulltextStandardTeiDocPath := concat($docPathStandard, "/", $docBaseTei) | |
| 57 let $fulltextStandardCollectionStr := | 69 let $fulltextStandardCollectionStr := |
| 58 if(contains($docbase, $docBaseArch) and contains($docbase, $docBaseEcho)) | 70 if(contains($docbase, $docBaseArch) and contains($docbase, $docBaseEcho) and contains($docbase, $docBaseTei)) |
| 71 then concat("collection('", $fulltextStandardArchDocPath, "', '", $fulltextStandardEchoDocPath, "', '", $fulltextStandardTeiDocPath, "')") | |
| 72 else if(contains($docbase, $docBaseArch) and contains($docbase, $docBaseEcho) and not(contains($docbase, $docBaseTei))) | |
| 59 then concat("collection('", $fulltextStandardArchDocPath, "', '", $fulltextStandardEchoDocPath, "')") | 73 then concat("collection('", $fulltextStandardArchDocPath, "', '", $fulltextStandardEchoDocPath, "')") |
| 60 else if(contains($docbase, $docBaseArch) and not(contains($docbase, $docBaseEcho))) | 74 else if(contains($docbase, $docBaseArch) and not(contains($docbase, $docBaseEcho)) and contains($docbase, $docBaseTei)) |
| 75 then concat("collection('", $fulltextStandardArchDocPath, "', '", $fulltextStandardTeiDocPath, "')") | |
| 76 else if(not(contains($docbase, $docBaseArch)) and contains($docbase, $docBaseEcho) and contains($docbase, $docBaseTei)) | |
| 77 then concat("collection('", $fulltextStandardEchoDocPath, "', '", $fulltextStandardTeiDocPath, "')") | |
| 78 else if(contains($docbase, $docBaseArch) and not(contains($docbase, $docBaseEcho)) and not(contains($docbase, $docBaseTei))) | |
| 61 then concat("collection('", $fulltextStandardArchDocPath, "')") | 79 then concat("collection('", $fulltextStandardArchDocPath, "')") |
| 62 else if(not(contains($docbase, $docBaseArch)) and contains($docbase, $docBaseEcho)) | 80 else if(not(contains($docbase, $docBaseArch)) and contains($docbase, $docBaseEcho) and not(contains($docbase, $docBaseTei))) |
| 63 then concat("collection('", $fulltextStandardEchoDocPath, "')") | 81 then concat("collection('", $fulltextStandardEchoDocPath, "')") |
| 82 else if(not(contains($docbase, $docBaseArch)) and not(contains($docbase, $docBaseEcho)) and contains($docbase, $docBaseTei)) | |
| 83 then concat("collection('", $fulltextStandardTeiDocPath, "')") | |
| 84 else "" | |
| 85 let $metadataStr := concat("(", $fulltextStandardCollectionStr, "/archimedes/info", "|" , $fulltextStandardCollectionStr, "/echo:echo/echo:metadata", "|" , $fulltextStandardCollectionStr, "/TEI:TEI/TEI:teiHeader", ")") | |
| 86 let $fulltextStandardCollection := | |
| 87 if($fulltextStandardCollectionStr != "") | |
| 88 then util:eval($fulltextStandardCollectionStr) | |
| 64 else () | 89 else () |
| 65 let $metadataStr := concat("(", $fulltextStandardCollectionStr, "/archimedes/info", "|" , $fulltextStandardCollectionStr, "/echo:echo/echo:metadata", ")") | |
| 66 let $fulltextStandardCollection := util:eval($fulltextStandardCollectionStr) | |
| 67 | 90 |
| 68 let $isAttributeSearch := | 91 let $isAttributeSearch := |
| 69 if ($queryType = "attribute") | 92 if ($queryType = "attribute") |
| 70 then true() | 93 then true() |
| 71 else false() | 94 else false() |
