#
# WIZARD Section
#

#
# task is a checkbox on the 1st page of wizard
#
task.addImports.name = Add libraries, required for deployment, to the project Search/Classpath
task.addImports.order = 10
task.addImports = true

task.compile.name = Compile classes from the selected diagram
task.compile.order = 20
task.compile = true

task.generateDD.name = Generate Deployment Descriptor
task.generateDD.order = 30
task.generateDD = true

#task.xmlEditor = true
#task.xmlEditor.name = Open XML Editor for the generated DD
#task.xmlEditor.order = 35

task.hotdeploy.name = Hot Deploy to IBM WebSphere 
task.hotdeploy.order = 40
task.hotdeploy = true

task.deleteTempBefore = true
task.deleteTempBefore.name = Clear temp folder before start
task.deleteTempBefore.order = 50

task.deleteTempAfter = true
task.deleteTempAfter.name = Clear temp folder after finish
task.deleteTempAfter.order = 60

task.correctBeans = true
task.correctBeans.name = Verify/Correct EJB for the selected server
task.correctBeans.order = 70

#
# Wizard pages
#
page.dirs.name = Common Properties
page.dirs.order = 1

page.correcture.name = Verify/Correct sources
page.correcture.task = correctBeans
page.correcture.order = 70

page.hotdeploy.name = Run-time deploy
page.hotdeploy.task = hotdeploy
page.hotdeploy.order = 2

#
# Wizard properties
#

#
# NAME = default value
# NAME.name = name of the field in wizard dialog
# NAME.type = type of property editor
# NAME.page = name of page of wizard dialog where the property should appear
# NAME.order = number specifying order of the property among others on the page

TEMP_OUT = /tmp/IBMWSDeploy
TEMP_OUT.name = Folder for the temporary files
TEMP_OUT.type = DirectoryField
TEMP_OUT.page = dirs
TEMP_OUT.order = 1

RESULT_OUT = /tmp/IBMWSDeploy
RESULT_OUT.name = Folder for the generated JAR file
RESULT_OUT.type = DirectoryField
RESULT_OUT.page = dirs
RESULT_OUT.order = 2


JAVA_HOME = /usr/local/jdk118
JAVA_HOME.name = IBM JDK root directory
JAVA_HOME.type = DirectoryField
JAVA_HOME.page = dirs
JAVA_HOME.order = 3
JAVA_HOME.check.1 = %%JAVA_HOME%%
JAVA_HOME.check.1.type = DirExistence
JAVA_HOME.check.1.message = JDK directory '%%JAVA_HOME%%' does not exist
JAVA_HOME.check.2 = %%JAVA_HOME%%/bin/javac
JAVA_HOME.check.2.type = FileExistence
JAVA_HOME.check.2.message = Unable to locate JAVAC application under selected JDK root: %%JAVA_HOME%%/bin/javac

IBMSPH_HOME = /opt/IBMWebAS
IBMSPH_HOME.name = WebSphere server directory
IBMSPH_HOME.type = DirectoryField
IBMSPH_HOME.page = dirs
IBMSPH_HOME.order = 4
IBMSPH_HOME.check.1 = %%IBMSPH_HOME%%
IBMSPH_HOME.check.1.type = DirExistence
IBMSPH_HOME.check.1.message = IBM WebSphere directory '%%IBMSPH_HOME%%' does not exist
IBMSPH_HOME.check.2 = %%IBMSPH_HOME%%/properties
IBMSPH_HOME.check.2.type = DirExistenceConfirm
IBMSPH_HOME.check.2.message = Directory '%%IBMSPH_HOME%%/properties' not found\n\
         Are you sure you have selected correct directory of IBM WebSphere server?

# ==============================
STOP_IF_NOT_COMPLIANT = true
STOP_IF_NOT_COMPLIANT.name = Stop deployment if verification failed
STOP_IF_NOT_COMPLIANT.type = BooleanField
STOP_IF_NOT_COMPLIANT.order = 10
STOP_IF_NOT_COMPLIANT.page = correcture

