diff options
Diffstat (limited to 'documentation/olinkdb/make-master-olinkdb-from-template.sh')
-rwxr-xr-x | documentation/olinkdb/make-master-olinkdb-from-template.sh | 49 |
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 | ||
2 | VER="R1.10" | ||
3 | |||
4 | OLINKDB_BASEDIR=`dirname $0` | ||
5 | |||
6 | MASTER=${OLINKDB_BASEDIR}/olink-targetdb-master | ||
7 | MASTERTEMPLATE=${MASTER}-template.xml | ||
8 | echo "Outgoing from template: $MASTERTEMPLATE" | ||
9 | |||
10 | #--------------------------- | ||
11 | FORMAT=pdf | ||
12 | MASTERFILE=${MASTER}-${FORMAT}.db | ||
13 | echo "Create $MASTERFILE" | ||
14 | cat ${MASTERTEMPLATE} | sed 's/MASTERVAR_BOOKFORMAT/pdf/;s/MASTERVAR_BOOKNAME/pdf/' >${MASTERFILE} | ||
15 | |||
16 | #--------------------------- | ||
17 | FORMAT=eclipse | ||
18 | MASTERFILE=${MASTER}-${FORMAT}.db | ||
19 | echo "Create $MASTERFILE" | ||
20 | cat ${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 | #--------------------------- | ||
29 | FORMAT=html | ||
30 | MASTERFILE=${MASTER}-${FORMAT}.db | ||
31 | echo "Create $MASTERFILE" | ||
32 | cat ${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 | |||
37 | echo " Now: a) Should test if all databases referred to from these files exist." | ||
38 | echo " Easiest way is to use XMLmind to open the created .db files" | ||
39 | echo " XMLmind shall be able to open the file, and will show the contents" | ||
40 | echo " of all database files." | ||
41 | echo " Do not add ENTITY lines to new book until the databases are created" | ||
42 | echo " It is still OK that XMLmind says that it is invalid, because it does" | ||
43 | echo " not understand the xreftext contents!" | ||
44 | echo " It is also OK with the comments which XMLmind shows in yellow." | ||
45 | echo " (Keep xreftext anyhow. Actually I think we even could remove" | ||
46 | echo " all xreftext fields, which I don't think we ever use, because we" | ||
47 | echo " always provide the display string in olink elements)" | ||
48 | echo "" | ||
49 | echo " b) Merge the .db files" | ||