Index: /trunk/SRC/Documentation/xmldoc/makefile
===================================================================
--- /trunk/SRC/Documentation/xmldoc/makefile	(revision 198)
+++ /trunk/SRC/Documentation/xmldoc/makefile	(revision 199)
@@ -30,4 +30,8 @@
 #
 # $Id$
+#
+# - fplod 20100120T101107Z aedon.locean-ipsl.upmc.fr (Darwin)
+#
+#   * add showdomainboxes
 #
 # - fplod 20100120T085428Z aedon.locean-ipsl.upmc.fr (Darwin)
@@ -101,5 +105,6 @@
 $(DIRWWW)/whatsnew.html \
 $(DIRWWW)/How_to_use_post_it.html \
-$(DIRWWW)/showpalettes.html
+$(DIRWWW)/showpalettes.html \
+$(DIRWWW)/showdomainboxes.html
 
 tracwiki : \
@@ -334,7 +339,39 @@
 $(DIRTMP)/showpalettes.xml : \
 $(DIRSRC)/showpalettes.sh
-	$(DIRSRC)/showpalettes.sh \
+	@$(DIRSRC)/showpalettes.sh \
 	-i $(DIRSRC)/../../../ \
 	-idl_dir /usr/local_linux/idl/idl_6.4/idl/ \
 	-o $(DIRTMP) \
 	-t $(DIRTMP)
