Difference between revisions of "EDT:Tutorial: RUI With Database Lesson 11"

From Eclipsepedia

Jump to: navigation, search
(Run the generated code)
(Edit the deployment descriptor)
 
(6 intermediate revisions by one user not shown)
Line 10: Line 10:
 
server-specific code to match your target environment.
 
server-specific code to match your target environment.
  
Deployment is a two stage process:Deployment is a two
+
Deployment is a two stage process:
stage process:
+
  
 
<ol><li>Internal deployment, when you deploy your handlers to a web project.  
 
<ol><li>Internal deployment, when you deploy your handlers to a web project.  
Line 21: Line 20:
  
 
== Edit the deployment descriptor ==
 
== Edit the deployment descriptor ==
 
 
  
 
The EGL deployment descriptor manages the internal deployment
 
The EGL deployment descriptor manages the internal deployment
 
and is created automatically in each '''EGLSource''' folder.
 
and is created automatically in each '''EGLSource''' folder.
The main handler is in the MortgageUIProject, and you use the EGL
+
The main handler is in the '''PaymentClient'''.  You use the EGL
deployment descriptor in the PaymentClient/EGLSource folder.
+
deployment descriptor in the '''PaymentClient/EGLSource''' folder.
  
 
To
 
To
 
edit the EGL deployment descriptor:
 
edit the EGL deployment descriptor:
 
 
 
<ol><li>In the '''EGLSource''' folder, double-click
 
<ol><li>In the '''EGLSource''' folder, double-click
the PaymentClient.egldd file. The
+
the '''PaymentClient.egldd''' file. The
EGL deployment descriptor opens in the Deployment Descriptor editor.
+
EGL deployment descriptor opens in the deployment descriptor editor.
 
EGL automatically added the embedded handlers to the list of Rich
 
EGL automatically added the embedded handlers to the list of Rich
 
UI handlers to deploy.
 
UI handlers to deploy.
Line 45: Line 40:
 
opens.
 
opens.
 
<li>In the '''Project Name''' field, enter
 
<li>In the '''Project Name''' field, enter
the following name:
+
the name '''PaymentWeb'''.
 
+
PaymentWeb
+
 
Any
 
Any
 
web project is acceptable. You are creating a simple one for the purposes
 
web project is acceptable. You are creating a simple one for the purposes
 
of the tutorial.
 
of the tutorial.
<li>For Target runtime, select one of the following options
+
<li>For Target runtime, select '''Apache Tomcat v6.0'''.
from the list:
+
The value of the '''Configuration''' field changes automatically to
 
+
<ul><li>'''Apache Tomcat v6.0'''
+
<li>'''WebSphere Application Server v<var class="keyword varname">n.n</var>'''
+
</ul>
+
The value of the Configuration field changes automatically to
+
 
match the new runtime environment.
 
match the new runtime environment.
<li>If you are deploying to a '''WebSphere Application Server runtime,
+
<li>Add the SQL database binding to the deployment descriptor as you did for the '''ServiceProject''' deployment descriptor as described in the section [[EDT:Tutorial: RUI With DataBase Lesson 6#Create binding to database connection|Create binding to database connection  ]].   If you chose to use runtime binding using an application server JNDI name to reference the database resource instead of hard coded binding, make sure that you have copied the '''derbyclient.jar''' file to the lib directory in the Tomcat install directory.
select '''Add project to an EAR''', which is underneath '''EAR
+
membership'''. If you add the project to an EAR, accept the
+
default name that the wizard displays. For Apache Tomcat, ensure that
+
the '''Add project to an EAR''' check box is clear.''' <br />[[Image:EDT_Tutorial_edt_richui_sql13_deploy_to_ear.jpg|The New Dynamic Web Project wizard, configured for WebSphere Application Server]]
+
 
+
 
<li>Click '''Finish'''. EGL
 
<li>Click '''Finish'''. EGL
 
creates the web project and re-displays the deployment descriptor.
 
creates the web project and re-displays the deployment descriptor.
 
<li>Save and close the deployment descriptor.
 
<li>Save and close the deployment descriptor.
</ol>
 
 
== Set the data source for the new project ==
 
 
Before you can access the database from the new project,
 
