Direct Method Invocation (DMI) DataSource on Google Application Engine
-----------------------------------------
This example illustrates setting up a DataSource using JPA to process the requests and
running under Google Application Engine (GAE).


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 App Engine SDK, 1.3.4 or later
  https://developers.google.com/appengine/downloads

  Ensure APPENGINE_HOME is set to the location of your Google Application Engine SDK directory.

- Google Web Toolkit, 2.6.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:
  Google Eclipse Plugin (GEP)
  https://developers.google.com/eclipse/docs/download

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


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

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

  Please read information on uploading your application to Google Apps:
  https://developers.google.com/appengine/docs/java/tools/uploadinganapp


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
---------------------
Eclipse and GEP are configured to open this sample 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.

- Follow the instructions for  "Working with Existing Projects" with the GEP:
  https://developers.google.com/eclipse/docs/existingprojects

  As of this writing, the instructions are slightly out of date for Eclipse 4.  After
  selecting "New -> Java Project" there won't be an option to "Create project from 
  existing source".  Instead, uncheck "Use default location" below "Project name" and
  browse to the root directory of the desired sample in your installation.

- Create a launch configuration and launch the app as described here:
  https://developers.google.com/eclipse/docs/running_and_debugging_2_0

- (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
----------------------
While running hosted mode you can browse the local database by visiting:

http://localhost:8080/_ah/admin


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.
