Wiki source code of WO 5.4 Getting Started

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

Hide last authors
Pascal Robert 53.1 1 = Running the examples =
2
Pascal Robert 55.1 3 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//.
Gavin Eadie 23.1 4
Pascal Robert 55.1 5 The first step is: install Eclipse and WOLips :-) 
David Avendasora 39.1 6
Pascal Robert 55.1 7 Some examples needs Derby, an embedded Java database (OpenBase is not included with WO anymore). To install the databases, you have to do:
David Avendasora 39.1 8
David Holt 43.1 9 {{code}}
10
11 cd /Developer/Examples/JavaWebObjects/
12 sudo sh installDatabases.sh <yourusername>
13
14 {{/code}}
15
Pascal Robert 55.1 16 Now, you can import the examples into Eclipse. Start Eclipse, select //File// > //Import//,
17 &nbsp; [[image:ImportMenu.png]]
18 &nbsp;
19 and select //General// > //Existing Projects// into Workplace.
David Holt 43.1 20
Pascal Robert 55.1 21 [[image:ImportGeneral.png]]
22 &nbsp;
23 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. [[image:ImportProjectsList.png]]
David Holt 43.1 24
Pascal Robert 55.1 25 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. [[image:PackageExplorer.png]]
26 &nbsp;
27 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...// [[image:BuildPathMenu.png]]
28 &nbsp;
29 Click on the //Projects// tab, select the references to the WO frameworks that have the Warning icon and click //Remove//. [[image:ConfigureBuildPath.png]]
30 Click on the //Libraries// tab, click the //Add Library// button.&nbsp; Select //WebObjects Frameworks// and click //Next//. [[image:AddLibrary.png]]
31 &nbsp;
32 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//.
David Holt 43.1 33
Pascal Robert 55.1 34 After you corrected the build path on a project, the project will rebuild itself and the errors shoud dissapear.
David Holt 43.1 35
Pascal Robert 55.1 36 //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:
37 [[image:GoodDerbyPath.png]]
38 &nbsp;
39 VoilĂ &nbsp; You finally can run the examples.&nbsp;