#
# WIZARD Section
#

#
# task is a checkbox on the 1st page of wizard
#
task.compile = true
task.compile.name = Compile classes from the selected diagram
task.compile.order = 1

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

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

task.deploy = true
task.deploy.name = Deploy EAR to iPlanet AS
task.deploy.order = 4

task.register = true
task.register.name = Register Deployed EAR in iPlanet AS
task.register.order = 5

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

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

task.verify = false
task.verify.name = Verify deployment and registration by starting kregedit app
task.verify.order = 8

task.correctTA = true
task.correctTA.name = Correct transaction attributes for selected server
task.correctTA.order = 9

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

#
# 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 = c:\\temp
TEMP_OUT.name = Folder for the temporary files
TEMP_OUT.type = DirectoryField
TEMP_OUT.page = dirs
TEMP_OUT.order = 1

JAVA_HOME = c:\\jdk1.2.2
JAVA_HOME.name = JDK 1.2 root directory
JAVA_HOME.type = DirectoryField
JAVA_HOME.page = dirs
JAVA_HOME.order = 2
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.exe
JAVA_HOME.check.2.type = FileExistence
JAVA_HOME.check.2.message = Unable to locate JAVAC.exe application under selected JDK root: %%JAVA_HOME%%\\bin\\javac.exe
# TODO: add checking for other tools presenting

IAS_HOME = c:\\iPlanet\\ias6
IAS_HOME.name = Root directory of iPlanet 6.0 installation
IAS_HOME.type = DirectoryField
IAS_HOME.page = dirs
IAS_HOME.order = 3
IAS_HOME.check.1 = %%IAS_HOME%%
IAS_HOME.check.1.type = DirExistence
IAS_HOME.check.1.message = iPlanetAS directory '%%IAS_HOME%%' does not exist
IAS_HOME.check.2 = %%IAS_HOME%%\\ias\\bin\\ejbc.exe
IAS_HOME.check.2.type = FileExistence
IAS_HOME.check.2.message = Unable to locate ejbc.exe application under selected iAS root: %%IAS_HOME%%\\ias\\bin\\ejbc.exe
# TODO: add checking for other tools presenting

#
# PLUGIN Properties
#

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

plugin.name = iPlanet AS 6.0
plugin.version = 1.0
plugin.message_tab = EJB Deployment
plugin.message_prefix = IAS60:\u0020

ejb.type = 1.1
ejb.ddprologue = <?xml version="1.0" encoding="UTF-8"?>\n\
         <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN'\u0020\
           'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
ejb.appprologue = <?xml version="1.0" encoding="UTF-8"?>\n\
         <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN'\u0020\
           'http://java.sun.com/j2ee/dtds/application_1_2.dtd'>
ejb.iasprologue = <?xml version="1.0" encoding="UTF-8"?>\n\
	 <!DOCTYPE ias-ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD iAS Enterprise JavaBeans 1.0//EN'\u0020\
	   'http://www.iplanet.com/j2ee/dtds/IASEjb_jar_1_0.dtd'>

ejb.encoding = UTF-8

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

env_JAVAC = %%JAVA_HOME%%\\bin\\javac.exe
env_JAR = %%JAVA_HOME%%\\bin\\jar.exe
env_JRE = %%JAVA_HOME%%\\jre\\bin\\java.exe
env_EJBC = %%IAS_HOME%%\\ias\\bin\\ejbc.exe
env_REG = %%IAS_HOME%%\\ias\\bin\\j2eeappreg.bat
env_GUID = %%IAS_HOME%%\\ias\\bin\\kguidgen.exe
env_KREGEDIT = %%IAS_HOME%%\\ias\\bin\\kregedit.bat

env_CP = "%%$TG_HOME%%\\lib\\javax.jar;\
          %%$TG_HOME%%\\jdk\\lib\\rt.jar;\
          %%$TG_HOME%%\\jdk\\jre\\lib\\rt.jar;\
          %%$CLASSPATH_PROJECT%%;"

