#!/bin/sh # ********************************************************************************************************************************* # * Licensed Materials - Property of IBM * # * * # * IBM Cognos Products: HTS * # * * # * (C) Copyright IBM Corp. 2005, 2019 * # * * # * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. * # ********************************************************************************************************************************* # *************** HTS Export ********************* # ** This batch is designed to export Human task service task data # ** -exportFile # ** the exportFile will be created in deployment folder and given a .xml.gz extension if you dont provide one # ** -password # ** this file will be encrypted if you provide this argument, in which case it will necessary to supply the password when you import # ** -camNamespace, -camUsername, -camPassword # ** when running deploy from bin the server must be running and if a secure namespace is defined, the details entered with these parameters # ** -persistenceUnit # ** defaults to humanTaskService but can be annotations # ************************************************ # *************** HTS Import ********************* # ** This batch is designed to import Human task service task data # ** -importFile # ** the importFile must point to a valid Human task service export file # ** -password # ** this file may be encrypted, in which case it is necessary to supply the password with the -password argument # ** -camNamespace, -camUsername, -camPassword # ** when running deploy from bin the server must be running and if a secure namespace is defined, the details entered with these parameters # ** -overwrite # ** still a work in progress # ** -persistenceUnit # ** defaults to humanTaskService but can be annotations # ************************************************ # --------------------------------------------------------------------------- # Shell script (Windows) to invoke jre and launch IBM Cognos Human task service import. # # When exporting, all human tasks will be sent to an xml file in the deployment folder. # at export time, cm is called to resolve all store ids into search paths. # use the htsExportAll batch to export # # to import the deployment file must be physically moved to the deployment folder of the target system # When importing all search paths will be resolved into store ids on the target system. # use the htsImporttAll batch to import # # # J_HOME is the location of the Java RE installation; if JAVA_HOME is # defined, use it. Otherwise default to the local distribution. # J_OPTS are the Java options to be passed into the JAVA VM (optional) # --------------------------------------------------------------------------- # If the argument -java:{env | local} is present as first argument then the required JRE will be # loaded: -java:env will force the script to look for JRE using JAVA_HOME environment variable. # If not found then it will end by an error. The argument -java:local will force it to look # for JRE within the local distribution. If not found then it will end by an error. # Otherwise, the script will default by looking for a JRE using the JAVA_HOME environment # variable, then if cannot find one, it will try to use the local distribution. function JavaHomeError { echo You have specified the argument '-java:env'. echo However, the environment variable JAVA_HOME is not defined or incorrectly defined. echo Please define JAVA_HOME first before using the argument '-java:env'. exit -100 } function useLocal { # Using the local distribution either because -java:local was # specified or because the JAVA_HOME environment variable # is not defined or if the JAVA_HOME location doesn't have a JRE. export J_HOME=../ibm-jre/jre if [ -e "$J_HOME/bin/java" ] then gotJava $@ else # Did not find a JRE in the local location, display error and exit. error fi } function useEnvVar { # Shift the first argument: -java:env if [ $1 == "-java:env" ] then echo shifting shift useEnvVarOnly $@ fi # Using the distribution referred by JAVA_HOME because # -java:local was NOT specified and the JAVA_HOME environment # variable is defined. export J_HOME=$JAVA_HOME if [ -e $J_HOME/bin/java ] then gotJava $@ else export J_HOME=$JAVA_HOME/jre if [ -e $J_HOME/bin/java ] then gotJava $@ else error fi fi } function error { echo Could not find a JRE. Cannot run IBM Cognos Configuration. exit -101 } function gotJava { # ----- Prepare Appropriate Java Execution Commands ------------------------- export _RUNJAVA=$J_HOME/bin/java echo java is $_RUNJAVA export CP=../webapps/p2pd/WEB-INF/classes:../webapps/p2pd/WEB-INF/lib/hts.jar:../webapps/p2pd/WEB-INF/lib/JSQLConnect.jar:../webapps/p2pd/WEB-INF/lib/zipi.jar:../webapps/p2pd/WEB-INF/lib/activation.jar:../webapps/p2pd/WEB-INF/lib/axis.jar:../webapps/p2pd/WEB-INF/lib/axisCrnpClient.jar:../webapps/p2pd/WEB-INF/lib/cclcfgapi.jar:../webapps/p2pd/WEB-INF/lib/cclcoreutil.jar:../webapps/p2pd/WEB-INF/lib/CognosIPF.jar:../webapps/p2pd/WEB-INF/lib/commons-configuration-1.5.jar:../webapps/p2pd/WEB-INF/lib/commons-discovery-0.2.jar:../webapps/p2pd/WEB-INF/lib/commons-httpclient-3.1.jar:../webapps/p2pd/WEB-INF/lib/commons-codec-1.3.jar:../webapps/p2pd/WEB-INF/lib/commons-io-2.4.jar:../webapps/p2pd/WEB-INF/lib/commons-lang-2.6.jar:../webapps/p2pd/WEB-INF/lib/commons-logging-1.1.jar:../webapps/p2pd/WEB-INF/lib/commons-pool-1.3.jar:../webapps/p2pd/WEB-INF/lib/concurrent.jar:../webapps/p2pd/WEB-INF/lib/dom4j-1.6.1.jar:../webapps/p2pd/WEB-INF/lib/i18nj.jar:../webapps/p2pd/WEB-INF/lib/jakarta-oro-2.0.8.jar:../webapps/p2pd/WEB-INF/lib/javacc.jar:../webapps/p2pd/WEB-INF/lib/jaxrpc.jar:../webapps/p2pd/WEB-INF/lib/jcam_crypto.jar:./jcam_jni.jar:../webapps/p2pd/WEB-INF/lib/log4j-1.2.8.jar:../webapps/p2pd/WEB-INF/lib/logkit-1.2.jar:../webapps/p2pd/WEB-INF/lib/mail.jar:../webapps/p2pd/WEB-INF/lib/p2pd.jar:../webapps/p2pd/WEB-INF/lib/saaj.jar:../webapps/p2pd/WEB-INF/lib/soap.jar:../webapps/p2pd/WEB-INF/lib/geronimo-stax-api_1.0_spec-1.0.1.jar:../webapps/p2pd/WEB-INF/lib/wsdl4j-1.5.1.jar:../webapps/p2pd/WEB-INF/lib/wsif.jar:../webapps/p2pd/WEB-INF/lib/xalan.jar:../webapps/p2pd/WEB-INF/lib/xml-apis.jar:../webapps/p2pd/WEB-INF/lib/xmlsec-1.4.3.jar:../webapps/p2pd/WEB-INF/lib/xts.jar:../webapps/p2pd/WEB-INF/lib/xtsext.jar:../tomcat/lib/tools.jar:../tomcat/lib/servlet-api.jar:.//ant.jar:.//cclcfgapi.jar:../webapps/p2pd/WEB-INF/lib/rdsclient.jar:../webapps/p2pd/WEB-INF/lib/uddi4j.jar:../webapps/p2pd/WEB-INF/lib/serp-1.13.1.jar:../webapps/p2pd/WEB-INF/lib/commons-collections-3.2.1.jar:../webapps/p2pd/WEB-INF/lib/commons-pool-1.3.jar:../webapps/p2pd/WEB-INF/lib/geronimo-jta_1.1_spec-1.1.jar:../webapps/p2pd/WEB-INF/lib/openjpa-1.2.1.jar:../webapps/p2pd/WEB-INF/lib/pf.jar:../webapps/p2pd/WEB-INF/lib/json.jar:../webapps/p2pd/WEB-INF/lib/caf.jar:../webapps/p2pd/WEB-INF/lib/jsm-common.jar:../webapps/p2pd/WEB-INF/lib/noticecast.jar:../webapps/p2pd/WEB-INF/lib/geronimo-jpa_3.0_spec-1.0.jar:../webapps/p2pd/WEB-INF/lib/cognos-ws-ht.jar:../webapps/p2pd/WEB-INF/lib/xmlbeans-2.3.0.jar:../bin/slf4j-api-1.7.23.jar:../bin/slf4j-nop-1.7.23.jar:./*.jar $_RUNJAVA -cp $CP $J_OPTS com.ibm.cognos.internal.hts.deployment.DeploymentTool $@ exit 0 } function useEnvVarOnly { # JAVA_HOME should be defined first. if [ $JAVA_HOME == "" ] then JavaHomeError fi echo Looking for JRE in: $J_HOME/bin export J_HOME=$JAVA_HOME if [ -e $J_HOME/bin/java ] then echo $J_HOME/bin/java gotJava $@ fi echo Looking for JRE in: $J_HOME/jre/bin export J_HOME=$JAVA_HOME/jre if [-e $J_HOME/bin/java] then gotJava $@ fi } # ----- Verify and Set Required Environment Variables ----------------------- # check if we need to run the local jre # if [ $# -eq 0 ] then echo no arguments are passed exit -102 fi echo JAVA_HOME is $JAVA_HOME if [ $1 = "-java:local" ] then shift useLocal $@ else # Try first the use of JAVA_HOME useEnvVar $@ fi