Home

  

Product

  

Buy

  

Support

 First Line 
 FAQs 
 Tutorials 
 Registered Users 
 User Guide 
 Knowledge Base 

News

  

Press

  

Downloads

  

Contact

  

Company

  

Partners

  

Resources

 
 

User Guide - Quick start

Index    Previous   <<>>  Next
  
6.1 Building a J2EE enterprise application

6.2 Building a J2EE web application

  6.1  Building a J2EE enterprise applicationTo top of page

  1. Configure JCodeBox
  2. Configure JCodeBox system options such as the default DataSource JNDI name. For further details on configuring system options please see chapter 18. Appendix C - JCodeBox configuration.

  3. Configure databases
    • In the main JCodeBox window, right mouse click on the Database Drivers node and select Add Driver...

    • Complete the Add Driver dialog

    • Restart JCodeBox

    Once you have configured your JDBC driver(s) you can create connections to your databases. For further details on configuring JDBC drivers and creating connections please see chapter 16. Appendix A - Database configuration.

  4. Add a connection
    • In the main JCodeBox window, right mouse click on the Database Driver you created in the previous step and select Add Connection...

    • Complete the Add Connection dialog

    • Double click on the connection to list the catalogs/schemas available in the database.

  5. Open the define application dialog
    • Right mouse click on the catalog/schema you would like to use and select Generate Application->J2EE Enterprise Application 1.3

    Note
    If you decide not to configure database support in JCodeBox at this time, you can still build and deploy J2EE Applications by selecting Generate->J2EE Enterprise Application from the main menu

  6. Enter application settings
    • Enter the application name (defaults to the name you entered in the system options dialog)
    • Enter the base package name (defaults to the name you entered in the system options dialog)
    • Enter the target output directory (defaults to the directory you entered in the system options dialog)
    • Enter a datasource JNDI name (Important this will be inherited by all subsequently created entity beans - defaults to the name you entered in the system options dialog)
    • Select your target application server
    • Select your target database
    Note
    Make sure you have previously configured the datasource JNDI name in your target application server.

  7. Define entities
  8. If you are defining an application from a database schema/catalog:

    • Right mouse click on the EIS Tier and choose Add Multiple Database Entities ...
    • Double click on the TABLES node
    • Select one or more tables and click OK (make sure all selected tables have primary keys defined in the database)
    • Click OK

    If you are defining an application with entities defined in the JCodeBox GUI:

    • Right mouse click on the EIS Tier and choose Add Manual Entity ...
    • Define the name, primary key fields and Data fields for your entity
    • Click OK
    • Define as many entities as your application requires.

  9. Define business objects
  10. To define an entity EJB:
    • Right mouse click on the Business Tier and choose Add Multiple BMP/CMP EJBs
    • Select the entities (configured in the previous step) these EJBs will be based on
    • Click OK

    To define a session EJB:

    • Right mouse click on the Business Tier and choose Add Stateless/Stateful Session EJB/Facade
    • Enter your business methods on the Code tab
    • Click OK

    To define a message driven bean:

    • Right mouse click on the Business Tier and choose Add Message Driven Bean/Facade
    • Enter your business logic in the onMessage method (on the Code tab)
    • Click OK

  11. Define view sets
    • Right mouse click on the Web Tier and choose Add Multiple View sets ...
    • Select the Business Objects you would like views created for.
    • Click OK

  12. Generate, build and deploy
    • Click Create in the Enterprise Application dialog
    • Select all of the build options (pre-process, generate, compile, package and deploy)
    • Click OK
    • If any resources need to be configured in your application server prior to deployment they will be displayed in a dialog. Click OK on this dialog when the resources have been configured.

  13. Finish
  14. If your application server is correctly configured, JCodeBox will generate, build and deploy your application. If you selected the Launch Browser after deploy option in system options, JCodeBox will open a browser displaying your deployed J2EE Application.

    All of the java source code (with javadoc tags), deployment descriptors, ANT build scripts, jar files, a readme file, etc can be found in the target output directory you entered in the Enterprise Application settings dialog.

    This tutorial has merely scratched the surface of the rich functionality available in JCodeBox. Please read the rest of the user guide for details on more advanced features including adding relationships, adding J2EE patterns, defining finders/selects, adding business methods and much much more.

  6.2  Building a J2EE web applicationTo top of page

  1. Configure JCodeBox
  2. Configure JCodeBox system options. For further details on configuring system options please see chapter 18. Appendix C - JCodeBox configuration.

  3. Configure databases
    • In the main JCodeBox window, right mouse click on the Database Drivers node and select Add Driver...

    • Complete the Add Driver dialog

    • Restart JCodeBox

    Once you have configured your JDBC driver(s) you can create connections to your databases. For further details on configuring JDBC drivers and creating connections please see chapter 16. Appendix A - Database configuration.

  4. Add a connection
    • In the main JCodeBox window, right mouse click on the Database Driver you created in the previous step and select Add Connection...

    • Complete the Add Connection dialog

    • Double click on the connection to list the catalogs/schemas available in the database.

  5. Open the define application dialog
    • Right mouse click on the catalog/schema you would like to use and select Generate Application->J2EE Web Application

  6. Enter application settings
    • Enter the application name (defaults to the name you entered in the system options dialog)
    • Enter the base package name (defaults to the name you entered in the system options dialog)
    • Enter the target output directory (defaults to the directory you entered in the system options dialog)
    • Enter a datasource JNDI name
    • Select your target application server
    • Select your target database

  7. Define entities
  8. If you are defining an application from a database schema/catalog:

    • Right mouse click on the EIS Tier and choose Add Multiple Database Entities ...
    • Double click on the TABLES node
    • Select one or more tables and click OK (make sure all selected tables have primary keys defined in the database)
    • Click OK

    If you are defining an application with entities defined in the JCodeBox GUI:

    • Right mouse click on the EIS Tier and choose Add Manual Entity ...
    • Define the name, primary key fields and Data fields for your entity
    • Click OK
    • Define as many entities as your application requires.

  9. Define view sets
    • Right mouse click on the Web Tier and choose Add Multiple View sets ...
    • Select the entities you would like views created for.
    • Click OK

  10. Define additional web components
  11. To define a JSP:
    • Right mouse click on the Web Tier and choose Add JSP
    • Complete the define JSP dialog
    • Click OK

    To define a view helper:

    • Right mouse click on the Web Tier and choose Add View Helper (+JSP)
    • Complete the define view helper dialog
    • Click OK

  12. Generate, build and deploy
    • Click Create in the Web Application dialog
    • Select all of the build options (pre-process, generate, compile, package and deploy)
    • Click OK

  13. Finish
  14. If your application server is correctly configured, JCodeBox will generate, build and deploy your application.

    All of the java source code (with javadoc tags), deployment descriptors, ANT build scripts, jar files, a readme file, etc can be found in the target output directory you entered in the Web Application settings dialog.

Index    Previous   <<>>  Next

[an error occurred while processing this directive]