Home

  

Product

  

Buy

  

Support

 First Line 
 FAQs 
 Tutorials 
 Registered Users 
 User Guide 
 Knowledge Base 

News

  

Press

  

Downloads

  

Contact

  

Company

  

Partners

  

Resources

 
 
5. Configuring JCodeBox

  
 5.1 Introduction

 5.2 Overview

 5.3 Default DataSource JNDI name

 5.4 Default output directory

 5.5 Temporary directory

 5.6 Warning if no DataSource JNDI set

 5.7 Default URL pattern

 5.8 Default base package

 5.9 Default application name

 5.10 EJB module name

 5.11 Web module name

 5.12 Create default creator (all fields)

 5.13 Create DataSource resource reference

 5.14 Synchronise DataSource field setting with resource reference

 5.15 Synchronise bean name with constructors

 5.16 Web app tab

  5.1 IntroductionTo top of page

 This tutorial describes how to configure JCodeBox. There are a number of configuration settings available which affect how JCodeBox works and this tutorial covers the most important of these. In particular it covers settings that should be set prior to using JCodeBox to generate applications or components.

  5.2 OverviewTo top of page

 JCodeBox is very flexible and provides a number of global options that can be used to tailor the way in which it works. To set options use the Tools->Options ... menu. This will load the JCodeBox options dialog.

We recommend that certain options are set prior to generating your first applications/components from JCodeBox. These are listed below and are discussed in further detail later in this tutorial:

  • Default DataSource JNDI name
  • Default output directory
  • Temporary directory

When you have completed setting your global options, click the OK button to commit your changes.

  5.3 Default DataSource JNDI nameTo top of page

 Application tab

Entity beans generated by JCodeBox typically maintain data held in a database. The entity bean needs a way to obtain a connection to this database. In J2EE, connections are obtained from a DataSource resource reference that has been previously configured in your application server (consult your application server's documentation for further details on creating resource references).

A DataSource resource reference is accessed (i.e. by an entity bean) using the JNDI name that was assigned to it when it was configured. Before using JCodeBox, you should create a DataSource resource reference for your database in your application server. You should then set the Default DataSource JNDI name setting in JCodeBox to the JNDI name you assigned to the DataSource resource reference.

When you create applications in JCodeBox, it will automatically set the applications' DataSource JNDI name to the value in the Default DataSource JNDI name global setting. Then, when you create any entity beans in your application, the entity bean's DataSource JNDI name will automatically be set to the application's DataSource JNDI name. In addition, JCodeBox can automatically create a DataSource resource reference in the entity beans' resource references list based on its DataSource JNDI name.

In effect, you only have to set the DataSource JNDI name once (in global settings), and all future components (that need DataSource objects i.e. entity beans) that you generate in JCodeBox can inherit this value.

If you change your database and create a new DataSource resource reference, again you only need to make the change in one place in JCodeBox (global settings) and all future applications/entity beans that are created will use this new value.

JCodeBox also allows you to maintain a list of commonly used DataSource JNDI names making it easier to switch between names. To add/edit/delete from this list, click the button to the right of the default DataSource JNDI name dropdown box.

Tip
If you have matching tables in different databases and would like your application to access the table in a different database (i.e. different from your Default DataSource resource reference) you can manually override the DataSource JNDI settings for an individual entity bean. Note however, this does depend on your application server and bean persistence type and also raises potential transaction issues.

  5.4 Default output directoryTo top of page

 Application tab

When you generate applications/components, JCodeBox will put all of the source code, deployment descriptors, etc in the default output directory. A default value is assigned the first time you run JCodeBox.

  5.5 Temporary directoryTo top of page

 General tab

When you preview components JCodeBox will put all of the preview source code in the temporary directory. A default value is assigned the first time you run JCodeBox.

  5.6 Warning if no DataSource JNDI setTo top of page

 General tab

When this option is set, JCodeBox will warn you if you attempt to create an entity bean when there is no DataSource JNDI name set in the application.

  5.7 Default URL patternTo top of page

 Application tab

This is the URL pattern JCodeBox will use for all generated web applications.

  5.8 Default base packageTo top of page

 Application tab

JCodeBox will assign this to be the base package name for all applications you create.

  5.9 Default application nameTo top of page

 Application tab

JCodeBox will assign this to be the application name for all applications you create.

  5.10 EJB module nameTo top of page

 Deployment tab

When JCodeBox packages your enterprise application, this is the name it will give to the archive file.

  5.11 Web module nameTo top of page

 Deployment tab

When JCodeBox packages your web application, this is the name it will give to the archive file.

  5.12 Create default creator (all fields)To top of page

 Entity Bean tab

When this option is set, JCodeBox will create a default creator (using all available bean fields) whenever you create an entity bean.

  5.13 Create DataSource resource referenceTo top of page

 Entity Bean tab

When this option is set, JCodeBox will create a DataSource resource reference (based on your application DataSource JNDI setting) whenever you create an entity bean. See Default DataSource JNDI name for further details.

  5.14 Synchronise DataSource field setting with resource referenceTo top of page

 Entity Bean tab

When this option is set, JCodeBox will keep the value of your entity bean's DataSource JNDI name synchronised with the name of your DataSource resource reference i.e. if you change one value, JCodeBox will change the other for you.

  5.15 Synchronise bean name with constructorsTo top of page

 Session Bean tab

When this option is set, JCodeBox will keep the name of your session bean's constructor methods synchronised with the name of your session bean class i.e. if you change one value, JCodeBox will change the other(s) for you.

  5.16 Web app tabTo top of page

 Web app tab

This tab contains settings that affect the web tier of your applications including:

  • Web style

  • Allows you to select the web style to apply to the generated web application. Please see the JCodeBox knowledge base for detailed information on how web styles affect your web application.
  • Include menu component (where supported by Web style)

  • Allows you to select whether or not you would like a menu component created for your web application.
  • Default view set path

  • The location where view set components are created in your web application.
  • Default system page path

  • The location where system pages are created in your web application.

[an error occurred while processing this directive]