Plants by WebSphere |
|
Getting started |
Identifying the directory structure |
Rebuilding and installing the Sample |
One of the great benefits of developing applications on a J2EE
platform is portability. All of the Sample programs in the Samples
Gallery are developed on a workstation and run on z/OS and iSeries systems without
changing one line of Java code. By building J2EE applications on
Intel or UNIX systems, a developer can eliminate the challenges of
EBCDIC to ASCII or ASCII to EBCDIC file conversions.
The availability of tools makes it easy for developers to write and test
on a development workstation and install the enterprise archive (EAR)
files on z/OS and iSeries systems.
Every WebSphere Application Server (Application Server) for z/OS and iSeries
customer is entitled to the Application Server media for
multiplatforms. If you install the WebSphere Application Server base product and
the Samples on one of the platforms supported by this package you see
the same gallery. The one exception is
that when you click sample_name > Build with Ant > platform > Rebuilding and installing the sample.ear file, you get instructions to
rebuild the EAR file on that platform. Because text files in an
EAR file (XML, xmi, JavaServer Pages (JSP) files, and so on) must
be in an ASCII format, it is easier to edit those files on an ASCII
machine. If you make changes on an ASCII machine, you can then deploy and install the
resulting EAR file on the z/OS or iSeries platform without an EBCDIC to ASCII
conversion.
Install WebSphere Application Server on the distributed platform of your choice and indicate to install Application Server Sample applications as well.
Make a backup copy of the <profile_root>/samples directory before attempting to modify or rebuild the Samples. Create a zip file of the samples directory. You can restore the samples directory to its original state by extracting the zip file.
The Samples are installed in the following directories:
<profile_root>/samples/src/PlantsByWebSphere | Contains the Sample source code for the Plants by WebSphere Sample. |
<profile_root>/samples/lib/PlantsByWebSphere | Contains the Web archive (WAR) files, Java archive (JAR) files, and the final PlantsByWebSphere.ear file for the Plants by WebSphere Sample. This directory is created after the Plants by WebSphere Sample is rebuilt. |
<profile_root>/samples/javadoc/PlantsByWebSphere | Contains the Javadoc documentation. This directory is created after the Plants by WebSphere Sample is rebuilt. |
<profile_root>/samples/bld/PlantsByWebSphere | Contains the generated class files. Use these class files to generate the final PlantsByWebSphere.ear file. This directory is created after the Plants by WebSphere Sample is rebuilt. |
The Plants by WebSphere Sample automatically installs with the WebSphere Application Server. You do not have to build the Plants by WebSphere Sample before using it. The following directions describe the steps to rebuild the Sample, along with additional information for modifications.
Executing the Sample build script |
To rebuild this Sample, verify that profile_root/bin is in your PATH environment variable. Follow these steps to execute the Sample build script, which rebuilds the Sample:
The Sample is now built.
The buildplantsby.bat and the buildplantsby.sh script in the profile_root/samples/bin/PlantsByWebSphere directory sets the appropriate class path information and executes the Ant build utility. Ant reads the build.xml files, which describe how to build the Sample. Refer to the Jakarta Web site for additional documentation on Ant.
During the build process, only class files
that have changes are rebuilt. The remaining class files are repackaged
into the new EAR file.
Use the File Transfer Protocol (FTP) to transfer the binary EAR file to the z/OS or iSeries server, using the following instructions.
By default, the Plants by WebSphere Sample installs into the profile_root/installedApps/<cell
name> directory, where <cell name>
is the name of the cell where your application is installed. Reinstall the Sample as described in the following steps:
wsadmin -conntype none -lang jython -c "AdminApp.uninstall('PlantsByWebSphere')"
wsadmin.sh -conntype none -lang jython -c "AdminApp.uninstall('PlantsByWebSphere')"
wsadmin.sh -conntype none -lang jython -c "AdminApp.uninstall('PlantsByWebSphere')"
wsadmin -conntype none -lang jython -c "AdminApp.uninstall('PlantsByWebSphere')"
wsadmin -conntype none -lang jython -c "AdminApp.install('PlantsByWebSphere.ear', ['-appname', 'PlantsByWebSphere', '-usedefaultbindings', '-node', '<node>', '-server', '<server>', '-deployejb', '-deployejb.dbtype', 'DERBY_V10'] )"where <node> is the name of node, and <server> is the name of server on which to install the Sample.
wsadmin.sh -conntype none -lang jython -c "AdminApp.install('PlantsByWebSphere.ear', ['-appname', 'PlantsByWebSphere', '-usedefaultbindings', '-node', '<node>', '-server', '<server>', '-deployejb', '-deployejb.dbtype', 'DERBY_V10'] )"where <node> is the name of node, and <server> is the name of server on which to install the Sample.
wsadmin.sh -conntype none -lang jython -c "AdminApp.install('PlantsByWebSphere.ear', ['-appname', 'PlantsByWebSphere', '-usedefaultbindings', '-node', '<node>', '-server', '<server>', '-deployejb', '-deployejb.dbtype', 'DERBY_V10'] )"
wsadmin -conntype none -lang jython -c "AdminApp.install('PlantsByWebSphere.ear', ['-appname', 'PlantsByWebSphere', '-usedefaultbindings', '-node', '<node>', '-server', '<server>', '-deployejb', '-deployejb.dbtype', 'DERBY_V10'] )"where <node> is the name of node, and <server> is the name of server on which to install the Sample.
The rebuilt PlantsByWebsphere.ear file is now deployed to your Application Server.