<commit_before>#!/bin/bash
#
#Script for automatically exporting the apex application from APEX
#
# This script is designed to be run from the top level directory of your project and will break otherwise

if [ -z "$ORACLE_HOME" ]; then
   echo "Missing environment variable: ORACLE_HOME. Please add the path of your oracle installation to your environment variables under the variable name ORACLE_HOME"; exit 1
fi

if [ -z "$APEX_HOME" ]; then
   echo "Missing environment variable: APEX_HOME. Please add the path of your apex installation to your environment variables under the variable name APEX_HOME. Note: You should be using APEX version 5 or above"; exit 1
fi

if [ ! -e $ORACLE_HOME/jdbc/lib/ojdbc6.jar ]; then
   echo "Missing ojdbc6.jar: please download from oracle and put in $ORACLE_HOME/jdbc/lib directory"; exit 1
fi

if [ ! -e $APEX_HOME/utilities/oracle/apex/APEXExport.class ]; then
   echo "Missing APEXExport class. Please ensure you are using Apex 5 or above and have the APEXExport and APEXExportSplitter classes are in the $APEX_HOME/utilities/oracle/apex/ directory"; exit 1
fi

if [ ! -e $APEX_HOME/utilities/oracle/apex/APEXExportSplitter.class ]; then
   echo "Missing APEXExportSplitter class. Please ensure you are using Apex 5 or above and have the APEXExport and APEXExportSplitter classes are in the $APEX_HOME/utilities/oracle/apex/ directory"; exit 1
fi

source ./config/apexupdate.conf

export CLASSPATH=$APEX_HOME/utilities:$ORACLE_HOME/jdbc/lib/ojdbc6.jar

export_file=f$apexappid.sql

if [ -d apex/ ]; then
   rm -r apex/
fi
if [ -e $export_file ]; then
   rm $export_file
fi

java oracle.apex.APEXExport -db $database_connection -user $username -password $password -applicationid $apexappid -skipExportDate -expOriginalIds #

if [ ! 0 -eq $? ]; then
    echo "Exit code #: $?. An error has occured while trying to use APEXExport. Please check that your database_connection, username, password, and apexappid variables are all set correctly."; exit 1
fi

java oracle.apex.APEXExportSplitter $export_file

if [ ! 0 -eq $? ]; then
    echo "Exit code #: $?. An error has occured while trying to use APEXExportSplitter. Please check that your apexappid variable is set correctly and that the application exists in the workspace you are trying to export from"; exit 1
fi

rm $export_file

mv f$apexappid apex #
cd apex

#		below line might have to be changed to say @/hom.... instead
sed -e s!@application!@../../apex/application! < install.sql > ../non-apex/install/install_apex_components.sql

cd ..
#then run reinstall database<commit_msg>apexupdate no longer creates the install_apex_components file since the originally generated file will be used<commit_after>#!/bin/bash
#
#Script for automatically exporting the apex application from APEX
#
# This script is designed to be run from the top level directory of your project and will break otherwise

if [ -z "$ORACLE_HOME" ]; then
   echo "Missing environment variable: ORACLE_HOME. Please add the path of your oracle installation to your environment variables under the variable name ORACLE_HOME"; exit 1
fi

if [ -z "$APEX_HOME" ]; then
   echo "Missing environment variable: APEX_HOME. Please add the path of your apex installation to your environment variables under the variable name APEX_HOME. Note: You should be using APEX version 5 or above"; exit 1
fi

if [ ! -e $ORACLE_HOME/jdbc/lib/ojdbc6.jar ]; then
   echo "Missing ojdbc6.jar: please download from oracle and put in $ORACLE_HOME/jdbc/lib directory"; exit 1
fi

if [ ! -e $APEX_HOME/utilities/oracle/apex/APEXExport.class ]; then
   echo "Missing APEXExport class. Please ensure you are using Apex 5 or above and have the APEXExport and APEXExportSplitter classes are in the $APEX_HOME/utilities/oracle/apex/ directory"; exit 1
fi

if [ ! -e $APEX_HOME/utilities/oracle/apex/APEXExportSplitter.class ]; then
   echo "Missing APEXExportSplitter class. Please ensure you are using Apex 5 or above and have the APEXExport and APEXExportSplitter classes are in the $APEX_HOME/utilities/oracle/apex/ directory"; exit 1
fi

source ./config/apexupdate.conf

export CLASSPATH=$APEX_HOME/utilities:$ORACLE_HOME/jdbc/lib/ojdbc6.jar

export_file=f$apexappid.sql

if [ -d apex/ ]; then
   rm -r apex/
fi
if [ -e $export_file ]; then
   rm $export_file
fi

java oracle.apex.APEXExport -db $database_connection -user $username -password $password -applicationid $apexappid -skipExportDate -expOriginalIds #

if [ ! 0 -eq $? ]; then
    echo "Exit code #: $?. An error has occured while trying to use APEXExport. Please check that your database_connection, username, password, and apexappid variables are all set correctly."; exit 1
fi

java oracle.apex.APEXExportSplitter $export_file

if [ ! 0 -eq $? ]; then
    echo "Exit code #: $?. An error has occured while trying to use APEXExportSplitter. Please check that your apexappid variable is set correctly and that the application exists in the workspace you are trying to export from"; exit 1
fi

rm $export_file

mv f$apexappid apex #

#now you can update your working copy with changes from your colleagues and reinstall into apex
{'fraction_non_alphanumeric': 0.07650273224043716, 'fraction_numerical': 0.00585480093676815, 'mean_word_length': 4.299896587383661, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '315416', 'n_tokens_mistral': 1650, 'n_tokens_neox': 1539, 'n_words': 642}