CORRECT_SRC = true
CORRECT_SRC.name = Correct sources to comply with WS3.02
CORRECT_SRC.type = BooleanField
CORRECT_SRC.order = 20
CORRECT_SRC.page = correcture

DO_BACKUP = true
DO_BACKUP.name = Backup sources before correction
DO_BACKUP.type = BooleanField
DO_BACKUP.order = 25
DO_BACKUP.page = correcture

BACKUP_DIR = /tmp/IBMWSDeploy/backup
BACKUP_DIR.name = Backup directory for the source files (if "correct sources" is selected)
BACKUP_DIR.type = DirectoryField
BACKUP_DIR.order = 30
BACKUP_DIR.page = correcture

DO_RETURN = true
DO_RETURN.name = Change return types in the ejbCreate methods
DO_RETURN.type = BooleanField
DO_RETURN.order = 35
DO_RETURN.page = correcture
# ==============================


VERBOSE = true
VERBOSE.name = Display messages from the tools
VERBOSE.type = BooleanField
VERBOSE.page = dirs
VERBOSE.order = 5

MASHINE_NAME = localhost
MASHINE_NAME.name = Computer name
MASHINE_NAME.type = StringField
MASHINE_NAME.page = hotdeploy
MASHINE_NAME.order = 1

APPLICATION_SERVER_NAME = Default Server
APPLICATION_SERVER_NAME.name = Application server name
APPLICATION_SERVER_NAME.type = StringField
APPLICATION_SERVER_NAME.page = hotdeploy
APPLICATION_SERVER_NAME.order = 2

EJB_CONTAINER_NAME = Default Container
EJB_CONTAINER_NAME.name = EJB container name
EJB_CONTAINER_NAME.type = StringField
EJB_CONTAINER_NAME.page = hotdeploy
EJB_CONTAINER_NAME.order = 3

DATA_SOURCE_NAME = was
DATA_SOURCE_NAME.name = Data Source name
DATA_SOURCE_NAME.type = StringField
DATA_SOURCE_NAME.page = hotdeploy
DATA_SOURCE_NAME.order = 4 

USER_ID = together
USER_ID.name = User ID 
USER_ID.type = StringField
USER_ID.page = hotdeploy
USER_ID.order = 5

USER_PASSWORD = together
USER_PASSWORD.name = Password
USER_PASSWORD.type = PasswordField
USER_PASSWORD.page = hotdeploy
USER_PASSWORD.order = 6

#
# PLUGIN Properties
#

#
# not editable properties
#
# ".page" is not defined; the property doesn't appear on any page of wizard

plugin.name = IBM WebSphere 3.02
plugin.version = 1.1
plugin.message_tab = EJB Deployment
plugin.message_prefix = was30:\u0020

ejb.type = 1.0
#ejb.ddprologue = <?xml version='1.0' encoding="ISO-8859-1" ?>\n\
#                 <!DOCTYPE ejb-JAR SYSTEM "%%TG_HOME%%/modules/com/togethersoft/modules/ejbframework/xmleditor/JetAceDTD.dtd">

ejb.ddprologue = <?xml version='1.0' encoding="ISO-8859-1" ?>\n\
                 <!DOCTYPE ejb-JAR SYSTEM "JetAceDTD.dtd">


# The directory where all temp files would be located
env_DeployTemp = %%TEMP_OUT%%/DeployEJB

env_JAVAC = %%JAVA_HOME%%/bin/javac
env_JAR = %%JAVA_HOME%%/bin/jar
env_JRE = %%JAVA_HOME%%/bin/java