you must connect the project to the database.
 
 
<ol><li>In the Project Explorer view, right-click the '''PaymentWeb''' project
 
and click '''Properties''' &gt; '''EGL
 
Runtime Data Source'''.
 
<li>Click '''Load values from a data tools connection'''.
 
<li>Click the down arrow next to the '''Connection''' field
 
and select '''Derby Database Connection''', which
 
is the connection profile that you created in Lesson 2. <br />[[Image:EDT_Tutorial_edt_richui_sql13_runtime_data_source.jpg|The connection is available in the display.]]
 
 
<li>Click '''OK'''.
 
 
</ol>
 
</ol>
  
 
== Deploy the Rich UI application ==
 
== Deploy the Rich UI application ==
 
 
  
 
You can now launch the deployment process:
 
You can now launch the deployment process:
 
  
 
<ol><li>In the EGLSource folder, right-click
 
<ol><li>In the EGLSource folder, right-click
the <span class="ph filepath">PaymentClient.egldd file.</span>
+
the '''PaymentClient.egldd file'''.  
<li>Click '''Deploy EGL Descriptor'''. <br />[[Image:EDT_Tutorial_edt_richui_sql13_deploy_dd.jpg|The Deploy EGL Descriptor option]]
+
<li>Click '''Deploy EGL Descriptor'''.<br />
The deployment
+
[[Image:EDT_Tutorial_edt_richui_sql13_deploy_dd.jpg|The Deploy EGL Descriptor option]]<br />
 +
The deployment
 
process requires no further action on your part. The process copies
 
process requires no further action on your part. The process copies
 
many files and might take several minutes.
 
many files and might take several minutes.
<li>If the Tomcat server shows a status of &quot;œRestart&quot;?, consider
+
<li>If the Tomcat server shows a status of '''Restart''', consider
that statement a directive: restart the server by clicking the green '''Start''' icon
+
that statement a directive: restart the server by right-clicking the server name and click '''Restart'''. When the server has restarted, the status is '''Started, Synchronized'''.
in the upper right of the Servers view <br />[[Image:EDT_Tutorial_edt_richui_sql13_restart_icon.jpg|EDT_Tutorial_edt_richui_sql13_restart_icon.jpg]]. Alternatively,
+
you can right-click the server name and click '''Restart'''. When the server has restarted, the status is "Started,
+
Synchronized".
+
 
</ol>
 
</ol>
  
Line 109: Line 71:
  
 
<ol><li>To run the internally deployed code, focus your attention
 
<ol><li>To run the internally deployed code, focus your attention
on the target project, PaymentWeb. In the PaymentWeb/WebContent folder,
+
on the target project, '''PaymentWeb'''. In the '''PaymentWeb/WebContent''' folder,
 
find '''PaymentFileMaintenance.html'''.  
 
find '''PaymentFileMaintenance.html'''.  
<li>Right-click the file name and click '''Run
+
<li>Right-click the file name and click '''Run As &gt; Run on Server'''<br />[[Image:EDT_Tutorial_edt_richui_sql13_run_as.jpg|The Run on Server option is shown in the menu]]<br />
As''' &gt; '''Run on Server''' <br />[[Image:EDT_Tutorial_edt_richui_sql13_run_as.jpg|The Run on Server option is shown in the menu]]
+
The '''Run On Server''' window opens.
The Run
+
<li>In the '''Run On Server''' window, select
On Server window opens.
+
<li>In the Run On Server window, select
+
 
the appropriate server and click '''Always use this server
 
the appropriate server and click '''Always use this server
 
when running this project'''. Click '''Finish'''. <br />[[Image:EDT_Tutorial_edt_richui_sql13_run_on_server.jpg|The Run On Server window for Tomcat]]
 
when running this project'''. Click '''Finish'''. <br />[[Image:EDT_Tutorial_edt_richui_sql13_run_on_server.jpg|The Run On Server window for Tomcat]]
  
 
<li>If you are using Tomcat and see a page not found error
 