env_bin = %%IAS_HOME%%\\ias\\bin

# Temp directories for JAR and EAR contents
env_JARDIR = %%env_DeployTemp%%\\jar
env_EARDIR = %%env_DeployTemp%%\\ear
env_RESULTDIR = %%IAS_HOME%%\\ias\\Apps

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

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

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

# Create directories if they are not existing yet
# temp
write.step.10 = %%env_DeployTemp%%
write.step.10.label = >>>>>>>>>> Creating temp dir
write.step.10.type = ejbframework.step.CreateDir

# jar temp
write.step.20 = %%env_JARDIR%%
write.step.20.label = >>>>>>>>>> Creating temp dir for EJB JAR file %%env_JARDIR%%
write.step.20.type = ejbframework.step.CreateDir

write.step.25.label = >>>>>>>>>> Correct transaction attributes for the selected server
write.step.25.type = ejbframework.step.CorrectTransactions
write.step.25.param.Specification = 1.1
write.step.25.task = task.correctTA

# Compile EJB classes into Apps directory of IAS (where ejbc can find them)
write.step.30 = %%env_JAVAC%% -d %%env_JARDIR%% -classpath %%env_CP%% %%classes_to_compile%%
write.step.30.label = >>>>>>>>>> Compiling EJB(s) to %%env_JARDIR%%
write.step.30.type = ejbframework.step.Compile
write.step.30.task = task.compile

# Copy compiled classes into Apps directory of IAS (where ejbc can find them)
write.step.40 = cmd /c xcopy /S /Y %%env_JARDIR%%\\*.* %%env_RESULTDIR%%
write.step.40.label = >>>>>>>>>> Copying compiled EJB(s) to %%env_RESULTDIR%%
write.step.40.type = ejbframework.step.ExecuteCommandLine

# Start EJBC for compiled classes
# %%classes_for_ejbc%% are assembled by the plugin and contains: "[modifier] package.BeanBean", "package.BeanHome" and "package.Bean"
# where modifier is assigned to "-sl" (stateless), "-sf" (stateful) or "-cmp" (CMP entity bean)
write.step.50 = %%env_EJBC%% -d %%env_JARDIR%% %%classes_for_ejbc%%
write.step.50.label = >>>>>>>>>> Creating stubs to %%env_JARDIR%%
write.step.50.type = ejbframework.plugins.ias60.steps.EJBC

# Copy compiled classes into Apps directory of IAS (where iAS can find them)
write.step.55 = cmd /c xcopy /S /Y %%env_JARDIR%%\\*.* %%env_RESULTDIR%%
write.step.55.label = >>>>>>>>>> Copying compiled EJB(s) to %%env_RESULTDIR%%
write.step.55.type = ejbframework.step.ExecuteCommandLine

# Create dir for XML ejb-jar Descriptor
write.step.60 = %%env_JARDIR%%\\META-INF
write.step.60.type = ejbframework.step.CreateDir

# Generate XML DD
write.step.70 = %%env_JARDIR%%\\META-INF\\ejb-jar.xml
write.step.70.label = >>>>>>>>>> Generating DeploymentDescriptor to %%env_JARDIR%%\\META-INF\\ejb-jar.xml
write.step.70.type = ejbframework.step.ProviderDDGenerator11
write.step.70.task = task.generateDD

# Open XML editor for previously generated DD
write.step.71 = %%env_JARDIR%%\\META-INF\\ejb-jar.xml
write.step.71.label = >>>>>>>>>> Open XML Editor for generated %%env_JARDIR%%\\META-INF\\ejb-jar.xml
write.step.71.type = ejbframework.xmleditor.CallXMLEditor
write.step.71.task = task.xmlEditor

# Generate iAS XML DD
write.step.75 = %%env_JARDIR%%\\META-INF\\ias-ejb-jar.xml -guid %%env_GUID%%
write.step.75.label = >>>>>>>>>> Generating DeploymentDescriptor to %%env_JARDIR%%\\META-INF\\ias-ejb-jar.xml
write.step.75.type = ejbframework.plugins.ias60.steps.IASSpecificDDGenerator
write.step.75.task = task.generateDD

