summaryrefslogtreecommitdiffstats
path: root/documentation/olinkdb/make-master-olinkdb-from-template.sh
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/olinkdb/make-master-olinkdb-from-template.sh')
-rwxr-xr-xdocumentation/olinkdb/make-master-olinkdb-from-template.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/documentation/olinkdb/make-master-olinkdb-from-template.sh b/documentation/olinkdb/make-master-olinkdb-from-template.sh
new file mode 100755
index 0000000..1840595
--- /dev/null
+++ b/documentation/olinkdb/make-master-olinkdb-from-template.sh
@@ -0,0 +1,49 @@
1#!/bin/sh
2VER="R1.10"
3
4OLINKDB_BASEDIR=`dirname $0`
5
6MASTER=${OLINKDB_BASEDIR}/olink-targetdb-master
7MASTERTEMPLATE=${MASTER}-template.xml
8echo "Outgoing from template: $MASTERTEMPLATE"
9
10#---------------------------
11FORMAT=pdf
12MASTERFILE=${MASTER}-${FORMAT}.db
13echo "Create $MASTERFILE"
14cat ${MASTERTEMPLATE} | sed 's/MASTERVAR_BOOKFORMAT/pdf/;s/MASTERVAR_BOOKNAME/pdf/' >${MASTERFILE}
15
16#---------------------------
17FORMAT=eclipse
18MASTERFILE=${MASTER}-${FORMAT}.db
19echo "Create $MASTERFILE"
20cat ${MASTERTEMPLATE} | sed 's/MASTERVAR_BOOKFORMAT/eclipse/' | \
21 sed '/<dir name="eclipse">/a\
22 <dir name="plugins">' | \
23 sed 's/<document baseuri="\(book[a-zA-Z\_\-]*[0-9a-zA-Z\_\-]*\)\.MASTERVAR_BOOKNAME"/ <dir name="com.enea.doc.\1">\n <document/' | \
24 sed 's/<\/document>/ <\/document>\n <\/dir>/' |\
25 sed 's/<\/sitemap>/<\/dir>\n<\/sitemap>/' | \
26 sed 's/<div href="#[^"]*"/<div href="index.html"/' >${MASTERFILE}
27
28#---------------------------
29FORMAT=html
30MASTERFILE=${MASTER}-${FORMAT}.db
31echo "Create $MASTERFILE"
32cat ${MASTERTEMPLATE} | sed 's/MASTERVAR_BOOKFORMAT/html/' | \
33 sed 's/<document baseuri="\(book[a-zA-Z\_\-]*[0-9a-zA-Z\_\-]*\)\.MASTERVAR_BOOKNAME"/ <dir name="\1">\n <document baseuri="index.html" /' | \
34 sed 's/<\/document>/ <\/document>\n <\/dir>/' >${MASTERFILE}
35#---------------------------
36
37echo " Now: a) Should test if all databases referred to from these files exist."
38echo " Easiest way is to use XMLmind to open the created .db files"
39echo " XMLmind shall be able to open the file, and will show the contents"
40echo " of all database files."
41echo " Do not add ENTITY lines to new book until the databases are created"
42echo " It is still OK that XMLmind says that it is invalid, because it does"
43echo " not understand the xreftext contents!"
44echo " It is also OK with the comments which XMLmind shows in yellow."
45echo " (Keep xreftext anyhow. Actually I think we even could remove"
46echo " all xreftext fields, which I don't think we ever use, because we"
47echo " always provide the display string in olink elements)"
48echo ""
49echo " b) Merge the .db files"