+
+$(DIRWWW)/showdomainboxes.html : \
+$(DIRTMP)/showdomainboxes_full.xml \
+$(SAXO_DIR)/SRC/Documentation/xmldoc/saxo_html.xsl \
+$(SAXO_DIR)/SRC/Documentation/xmldoc/style.css \
+$(SAXO_DIR)/SRC/Documentation/xmldoc/saxo.css
+	@xsltproc \
+	--param html.stylesheet "'style.css saxo.css'" \
+	--param css.decoration 1 \
+	--param link.mailto.url "'mailto:Francoise.Pinsard_at_locean-ipsl.upmc.fr'" \
+	--param section.autolabel 1 \
+	--output $@ \
+	$(SAXO_DIR)/SRC/Documentation/xmldoc/saxo_html.xsl \
+	$<
+
+$(DIRTMP)/showdomainboxes_full.xml : \
+$(DIRTMP)/showdomainboxes.xml
+	@xmllint \
+	--xinclude \
+	--encode utf-8 \
+	--noent \
+	--output $@ \
+	$<
+
+$(DIRTMP)/showdomainboxes.xml : \
+$(DIRSRC)/showdomainboxes.sh \
+$(DIRSRC)/../../../config/domain_boxes.def
+	@$(DIRSRC)/showdomainboxes.sh \
+	-i $(DIRSRC)/../../../ \
+	-idl_dir /usr/local_linux/idl/idl_6.4/idl/ \
+	-o $(DIRTMP) \
+	-t $(DIRTMP)
Index: /trunk/SRC/Documentation/xmldoc/showdomainboxes.sh
===================================================================
--- /trunk/SRC/Documentation/xmldoc/showdomainboxes.sh	(revision 199)
+++ /trunk/SRC/Documentation/xmldoc/showdomainboxes.sh	(revision 199)
@@ -0,0 +1,318 @@
+#! /bin/sh
+#+
+#
+# NAME
+# ====
+#
+# showdomainboxes.sh - show available domain boxes
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+# $ showdomainboxes.sh -i indir -idl_dir idl_dir -o outdir -t tempdir
+#
+# DESCRIPTION
+# ===========
+#
+# ``showdomainboxes.sh`` inspect ``indir`` and look for the file ``domain_boxes.def``.
+#
+# Each usefull line of this file is parsed in term of boxes parameters.
+#
+# A XML/DocBook outdir/showdomainboxes.xml is produced to present domain boxes usage
+# and 
+# building.
+#
+# By default, indir is the current directory.
+#
+# Log file is written on ${tempdir}/showdomainboxes.log.\ *YYYYMMDDTHHMMSSZ*
+#
+# CAUTIONS
+# ========
+#
+# SAXO_DIR must be set. The value should be the directory where
+# SAXO is available.
+#
+# for example, if you work at LOCEAN and work with default SAXO,
+# SAXO_DIR=/usr/home/smasson/SAXO_DIR.
+#
+# For working in progress, you should checkout SAXO on a personnal
+# directory and set SAXO_DIR to the working space.
+#
+# example for me : SAXO_DIR=/usr/lodyc/incas/fplod/SAXO_DIR_ws/
+#
+# EXAMPLES
+# ========
+#
+# For POST_IT in working space /usr/lodyc/incas/fplod/post_it_ws/
+# with IDL 6.4
+#
+# ::
+#
+# $ /usr/lodyc/incas/fplod/post_it_ws/SRC/Documentation/xmldoc/showdomainboxes.sh -i /usr/lodyc/incas/fplod/post_it_ws/ -idl_dir /usr/local_linux/idl/idl_6.4/idl/ -o /tmp/ -t /tmp/
+#
+# For POST_IT in working space /usr/lodyc/incas/fplod/post_it_ws/
+# with IDL 7.0
+#
+# ::
+#
+# $ /usr/lodyc/incas/fplod/post_it_ws/SRC/Documentation/xmldoc/showdomainboxes.sh -i /usr/lodyc/incas/fplod/post_it_ws/ -idl_dir /usr/local_linux/idl/idl70/ -o /tmp/ -t /tmp/
+#
+# TODO
+# ====
+#
+# Some IDL files should be produced and processed to produce some plots (png files)
+# to be added in each line.
+#
+# Now (20100120) we are supposed to have only one domain_boxes.def in indir/config.
+# But as we already know we have to improve configuration organisation, we already
+# in this script have the opportunity to handle more than one.
+#
+# conflict between domain_boxes.def files
+#
+# an Earth map to show latitude and longitude convention
+#
+# Some explanation on latidute range > 360 °
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id$
+#
+# - fplod 20100120T093444Z aedon.locean-ipsl.upmc.fr (Darwin)
+#
+#   * creation
+#
+system=$(uname)
+case "${system}" in
+ AIX|IRIX64)
+ echo " www : no specific posix checking"
+ ;;
+ *)
+ set -o posix
+ ;;
+esac
+command=$(basename ${0})
+log_date=$(date -u +"%Y%m%dT%H%M%SZ")
+#
+usage=" Usage : ${command} -i indir -idl_dir idl_dir -o outdir -t tempdir"
+#
+minargcount=8
+#echo " narg ${#}"
+if [ ${#} -lt ${minargcount} ]
+then
+ echo "eee : not enought arguments (${#} vs ${minargcount})"
+ echo "${usage}"
+ exit 1
+fi
+#
+# default
+# default IDL command and directory
+#idl_dir=/usr/local_linux/idl/idl64/ # overriding idl_dir for test ++
+#
+# default indir directory
+indir=$(pwd)
+# default outdir directory
+outdir=/tmp/
+# default tempdir directory
+tempdir=/tmp/
+#
+# read parameters on command line
+while [ ! -z "${1}" ]
+do
+ case ${1} in
+ -i)
+ indir=${2}
+ shift
+ ;;
+ -idl_dir)
+ idl_dir=${2}
+ shift
+ ;;
+ -o) # directory for outputs choosen by user
+  outdir=${2}
+  shift
+ ;;
+ -t) # directory for temporary outputs choosen by user
+  tempdir=${2}
+  shift
+ ;;
+ -h)
+ echo "${usage}"
+ exit 0
+ ;;
+ *) # other choice
+ echo "${usage}"
+ exit 1
+ ;;
+ esac
+ shift # next flag
+done
+#
+set -u
+#
+# test if ${indir} exist
+if [ ! -d ${indir} ]
+then
+ echo "eee : ${indir} not found"
+ exit 1
+fi
+#
+# test if ${tempdir} exist
+if [ ! -d ${tempdir} ]
+then
+  mkdir -p ${tempdir}
+  echo "${command} : iii : creation of \${tempdir}"
+fi
+#
+# check for permission on ${tempdir}
+if [ ! -x ${tempdir} ]
+then
+ echo " eee : ${tempdir} not reachable"
+ exit 1
+fi
+#
+# test if ${outdir} exist
+if [ ! -d ${outdir} ]
+then
+  mkdir -p ${outdir}
+  echo "${command} : iii : creation of \${outdir}"
+fi
+#
+# check for permission on ${outdir}
+if [ ! -x ${outdir} ]
+then
+ echo " eee : ${outdir} not reachable"
+ exit 1
+fi
+#
+if [ ! -w ${outdir} ]
+then
+ echo " eee : ${outdir} not writable"
+ exit 1
+fi
+#
+log=${tempdir}/$(basename ${command} .sh).log.${log_date}
+#
+# ++ test si IDL (car GDL inutilisable)
+application=${idl_dir}/bin/idl
+#
+# find domain_boxes.def files
+list_domainboxes_files=$(find ${indir} \! \( -name '.svn' -prune \) -name "domain_boxes.def")
+#
+# test if at least one found
+if [ "${list_domainboxes_files}" = "" ]
+then
+ echo "iii : no domain_boxes.def files found under ${indir}"
+ echo "iii : nothing to do !"
+ exit 0 #++ 1
+fi
+#
+# header of XML/DocBook file
+cat << EOF > ${tempdir}/showdomainboxes${log_date}.xml
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE article [
+<!ENTITY promptidl "idl&gt;">
+]>
+
+<article version="5.0"
+xmlns="http://docbook.org/ns/docbook"
+xmlns:xl="http://www.w3.org/1999/xlink"
+xml:lang="en"
+xml:id="domainboxes">
+
+<title>Domain boxes</title>
+<para>
+Here are available domain boxes.
+</para>
+<sect1>
+<title>How to use ?</title>
+<para>
+++
+</para>
+</sect1>
+<sect1>
+<title>Available domain boxes</title>
+<para>
+++
+</para>
+<informaltable  frame="all">
+<tgroup cols="8" colsep="1" rowsep="1">
+<colspec colname="name"/>
+<colspec colname="lat_inf"/>
+<colspec colname="lat_sup"/>
+<colspec colname="long_inf"/>
+<colspec colname="long_sup"/>
+<colspec colname="depth_inf"/>
+<colspec colname="depth_sup"/>
+<colspec colname="stride"/>
+<thead>
+<row>
+<entry colname="name">Name </entry>
+<entry colname="lat_inf">Latitude inf</entry>
+<entry colname="lat_sup">Latitude sup</entry>
+<entry colname="long_inf">Longitude inf</entry>
+<entry colname="long_sup">Longitude sup</entry>
+<entry colname="depth_inf">Depth inf</entry>
+<entry colname="depth_sup">Depth sup</entry>
+<entry colname="stride">Stride</entry>
+</row>
+</thead>
+<tbody>
+EOF
+#
+# loop on domainboxes files
+for domainboxes_file in ${list_domainboxes_files}
+do
+ domainboxes_bfile=$(basename ${domainboxes_file})
+ # get rid of comment lines
+ grep -v "^#" ${domainboxes_file} > ${tempdir}/${domainboxes_bfile}_nocomment
+ # loop on lines
+ while read line
+ do
+  name=$( echo ${line} | awk '{print $1}')
+  domain=$( echo ${line} | awk '{print $2}')
+  stride=$( echo ${line} | awk '{print $3}')
+  lat_inf=$( echo ${domain} | awk -F "/" '{print $1}')
+  lat_sup=$( echo ${domain} | awk -F "/" '{print $2}')
+  lon_inf=$( echo ${domain} | awk -F "/" '{print $3}')
+  lon_sup=$( echo ${domain} | awk -F "/" '{print $4}')
+  depth_sup=$( echo ${domain} | awk -F "/" '{print $5}')
+  depth_inf=$( echo ${domain} | awk -F "/" '{print $6}')
+cat << EOF >> ${tempdir}/showdomainboxes${log_date}.xml
+<row>
+ <entry colname="name">${name}</entry>
+ <entry colname="lat_inf">${lat_inf}</entry>
+ <entry colname="lat_sup">${lat_sup}</entry>
+ <entry colname="lon_inf">${lon_inf}</entry>
+ <entry colname="lon_sup">${lon_sup}</entry>
+ <entry colname="depth_inf">${depth_sup}</entry>
+ <entry colname="depth_sup">${depth_inf}</entry>
+ <entry colname="stride">${stride}</entry>
+</row>
+EOF
+ done < ${tempdir}/${domainboxes_bfile}_nocomment
+ rm ${tempdir}/${domainboxes_bfile}_nocomment
+done
+#
+# footer of XML/DocBook file
+cat << EOF >> ${tempdir}/showdomainboxes${log_date}.xml
+</tbody>
+</tgroup>
+</informaltable>
+</sect1>
+<sect1>
+<title>How to build ?</title>
+<para>
+++
+</para>
+</sect1>
+</article>
+EOF
+#
+mv ${tempdir}/showdomainboxes${log_date}.xml ${outdir}/showdomainboxes.xml
+echo "iii : ${outdir}/showdomainboxes.xml can be processed"
+#
+# end
+exit 0
