Step Screenshots and generated files of Bean Wizard
Bean Wizard provides an environment where you can either menually build your business object/bean image
or automatically load the image from a given jar file. This will be the first phase definding your web
application if you do it in a "bottom-up" manner.
A. Introduction
In the demo, I will should you the second way, loading the business image from a jar file. The first
thing you need to deal with is the jar file, MyBeans.jar. This file tells what your next tier presents.
It contains a configuration file (coo-deploy-config.xml), delegation class file (DataStorage.java),
bean classes and other classes. coo-deploy-config.xml is a place where you define the basic attributes
of your web application such as name, access url and so on:
<?xml version="1.0" encoding="UTF-8" ?>
<application _name="PetStore" _urlPre="http://localhost:8080/" _title="Pet Store"
_delegation="com.xxx.samples.petstore.webapp.EJBDelegation"
_packName="com.xxx.samples.petstore.webapp" _jspPath="/pages/samples/petstore/"
_jspURL="/pages/samples/petstore/">
<delegation>
<jars>
<jar _name="WEB-INF/classes/com/xxx/samples" _type="dir" root="com.xxx.samples" />
</jars>
</delegation>
</application>
The DataStorage class contains all the APIs of next tier such as Spring or EJB available
to web tier.
B. Steps to create a simple web application
Be default, the Bean Wizard will create an "Bean Info" application with tabs at the upper and two screens in the
lower area. The tab area will only contain a tab named "Beans" which show all types of beans found by the wizard
listed as headers. The upper screen in the lower area contains all the instances of the selected bean and the
lower screen will allow you to edit a selected bean instance in the upper screen.
Step 1:
Launch the Coolshare Wizard and select the "Builder" tab
Step 2:
Select "Bean" (Bean Wizard) among headers of the "Builder" tab. You will see there are six buttons and
some of them label with step numbers. Disabled buttons depends on early steps.
Step 3:
To scan a jar file, click at button "Scan Jars (1)".
Step 4:
Select a jar file from the popup dialog.
Step 5:
Click at "inspect" button to start the scanning. A message will be shown when done.
Step 6:
Click at "OK" in the message box and you will see the result of scanning.
Step 7:
Since some of the classes may not be a business object so you need to uncheck them.
In our case, "DataStorage" is removed. This file is used to simulate a DB.
Step 8:
Next, click at button "Generate Codes (2)". The Wizard will then generate all the
necessary files but keep them in memory w/o filing. You can see we have "Java" files
"JSP" files
"Struts" configuration files
The real files are here
(All *.jsp files were rename to *.txt so that we can see them)
Step 9:
Click at button "Deploy (3)" to deploy the web application into the web server. The Wizard
will actually create a war file and then copy it over. You can see the button "Run (4)" is
now enabled in the last picture below
Step 10:
Click at the button "Run (4)" and you will see a popup asking for the url.
Step 11:
Just click at button "OK". You can then see the web application, "Pet Store" as you defined in
the jar file, you are building is now up.
Step 12:
You can play around in your "Pet Store"
Summary
If you look at the files you generated again,
you will see , so far, most the information about your "Pet Store" resides only in the configuration files:
all the java files and jsp files are "empty"! You will need some coding to customize it into a real
"Pet Store" but the coding is minimized and will be mostly done in the Wizards in a visual way.
I am building more Wizards such as
Application Wizard constructing application layout
Control Flow Wizard designing the control flows
More..
Come back soon to see!!
|