env_CP = %%JAVA_HOME%%/lib/classes.zip:\
         %%IBMSPH_HOME%%/lib/deployTool.jar:\
         %%IBMSPH_HOME%%/lib/iioptools.jar:\
         %%IBMSPH_HOME%%/lib/ujc.jar:\
         %%IBMSPH_HOME%%/lib/ejs.jar:\
         %%IBMSPH_HOME%%/lib/vaprt.jar:\
         %%IBMSPH_HOME%%/lib/ivbjfaceall.jar:\
         %%IBMSPH_HOME%%/lib/BEXruntime.jar:\
         %%IBMSPH_HOME%%/lib/developBEX.jar:\
         %%IBMSPH_HOME%%/lib/jetace.jar:\
         %%IBMSPH_HOME%%/lib/developEJB.jar:\
         %%IBMSPH_HOME%%/lib/xml4j.jar:\
         %%IBMSPH_HOME%%/lib/ibmwebas.jar:\
         %%IBMSPH_HOME%%/lib/console.jar:\
         %%IBMSPH_HOME%%/lib/admin.jar:\
         %%IBMSPH_HOME%%/properties:\
         %%IBMSPH_HOME%%/lib/repository.jar:\
         %%IBMSPH_HOME%%/lib/sslight.jar:\
         %%IBMSPH_HOME%%/lib/swingall.jar:\
         %%$CLASSPATH_PROJECT%%

env_EjbJar = %%env_DeployTemp%%/ejb-jar.xml

#WebSphere params
InputJar = %%TEMP_OUT%%/%%$PRJ_NAME%%.jar
OutputJar = %%TEMP_OUT%%/%%BEAN_NAME%%.jar
DeployJar = %%RESULT_OUT%%/Deploy%%BEAN_NAME%%.jar
SessionTimeout = 0
IsolationAttribute = READ_COMMITTED
DbExclusiveAccess = false
MinPoolSize = 2

execIBMJetAce = "%%env_JRE%%" -classpath "%%env_DeployTemp%%:%%TEMP_OUT%%:%%env_CP%%:.:" -Dcom.ibm.beans.BeanWorkingDirectory=%%TEMP_OUT%% com.ibm.ejb.jetjar.JetAceMain -f %%XMLFileName%%
WebSphereDTDPlacement = %%TG_HOME%%/modules/com/togethersoft/modules/ejbframework/plugins/ibmws30/JetAceDTD.dtd 
CopyCommand = cp %%WebSphereDTDPlacement%% %%env_DeployTemp%%

#Manifest file path
ManifestFile = %%RESULT_OUT%%/manifest.mf

read.step.1 = echo Not implemented yet
read.step.1.label = start

write.step.10 = Start Export
write.step.10.type = ejbframework.step.DisplayMessage

write.step.15 = %%env_CP%%
write.step.15.label = >>>>>>>>>> Adding "%%env_CP%%" to the project Search/Classpath
write.step.15.type = ejbframework.step.AddToProjectClasspath
write.step.15.task = task.addImports

# Create directories if they are not existing yet
write.step.20 = %%RESULT_OUT%%
write.step.20.label = >>>>>>>>>> Creating result dir %%RESULT_OUT%%
write.step.20.type = ejbframework.step.CreateDir

write.step.25 = %%env_DeployTemp%%
write.step.25.label = >>>>>>>>>> Deleting previous temp files
write.step.25.type = ejbframework.step.RemoveDirSilent
write.step.25.task = task.deleteTempBefore

write.step.30 = %%env_DeployTemp%%
write.step.30.label = >>>>>>>>>> Creating folder for temp files
write.step.30.type = ejbframework.step.CreateDir

write.step.40 = %%env_DeployTemp%%/META-INF
write.step.40.type = ejbframework.step.CreateDir

write.step.50.label = >>>>>>>>>> Correct EJB for selected server
write.step.50.type = ejbframework.step.CorrectEjb
write.step.50.task = task.correctBeans
#=================================================================================
# Verifying/correction section

# create backup dir if Verify task is selected and Backup checkbox is on
write.step.51 = CREATE_BACKUP_DIR
write.step.51.type = ejbframework.step.EvaluateLogicalExpr
write.step.51.param.oper = AND
write.step.51.param.arg1 = %%task.correctBeans%%
write.step.51.param.arg2 = %%DO_BACKUP%%

