Pages

Recently Viewed

Saturday, March 16, 2013

Generic UNIX script to import OAF personalizations

Below is the piece of UNIX which will import OAF personalization to system.  This is a common script and will work for all CO, VO extension or other OAF personalization.
 
 
# ***********************************************************************************************************
#  Import OAF Personalizations
# ***********************************************************************************************************
echo "# ******************************************************************************" >> $v_log
echo "# Import OAF Personalizations" >> $v_log
echo "# ******************************************************************************" >> $v_log
echo ""
echo "Immporting OAF Personalizations...."
 
########### Import CO Extension & Other Personalizations ################################
for file in `find unzipped_folder | grep PG.xml`
do
                                v_file_name=`echo $file | rev | cut -d "/" -f1 | rev`
                                lv=`echo $file | sed s/$v_file_name/"@"/g | cut -d "@" -f1`
                                v_MDS_RN=`echo $JAVA_TOP/$lv`
                                v_rootPackage=`echo $lv | sed s/" unzipped_folder "/"@"/g | cut -d "@" -f2`
                                                               
                                echo "File Name : $v_file_name" >>$v_log
                echo "lv :: $lv" >>$v_log
                                echo "MDS_RN : $v_MDS_RN" >>$v_log
                                echo "Root Package : $v_rootPackage" >>$v_log
     
                                 java oracle.jrad.tools.xml.importer.XMLImporter ${v_MDS_RN}${v_file_name} -username apps -password $v_apps_schema -dbconnection "$lv_jdbc" -rootdir ${v_MDS_RN} -rootPackage $v_rootPackage >>$v_log
 
                                if [ $? != 0 ];then
                                                echo "ERROR - Failed while importing $file"   >>$v_log
                                                echo "ERROR - Failed while importing $file"  
                                else
                                                echo "Import $file successfully "  >>$v_log
                                fi
                                echo " " >> $v_log
done
 
 
########### Import VO Extension################################
for file in `find xxxxx | grep .jpx`
do
                                v_file_name=`echo $file | rev | cut -d "/" -f1 | rev`
                                lv=`echo $file | sed s/$v_file_name/"@"/g | cut -d "@" -f1`
                                v_MDS_RN=`echo $JAVA_TOP/$lv`
                               
                                                               
                                echo "File Name : $v_file_name" >>$v_log
                                echo "lv :: $lv" >>$v_log
                                echo "MDS_RN : $v_MDS_RN" >>$v_log
                                      
                                 java oracle.jrad.tools.xml.importer.JPXImporter ${v_MDS_RN}/${v_file_name} -username apps -password $v_apps_schema -dbconnection "$lv_jdbc" >>$v_log
 
                                if [ $? != 0 ];then
                                                echo "ERROR - Failed while importing $file"   >>$v_log
                                                echo "ERROR - Failed while importing $file"  
                                else
                                                echo "Import $file successfully "  >>$v_log
                                fi
                                echo " " >> $v_log
done
fi
# ******************************************************************************
 
 
 
Prerequisite is to place all java,class & XML files at correct folder path. For example if we are extending the agreement CO.  File structures should be –
 
xxxx.oracle.apps.po.documents.agreement.webui
*.class
*.java
xxxx.oracle.apps.po.documents.agreement.webui.customization.site/responsibility.0/responsibility_id
*.xml
 

 

 

No comments:

Post a Comment