Dear Gitlab users, due to maintenance reasons, Gitlab will not be available on Thursday 30.09.2021 from 5:00 pm to approximately 5:30 pm.

Commits (60)
.build/
build/
test/
local.build.properties
expath-pkg.xml
node_modules
.npm
# 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
# Release versions of SADE 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
---
# pipelines are only created on commits to open merge request branches and
# merges to the default branch
workflow:
rules:
- if: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
.npm-setup: &npm-setup
- curl -sL https://deb.nodesource.com/setup_14.x | bash -
- apt-get install -y nodejs
- npm ci --unsafe-perm --cache .npm --prefer-offline
stages:
- build
- test
- deploy
- release
# 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
- tags
stage: build
script:
- ant test
artifacts:
paths:
- build/*.xar
- test/
default:
# a general image that contains everything eXist-db needs to run properly
image: docker.gitlab.gwdg.de/fontane-notizbuecher/build:latest
# 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
- ant test
artifacts:
paths:
- 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 &
# build the xar-file and prepare a test environment
- ./build_test
- bash test/exist-distribution-*/bin/startup.sh | tee output.log &
# wait for eXist to have started
- while [ $(curl --head --silent http://localhost:8080 | grep -c "200 OK") == 0 ]; do sleep 2s; done
- while [ $(curl --head --silent http://localhost:8080 | grep -c "200 OK") == 0 ]; do sleep 1s; done
# shutdown eXist
- bash test/eXist-db-*/bin/shutdown.sh
- bash test/exist-distribution-*/bin/shutdown.sh
- ls -al /tmp; mv /tmp/tests-* . || true
artifacts:
paths:
- output.log
- test/tests-*.xml
- test/eXist-db-*/webapp/WEB-INF/logs/expath-repo.log
- test/exist-distribution-*/logs/expath-repo.log
# this enables us to get information like test coverage.
reports:
junit: test/tests-*.xml
upload:
only:
- master
- develop
except:
- tags
stage: deploy
semantic-release:
stage: release
before_script:
- *npm-setup
script:
- FILENAME=$(ls build/*.xar)
- curl -u ci:${EXIST_UPLOAD_PW} -X POST -F file=@${FILENAME} https://ci.de.dariah.eu/exist-upload
- npx semantic-release
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# 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'
artifacts:
paths:
- gitlab-release.json
# Description
Just leave a short summary what the bug is about and where you came to notice it.
## I expected the following to happen:
## On the contrary, I observed:
# How to reproduce the bug
Please describe briefly how you discovered the bug and what a developer has to do to reproduce it.
_Steps:_
* Step 1
* Step 2
* ...
# Severity
How much impact does this bug have on the product or further development?
* [ ] Minor
* [ ] Major
* [ ] Critical
* [ ] Blocker
# Platform
* [ ] Unix
* [ ] Windows
* [ ] MacOS
# Program version
Which version of SADE did you use?
# Related tickets
Add related issues if applicable.
/cc [Mathias Göbel](https://gitlab.gwdg.de/mgoebel), [Stefan Hynek](https://gitlab.gwdg.de/hynek), [Michelle Weidling](https://gitlab.gwdg.de/mrodzis)
# Description
Just leave a short summary what the feature is about.
# Use Cases
If you can, please provide use cases for this feature.
# Classification
Is this feature an enhancement of existing code or a completely new feature?
* [ ] enhancement
* [ ] new feature
# Related Tickets
Add all related issues if applicable.
/cc [Mathias Göbel](https://gitlab.gwdg.de/mgoebel), [Stefan Hynek](https://gitlab.gwdg.de/hynek), [Michelle Weidling](https://gitlab.gwdg.de/mrodzis)
Well, it seems that it is impossible to write software without bugs. That's why
we are really happy that you are here. Thank you very much! Please take a moment
to help us include the purposed bugfix to SADE by filling out the following form.
# Related Tickets
Add all related issues and especially those to be closed. Keep in mind that every
bugfix branch needs an issue that properly describes the bug beforehand. If your
fix addresses something untracked, please open a ticket at first.
## Related
## Closes
# Summary
Apart from what is mentioned in the main ticket you are going to close with this
MR, tell us what you have done to achieve this goal.
# Changelog
* [ ] I added a statement to the CHANGELOG.
/cc [Mathias Göbel](https://gitlab.gwdg.de/mgoebel), [Michelle Weidling](https://gitlab.gwdg.de/mrodzis)
We welcome every new feature to the upstream branch!
But at first we ask you to fill in the following information about your feature.
So please take a few minutes to make this great thing even better.
# Summary
This MR provides…
# Use Cases
If you can, please provide use cases for this feature.
# Documentation
Shall we add your feature to the documentation? There is a [feature list](docs/featurelist.md) available.
## Function Documentation
* [ ] Of course I prepared all my functions with an appropriate documentation.
## Are there parts of the documentation we have to adjust?
* [ ] No.
* [ ] Yes, but I'd like someone else to do it.
* [ ] Yes, and I already did!
# Tests
Are we able to test this new feature?
* [ ] Yes, everything can be done via unit tests.
* [ ] No, it is not possible.
# Changelog
* [ ] I added a statement to the CHANGELOG.
# Related Tickets
Add all related issues and especially those to be closed.
## Related
## Closes
# Logs and Screenshots
/cc [Mathias Göbel](https://gitlab.gwdg.de/mgoebel), [Michelle Weidling](https://gitlab.gwdg.de/mrodzis)
## [4.1.1](https://gitlab.gwdg.de/SADE/SADE/compare/v4.1.0...v4.1.1) (2021-05-10)
### Bug Fixes
* make TILE publishable ([bbe883b](https://gitlab.gwdg.de/SADE/SADE/commit/bbe883be560fa406870d26910427bcb15b17d906))
# Changelog
This project's changelog is maintained in the database's [`repo.xml`](https://gitlab.gwdg.de/SADE/SADE/blob/develop/repo.xml).
......@@ -20,6 +20,10 @@ you do not have an account there, do not hesitate to
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).
Currently you have two issue templates at your disposal: [Bug](https://gitlab.gwdg.de/SADE/SADE/blob/master/.gitlab/issue_templates/Bug.md) and [Feature]((https://gitlab.gwdg.de/SADE/SADE/blob/master/.gitlab/issue_templates/Feature-request.md). Please
use one of these to create your issue to provide all information we need to swiftly
getting things done.
A ticket is not necessary for [trivial
changes](https://puppet.com/community/trivial-patch-exemption-policy#general-guidance-for-using-this-policy).
......@@ -106,6 +110,32 @@ After implementing (or declining) the desired suggestions, the MR is reassigned
If a merge conflict occurs the person who has proposed the MR is responsible for solving all conflicts.
### Release
New features and bugfixes will be added to new releases. [Here](https://gitlab.gwdg.de/SADE/SADE/-/releases)
you can find an overview of all releases.
#### How to set up a new release
Following the *git flow* new releases will be prepared with the CLI tool [gitflow-avh](https://github.com/petervanderdoes/gitflow-avh)).
+ the currently active [milestone](https://gitlab.gwdg.de/groups/SADE/-/milestones) names the version number of SADE/SADE only! For SADE/assets, SADE/build and all others please look at the version with `grep --max-count=1 project.version < build.properties`
* is there a sufficient number of issues closed?
* move open issues to next milestone
+ remove the [branch protection](https://gitlab.gwdg.de/SADE/SADE/-/settings/repository#js-protected-branches-settings) to enable push requests to develop and master (otherwise all merges have to be done at GitLab and not locally)
+ `git flow release start '[VERSION]'` to create the release branch.
+ set the version number according to the milestone
+ `git flow release finish '[VERSION]'` to merge the release branch into master and develop.
+ add Release Notes: The first commit message (`.git/MERGE_MSG`) the command above will ask for will become the release description.
* write in markdown and escape `#` with `\#`
* insert a headline and write a short paragraph about this release
* insert sections for features and bugfixes and list all of them using the issue reference `#[ISSUENUMBER]`
+ it is possible to use the same text for the following tag and commit message
+ after successfully finishing the release process, the version for develop should be increased by a PATCH ([SemVer](https://semver.org/#backusnaur-form-grammar-for-valid-semver-versions)). please commit this change.
+ send all of this to the remote `git push --all && git push --tags`
+ reset the [branch protection](https://gitlab.gwdg.de/SADE/SADE/-/settings/repository#js-protected-branches-settings)
#### GitLab Releases
GitLab can maintain releases via API only. Therefore a CI job is used parsing the
merge message, preserving the build artifact and preparing the release.
### 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
......
......@@ -7,43 +7,41 @@ 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 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
* 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:
```
```sh
mkdir SADE
cd SADE
git clone git@gitlab.gwdg.de:SADE/SADE.git
```
Once the repository is cloned, run
```
ant test
```sh
./build_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
```sh
bash test/exist-distribution-*/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 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
......@@ -51,50 +49,57 @@ default installation of this package serves the documentation as website
integrated in your template and in your instance.
### 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.
#### pre-commit
We test for `DONOTCOMMIT` comments in the code. As long as a comment like this
is in files, no commit is possible.
#### post-commit
On any commit a new artifact is being created, so you can proceed and test it
immediately.
## Build
`ant`
Artifacts will be stored in `build/`.
```sh
./build_xar
```
Artifacts will be stored in `.build/`.
The default artifact is the xar package.
## Test
`ant test` will download the specified version of eXist and all dependencies to
`./build_test` will download the specified version of eXist and all dependencies to
a ready-to-go instance in the `test/` directory. at the first start all tests
will be executed by the `post-install.xq` script. To start the database use
```bash
test/eXist-db-*/bin/startup.sh
```sh
test/exist-distribution-*/bin/startup.sh
```
Guide your favorite browser to the [dashboard](http://localhost:8080/exist/).
### Port settings
When the port 8080 is blocked by a different service, simply set different ones
with the following command and restart the database.
```bash
```sh
sed -i 's/"8080"/"8090"/g; s/"8443"/"8444"/g' \
test/eXist-db-4.5.0/tools/jetty/etc/jetty-http.xml \
test/eXist-db-4.5.0/tools/jetty/etc/jetty.xml \
test/eXist-db-4.5.0/tools/jetty/etc/jetty-ssl.xml
```
## Deploy
We recommend using Debian packages for deployment. There built-in routines
in the ant script. The [CI configuration](.gitlab-ci.yml) has a part to
publish the package at the [DARIAH-DE Aptly Repository](https://ci.de.dariah.eu/packages/pool/snapshots/s/).
## Installation
## Known Issues
In the unlikely event of cycling to the next digit in TextGrid URIs you may
encounter issues when you going to use an older URI together with a newer that
starts with the same characters. Example: One will publish the text
......
project.name=http://sade.textgrid.de/ns/SADE-develop
project.version=4.1.0
project.title=Scalable Architecture for Digital Editions powered by TextGrid
project.abbrev=SADE-develop
project.processorversion=4.7.1
destfile=${build.dir}/${project.abbrev}-${project.version}.xar
test.dir=test
dependency.track=-develop
assets.abbrev=sade_assets${dependency.track}
code-viewer.abbrev=cv
<?xml version="1.0" encoding="UTF-8"?>
<project default="xar" name="SADE" xmlns:xdb="http://exist-db.org/ant">
<property environment="env"/>
<property name="build.dir" value="build"/>
<property file="local.build.properties"/>
<property file="build.properties"/>
<!-- bind environment variables to 'env'//-->
<property environment="env" />
<!-- default values for building outside CI //-->
<property name="project.abbrev" value="sade" />
<property name="project.name" value="http://sade.textgrid.de/ns/${project.abbrev}" />
<condition property="project.version" value="${env.RELEASE_VERSION}" else="${env.PREVIOUS_VERSION}+${env.LAST_COMMIT_SHORT_SHA}">
<isset property="env.RELEASE_VERSION" />
</condition>
<property name="project.title" value="Scalable Architecture for Digital Editions powered by TextGrid" />
<property name="project.processorversion" value="5.2.0" />
<property name="build.dir" value=".build"/>
<property name="test.dir" value="test"/>
<property name="exist.root" value="${test.dir}/exist-distribution-${project.processorversion}"/>
<property name="destfile" value="${build.dir}/${project.abbrev}-${project.version}.xar" />
<xmlproperty file="expath-pkg.xml.tmpl"/>
<antversion property="antversion"/>
......@@ -23,12 +36,11 @@
<filter token="project.abbrev" value="${project.abbrev}"/>
<filter token="project.name" value="${project.name}"/>
<filter token="project.processorversion" value="${project.processorversion}"/>
<filter token="dependency.track" value="${dependency.track}"/>
</filterset>
</copy>
<mkdir dir="${build.dir}"/>
<zip basedir="." destfile="${destfile}" defaultexcludes="no"
excludes=".git/,${build.dir}/,${test.dir}/"/>
includes="docs/**, modules/**, templates/**, textgrid/**, CHANGELOG.md, collection.xconf, config.xml, controller.xql, expath-pkg.xml, icon.png, lang.xml, LICENSE, navigation.xml, post-install.xq, pre-install.xq, README.md, repo.xml, search-hits.xslt, test.xq, test.xqm" />
</target>
<target name="cleanup">
......@@ -36,21 +48,24 @@
</target>
<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" />
<!-- this path may be and is subject to change! -->
<get src="https://github.com/eXist-db/exist/releases/download/eXist-${project.processorversion}/exist-distribution-${project.processorversion}-unix.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">
<file file="${test.dir}/eXist-db-${project.processorversion}/bin/startup.sh"/>
<!-- task setpermissions requries at least ant 1.10.0 -->
<setpermissions permissions="OWNER_READ,OWNER_WRITE,OWNER_EXECUTE,OTHERS_READ,OTHERS_EXECUTE,GROUP_READ,GROUP_EXECUTE">
<file file="${exist.root}/bin/startup.sh"/>
</setpermissions>
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=${assets.abbrev}&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/sade_assets-latest.xar" ignoreerrors="true"/>
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=${code-viewer.abbrev}&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/codeview-latest.xar" ignoreerrors="true"/>
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=fontane-lucene-exist-module&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/fontane-lucene-latest.xar" ignoreerrors="true"/>
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=sade_assets&amp;processor=${project.processorversion}" dest="${exist.root}/autodeploy/sade_assets-latest.xar" ignoreerrors="true"/>
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=cv&amp;processor=${project.processorversion}" dest="${exist.root}/autodeploy/codeview-latest.xar" ignoreerrors="true"/>
<get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=markdown&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/markdown-latest.xar" ignoreerrors="true"/>
<get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=functx&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/functx-latest.xar" ignoreerrors="true"/>
<get src="http://exist-db.org/exist/apps/public-repo/public/markdown-0.6.xar" dest="${exist.root}/autodeploy/markdown-latest.xar" ignoreerrors="true"/>
<get src="http://exist-db.org/exist/apps/public-repo/public/functx-1.0.1.xar" dest="${exist.root}/autodeploy/functx-latest.xar" ignoreerrors="true"/>
<copy file="${destfile}" todir="${test.dir}/eXist-db-${project.processorversion}/autodeploy" />
<copy file="${destfile}" todir="${exist.root}/autodeploy" />
</target>
</project>
export PREVIOUS_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1) | sed 's/^v//')
export LAST_COMMIT_SHORT_SHA=$(git rev-parse --short HEAD)
ant test
\ No newline at end of file
export PREVIOUS_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1) | sed 's/^v//')
export LAST_COMMIT_SHORT_SHA=$(git rev-parse --short HEAD)
ant
\ No newline at end of file
# Customization
SADE has been built to fit the needs of many projects creating digital editions.
For a complete customization, an adaption of some XQuery modules may become
necessary. But a few things are made to being set up by any user, as long as she is
familiar with the basics of XML. When you want to start preparing your own
instance, look at the file `config.xml` in the root collection of the application.
There are many things you can set up.
## Top Menu
Edit the top menu (navbar) by entering your preferred structure in the file
`navigation.xml`.
SADE has been built to fit the needs of many projects creating digital editions. A few
things can be set up by any user who is familiar with the basics of XML but for a deeper
customization, an adaption of some XQuery modules may become necessary. If you want to
start preparing your own instance, look at the `config.xml` file in the root collection
of the application to set up the basics.
## Top Menu / Navigation
### General
SADE provides an out-of-the-box mechanism to customize the website's top navigation. It
is possible to add simple **buttons** or **dropdown menus**. All necessary adjustments
can be made in the `/db/apps/sade/nagivation.xml` file.
The configuration for the navigation shipped with SADE is this:
```xml
<navigation>
<item label="Ein Text" link="view.html?id=text.md"/>
<submenu label="Links">
<item label="http://textgrid.de" link="http://textgrid.de"/>
<item label="Über SADE" label-en="About SADE" link="docs/about.md"/>
<submenu label="Dokumentation" label-en="Documentation">
<item label="Installation" label-en="Install" link="docs/install.md"/>
<item label="Features" label-en="Features" link="docs/features.md"/>
...
</submenu>
<submenu label="Weiterführende Links" label-en="Further Links">
<item label="TextGrid Benutzerhandbuch" link="https://dev2.dariah.eu/wiki/display/TextGrid/User+Manual+2.0"/>
<item label="TextGrid Homepage" link="http://textgrid.de"/>
</submenu>
</navigation>
```
In case you want to add a new top level link to the navigation, simply add a new `item`
node as a child node of `navigation`, e.g.:
```xml
<item label="Metadata" link="view.html?id=metadata.md"/>
```
In the `label` attribute you can provide the link's text whereas the `link` attribute
holds the path to the target resource.
To create a label for a dropdown selection of links, add a `submenu` node as a child
node of `navigation` with as many `item`s as you wish. Each `item` will be rendered as
a link in the dropdown menu.
```xml
<submenu label="Features">
<item label="Feature 1" link="some/path/feature1.md"/>
<item label="Feature 2" link="some/path/feature2.md"/>
<item label="Feature 3" link="some/path/feature3.md"/>
</submenu>
```
### Navigation labels and multilingual support
Both the `item` and `subitem` nodes have a `label` attribute from which the text to be
displayed is taken by default. In case you have [**multilanguage**](multilingual.md)
support enabled, you can add more labels for other languages, e.g. `label-en` or
`label-es`. Please note that these have to be listed in the multilanguage module
configuration at `config.xml` as well; otherwise switiching languages might not work.
# How to search
After entering a search term a list of matching documents is presented.
## Facets
On the left side a list of terms is presented which allow to further filter the
result set. A facet could be presented like:
Place of Publication
- Munich (14)
- Berlin (8)
This tells that 14 documents have been published in Munich and 8 have been
published in Berlin. Clicking on the label name, e.g. "Munich" will just show
you the 14 documents which have been published in Munich. You could now apply
further filters, like on the "Publication Year". The filter can be removed with
clicking the small minus sign "-" in front of the selected term. If you do not
click on the term "Munich", but on the minus sign "-", all documents **not**
published in Munich are shown. After applying the filter, a small plus sign "+"
appears in front of the filter. This allows you to undo this filter again.
......@@ -4,27 +4,51 @@
SADE is provided as Debian package for Debian based Linux distributions like Ubuntu.
### Installation from command line
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/)
After downloading the latest Debian package, install it from command line
```sh
sudo dpkg -i sade_*.deb
```
while selecting the appropriate version and date of the package. After the package's
installation, eXist-db fires up and is available at [http://localhost:8080/](http://localhost:8080/).
### Installation with Debian's Software Center
Another option to install SADE is using Debian's Software Center. First, download a SADE
Debian package as described above and double click on it from your desktop environments
file manager. The Software Center should launch and guide you through the installation.
As soon as the installation is complete, eXist-db takes a moment to fire up and is
then available at [http://localhost:8080/](http://localhost:8080/).
## All Operating Systems
Make sure to have [Java](https://www.java.com/de/download/) at least in version 1.8 installed.
Make sure you have [Java](https://www.java.com/de/download/) installed at least in version
1.8.
Download SADE as zip file:
Download SADE as a 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 `artifacts.zip` file and change to the `build/sade/bin` directory.
Start the service with `./startup.sh` (Linux/Mac) or `startup.bat` (Windows).
If you are experiencing problems starting SADE this way you may also try to change to the
`build/sade` directory and enter `java -jar start.jar jetty` from the command line.
Unzip the file `artifacts.zip`and change to directory `build/sade/bin`
Finally, eXist-db's front and back end are 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).
Start the service with `./startup.sh` (Linux/Mac) or `startup.bat` (Windows).
## How to log in
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`
SADE is initialized with a default superuser `admin` with an empty password.
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).
__Caution:__ Provide the superuser `admin` with a password, if you plan to deploy your
SADE instance to a server.
......@@ -7,7 +7,7 @@
<title>@project.title@</title>
<dependency processor="http://exist-db.org" semver-min="@project.processorversion@"/>
<dependency package="http://exist-db.org/apps/shared"/>
<dependency package="https://sade.textgrid.de/ns/assets@dependency.track@" semver-min="2.0.0"/>
<dependency package="https://sade.textgrid.de/ns/assets" semver-min="2.0.0"/>
<dependency package="http://www.functx.com"/>
<dependency package="http://exist-db.org/apps/markdown"/>
</package>
{
"name": "",
"tag_name": "",
"description": "",
"assets": {
"links": [{
"name": "",
"url": ""
}]
}
}
project.abbrev=SADE
project.name=http://sade.textgrid.de/ns/SADE
dependency.track=
......@@ -3,6 +3,10 @@ xquery version "3.1";
: generic and simple functions used by templates and other modules.
: also an incubator of new modules.
:
: @author unknown
: @author Stefan Hynek
: @author Michelle Weidling
: @version 0.2
:)
module namespace app="https://sade.textgrid.de/ns/app";
......@@ -73,6 +77,7 @@ declare function app:css-injection($node as node(), $model as map(*), $exist-res
declare function app:javascript-injection($node as node(), $model as map(*), $exist-resource) {
switch ($exist-resource)
case "publish.html" return <script src="~assets/publish-gui/publish-gui.js"/>
case "search.html" return <script src="~assets/faceted-search/bootstrap-paginator.min.js" />
default return ()
};
......@@ -97,7 +102,8 @@ return
(:~
:
:)
declare function app:recentlyPublished($node as node(), $model as map(*), $howmany) as map(*)* {
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 :=
......@@ -112,17 +118,20 @@ declare function app:recentlyPublished($node as node(), $model as map(*), $howma
map { "last-resources": $metadata[1,2,3] }
};
declare function app:recentlyPublished-link($node as node(), $model as map(*), $num as xs:integer) {
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>
};
declare function app:recentlyPublished-title($node as node(), $model as map(*), $num as xs:integer) {
declare function app:recentlyPublished-title($node as node(), $model as map(*), $num as xs:integer)
{
$model("last-resources")[$num]//tgmd:title/text()
};
declare function app:recentlyPublished-description($node as node(), $model as map(*), $num as xs:integer) {
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 "
......@@ -144,7 +153,8 @@ declare function app:recentlyPublished-description($node as node(), $model as ma
};
declare
function app:featuredWorks($node as node(), $model as map(*)) {
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 :=
......@@ -226,7 +236,8 @@ element { name($node) } {
(:~
: link rewriter. takes a URL and returns the URL including the lang
: parameter.
: :)
:
:)
declare
%templates:wrap
function app:rewriteLink($ref as xs:string) as xs:string {
......@@ -234,8 +245,9 @@ function app:rewriteLink($ref as xs:string) as xs:string {
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)
if(contains($get-parameter, "lang="))
then $get-parameter
else (tokenize($get-parameter, "&amp;")[. != ""], "lang=" || $lang)
let $anchor := substring-after($ref, "#")
(:~
......@@ -263,7 +275,6 @@ return
|| (if($anchor != "") then "#" || $anchor else ())
};
declare
%templates:wrap
function app:list-docs($node as node(), $model as map(*)) {
......@@ -373,14 +384,6 @@ function app:display-charsyn-info($node as node(), $model as map(*)) {
};
(:~
: serves the error messages powered by programmingexcuses.com
: a random message is created on each error report and send out to the user.
: :)
declare function app:error($node as node(), $model as map(*)) {
httpclient:get(xs:anyURI('http://programmingexcuses.com/'), false(), ())//*:body/*:div[@class="wrapper"]/*:center/*:a/text()
};
declare function app:currentyear($node as node(), $model as map(*)) {
year-from-date( current-date() )
};
......