#!/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 "VERSON:" 
	echo "1.0"
	echo ""
	echo "NAME:" 
	echo "Modify Buletin Boards"
	echo ""
	echo "DESCRIPTION:"
	echo "ommodbb modifies a Bulletin Board.<br><br>To modify a Bulletin Board, you must have config access to it."
	echo ""
	echo "PARAMETERS:"
        echo "-B	AbsRef		number	single	The absolute reference number of the Bulletin  Board  to<br>be modified.  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 modified.  To list the temporary reference number  of<br>a Bulletin Board, use the command omlistbbs."
        echo "-m	Match		string	single	The  subject, within quotes, of the Bulletin Board to be<br>modified.  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 modified.  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 "-s	Subject		string	single	A new subject for the Bulletin Board."
        echo "-t	Date		string	single	A  new  expiration date.  The date on which items in the<br>Bulletin Board expire.  The date specified takes  precedent<br>over any expiration delay value set.<br><br>If  -l  is  set  to 1 and -t is set to 0.0.0, items will<br>never expire."
        echo "-l	Delay		number	single	A new expiration delay.  The number of  days  after  the<br>last  modification, creation or attachment that items in<br>the Bulletin Board expire."
        echo "-S	Individual items expire independantly			none	Individual items on a Bulletin Board can have expiration<br>flags set independently."
        echo "-U	Individual items can't expire independantly			none	Individual items on a Bulletin Board cannot have expiration<br>flags set independently."
        echo "-o	order		number	single	A new client list order for the  Bulletin  Board.   When<br>viewing  a  Bulletin  Board  or  the Bulletin Board area<br>using a  client  that  supports  sorted  Bulletin  Board<br>views,  the  resulting view is sorted by the client list<br>order.  Bulletin Boards are returned in increasing order<br>- a Bulletin Board with a client list order of 1 appears<br>ahead of one with a client list order  of  2.   Bulletin<br>Boards  with  a client list order of 0 appear at the end<br>of the list."
        echo "-R	Recurse			none	Recurse  down the Bulletin Board tree from the specified<br>Bulletin Board and apply modifications to all Bulletin<br>Boards below this point.  This option cannot be used if<br>the -s option is specified."
        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/ommodbb $params
exit 0
