Built-In SQL DataSource
-----------------------
This example illustrates setting up a datasource of type "sql" which allows you
to simply point to your database table in the datasource declaration and
Smart GWT EE takes care of automatically supporting the various operations
such as fetch, update, insert and delete without requiring you to write any
additional server-side code.


Using sample projects
---------------------
Instructions are provided below for importing the sample project with Eclipse or
building it from the command line with Ant.

If you instead want to add Smart GWT EE to an existing project, see these
instructions:

   http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/docs/SgwtEESetup.html

For instructions for launching tools such as the Developer Console, Visual
Builder or DataSource Wizards, see the Smart GWT FAQ:

   http://forums.smartclient.com/showthread.php?t=8159


Build Prerequisites
-------------------
- Google Web Toolkit, 2.12.1 or later
  https://developers.google.com/web-toolkit/download

  Ensure that the GWT_HOME environment variable is set to the location of your
  Google Web Toolkit SDK directory.

- If building with ant:
  Apache Ant, 1.6.5 or later (1.7.1 or later recommended)
  http://ant.apache.org/

  A copy of Ant is included in the Smart GWT distribution under the
  'apache-ant-1.7.1' directory.

  Ensure that the ANT_HOME environment variable is set to the location of your
  Apache Ant directory, and the 'ant' command is in your PATH.

- If building with Eclipse:
  GWT Eclipse Plugin (GEP)
  https://github.com/gwt-plugins/gwt-eclipse-plugin

  The GEP is highly recommended if using Eclipse. Its use is assumed in the
  instructions below.

  The Jetty Eclipse Plugin and a separate Jetty 11 installation
  https://marketplace.eclipse.org/content/eclipse-jetty
  https://jetty.org/download.html- 
  Note that the current Jetty Eclipse plugin may not work with Jetty 12.
  

Build and deployment using ant
------------------------------
- 'ant'
  Compile for deployment.

- 'ant war'
  Compile for deployment and bundle into BuiltInDS.war file.

  If you have a web container operating on localhost:8080, you can deploy
  BuiltInDS.war into the web container and access the sample at:

    http://localhost:8080/BuiltInDS/BuiltInDS.html


Super Development Mode
----------------------
Hosted Mode is being being phased out by GWT and replaced with Super Dev Mode.
You can find an overview of SDM at:

    http://www.gwtproject.org/articles/superdevmode.html

For more details about how to set up or use SDM, see our online Smart GWT SDM
Troubleshooting help topic at:

    http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/docs/SuperDevModeTroubleshooting.html


Eclipse Configuration
---------------------
When using Servlet 5 and Jakarta, you cannot use the Jetty server built into GWT,
which complicates setup as you'll need to launch Jetty separately.  To open this
sample, configure Eclipse and GEP as follows:

- Set the Eclipse Classpath variable SGWTEE_HOME to point to the root directory
  of the Smart GWT EE distribution. This is configured through
    Windows: Window  -> Preferences -> Java -> Build Path -> Classpath Variables
    MacOS X: Eclipse -> Preferences -> Java -> Build Path -> Classpath Variables
  The included Eclipse project files load JARs from SGWTEE_HOME/lib.

- Set the Eclipse Classpath variable GWT_HOME to point to the root directory of
  your GWT SDK 2.12.x intallation.  This variable helps define the classpath for
  Jetty Plugin.

- Due to requirements of the Jetty Eclipse Plugin, you'll need to remove the two
  mortbay JARs from the lib/apache-jsp directory in the Jetty 11 installation,
  create a new lib/apache-jstl directory in the insllation, and populate it with
  the following two JARs:
  - jakarta.servlet.jsp.jstl-3.0.1.jar
  - jakarta.servlet.jsp.jstl-api-3.0.2.jar
  downloaded from https://mvnrepository.com/search?q=jakarta.servlet.jsp.jstl

- Use File -> Import, General -> Existing Projects into Workspace to import this
  sample.

- Use Run -> Debug Configuration (or Run Configuration) to open the launch
  configurations and start the prebuilt DevMode Plugin launch configuration.
  This will run DevMode without Jetty, as GWT Jetty doesn't support Jakarta.

- Open the prebuilt Jetty Webapp launch configuration next, and in the options
  tab, point it at your external Jetty 11 installation ("Use Jetty at path").
  Launch Jetty to finish the launch and let you run SuperDevMode in your browser.
  If you've having problems launching Jetty using the plugin, you can always
  launch it externally (outside Eclipse).  This also will allow you to use a
  more recent version of Jetty (e.g. Jetty 12) if you wish.

- (Optional) Attach the server Javadocs for the Server Framework JARs:
  - In Eclipse, right click on the project in Package Explorer.
  - On the left, select "Java Build Path".
  - Click on the Libraries tab.
  - For each of the entries SGWTEE_HOME/lib/isomorphic_contentexport.jar, SGWTEE_HOME/lib/isomorphic_core_rpc.jar,
    SGWTEE_HOME/lib/isomorphic_spring.jar, SGWTEE_HOME/lib/isomorphic_sql.jar, and SGWTEE_HOME/lib/isomorphic_tools.jar:
    - Click the plus icon (Windows) or arrow (Mac) next to the entry.
    - Select "Javadoc location:".
    - Click the "Edit..." button.
    - Click the "Javadoc URL" radio and browse to the doc/server/javadoc/ folder from the unpacked Smart GWT EE distribution.


Hosted Mode using ant (deprecated)
----------------------------------
Use 'ant hosted' to run in GWT Hosted Mode.


Database Configuration
----------------------
This sample connects to an HSQL database that contains various tables with
sample data. The database name is "isomorphic" and is located under
war/WEB-INF/db/hsqldb.

For ease of setup of this sample, a servlet listener HSQLServletContextListener
is configured in war/WEB-INF/web.xml to start and stop HSQL automatically as the
webapp is started/stopped. The contents of the database may be viewed
directly with the sample located at samples/db/run-dbm: select
'HSQL Database Engine Server' and point to

    jdbc:hsqldb:hsql://localhost/isomorphic

to browse the contents of the HSQL database.


Debugging
---------
See our debugging overview at:

    http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/docs/Debugging.html

Note: Due to a bug in GWT, the very first time you launch hosted mode, tools such
as the Admin Console will not work. Restart to correct this problem. Compiled mode
is not affected.