write.step.52 = %%BACKUP_DIR%%
write.step.52.label = >>>>>>>>>> Creating folder for backup files
write.step.52.type = ejbframework.step.CreateDir
write.step.52.task = CREATE_BACKUP_DIR

write.step.53 = VERIFY_AND_CORRECT
write.step.53.type = ejbframework.step.EvaluateLogicalExpr
write.step.53.param.oper = AND
write.step.53.param.arg1 = %%task.correctBeans%%
write.step.53.param.arg2 = %%CORRECT_SRC%%

# Step 1. Verify
write.step.54 = Verifying EJBs for compliance with IBMWS3.0
write.step.54.type = ejbframework.step.DisplayMessage
write.step.54.task = task.correctBeans

write.step.55 = Correct CMP ejbCreate methods to EJB1.0 Spec
write.step.55.label = >>>>>>>>>> Correction CMP EJBs ejbCreate methods to EJB1.0
write.step.55.type = ejbframework.step.migrate.CorrectEjbCreateCMP10
write.step.55.param.Backup = %%DO_BACKUP%%
write.step.55.param.BackupCmd = cp %%file_name%% %%BACKUP_DIR%%
write.step.55.param.BackupType = ejbframework.step.ExecuteCommandLine
write.step.55.param.remarkReturn = %%DO_RETURN%%
write.step.55.task = VERIFY_AND_CORRECT

# check whether CMP ejbCreate methods return PK (not void as in EJB1.0)
write.step.56 = Check for CMP ejbCreate methods
write.step.56.label = >>>>>>>>>> Verifying CMP EJBs ejbCreate methods
write.step.56.type = ejbframework.step.verify.EjbCreateCMP10
write.step.56.param.StopIfError = %%STOP_IF_NOT_COMPLIANT%%
write.step.56.task = task.correctBeans


#=================================================================================
write.step.59.label = >>>>>>>>>> Correct transaction attributes for selected server
write.step.59.type = ejbframework.step.CorrectTransactions
write.step.59.param.Specification = 1.0
write.step.59.task = task.correctBeans

write.step.60.label = >>>>>>>>>> Finder Helper Methods creating
write.step.60.type = ejbframework.plugins.ibmws30.step.WebSphereFinderStep
write.step.60.task = task.generateDD

write.step.100 = "%%env_JAVAC%%"  -d %%env_DeployTemp%% -classpath "%%env_CP%%" %%classes_to_compile%%
write.step.100.label = >>>>>>>>>> Compiling EJB(s) to %%env_DeployTemp%%
write.step.100.type = ejbframework.step.Compile
write.step.100.task = task.compile

#write.step.200 = %%env_EjbJar%%
#write.step.200.label = >>>>>>>>>> Generate DeploymentDescriptor to %%env_EjbJar%%
#write.step.200.type = ejbframework.step.ProviderDDGenerator11
#write.step.200.task = task.generateDD

#write.step.210 = 
#write.step.210.label = >>>>>>>>>> Generate Serialized Deployment Descriptor 
#write.step.210.type = ejbframework.plugins.ejb10.steps.SerDTD
#write.step.210.task = task.generateDD

# "-C %%TEMP_OUT%% ." means that root of directories to archive is located in TEMP_OUT and parent
# levels of directory tree should not arrive in result jar. All files and subdirectories
# of TEMP_OUT should be added
write.step.450.label = >>>>>>>>>> Creating JAR step 1: %%TEMP_OUT%%/%%$PRJ_NAME%%.jar
write.step.450 = "%%env_JAR%%" cvf %%TEMP_OUT%%/%%$PRJ_NAME%%.jar `cd %%env_DeployTemp%%; find . -name "*.class" | sed "s/\\.\\///"`
write.step.450.type = ejbframework.step.ExtendedExecuteCommandLine
write.step.450.task = task.generateDD
write.step.450.param.verbose = %%VERBOSE%%
write.step.450.param.highlightErrors = false

