WO 5.4 Getting Started

Version 56.1 by Pascal Robert on 2007/11/29 13:44

Running the examples

Apple has converted their WebObjects examples in the Eclipse format, but no documentation is provided on how to import them into Eclipse.  The examples are in /Developer/Examples/JavaWebObjects.

The first step is: install Eclipse and WOLips :-) 

Some examples needs Derby, an embedded Java database (OpenBase is not included with WO anymore).  To install the databases, you have to do:


cd /Developer/Examples/JavaWebObjects/
sudo sh installDatabases.sh <yourusername>

Now, you can import the examples into Eclipse.  Start Eclipse, select File > Import,
&nbsp; ImportMenu.png
&nbsp;
and select General > Existing Projects into Workplace.

ImportGeneral.png
&nbsp;
On the next page, select Select root directory and browse your disk to /Developer/Examples/JavaWebObjects.  You should see a list of projects to import.&nbsp; Deselect the second javaeoutil project, or else you won't be able to import the projects. ImportProjectsList.png

After the importation is done, you should see the projects in the WO Package Explorer.  If you see the projects in Package Explorer (without "WO" in the name), that means that you are using the Java perpective instead of the WOLips perpective.&nbsp; Switch the perpective to WOLips. PackageExplorer.png
&nbsp;
Now, you need to fix the examples, because the build path is pointing to the source projects of the WO frameworks, source that nobody outside Apple has access to :-)For each project, right-click on each project, select Build Path > Configure Build Path... BuildPathMenu.png
&nbsp;
Click on the Projects tab, select the references to the WO frameworks that have the Warning icon and click Remove. ConfigureBuildPath.png
Click on the Libraries tab, click the Add Library button.&nbsp; Select WebObjects Frameworks and click Next. AddLibrary.png
&nbsp;
Click System, open the triangle next to System and make sure that JavaEOAccess, JavaEOControl, JavaFoundation, JavaWebObjects, JavaWOExtensions and JavaXML are selected.  For SchoolToolsClient, you also need to add JavaWebServicesSupport and JavaWebServicesClient to the build path.  For the SchoolToolsServer, you need to add JavaWebServicesSupport.

After you corrected the build path on a project, the project will rebuild itself and the errors shoud dissapear.

JavaBusinessLogic and RelatedLinks requires Apache Derby, but the path to Derby's JAR is wrong. Remove the JAR from the build path, click Add External JARs..., browse your disk up to /Developer/Examples/JavaWebObjects/Databases/db-derby-10.2.2.0-bin/lib and select derby.jar.&nbsp; The build path should look like this:
GoodDerbyPath.png
&nbsp;
VoilĂ &nbsp; You finally can run the examples.&nbsp;