Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
Olivier DOSSMANN | ee9488ab7e | |
Olivier DOSSMANN | 23b6950f88 | |
Olivier DOSSMANN | af5872d98e | |
Olivier DOSSMANN | 7a173006fc |
|
@ -1,10 +1,12 @@
|
|||
all: orgas.svg policies.svg
|
||||
DATE := $(shell date +'%Y%m%d')
|
||||
|
||||
all: $(DATE)-orgas.svg $(DATE)-policies.svg
|
||||
|
||||
# All .dot files are generated by gen_%.sh file (gen_orgas.sh for example)
|
||||
%.dot: gen_%.sh
|
||||
bash "$<" "$@"
|
||||
|
||||
%.svg: %.dot
|
||||
$(DATE)-%.svg: %.dot
|
||||
dot -Tsvg "$<" -o "$@"
|
||||
|
||||
clean:
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# Presentation
|
||||
|
||||
*gen.sh* generates a diagram with **graphviz** with the link between organisations, libraries and users in *rero-ils* project.
|
||||
*gen_orgas.sh* generates a diagram with **graphviz** with the link between organisations, libraries and users in *rero-ils* project.
|
||||
|
||||
*gen_policies.sh* do the same with link between organisations, libraries, circulation policies and patron\_type/item\_type couples.
|
||||
|
||||
# Requirements
|
||||
|
||||
|
@ -9,11 +11,10 @@
|
|||
|
||||
# Usage
|
||||
|
||||
* Open **gen.sh** file
|
||||
* change **RERO\_DIR** variable to point your **rero-ils directory**
|
||||
|
||||
```
|
||||
make clean && make
|
||||
make clean && RERO_DIR="/home/moi/rero/rero-ils" make
|
||||
```
|
||||
|
||||
Result: **organisations.svg** file (can be open with Gimp for example).
|
||||
Result: **2 files (orgas.svg and policies.svg)** file (can be open with Gimp for example).
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
# Built variables
|
||||
outputfile="$1"
|
||||
RERO_DIR="${RERO_DIR:-${HOME}/projets/rero/rero-ils}"
|
||||
SRC_DIR="${RERO_DIR}/data/"
|
||||
|
||||
# Templates
|
||||
|
@ -32,6 +33,14 @@ elif [[ -f "${outputfile}" ]]; then
|
|||
echo "File already exists!"
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -d "${RERO_DIR}" ]]; then
|
||||
echo "Source directory doesn't exist: ${RERO_DIR}. Did you set RERO_DIR variable?"
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -d "${SRC_DIR}" ]]; then
|
||||
echo "No data directory found in ${RERO_DIR}. Did you set RERO_DIR variable correctly?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# FUNCTIONS
|
||||
# WRITE first argument in output file
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
.[] | {
|
||||
pid,
|
||||
name,
|
||||
description,
|
||||
organisation: .organisation."$ref"
|
||||
}
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
# dot -Tsvg output.dot -o organisations.svg
|
||||
# where `output.dot` is the previous file. And `organisations.svg` the final schema you want to display.
|
||||
|
||||
# CONFIG
|
||||
RERO_DIR="${HOME}/projets/rero/rero-ils"
|
||||
|
||||
# Load commons variables, functions and statements
|
||||
source commons.sh
|
||||
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
# Generate a dot file to create graph of RERO-ils data
|
||||
#
|
||||
|
||||
# CONFIG
|
||||
RERO_DIR="${HOME}/projets/rero/rero-ils"
|
||||
|
||||
# Load commons variables, functions and statements
|
||||
source commons.sh
|
||||
|
||||
|
|
|
@ -11,7 +11,10 @@ while read pt
|
|||
do
|
||||
pid=$(echo $pt|jq -r .pid)
|
||||
name=$(echo $pt|jq -r .name)
|
||||
# fix problems with '<' and '>' in descriptions
|
||||
description=$(echo $pt|jq -r .description|sed -e 's/</\</g ; s/>/\>/g')
|
||||
orga=$(echo $pt|jq -r .organisation)
|
||||
|
||||
# write result in output
|
||||
identifier="Type${pid}"
|
||||
label="$(render templates/label_patron_types.tmpl)"
|
||||
|
|
|
@ -1 +1 @@
|
|||
\"${identifier}\" [shape=${shape} color=\"${border_color:-transparent}\" style=filled fillcolor=\"${color}\" label=${label} ${additionals}]
|
||||
\"${identifier}\" [shape=${shape} color=\"${border_color:-transparent}\" style=filled fillcolor=\"${color}\" label=${label} ${additionals}];
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
<${name}<br/>PID: ${pid}>
|
||||
<${name}<br/>${description}<br/>
|
||||
PID: ${pid}>
|
||||
|
|
|
@ -1 +1 @@
|
|||
\"${identifier}\" -> \"${relation}\"
|
||||
\"${identifier}\" -> \"${relation}\";
|
||||
|
|
Reference in New Issue