#!/bin/sh
VER="R1.10"
OLINKDB_BASEDIR=`dirname $0`
MASTER=${OLINKDB_BASEDIR}/olink-targetdb-master
MASTERTEMPLATE=${MASTER}-template.xml
echo "Outgoing from template: $MASTERTEMPLATE"
#---------------------------
FORMAT=pdf
MASTERFILE=${MASTER}-${FORMAT}.db
echo "Create $MASTERFILE"
cat ${MASTERTEMPLATE} | sed 's/MASTERVAR_BOOKFORMAT/pdf/;s/MASTERVAR_BOOKNAME/pdf/' >${MASTERFILE}
#---------------------------
FORMAT=eclipse
MASTERFILE=${MASTER}-${FORMAT}.db
echo "Create $MASTERFILE"
cat ${MASTERTEMPLATE} | sed 's/MASTERVAR_BOOKFORMAT/eclipse/' | \
sed '/
/a\
' | \
sed 's/\n / <\/document>\n <\/dir>/' |\
sed 's/<\/sitemap>/<\/dir>\n<\/sitemap>/' | \
sed 's/${MASTERFILE}
#---------------------------
FORMAT=html
MASTERFILE=${MASTER}-${FORMAT}.db
echo "Create $MASTERFILE"
cat ${MASTERTEMPLATE} | sed 's/MASTERVAR_BOOKFORMAT/html/' | \
sed 's/\n / <\/document>\n <\/dir>/' >${MASTERFILE}
#---------------------------
echo " Now: a) Should test if all databases referred to from these files exist."
echo " Easiest way is to use XMLmind to open the created .db files"
echo " XMLmind shall be able to open the file, and will show the contents"
echo " of all database files."
echo " Do not add ENTITY lines to new book until the databases are created"
echo " It is still OK that XMLmind says that it is invalid, because it does"
echo " not understand the xreftext contents!"
echo " It is also OK with the comments which XMLmind shows in yellow."
echo " (Keep xreftext anyhow. Actually I think we even could remove"
echo " all xreftext fields, which I don't think we ever use, because we"
echo " always provide the display string in olink elements)"
echo ""
echo " b) Merge the .db files"