#!/bin/bash
#
#
#    Scalix Public License
#
#
#    The contents of this file are subject to the Scalix Public License
#    Version 1.1 ("License"); you may not use this file except in
#    compliance with the License. You may obtain a copy of the License at
#
# 
#    http://www.scalix.com/community/licensing 
#
# 
#    Software distributed under the License is distributed on an "AS IS"
#    basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
#    the License for the specific language governing rights and limitations
#    under the License.
#
# 
#    The Original Code is Scalix Server. 
#    The Initial Developer of the Original Code is Scalix Corporation. 
#    Copyright (C) 2006 Scalix Corporation. 
#    All Rights Reserved.
#    Additional Copyrights may apply - see the notice in each file
#
#
#
#
#
#
# Copyright (C) 2006 Scalix Corporation.  All Rights Reserved.
#

help() {
	echo ""
	echo ""
	echo "VERSION:" 
	echo "1.0"
	echo ""
	echo "NAME:" 
	echo "Delete Buletin Board"
	echo ""
	echo "DESCRIPTION:"
	echo ""
	echo "omdelbb deletes a Bulletin Board.<br><br>To  delete a Bulletin Board, you must have config (owner) access to it."
	echo "PARAMETERS:"
        echo "-B	AbsRef		number	single	The absolute reference number of the Bulletin  Board  to<br>be  deleted.  To list the absolute reference number of a<br>Bulletin Board, use  the  -b  option  with  the  command<br>omlistbbs"
        echo "-n	Number		number	single	The temporary reference number of the Bulletin Board to<br>be deleted.  To list the temporary reference number of a<br> Bulletin Board, use the command omlistbbs."
        echo "-m	Match		string	single	The  subject, within quotes, of the Bulletin Board to be<br>deleted.  To specify a nested  Bulletin  Board,  give  a<br>hierarchy  of  bulletin  Board  subjects, delimiting the<br>subjects with angle brackets (>).  To list the  subjects<br>of Bulletin Boards, use the command omlistbbs."
        echo "-d	Depth		number	single	The  depth  of  the  Bulletin  Board to be deleted.  The<br>depth is the number of  levels  the  Bulletin  Board  is<br> nested under the Bulletin Board area.<br><br>Required  with  the -B and -n options unless a top-level<br>Bulletin Board is specified.<br><br>The depth must be the same as that used when the  reference<br>number was obtained using the command omlistbbs."
        echo ""
	echo "--help	Help	\"\"	\"\"	\"\"	Usage Information"
	echo ""
	echo "OUTPUT:"
	echo ""
	echo "text/plain"
}
#
# main script
#

declare params;
params="";
while [ "$1" != "" ]; do
	case "$1" in
		--help) help;
                        exit 0
			shift;;
		*) params="$params $1 $2";
                   shift;;
	esac
	shift
done
/opt/scalix/bin/omdelbb $params
exit 0
