WebObjects includes Enterprise Objects Framework database integration technology and several examples that demonstrate Enterprise Objects Framework programming techniques. The Enterprise Objects Framework examples are built around the idea of a video rental store. The rental store uses two separate databases. The first database, Movies, contains background information on all movies available from the store's distributor. The second database, Rentals, contains the inventory, customer list, and rental transaction records for the store. Disclaimer: none of the data in the Movies database is guaranteed to be accurate.
The Enterprise Objects Framework examples are located in: NEXT_ROOT/NextDeveloper/Examples/EnterpriseObjects
This guide describes:Before you can run the examples, you must set up the Movies and Rentals databases on your system. Installing the sample databases involves the following four steps:
The multi-database support in EOF 2.0 makes it possible for you to install the sample databases in three different configurations:
Depending on your desired set up, you use the tools available with your database server to set up one or two new user/databases. For example. on Sybase you might create a new database on your server called "Movies" and login with the user "sa". On Oracle you might create a new user with the name "Movies". Once you have set up these accounts, you are ready to install the examples.
The database installation scripts make modifications to some of the example files based on your database set up, so you should copy the example directory to a directory that you can write in.
The model files used by the examples must be configured to use your database and its adaptor. To configure the model files, simply run the configure_examples program in a command shell. (To open a shell on NT, choose Sh in the OPENSTEP program group.) cd to your copy of the examples directory, and run configure_examples. It asks you for the name of the adaptor you want to use (Informix, ODBC, Oracle, or Sybase) and for the login information for your database. It then modifies the example models to work with your server.
To fill your example databases with sample data, use the install_database program. in the DatabaseSetUp directory. In your command shell, cd to the DatabaseSetUp directory, and run install_database. It connects to your databases, adds the example tables, and fills them with data. If you later wish to remove the data, run the drop_database program.
None of the examples in this directory are web-based. In fact, many of them require OpenStep Enterprise. Unless you have OpenStep Enterprise, you won't be able to build the following examples:
However, the remaining examples may be useful to you as examples of how to program with Enterprise Objects Framework.
For more information on these examples, see the ExampleGuide.rtfd file in the EnterpriseObjects examples directory.
Building the examples requires two steps:
Window's Users: to install and run the examples your executable path environment variable must include:
Mach Users: to install and run the examples you must create the directory /LocalDeveloper/Frameworks. This directory must be set to be writable by the user installing the examples.
With your example projects installed and your database filled with data, you are ready to build and run the examples. In a command shell, cd to the example you want to build and type make.