write.step.455 = cp %%WebSphereDTDPlacement%% %%env_DeployTemp%%
write.step.455.label = >>>>>>>>>> Copying JetAce DTD template to '%%env_DeployTemp%%'
write.step.455.type = ejbframework.step.ExecuteCommandLine

write.step.460.label = >>>>>>>>>> Creating XML DD files 
write.step.460 =
write.step.460.type = ejbframework.plugins.ibmws30.step.WebSphereDTD
write.step.460.task = task.generateDD

#write.step.465.label = >>>>>>>>>> XML files editing
#write.step.465 = %%env_DeployTemp%%/%%BEAN_NAME%%.xml
#write.step.465.type = ejbframework.xmleditor.CallCycleXMLEditor
#write.step.465.task = task.xmlEditor

write.step.470.label = >>>>>>>>>> Creating serialized DD with IBM JetAce tool 
write.step.470 = "%%env_JRE%%" -classpath "%%env_DeployTemp%%:%%TEMP_OUT%%:%%env_CP%%:.:" -Dcom.ibm.beans.BeanWorkingDirectory=%%TEMP_OUT%% com.ibm.ejb.jetjar.JetAceMain -f %%BEAN_NAME%%.xml
write.step.470.type = ejbframework.step.BeanCycleCommandLineExecutor
write.step.470.task = task.generateDD
write.step.470.param.verbose = %%VERBOSE%%
write.step.470.param.highlightErrors = true


# Deployable jar building
write.step.510 = PATH=%%JAVA_HOME%%/bin:$PATH LD_LIBRARY_PATH=%%IBMSPH_HOME%%/bin:$LD_LIBRARY_PATH "%%env_JRE%%" -classpath "%%env_CP%%:" com.ibm.ivj.ejb.tools.deployment.EJBDeploy %%OutputJar%% %%TEMP_OUT%% %%DeployJar%% -t 
write.step.510.label = >>>>>>>>>> Creating deployable JAR step 2: %%DeployJar%% 
write.step.510.type = ejbframework.step.BeanCycleCommandLineExecutor
write.step.510.task = task.generateDD
write.step.510.param.verbose = %%VERBOSE%%
write.step.510.param.highlightErrors = false


#Hot Deploy
write.step.520 =   
write.step.520.label = >>>>>>>>>> Hot Deploy step 1: XML import file(s) creation
write.step.520.type = ejbframework.plugins.ibmws30.step.WebSphereDeployStep
write.step.520.task = task.hotdeploy

#write.step.530 = "%%env_JRE%%" -classpath "%%env_CP%%" com.ibm.websphere.xmlconfig.XMLConfig -adminNodeName %%MASHINE_NAME%% -import %%DeployXMLFileName%%
#write.step.530.label = >>>>>>>>>> Hot Deploy of '%%RESULT_OUT%%/DEPLOYABLE_%%$PRJ_NAME%%.jar' to running IBM WebSphere server
#write.step.530.type = ejbframework.plugins.ibmws30.step.WebSphereXMLConfigStep
#write.step.530.task = task.hotdeploy

write.step.530 = "%%env_JRE%%" -classpath "%%env_CP%%" com.ibm.websphere.xmlconfig.XMLConfig -adminNodeName %%MASHINE_NAME%% -import Deploy%%BEAN_NAME%%.xml
write.step.530.label = >>>>>>>>>> Hot Deploy step 2: deployment of the jar-packed bean(s) to running IBM WebSphere server
write.step.530.type = ejbframework.step.BeanCycleCommandLineExecutor
write.step.530.task = task.hotdeploy
write.step.530.param.verbose = %%VERBOSE%%
write.step.530.param.highlightErrors = true

# delete temp directory
write.step.1000 = %%env_DeployTemp%%
write.step.1000.type = ejbframework.step.RemoveDir
write.step.1000.label = >>>>>>>>>> Deleting temporary folder %%env_DeployTemp%%
write.step.1000.task = task.deleteTempAfter