# Open XML editor for previously generated DD
write.step.76 = %%env_JARDIR%%\\META-INF\\ias-ejb-jar.xml
write.step.76.label = >>>>>>>>>> Open XML Editor for generated %%env_JARDIR%%\\META-INF\\ias-ejb-jar.xml
write.step.76.type = ejbframework.xmleditor.CallXMLEditor
write.step.76.task = task.xmlEditor

# create JAR file
write.step.80 = %%env_JAR%% cvf %%env_DeployTemp%%\\%%$PRJ_NAME%%.jar -C %%env_JARDIR%%\\ .
write.step.80.label = >>>>>>>>>> creating JAR: %%env_DeployTemp%%\\%%$PRJ_NAME%%.jar
write.step.80.type = ejbframework.step.ExecuteCommandLine

# delete JAR directory
write.step.90 = %%env_JARDIR%%
write.step.90.type = ejbframework.step.RemoveDir
write.step.90.task = task.deleteTempAfter

# create EAR dir
write.step.100 = %%env_EARDIR%%
write.step.100.label = >>>>>>>>>> Creating temp dir for application EAR file %%env_EARDIR%%
write.step.100.type = ejbframework.step.CreateDir

# move JAR file into EAR dir
write.step.110 = cmd /c move %%env_DeployTemp%%\\%%$PRJ_NAME%%.jar %%env_EARDIR%%\\
write.step.110.label = >>>>>>>>>> copying JAR to EAR dir: %%env_EARDIR%%\\%%$PRJ_NAME%%.jar
write.step.110.type = ejbframework.step.ExecuteCommandLine

# create EAR/META-INF dir
write.step.120 = %%env_EARDIR%%\\META-INF
write.step.120.type = ejbframework.step.CreateDir

# create application.xml into EAR/META-INF
# params = FQN of application.xml and name of EJB-JAR module
write.step.130 = %%env_EARDIR%%\\META-INF\\application.xml %%$PRJ_NAME%%.jar
write.step.130.label = >>>>>>>>>> Generating Application Descriptor to %%env_EARDIR%%\\META-INF\\application.xml
write.step.130.type = ejbframework.plugins.ias60.steps.ApplicationDDGenerator
write.step.130.task = task.generateDD

# Open XML editor for previously generated DD
write.step.135 = %%env_EARDIR%%\\META-INF\\application.xml
write.step.135.label = >>>>>>>>>> Open XML Editor for generated %%env_EARDIR%%\\META-INF\\application.xml
write.step.135.type = ejbframework.xmleditor.CallXMLEditor
write.step.135.task = task.xmlEditor

# create JAR file
write.step.140 = %%env_JAR%% cvf %%env_RESULTDIR%%\\%%$PRJ_NAME%%.ear -C %%env_EARDIR%%\\ .
write.step.140.label = >>>>>>>>>> creating EAR: %%env_RESULTDIR%%\\%%$PRJ_NAME%%.ear
write.step.140.type = ejbframework.step.ExecuteCommandLine

# delete EAR directory
write.step.150 = %%env_EARDIR%%
write.step.150.type = ejbframework.step.RemoveDir
write.step.150.task = task.deleteTempAfter

# Register deployed EAR
write.step.160 = %%env_REG%% %%env_RESULTDIR%%\\%%$PRJ_NAME%%.ear
write.step.160.label = >>>>>>>>>> Registering EAR: %%env_DeployTemp%%\\%%$PRJ_NAME%%.ear
write.step.160.type = ejbframework.step.ExecuteCommandLine
write.step.160.task = task.register

# start kregedit app to verify registration
write.step.170 = %%env_KREGEDIT%%
write.step.170.label = >>>>>>>>>> Starting registration verification program. Find information under %%$PRJ_NAME%%
write.step.170.type = ejbframework.step.ExecuteCommandLine
write.step.170.task = task.verify
