Commit 21eaef72 authored by olaf michaelis's avatar olaf michaelis
Browse files

Add shared catalog table to readme

parent bc49184f
all: make_readme
make_readme:
tools/make_readme.sh
......@@ -7,3 +7,17 @@ The files that are officially provided by the RDMO project are in the `rdmorgani
Content shared by RDMO Users can be found under `shared`. There may be multiple files in a folder like for example conditions, options and questions. Files in the same folder belong together. All of them should be imported. Please pay attention to the order in which you import files. Question catalogs referring to other content should be imported at last.
In `sanitizer` is a tool that is used to automatically replace the default URI in XML files. It is rather uninteresting for the average RDMO user but of relevance for the project and therefore included here.
## Shared catalogs
|Name|File|
|---|---|
|All questions|shared/fodako/catalog_all.xml|
|DFG grants (scientific editions in litary studies)|shared/ub_fau_erlangen_nuernberg/DFG_Editionen/DFG_editions.xml|
|DFG|shared/fodako/catalog_dfg.xml|
|Economics + DFG|shared/fodako/catalog_economics_dfg.xml|
|Educational Sci. + DFG|shared/fodako/catalog_edu_dfg.xml|
|Horizon 2020 Grants|shared/ub_fau_erlangen_nuernberg/eHum_H2020/eHum_H2020_Fragebogen.xml|
|RDMO Mechanical Engineering V0.1 - 28.03.2019|shared/nfdi4ing/rdmo_mechanical_engineering/catalog_mb_20190124.xml|
|Sociology + DFG|shared/fodako/catalog_ratswd_dfg.xml|
# RDMO Catalog
The repository holds XML files that can be imported into RDMO. They contain different kinds of information like for example the domain model, question catalogs or optionsets.
The files that are officially provided by the RDMO project are in the `rdmorganiser` folder. We recommend to import these files to be able to make use of the official domain model, options, tasks and conditions. _Note that parts of these data are required to import user content because RDMO user's question catalogs may refer to parts of the official data_.
Content shared by RDMO Users can be found under `shared`. There may be multiple files in a folder like for example conditions, options and questions. Files in the same folder belong together. All of them should be imported. Please pay attention to the order in which you import files. Question catalogs referring to other content should be imported at last.
In `sanitizer` is a tool that is used to automatically replace the default URI in XML files. It is rather uninteresting for the average RDMO user but of relevance for the project and therefore included here.
#!/bin/bash
scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
basedir=$(echo "${scriptdir}" | grep -Po ".*(?=\/)")
arr=($(find "${basedir}/shared" -regex ".*\.xml$" | sort))
tmpfile="/tmp/rdmocatalogtable.tmp"
readme_tpl="${basedir}/readme.tpl"
readme_out="${basedir}/readme.md"
rm -f "${tmpfile}"
function ec(){
echo -e "${1}" >> "${readme_out}"
}
echo "Generate shared catalog table "
for f in "${arr[@]}"; do
if [[ $(grep -Pc "<catalog\sdc:uri=.*>" "${f}") != 0 ]]; then
title=$(
cat "${f}" \
| tr '\n' ' ' \
| grep -Po "<catalog\s.*<\/catalog>" \
| grep -Po "(?<=title lang=\"en\">).*?(?=</title)"
)
file=$(echo "${f}" | grep -Po "(?<=${basedir}\/).*")
echo "Process file ${file}"
echo "|${title}|${file}|" >> "${tmpfile}"
fi
done
cat "${readme_tpl}" > "${readme_out}"
ec "\n\n## Shared catalogs"
ec "\n|Name|File|"
ec "|---|---|"
cat "${tmpfile}" | sort >> "${readme_out}"
echo "Done"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment