#
# WIZARD Section
#

#
# task is a checkbox on the 1st page of wizard
#
task.compile = true
task.compile.name = Compile classes from 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 generated DD
task.xmlEditor.order = 3

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

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

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

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

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

#
# 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

RESULT_OUT = c:\\temp
RESULT_OUT.name = Folder for the generated JAR file
RESULT_OUT.type = DirectoryField
RESULT_OUT.page = dirs
RESULT_OUT.order = 2

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 = 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.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

J2EE_HOME = c:\\j2sdkee1.2
J2EE_HOME.name = JDK 1.2 Enterprise Edition root directory
J2EE_HOME.type = DirectoryField
J2EE_HOME.page = dirs
J2EE_HOME.order = 4
J2EE_HOME.check.1 = %%J2EE_HOME%%
J2EE_HOME.check.1.type = DirExistence
J2EE_HOME.check.1.message = JDK1.2EE directory '%%J2EE_HOME%%' does not exist
J2EE_HOME.check.2 = %%J2EE_HOME%%\\lib\\j2ee.jar
J2EE_HOME.check.2.type = FileExistence
J2EE_HOME.check.2.message = Unable to locate j2ee.jar under selected JDK1.2EE root: %%J2EE_HOME%%\\lib\\j2ee.jar

CORRECT_SRC = true
CORRECT_SRC.name = Correct sources to comply with EJB 1.1 specification
CORRECT_SRC.type = BooleanField
CORRECT_SRC.order = 10
CORRECT_SRC.page = correcture

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

BACKUP_DIR = c:\\temp\\backup
BACKUP_DIR.name = Backup directory for the sources files (if "Correct sources" is selected)
BACKUP_DIR.type = DirectoryField
BACKUP_DIR.order = 20
BACKUP_DIR.page = correcture

#DO_RETURN = true
#DO_RETURN.name = Change return types in the Create methods
#DO_RETURN.type = BooleanField
#DO_RETURN.order = 25
#DO_RETURN.page = correcture
#
# PLUGIN Properties
#

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

plugin.name = Generic 1.1
plugin.version = 1.1
plugin.message_tab = EJB Deployment
plugin.message_prefix = ejb11:\u0020

ejb.type = 1.1
ejb.ddprologue = <?xml version="1.0"?>\n\
      <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.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%%\\jre\\lib\\rt.jar;\
    \
    %%JAVA_HOME%%\\lib\\rt.jar;\
    %%J2EE_HOME%%\\lib\\j2ee.jar;\
    %%$CLASSPATH_PROJECT%%;

env_EjbJar = %%env_DeployTemp%%\\META-INF\\ejb-jar.xml

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

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

# Create directories if they are not existing yet
write.step.20 = %%RESULT_OUT%%
write.step.20.label = >>>>>>>>>> Creating the target dir
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 %%env_DeployTemp%%
write.step.30.type = ejbframework.step.CreateDir

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

write.step.50 = CREATE_BACKUP_DIR
write.step.50.type = ejbframework.step.EvaluateLogicalExpr
write.step.50.param.oper = AND
write.step.50.param.arg1 = %%task.correctBeans%%
write.step.50.param.arg2 = %%DO_BACKUP%%

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

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

write.step.53.label = >>>>>>>>>> Correct EJB for selected server
write.step.53.type = ejbframework.step.CorrectEjb
write.step.53.task = VERIFY_AND_CORRECT

write.step.54 = Correct CMP ejbCreate methods to EJB1.0 Spec
write.step.54.label = >>>>>>>>>> Correcting CMP EJBs ejbCreate methods to EJB1.0
write.step.54.type = ejbframework.step.migrate.CorrectEjbCreateCMP11
write.step.54.param.Backup = %%DO_BACKUP%%
write.step.54.param.BackupCmd = cmd /c copy %%file_name%% %%BACKUP_DIR%%
write.step.54.param.BackupType = ejbframework.step.ExecuteCommandLine
#write.step.54.param.remarkReturn = %%DO_RETURN%%
write.step.54.task = VERIFY_AND_CORRECT

write.step.55.label = >>>>>>>>>> Correct transaction attributes for selected server
write.step.55.type = ejbframework.step.CorrectTransactions
write.step.55.param.Specification = 1.1
write.step.55.task = VERIFY_AND_CORRECT

write.step.100 = "%%env_JAVAC%%"  -d "%%env_DeployTemp%%" -classpath "%%env_CP%%" %%classes_to_compile%%
write.step.100.label = >>>>>>>>>> Compiling classes to %%env_DeployTemp%%
write.step.100.type = ejbframework.step.Compile
# make the step only if task is selected
write.step.100.task = task.compile

write.step.200 = %%env_EjbJar%%
write.step.200.label = >>>>>>>>>> Generating Deployment Descriptor to %%env_EjbJar%%
write.step.200.type = ejbframework.step.ProviderDDGenerator11
write.step.200.task = task.generateDD

write.step.205 = %%env_EjbJar%%
write.step.205.label = >>>>>>>>>> Open XML Editor for generated %%env_EjbJar%%
write.step.205.type = ejbframework.xmleditor.CallXMLEditor
write.step.205.task = task.xmlEditor

# "-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 = "%%env_JAR%%" cvfM %%RESULT_OUT%%\\%%$PRJ_NAME%%.jar -C %%env_DeployTemp%%\\ .
write.step.450.label = >>>>>>>>>> creating JAR: %%RESULT_OUT%%\\%%$PRJ_NAME%%.jar
write.step.450.type = ejbframework.step.ExecuteCommandLine
write.step.450.task = task.generateDD

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