IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.tools.migration.util
Class CommonUtils

java.lang.Object
  extended bycom.ibm.btt.tools.migration.util.CommonUtils

public class CommonUtils
extends java.lang.Object

CommonUtils Provides some of common use of APIs.


Field Summary
protected static org.eclipse.core.resources.IProject EJBProject
           
protected static int invokerType
           
protected static java.lang.String jspFilePath
           
protected static boolean onWSADIE
           
protected static org.eclipse.core.resources.IProject SvcProject
           
protected static org.eclipse.core.resources.IProject WebProject
           
 
Constructor Summary
CommonUtils()
           
 
Method Summary
static org.eclipse.core.resources.IProject getEJBProject()
           
static int getInvokerType()
          get the invoker type 0: for html 1: for java client 2: for both
static java.lang.String getJspFilePath()
           
static org.eclipse.core.resources.IProject getSvcProject()
           
static org.eclipse.core.resources.IProject getWebProject()
           
static void initBTTEnv(java.lang.String iniPath)
          Initialize the BTT environment by using the specified dse.ini file.
static boolean isBTTEnvInitialized()
          Check whether BTT environment is initialized or not
static boolean isOnWSADIE()
           
static void redirectSystemOut(java.lang.String logfile)
          Redirect the system out from the console to a log file.
static java.lang.String replaceAll(java.lang.String str, java.lang.String oldStr, java.lang.String newStr)
          Replace a short sting with a long string by a specified string.
static void setEJBProject(org.eclipse.core.resources.IProject project)
           
static void setInvokerType(int type)
           
static void setJspFilePath(java.lang.String string)
           
static void setOnWSADIE(boolean b)
           
static void setSvcProject(org.eclipse.core.resources.IProject project)
           
static void setWebProject(org.eclipse.core.resources.IProject project)
           
static java.lang.String toOneString(int deep, Tag aTag)
           
static java.lang.String toOneString(int deep, Tag aTag)
           
static java.lang.String toOneString(int deep, Vector Tags)
           
static void writeToTaget(java.lang.String targetLoc, java.lang.String fileName, java.lang.String outString)
          Write the BTT defintion string which is got from the externalizer to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

onWSADIE

protected static boolean onWSADIE

WebProject

protected static org.eclipse.core.resources.IProject WebProject

SvcProject

protected static org.eclipse.core.resources.IProject SvcProject

EJBProject

protected static org.eclipse.core.resources.IProject EJBProject

jspFilePath

protected static java.lang.String jspFilePath

invokerType

protected static int invokerType
Constructor Detail

CommonUtils

public CommonUtils()
Method Detail

redirectSystemOut

public static void redirectSystemOut(java.lang.String logfile)
                              throws java.lang.Exception
Redirect the system out from the console to a log file. The default log file is "c:\migrationtool.log"

Throws:
java.lang.Exception

initBTTEnv

public static void initBTTEnv(java.lang.String iniPath)
                       throws java.io.IOException,
                              DSEException
Initialize the BTT environment by using the specified dse.ini file. The method will check whether the BTT environment is initialized or not. If not, it will initialize the BTT environment by using the specified dse.ini file directly. If yes, it will check if the current BTT environment is based on the same dse.ini file. If not, initializes BTT environment again. If yes, do nothing.

Parameters:
iniPath -
Throws:
java.io.IOException
DSEException

isBTTEnvInitialized

public static boolean isBTTEnvInitialized()
Check whether BTT environment is initialized or not

Returns:
boolean true means initialized.

replaceAll

public static java.lang.String replaceAll(java.lang.String str,
                                          java.lang.String oldStr,
                                          java.lang.String newStr)
Replace a short sting with a long string by a specified string.

Parameters:
str - A string contains the string that will be replaced
oldStr - A string that will be replaced
newStr - A string will be instead of.
Returns:
String

writeToTaget

public static void writeToTaget(java.lang.String targetLoc,
                                java.lang.String fileName,
                                java.lang.String outString)
                         throws java.lang.Exception
Write the BTT defintion string which is got from the externalizer to a file. It will add: >>> ahead of string - - <$filename$> , for example, dse.ini, dsectxt.xml, etc >>> behind - <$filename$>

Parameters:
targetLoc -
fileName -
outString -
Throws:
java.lang.Exception

toOneString

public static java.lang.String toOneString(int deep,
                                           Tag aTag)

toOneString

public static java.lang.String toOneString(int deep,
                                           Tag aTag)

toOneString

public static java.lang.String toOneString(int deep,
                                           Vector Tags)

getEJBProject

public static org.eclipse.core.resources.IProject getEJBProject()
Returns:
IProject

isOnWSADIE

public static boolean isOnWSADIE()
Returns:
boolean

getSvcProject

public static org.eclipse.core.resources.IProject getSvcProject()
Returns:
IProject

getWebProject

public static org.eclipse.core.resources.IProject getWebProject()
Returns:
IProject

setEJBProject

public static void setEJBProject(org.eclipse.core.resources.IProject project)
Parameters:
project -

setOnWSADIE

public static void setOnWSADIE(boolean b)
Parameters:
b -

setSvcProject

public static void setSvcProject(org.eclipse.core.resources.IProject project)
Parameters:
project -

setWebProject

public static void setWebProject(org.eclipse.core.resources.IProject project)
Parameters:
project -

getJspFilePath

public static java.lang.String getJspFilePath()
Returns:
String

setJspFilePath

public static void setJspFilePath(java.lang.String string)
Parameters:
string -

setInvokerType

public static void setInvokerType(int type)
Parameters:
type -

getInvokerType

public static int getInvokerType()
get the invoker type 0: for html 1: for java client 2: for both

Returns:
int

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005