add

About Me

My photo
Oracle Apps - Techno Functional consultant

Thursday, September 29

It will automate the transfer of one or more form personalization from an environment to another

echo "This script will create the installation script of a Form Personalization and it will download the needed files in the current folder."
echo "Execute as Application Admin"
echo "The current folder should have chmod 777"
echo "Please type the information required."
echo "Blank to finish.";
echo -n "RFC NUMBER: "
read rfc_num
echo -n "RFC TITLE: "
read rfc_title
echo -n "RFC DEVELOPER: "
read rfc_developer
echo -n "FILE VERSION: "
read file_version
echo -n "APPS PASSWORD (DOWNLOAD): "
read apps_password

counter=1
function=x
APPS_PWD=$apps_password;export APPS_PWD
mkdir rfc_$rfc_num
chmod 777 rfc_$rfc_num
cd rfc_$rfc_num

rm -f rfc_$rfc_num.sh
echo "#!/bin/sh" >> rfc_$rfc_num.sh
echo " " >> rfc_$rfc_num.sh
echo "# ****************************************************************************" >> rfc_$rfc_num.sh
echo "# \$Date: `date`" >> rfc_$rfc_num.sh
echo "# \$Version: $file_version" >> rfc_$rfc_num.sh
echo "# \$Author: $rfc_developer" >> rfc_$rfc_num.sh
echo "# \$HeadURL: $" >> rfc_$rfc_num.sh
echo "# \$Id: $" >> rfc_$rfc_num.sh
echo "#" >> rfc_$rfc_num.sh
echo "# CUSTOMIZATION" >> rfc_$rfc_num.sh
echo "# RFC $rfc_num - $rfc_title" >> rfc_$rfc_num.sh
echo "#" >> rfc_$rfc_num.sh
echo "# DESCRIPTION" >> rfc_$rfc_num.sh
echo "# Installation script for Form Personalizations" >> rfc_$rfc_num.sh
echo "#" >> rfc_$rfc_num.sh
echo "# MODIFICATION HISTORY" >> rfc_$rfc_num.sh
echo "# `date` - $rfc_developer" >> rfc_$rfc_num.sh
echo "# *****************************************************************************" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh

echo "echo \"+ -------------------------------------------------------------------------------------- +\"" >> rfc_$rfc_num.sh
echo "echo \"+ -------------------------------------------------------------------------------------- +\"" >> rfc_$rfc_num.sh
echo "echo \"+ Usage: rfc_$rfc_num.sh +\"" >> rfc_$rfc_num.sh
echo "echo \"+ +\"" >> rfc_$rfc_num.sh
echo "echo \"+ -------------------------------------------------------------------------------------- +\"" >> rfc_$rfc_num.sh
echo "echo \"+ -------------------------------------------------------------------------------------- +\"" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh

echo "# ------------------------------------------------- " >> rfc_$rfc_num.sh
echo "# Starting point of the Installation script " >> rfc_$rfc_num.sh
echo "# ------------------------------------------------- " >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh

echo "P_APPS_PW=\${1}" >> rfc_$rfc_num.sh
echo "P_BOLINF_PW=\${2}" >> rfc_$rfc_num.sh
echo "P_HOSTNAME=\${3}" >> rfc_$rfc_num.sh
echo "P_PORT_NO=\${4}" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh

echo "#####################################################################" >> rfc_$rfc_num.sh
echo "# Define the log file name and location" >> rfc_$rfc_num.sh
echo "#####################################################################" >> rfc_$rfc_num.sh
echo "LOG=\${XBOL_TOP}/install/rfc_$rfc_num/rfc_$rfc_num_\${TWO_TASK}.log" >> rfc_$rfc_num.sh
echo "echo \"\" | tee \${LOG}" >> rfc_$rfc_num.sh
echo "echo \"Installation script\" | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo \"-------------------\" | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo \"\" | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo \"RFC $rfc_num - $rfc_title\" | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo \"-----------------------------------\" | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo \"\" | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo \"Version $file_version\" | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo \"\" | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo \"Started : `date`\" | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh

echo "#####################################################################" >> rfc_$rfc_num.sh
echo "# LOCAL PARAMETERS" >> rfc_$rfc_num.sh
echo "#####################################################################" >> rfc_$rfc_num.sh
echo "echo ================================================================ | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo Running rfc_$rfc_num.sh with following params | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo Passwords not printed | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo ================================================================ | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo USER SCHEMA ___________________: BOLINF | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo P_HOSTNAME ____________________: \$P_HOSTNAME | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo TARGET DB _____________________: \$TWO_TASK | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo P_PORT_NO _____________________: \$P_PORT_NO | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh

echo "#####################################################################" >> rfc_$rfc_num.sh
echo "# START THE INSTALLATION PROGRAM" >> rfc_$rfc_num.sh
echo "#####################################################################" >> rfc_$rfc_num.sh
echo "#####################################################################" >> rfc_$rfc_num.sh
echo "# START CREATING of AOL objects" >> rfc_$rfc_num.sh
echo "#####################################################################" >> rfc_$rfc_num.sh
echo "echo ================================================================ | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo Starting uploading of Forms Personalization Setup | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo ================================================================ | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh
echo "l_tmp_file=\$\$.tmp" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh

while [ "$function" != "" ]
do
echo -n "FUNCTION $counter to EXPORT: "
read function
functions[$counter]=function
if [ "$function" != "" ]
then
FNDLOAD apps/$APPS_PWD 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct RFC$rfc_num-$function.ldt FND_FORM_CUSTOM_RULES function_name="$function"

echo "echo ================================================================ | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo $counter. Uploading Personalizations for $function Function | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo ================================================================ | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh
echo "FNDLOAD apps/\$P_APPS_PW 0 Y UPLOAD \$FND_TOP/patch/115/import/affrmcus.lct RFC$rfc_num-$function.ldt > \$l_tmp_file 2>&1" >> rfc_$rfc_num.sh
echo "l_fnd_log_file=\`cat \${l_tmp_file}|grep Log|awk '{print \$4}'\`" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh

fi
let counter=counter+1
done

echo "cat \${l_fnd_log_file} | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "rm -f \${l_fnd_log_file}" >> rfc_$rfc_num.sh
echo "rm -f \${l_tmp_file}" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh
echo "echo \"Installation Complete at : `date`\" | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "echo \"\" | tee -a \${LOG}" >> rfc_$rfc_num.sh
echo "" >> rfc_$rfc_num.sh
echo "exit" >> rfc_$rfc_num.sh

chmod 777 rfc_$rfc_num.sh
echo ""
echo "Installation Script rfc_$rfc_num.sh created succesfully!"

No comments: