Commit ffab83ea authored by Mathias Goebel's avatar Mathias Goebel 馃帬
Browse files

\#SADE Release 4.1.0 馃

\# Dynamic Duck

\## Release Notes
This release serves a few improvements and bugfixes. From now on we are
utilizing Gitlab releases and keep build artifacts corresponding to
releases in place at https://gitlab.gwdg.de/SADE/SADE/-/releases

We would love to upgrade for eXist-db 5.0.0 but there is [a fixed
regression](https://github.com/eXist-db/exist/pull/3047) we need to get
in a forthcoming release of eXist-db.

\## Features
* upgrade to eXist 4.7.1
* extended documentation (#54, README.md, installation)
* cleanup the config (#71)
* test for ant version on build, so one will be harmed by the
`setpermissions` task

\## Bugfixes
* restrict fork name #67
* facted search (#75, #79 and #78)
* many others like #61, #60, #59
parents 17f89eac f9eb22ff
# This GitLab runner configuration ensures every version of the SADE app is
# working properly before making it public.
#
# Final versions of SADE (i.e. develop or master branches) that have been built
# successfully are uploaded to DARIAH-DE's public eXist repository at
# https://ci.de.dariah.eu/exist-repo/index.html where other projects can reuse it.
#
# Please make sure you have all necessary passwords set as secret variables.
#
# In case you're using SADE for an non-DARIAH-DE project, 'upload' should be
# adapted or completely omitted.
#
# Environment variables used:
# * ${EXIST_UPLOAD_PW} - the password needed to push to DARIAH-DE's eXist repo
# * ${FILENAME} - the name if the XAR package created, e.g. SADE-develop-1-1-1.xar
# a general image that contains everything eXist-db needs to run properly
image: docker.gitlab.gwdg.de/fontane-notizbuecher/build:latest
stages:
......@@ -5,6 +22,10 @@ stages:
- test
- deploy
# in the build stage eXist-db is (as the name implies) built considering all
# dependencies that are stated in build.properties and/or generic.xml.
# build-develop is triggered after pushing/merging into any branch except master
build-develop:
except:
- master
......@@ -17,9 +38,12 @@ build-develop:
- build/*.xar
- test/
# build-master is only triggered after pushing/merging into master
build-master:
only:
- master
- tags
stage: build
script:
- cp master.build.properties local.build.properties
......@@ -29,13 +53,15 @@ build-master:
- build/*.xar
- test/
# eXist-db is installed and all tests stated in post-install.xq are executed.
# ATTENTION: tests failing in post-install.xq will NOT cause the stage to fail!
installation:
except:
- tags
stage: test
script:
- bash test/eXist-db-*/bin/startup.sh | tee output.log &
# wait for eXist
# wait for eXist to have started
- while [ $(curl --head --silent http://localhost:8080 | grep -c "200 OK") == 0 ]; do sleep 2s; done
# shutdown eXist
- bash test/eXist-db-*/bin/shutdown.sh
......@@ -45,9 +71,11 @@ installation:
- output.log
- test/tests-*.xml
- test/eXist-db-*/webapp/WEB-INF/logs/expath-repo.log
# this enables us to get information like test coverage.
reports:
junit: test/tests-*.xml
upload:
only:
- master
......@@ -58,3 +86,35 @@ upload:
script:
- FILENAME=$(ls build/*.xar)
- curl -u ci:${EXIST_UPLOAD_PW} -X POST -F file=@${FILENAME} https://ci.de.dariah.eu/exist-upload
# when a git flow release is made, a tag will be pushed starting this job. it
# will keep the resulting artifact from job number one and it will set up a
# Gitlab release at the repo. therefore the merge message starting at the release
# branch should be written in markdown.
release:
stage: deploy
only:
- tags
script:
# get number of first job in pipeline (assuming that this will create the needed artifact)
# it is also possible to query for a job name by altering the jq filter
- 'curl --output jobs.json --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/pipelines/$CI_PIPELINE_ID/jobs"'
- CI_JOB_TARGET=$(jq ".[0].id" < jobs.json)
- echo $CI_JOB_TARGET
# keep artifact (release will link there)
- 'curl --request POST --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/$CI_JOB_TARGET/artifacts/keep"'
# create release data
# parse commit message (markdown, lines starting with 鈥淺鈥)
- MARKDOWN=$(echo "$CI_COMMIT_MESSAGE" | sed 's=^\\==g')
# prepare the json file
- 'jq
".name = \"$CI_PROJECT_PATH $CI_COMMIT_TAG\" |
.tag_name = \"$CI_COMMIT_TAG\" |
.description = \"$MARKDOWN\" |
.assets.links[0].name = \"package\" |
.assets.links[0].url = \"https://gitlab.gwdg.de/$CI_PROJECT_PATH/-/jobs/$CI_JOB_TARGET/artifacts/download\"
" < gitlab-release.json.tmpl > gitlab-release.json'
- 'curl --header "Content-Type: application/json" --header "PRIVATE-TOKEN: $GITLAB_TOKEN" --data @gitlab-release.json --request POST $CI_API_V4_URL/projects/$CI_PROJECT_ID/releases'
artifact:
paths:
- gitlab-release.json
File mode changed from 100644 to 100755
#!/bin/bash
# see https://gist.github.com/samhemelryk/8857553
#
# This pre-commit hook checks that you havn't left and DONOTCOMMIT tokens in
# your code when you go to commit.
#
# To use this script copy it to .git/hooks/pre-commit and make it executable.
#
# This is provided just as an example of how to use a pre-commit hook to
# catch nasties in your code.
# Work out what to diff against, really HEAD will work for any established repository.
if git rev-parse --verify HEAD >/dev/null 2>&1
then
......@@ -17,10 +10,13 @@ else
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
diffstr=`git diff --cached $against | grep -e '^\+.*DONOTCOMMIT.*$'`
if [[ -n "$diffstr" ]] ; then
echo "You have left DONOTCOMMIT in your changes."
echo "It is important that you read and understand them,"
echo "before you proceed and remove them."
exit 1
fi
function test {
diffstr=`git diff $against | grep "$1" | grep -e "^+"`
if [[ -n "$diffstr" ]] ; then
echo "You have left $1 in your changes, you can't commit until it has been removed."
exit 1
fi
}
test console:log\(
test console=\"
#!/bin/bash
# copy the default hooks
WHAT=$(ls .hooks/ -I "*flow*" -1)
for FILE in $WHAT
do
cp .hooks/$FILE .git/hooks/$FILE
done;
exit
#!/bin/bash
# copy the default hooks
WHAT=$(ls .hooks/ -I "*flow*" -1)
for FILE in $WHAT
do
cp .hooks/$FILE .git/hooks/$FILE
done;
exit
#!/bin/bash
# copy the default hooks
WHAT=$(ls .hooks/ -I "*flow*" -1)
for FILE in $WHAT
do
cp .hooks/$FILE .git/hooks/$FILE
done;
exit
# Changelog
This project's changelog is maintained in the database's [`repo.xml`](https://gitlab.gwdg.de/SADE/SADE/blob/develop/repo.xml).
......@@ -17,8 +17,8 @@ tracker](https://gitlab.gwdg.de/SADE/SADE/issues). This is a good place to start
a discussion about your request and we can establish a basic collaboration. If
you do not have an account there, do not hesitate to
[register](https://gwdg.de/registration). Because this is a rather generic account,
we need a short information when you received your user name to add your account to GitLab. Please send it to
[sade-owner@sub.uni-goettingen.de](mailto:sade-owner@sub.uni-goettingen.de).
we need a short information when you received your user name to add your account
to GitLab. Please send it to [sade-owner@sub.uni-goettingen.de](mailto:sade-owner@sub.uni-goettingen.de).
A ticket is not necessary for [trivial
changes](https://puppet.com/community/trivial-patch-exemption-policy#general-guidance-for-using-this-policy).
......@@ -71,5 +71,45 @@ you can always ask for assistance.
After feedback has been given we expect responses within two weeks. After two
weeks we may close the PR if it isn't showing any activity.
# Further readings
## Internal Workflow
This part is dedicated to the internal workflow and reflects what is considered
to be best practice at Research and Development at SUB G枚ttingen. For an
extensive description please consult the [RDD Technical Reference](https://github.com/subugoe/rdd-technical-reference/).
### git flow
We are using [`git flow`](https://danielkummer.github.io/git-flow-cheatsheet/).
This means that all developments will be reviewed before they will be merged to
the `develop` branch. The `develop` branch is the default one.
When a branch is dedicated to a ticket, the branch name should start with the
number of the ticket and match a pattern like `(bugfix|hotfix|feature)/#\d+-[a-z\-]`.
All issues will be arranged in [milestones](https://gitlab.gwdg.de/groups/SADE/-/milestones). Milestones are
always group-wide, so we combine tickets from all projects at the [SADE group](https://gitlab.gwdg.de/groups/SADE)
to a single milestone.
All projects in the SADE group are using [branch protection](https://docs.gitlab.com/ee/user/project/protected_branches.html) ([local documentation](https://gitlab.gwdg.de/help/user/project/protected_branches))
for `master` and `develop` branches. No one is allowed to push
directly to these branches except for the release workflow. To be able to
merge develop to master locally and to use the git flow command line tools, both
branches will be set to **unprotected** (allow to push for maintainers) for this
single action.
### Merge requests (MR)
Merge requests are peer reviewed before merging them into `develop`.
Please choose a person you see fit as assignee.
Always squash commit your MR and make sure the source branch (hotfix/bugfix/feature) is deleted after the MR has been accepted.
In case an assignee wants something to be changed in the MR, the MR is reassigned to the original reviser of the issue.
After implementing (or declining) the desired suggestions, the MR is reassigned to the original assignee.
If a merge conflict occurs the person who has proposed the MR is responsible for solving all conflicts.
### Meetings
Once in a month all team members will meet at an informal (and usually internal)
meeting to discuss issues and proceedings. If external participants are interested
in, they can contact us via [this e-mail address](mailto:sade-owner@sub.uni-goettingen.de).
## Further readings
This guide is inspired by [Puppetlabs/puppet/CONTRIBUTING.md](https://github.com/puppetlabs/puppet/blob/74c759f43f99789455ca52a26eeee20a7f6e4782/CONTRIBUTING.md) and [thoughtbot/factory_bot_rails/CONTRIBUTING.md](https://github.com/thoughtbot/factory_bot_rails/blob/c5d11518d7168ac28c80cee3d55e0d7e251dc49b/CONTRIBUTING.md). Both are mentioned in a [blog article at GitHub](https://blog.github.com/2012-09-17-contributing-guidelines/).
# SADE
Scalable Architecture for Digital Editions
# SADE 鈥 Scalable Architecture for Digital Editions
SADE ( Scalable Architecture for Digital Editions) it an application for
[eXist-db](https://exist-db.org) that offers a set of useful features to quickly build a website for digital editions basing on [TEI](http://www.tei-c.org)-encoded texts.
This is the main application for SADE. It serves as XAR package according to the
[EXPath Packaging System](http://expath.org/spec/pkg) and is created for the
[eXist database](https://exist-db.org)
[EXPath Packaging System](http://expath.org/spec/pkg) and is created as an application for
[eXist-db](https://exist-db.org).
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
### Prerequisites
* ant >= 1.10.0
### Local installation
To get a version of SADE running locally on your computer, clone this repository in your preferred git directory:
```
mkdir SADE
cd SADE
git clone git@gitlab.gwdg.de:SADE/SADE.git
```
Once the repository is cloned, run
```
ant test
```
which installs all necessary dependencies and creates a local version of SADE in `/test`.
To start the database, run
```
bash test/eXist-db-*/bin/startup.sh
```
SADE's backend is now available at `localhost:8080`. To have a look at the website, view `http://localhost:8080/exist/apps/sade/index.html` in your preferred browser.
## The git repo
This repo brings you the sources of the application which contain a brief
## The Git repo
This repo contains the sources of the application which contain a brief
documentation as long as you are not dealing with a fork. Please find the
documentation in the folder `docs` where they are stored in Markdown. Any
default installation of this package serves the documentation as website
integrated in your template and in your instance.
### git hooks
### Git hooks
The folder `.hooks` contains git hook scripts to be executed on certain git
events. The usage of these scripts is recommended, as they ensure a smooth
workflow.
......
project.name=http://sade.textgrid.de/ns/SADE-develop
project.version=4.0.0
project.version=4.1.0
project.title=Scalable Architecture for Digital Editions powered by TextGrid
project.abbrev=SADE-develop
project.processorversion=4.5.0
project.processorversion=4.6.1
destfile=${build.dir}/${project.abbrev}-${project.version}.xar
test.dir=test
......
......@@ -7,7 +7,15 @@
<property file="build.properties"/>
<xmlproperty file="expath-pkg.xml.tmpl"/>
<target name="xar" depends="cleanup">
<antversion property="antversion"/>
<target name="antversion-test">
<antversion property="antversionReady" atleast="1.10"/>
<fail unless="antversionReady">installed version of ant (${antversion}) is lower than the required one (1.10.0)</fail>
<echo message="installed version of ant (${antversion}) is satisfying"/>
</target>
<target name="xar">
<copy file="expath-pkg.xml.tmpl" tofile="expath-pkg.xml" filtering="true" overwrite="true">
<filterset>
<filter token="project.version" value="${project.version}"/>
......@@ -27,7 +35,8 @@
<delete dir="${test.dir}"/>
</target>
<target name="test" depends="xar">
<target name="test" depends="antversion-test, cleanup, xar">
<!-- task setpermissions requries at least ant 1.10.0 -->
<get src="https://bintray.com/existdb/releases/download_file?file_path=eXist-db-${project.processorversion}.tar.bz2" dest="${build.dir}/eXist-db-${project.processorversion}.tar.bz2" skipexisting="true" />
<untar src="${build.dir}/eXist-db-${project.processorversion}.tar.bz2" dest="${test.dir}" compression="bzip2" />
<setpermissions mode="755">
......
......@@ -69,11 +69,6 @@
<module key="multiviewer">
<param key="xslt">
<stylesheet namespace="http://www.tei-c.org/ns/1.0" location="_assets/TEI-stylsheets/html5/html5.xsl"/>
<stylesheet namespace="http://blumenbach-online.de/blumenbachiana" local="true" location="xslt/bol.xsl">
<parameters>
<param name="imgParams" value="?dh=200"/>
</parameters>
</stylesheet>
</param>
</module>
......
# SADE
SADE, an acronym for 芦Scalable Architecture for Digital Editions禄, is a software
package that includes many components, which are particularly suitable for
developing and displaying a digital edition. It focuses on the presentation of
XML documents that follow the guidelines of the Text Encoding Initiative (TEI).
Since 2012 a larger developer community has constantly been working on this
software, which was originally developed at the Berlin-Brandenburg Academy of
Sciences and Humanities (BBAW) as part of the digitization initiative []芦The
Electronic Life Of The Academy禄 (TELOTA)](http://www.bbaw.de/en/telota).
Contributors are among others the
[BBAW](http://www.bbaw.de/), the [Austrian Academy of Sciences](https://www.oeaw.ac.at) (OeAW; as part of the project CLARIN:
Common Language Resources and Technology Infrastructure), the [Max Planck
Institute for the History of Science ](https://www.mpiwg-berlin.mpg.de) (MPI-WG), the [Cologne Center for
eHumanities](http://cceh.uni-koeln.de) (CCEH) and the [G枚ttingen State and University Library}(https://www.sub.uni-goettingen.de) (SUB; as
part of the project TextGrid).
The software is based on the XML database [eXist-db](https://exist-db.org) and its
up to date version itself is a customization. It was developed for the TextGrid
infrastructure. Over the years a few components became obsolete, so the current
version is a completely rewritten one.
application for the XML database [eXist-db](https://exist-db.org). It includes many [components](features.md) which are particularly suitable for developing and displaying a digital edition. It focuses on the presentation of
XML documents that follow the guidelines of the Text Encoding Initiative ([TEI](http://www.tei-c.org)).
## TextGrid flavored SADE
This version is prepared to present data transferred via the [TextGrid](https://textgrid.de/)
Laboratory. You can use the [SADE Publish Tool Plug-In](https://wiki.de.dariah.eu/display/TextGrid/Publish+Tool+SADE) in the Lab for an easy data ingest. However, SADE can be run without using TextGrid at all.
## Features
SADE currently offers several features that help you set up a digital edition, e.g.:
* a [faceted search](faceted-search.md)
* a tool for display [multiple languages](multilingual.md) on the website
* a [highlight.js](https://highlightjs.org/) compatible [code viewer](code-viewer.md)
and many more.
For a full overview see [SADE's feature list](features.md).
## TextGrid
This version is prepared to present data transferred via the [TextGrid](https://textgrid.de/)
Laboratory. You can use the [SADE Publish Tool Plug-In](https://wiki.de.dariah.eu/display/TextGrid/Publish+Tool+SADE) in the Lab for an easy data ingest.
## Development
Get an overview of the complete architecture and an entry point to start
developing right now at the [Developers Guide](develop.md).
developing right now at the [Developer's Guide](develop.md).
You can find our git repositories at
[GWDG's Gitlab](https://gitlab.gwdg.de/SADE/).
We are happy to get your bug reports and feature requests!
We are happy to get your feature requests and bug reports!
## History
Since 2012 a larger developer community has constantly been working on this
software, which has originally been developed at the [Berlin-Brandenburg Academy of
Sciences and Humanities (BBAW)](http://www.bbaw.de/) as part of the digitization initiative 芦The
Electronic Life Of The Academy禄 ([TELOTA](http://www.bbaw.de/en/telota)).
Contributors are among others the [BBAW](http://www.bbaw.de/), the [Austrian Academy of Sciences](https://www.oeaw.ac.at) (OeAW; as part of the project CLARIN: Common Language Resources and Technology Infrastructure), the [Max Planck Institute for the History of Science ](https://www.mpiwg-berlin.mpg.de) (MPI-WG), the [Cologne Center for
eHumanities](http://cceh.uni-koeln.de) (CCEH) and the [G枚ttingen State and University Library](https://www.sub.uni-goettingen.de) (SUB; as part of the [TextGrid](http://www.textgrid.de) project).
This TextGrid flavored SADE has been largely refactored, updated and further developed since 2015 by G枚ttingen State and University Library.
# Install SADE
## Debian / Ubuntu
SADE is provided as Debian package for Debian based Linux distributions like Ubuntu.
Latest snapshot development packages can be downloaded from
[https://ci.de.dariah.eu/packages/pool/snapshots/s/sade/](https://ci.de.dariah.eu/packages/pool/snapshots/s/sade/)
## All Operating Systems
Make sure to have [Java](https://www.java.com/de/download/) at least in version 1.8 installed.
Download SADE as zip file:
* [latest release](https://gitlab.gwdg.de/SADE/build/-/jobs/artifacts/master/download?job=build-master) - recommended
* [lastest unstable and untested build](https://gitlab.gwdg.de/SADE/build/-/jobs/artifacts/develop/download?job=build-develop)
https://example.com/<namespace>/<project>/-/jobs/artifacts/<ref>/download?job=<job_name>
https://gitlab.gwdg.de/SADE/build/-/jobs/artifacts/master/download?job=build-master
Unzip the file `artifacts.zip`and change to directory `build/sade/bin`
Start the service with `./startup.sh` (Linux/Mac) or `startup.bat` (Windows).
If you have problems starting SADE this way you may also try to change to directory `build/sade` and enter `java -jar start.jar jetty`
Finally eXist front and back end is available at [http://localhost:8080/](http://localhost:8080/) and the local SADE is visible at
[http://localhost:8080/exist/apps/sade/index.html](http://localhost:8080/exist/apps/sade/index.html).
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://expath.org/ns/pkg"
name="http://sade.textgrid.de/ns/SADE-develop"
abbrev="SADE-develop"
version="3.0.1"
spec="1.0">
<title>Scalable Architecture for Digital Editions powered by TextGrid</title>
<dependency processor="http://exist-db.org" semver-min="4.5.0"/>
<dependency package="http://exist-db.org/apps/shared"/>
<dependency package="https://sade.textgrid.de/ns/assets-develop"/>
<dependency package="http://www.functx.com"/>
<dependency package="http://exist-db.org/apps/markdown"/>
</package>
{
"name": "",
"tag_name": "",
"description": "",
"assets": {
"links": [{
"name": "",
"url": ""
}]
}
}
......@@ -98,24 +98,24 @@ return
:
:)
declare function app:recentlyPublished($node as node(), $model as map(*), $howmany) as map(*)* {
let $collection-uri := $config:app-root || "/" || config:get("project-id") || "/meta"
return if( not(xmldb:collection-available($collection-uri)) ) then () else
let $last-resources :=
for $resource in xmldb:get-child-resources($collection-uri)
let $last-modified := xmldb:last-modified($collection-uri, $resource)
order by $last-modified descending
return
$resource
let $collection-uri := $config:app-root || "/" || config:get("project-id") || "/meta"
return if( not(xmldb:collection-available($collection-uri)) ) then () else
let $last-resources :=
for $resource in xmldb:get-child-resources($collection-uri)
let $last-modified := xmldb:last-modified($collection-uri, $resource)
order by $last-modified descending
return
$resource
let $metadata := $last-resources[1,2,3] ! doc( $collection-uri || "/" || . )
return
map { "last-resources": $metadata[1,2,3] }
let $metadata := $last-resources[1,2,3] ! doc( $collection-uri || "/" || . )
return
map { "last-resources": $metadata[1,2,3] }
};
declare function app:recentlyPublished-link($node as node(), $model as map(*), $num as xs:integer) {
<a href="./{$model("last-resources")[$num]//tgmd:textgridUri/string() => replace(":", "%3A")}">
<img class="media-object" src="~assets/generic/icons/{replace($model("last-resources")[$num]//tgmd:format, "/", "-")}.svg" alt="{string($model("last-resources")[$num]//tgmd:format)}"/>
</a>
<a href="./{$model("last-resources")[$num]//tgmd:textgridUri/string() => replace(":", "%3A")}">
<img class="media-object" src="~assets/generic/icons/{replace($model("last-resources")[$num]//tgmd:format, "/", "-")}.svg" alt="{string($model("last-resources")[$num]//tgmd:format)}"/>
</a>
};
declare function app:recentlyPublished-title($node as node(), $model as map(*), $num as xs:integer) {
......@@ -123,41 +123,41 @@ declare function app:recentlyPublished-title($node as node(), $model as map(*),
};
declare function app:recentlyPublished-description($node as node(), $model as map(*), $num as xs:integer) {
let $lastModinLab := $model("last-resources")[$num]//tgmd:lastModified/substring-before(., ".")
let $info := if($lastModinLab = "") then () else
"This document was last modified in the Lab at "
|| $lastModinLab
|| "."
let $root-name := ($model("last-resources")[$num]//tgrel:rootElementLocalPart/string(.))[1]
let $namespace := ($model("last-resources")[$num]//tgrel:rootElementNamespace/string(@rdf:resource))[1]
let $additionalInfo := if($root-name = "") then () else
"Its root element ("
|| $root-name
|| ") is in the 禄"
|| $namespace
|| "芦 namespace."
let $lastModinLab := $model("last-resources")[$num]//tgmd:lastModified/substring-before(., ".")
let $info := if($lastModinLab = "") then () else
"This document was last modified in the Lab at "
|| $lastModinLab
|| "."
let $root-name := ($model("last-resources")[$num]//tgrel:rootElementLocalPart/string(.))[1]
let $namespace := ($model("last-resources")[$num]//tgrel:rootElementNamespace/string(@rdf:resource))[1]
let $additionalInfo := if($root-name = "") then () else
"Its root element ("
|| $root-name
|| ") is in the 禄"
|| $namespace
|| "芦 namespace."
return
$info || $additionalInfo
return
$info || $additionalInfo
};
declare
function app:featuredWorks($node as node(), $model as map(*)) {
let $collection-uri := $config:app-root || "/" || config:get("project-id") || "/meta"
return if( not(xmldb:collection-available($collection-uri)) ) then () else
let $largest-resources :=
for $extent in collection($collection-uri)//tgmd:extent
order by number($extent/text()) descending
return
$extent/ancestor::tgmd:MetadataContainerType
let $collection-uri := $config:app-root || "/" || config:get("project-id") || "/meta"
return if( not(xmldb:collection-available($collection-uri)) ) then () else
let $largest-resources :=
for $extent in collection($collection-uri)//tgmd:extent
order by number($extent/text()) descending
return
$extent/ancestor::tgmd:MetadataContainerType
return
map {
"largest-resources": $largest-resources[1,2,3,4],
"largest-extent": $largest-resources[1]//tgmd:extent/string()
}
return
map {
"largest-resources": $largest-resources[1,2,3,4],
"largest-extent": $largest-resources[1]//tgmd:extent/string()
}
};
declare function app:featuredWorks-a($node as node(), $model as map(*)) {
......@@ -230,15 +230,32 @@ element { name($node) } {
declare
%templates:wrap
function app:rewriteLink($ref as xs:string) as xs:string {
let $lang := app:getLanguage()
let $base-url := tokenize($ref, "\?|#")[1]
let $get-parameter := tokenize(substring-after($ref, "?"), "#")[1]
let $get-parameter := if(contains($get-parameter, "lang="))
then $get-parameter
else
(tokenize($get-parameter, "&amp;")[.!=""],
"lang="||$lang)
let $anchor := substring-after($ref, "#")
let $lang := app:getLanguage()
let $base-url := tokenize($ref, "\?|#")[1]
let $get-parameter := tokenize(substring-after($ref, "?"), "#")[1]
let $get-parameter :=
if(contains($get-parameter, "lang=")) then $get-parameter
else (tokenize($get-parameter, "&amp;")[. != ""], "lang=" || $lang)
let $anchor := substring-after($ref, "#")
(:~
: special rewrite for .md files in $config:app-root /docs.
: adds a lang suffix and loads the lang specific .md file.
: in case this file does not exist it loads the .md file without langsuffix, so the english one.
: :)
let $base-url :=