#!/usr/bin/ksh93
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# 61haes_r714 src/43haes/usr/sbin/cluster/sa/filenet/sbin/cl_filenet_manual_config.sh 1.1 
#  
# Licensed Materials - Property of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2010 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
# @(#)14	1.1  src/43haes/usr/sbin/cluster/sa/filenet/sbin/cl_filenet_manual_config.sh, hacmp, 61haes_r714 11/28/11 15:19:40
###############################################################################
#
# Name: cl_filenet_manual_config
#
# FileNet smart assist manual configuration with input XML file
# populated with required information to configure.
#
# Syntax:
# cl_filenet_manual_config -f <input XML file>
#
# Arguments:
#       -f      Input XML file
#
# Return:
#	N/A
#
###############################################################################

function usage
{
	[[ "$VERBOSE_LOGGING" == "high" ]] && set -x
	KLIB_SA_logmsg WARN 9 1 filenetsa.cat "Usage: \
cl_filenet_manual_config -f <input XML file>\n"
	exit 1
}

typeset CONFIG_FILE=""
KLIB_OUTPUT_CONSOLE=true
KLIB_HACMPLOG_ENTRY=filenetsa.log
FPATH_BASE=/usr/es/lib/ksh93
FPATH=$FPATH_BASE/sa

NUM_ARGS=$#
(( $NUM_ARGS == 0 )) && usage
while getopts f: option
do
    case $option in
	f) # Input xml file for manual configuration
		CONFIG_FILE=$OPTARG
		;;
	*)
		usage
    esac
done

[[ -z "$CONFIG_FILE" ]] && usage

FILENET_SA_SBIN_DIR="/usr/es/sbin/cluster/sa/filenet/sbin"

#
# Configuration of DB for Content Engine
#
$FILENET_SA_SBIN_DIR/cl_db_ce_pe_preimport -c "Content_Engine_db2_database" -f $CONFIG_FILE

#
# Configuration of DB for Process Engine
#
$FILENET_SA_SBIN_DIR/cl_db_ce_pe_preimport -c "Process_Engine_db2_database" -f $CONFIG_FILE

#
# Configuration of Process Engine
#
$FILENET_SA_SBIN_DIR/cl_filenet_pe_import -f $CONFIG_FILE

#
# Configuration of Application Engine
#
$FILENET_SA_SBIN_DIR/cl_was_AE_CE_import -C "FILENET_APPLICATION_ENGINE" -f $CONFIG_FILE

#
# Configuration of Content Engine
#
$FILENET_SA_SBIN_DIR/cl_was_AE_CE_import -C "FILENET_CONTENT_ENGINE" -f $CONFIG_FILE