<li>If you are using Tomcat and see a page not found error
(404), check whether the server is showing a Restart status. If so,
+
(404), check whether the server is showing a '''Restart''' status. If so,
restart the server and refresh the page. <br />[[Image:EDT_Tutorial_edt_richui_sql13_restart.jpg|The Server window asks you to restart the server.]]
+
restart the server and refresh the page. <br />[[Image:EDT_Tutorial_edt_richui_sql13_restart.jpg|The Server window asks you to restart the server.]]<br />
 
The page
 
The page
 
opens.
 
opens.
Line 130: Line 90:
 
''' Related concepts '''<br>
 
''' Related concepts '''<br>
  
[../../com.ibm.egl.gg.doc/topics/gegl_core_overview.html Introduction to EGL generation and deployment]
+
* Help topic:  Introduction to EGL generation and deployment<br />
  
 
== Lesson checkpoint ==
 
== Lesson checkpoint ==

Latest revision as of 09:35, 12 April 2012

Access a database with EGL Rich UI


< Previous | Next >

Contents

[edit] Lesson 11: Deploy and test the payment application

During the deployment process, EGL creates HTML files and server-specific code to match your target environment.

Deployment is a two stage process:

  1. Internal deployment, when you deploy your handlers to a web project.
  2. External deployment, when you deploy the web project to an application server.

After you deploy the tutorial application internally, you can run it on an application server in the workbench.

[edit] Edit the deployment descriptor

The EGL deployment descriptor manages the internal deployment and is created automatically in each EGLSource folder. The main handler is in the PaymentClient. You use the EGL deployment descriptor in the PaymentClient/EGLSource folder.

To edit the EGL deployment descriptor:

  1. In the EGLSource folder, double-click the PaymentClient.egldd file. The EGL deployment descriptor opens in the deployment descriptor editor. EGL automatically added the embedded handlers to the list of Rich UI handlers to deploy.
  2. Because you are using a dedicated service, you do not need to add information to the Service Bindings Configuration section. The list is empty.
  3. Under Deployment Target, next to the Target project field, click New.
    The Overview page of the EGL deployment descriptor shows no services to generate, and shows the list of your handlers under Rich UI Deployment. The Dynamic Web Project wizard opens.
  4. In the Project Name field, enter the name PaymentWeb. Any web project is acceptable. You are creating a simple one for the purposes of the tutorial.
  5. For Target runtime, select Apache Tomcat v6.0. The value of the Configuration field changes automatically to match the new runtime environment.
  6. Add the SQL database binding to the deployment descriptor as you did for the ServiceProject deployment descriptor as described in the section Create binding to database connection . If you chose to use runtime binding using an application server JNDI name to reference the database resource instead of hard coded binding, make sure that you have copied the derbyclient.jar file to the lib directory in the Tomcat install directory.
  7. Click Finish. EGL creates the web project and re-displays the deployment descriptor.
  8. Save and close the deployment descriptor.

[edit] Deploy the Rich UI application

You can now launch the deployment process:

  1. In the EGLSource folder, right-click the PaymentClient.egldd file.
  2. Click Deploy EGL Descriptor.
    The Deploy EGL Descriptor option
    The deployment process requires no further action on your part. The process copies many files and might take several minutes.
  3. If the Tomcat server shows a status of Restart, consider that statement a directive: restart the server by right-clicking the server name and click Restart. When the server has restarted, the status is Started, Synchronized.

[edit] Run the generated code

  1. To run the internally deployed code, focus your attention on the target project, PaymentWeb. In the PaymentWeb/WebContent folder, find PaymentFileMaintenance.html.
  2. Right-click the file name and click Run As > Run on Server
    The Run on Server option is shown in the menu
    The Run On Server window opens.
  3. In the Run On Server window, select the appropriate server and click Always use this server when running this project. Click Finish.
    The Run On Server window for Tomcat
  4. If you are using Tomcat and see a page not found error (404), check whether the server is showing a Restart status. If so, restart the server and refresh the page.
    The Server window asks you to restart the server.
    The page opens.
  5. Test the application by adding, deleting, and modifying payment records.

Related concepts

  • Help topic: Introduction to EGL generation and deployment

[edit] Lesson checkpoint

You learned how to complete the following tasks:

  • Edit a deployment descriptor to deploy a Rich UI handler.
  • Run the application on an application server.


< Previous | Next >