localize.sh 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #! /bin/sh
  2. # Licensed Materials - Property of IBM
  3. # IBM Cognos Products: localizationkit
  4. # © Copyright IBM Corp. 2005, 2020
  5. # US Government Users Restricted Rights - Use, duplication or disclosure restricted
  6. # by GSA ADP Schedule Contract with IBM Corp.
  7. #
  8. # ---------------------------------------------------------------------------
  9. # Shell script (UNIX) to invoke jre and launch Localization Kit application.
  10. #
  11. # JAVA_CMD is the Java intepreter location, may include full path
  12. # JAVA_OPTS are the Java options to be passed into the JAVA VM
  13. # ---------------------------------------------------------------------------
  14. # Make sure prerequisite environment variables are set
  15. if [ -z "$JAVA_HOME" ]; then
  16. echo "The JAVA_HOME environment variable is not defined"
  17. echo "This environment variable is needed to run this program"
  18. exit 1
  19. fi
  20. # ----- Save Environment Variables That May Change --------------------------
  21. _CLASSPATH="$CLASSPATH"
  22. _CP="$CP"
  23. # location of Java interpreter
  24. JAVA_CMD="$JAVA_HOME"/bin/java
  25. export JAVA_CMD
  26. JAVA_OPTS="-Xmx768m"
  27. export JAVA_OPTS
  28. # Set CP for general processing
  29. CP=.:./localizationkit.jar:localizationkitExt.jar:dom4j-2.1.1.jar:../webapps/p2pd/WEB-INF/lib/jaxen-1.1.1.jar:jdxslt.jar
  30. if [ "$1" = "genbrandldkspec" -o "$1" = "sync" -o "$1" = "validate" -o "$1" = "clean" ]; then
  31. CLASSPATH="$CP"; export CLASSPATH
  32. $JAVA_CMD $JAVA_OPTS com.cognos.localizationkit.CCLMsgLocalizer $* 2>&1
  33. elif [ "$1" = "generate" ]; then
  34. # Need to set some extra CP for the XTS engine
  35. CLASSPATH="$CP" export CLASSPATH
  36. $JAVA_CMD $JAVA_OPTS com.cognos.localizationkit.CCLMsgLocalizer $* 2>&1
  37. else
  38. # Unknown command is specified
  39. echo "Unknown command parameter is specified"
  40. echo "Usage: localize.sh <command>"
  41. echo "Where command could be one of the following"
  42. echo " genbrandldkspec"
  43. echo " generate a brand_ldkspec.xml file to identify brandable resources only"
  44. echo " sync"
  45. echo " synchronzize XML message files"
  46. echo " validate"
  47. echo " validate XML message files"
  48. echo " generate"
  49. echo " generate target message files"
  50. echo " clean"
  51. echo " remove translate attribute from message files in synchronization directory"
  52. fi
  53. # --------------------- Restore the old enviroment setting --------------------------------
  54. CLASSPATH="$_CLASSPATH"
  55. _CLASSPATH=""
  56. CP="$_CP"
  57. _CP=""
  58. exit 0