







 Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.

General Build Notes for Java EE Samples

----------------------------------------

Whenever possible the build files for the Java EE 5 and Java EE 6 tutorial samples have been left unchanged

to work in the context of building for Oracle WebLogic Server and the Oracle Cloud. However, a few common changes

were necessary. Among them are:

  - The inclusion of <property environment="env"/> at the top of each project build file to pickup the Oracle Cloud-specific

environment settings.

  - The import of common.xml to tie the overall samples build into the individual EE sample's builds.

  - The definition of the "build" target in each project build.xml to again tie in the upper-level samples build

to the EE tutorial builds.

  - Some property settings, such as run.uri, to support the use of the run/browse/launch target from the Oracle Cloud build.



For the database samples, specifically the books* samples, where the EE Tutorial are based on the ability to

directly access the database being used, we have instead modified the bookstore[.jar] so that it uses JPA

to populate the Oracle cloud-supplied data source (by default 'ocacleds-1') on the first hit of the servlets. This also

required modifying the init() method of the BookstoreServlet to ensure that the setupBooks() method (defined in bookstore.jar)

is called. Since an Oracle Cloud user does not have direct access to the database, it is not possible to

setup the database by using the tutorial.sql and delete.sql files per the tutorial instructions. 



An alternative to using the JPA-based setup would have been to define another init() method that would read in DDL and

perform the operations on the data source using traditional JDBC-based access.



N.B. prior to running the bookstore examples, be sure to hit the URL for bookstore1.  This causes the database to be read.

To do this properly, each of the bookstore samples needs to be changed so that it does its own initialization, either

directly or via linking to another servlet, such as bookstore1's BookStoreServlet.



+----------------------------------+------------------------------+--------------------------------------------------+----------------------------------------------------+

|Project Name/Location             |Technolgies demonstrated      |Build notes                                       |Run URI                                             |

|                                  |                              |                                                  |                                                    |

+----------------------------------+------------------------------+--------------------------------------------------+----------------------------------------------------+

|ee5/bookstore                     |JPA: persistence-unit         |persistence.xml contains reference to             |None: jar included in other apps.                   |

|                                  |(persistence.xml) to          |@data-source@ which is substituted with actual    |                                                    |

|                                  |WebLogic/Cloud datasource.    |datasource name during the build                  |                                                    |

|                                  |                              |com.sun.bookstore.database.BooksSetup added to    |                                                    |

|                                  |                              |populate the book catalog data.                   |                                                    |

+----------------------------------+------------------------------+--------------------------------------------------+----------------------------------------------------+

|ee5/bookstore1                    |Servlets. Use of JPA via      |BookStoreServlet modified to call                 |http://localhost:7001/bookstore1/bookstore          |

|                                  |BookDBAO (database access     |BooksSetup.setUp() to populate the book catalog   |                                                    |

|                                  |object).                      |during init() call of servlet.                    |                                                    |

|                                  |                              |                                                  |                                                    |

|                                  |                              |                                                  |                                                    |

+----------------------------------+------------------------------+--------------------------------------------------+----------------------------------------------------+

|ee6/ajaxguessnumber               |Ajax                          |                                                  |http://localhost:7001/ajaxguessnumber/              |

|                                  |                              |                                                  |                                                    |

|                                  |                              |                                                  |                                                    |

|                                  |                              |                                                  |                                                    |

|                                  |                              |                                                  |                                                    |

+----------------------------------+------------------------------+--------------------------------------------------+----------------------------------------------------+

|ee6/guessnumber                   |ManagedBean and facelets      |                                                  |http://localhost:7001/guessnumber/                  |

|                                  |                              |                                                  |                                                    |

|                                  |                              |                                                  |                                                    |

|                                  |                              |                                                  |                                                    |

|                                  |                              |                                                  |                                                    |

+----------------------------------+------------------------------+--------------------------------------------------+----------------------------------------------------+
