You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

This tutorial will help you import an existing Xcode WebObjects project for use in WOLips. Eclipse has the concept of a workspace--a folder where a collection of your projects are stored. You select the current workspace when Eclipse launches (unless you have selected a default workspace). Eclipse does not require that your project itself be in the workspace folder, but this is the default behavior. You can choose to move your existing Xcode project into your workspace folder, or you may add Eclipse/WOLips features to your existing Xcode project. This tutorial will initially focus on moving a copy of your Xcode project into the Eclipse workspace for use in WOLips.

1. Create a new WO Application. For this tutorial we will import the example PetStoreWOJava project from /Developer/Examples/JavaWebObjects/PetStorewOJava so we will call this new project PetStoreWOJava.

2. Copy the Java files from the Xcode project into the src folder of the new WOLips project. You can do this in a variety of ways, including in the Finder, but the easiest is probably to filter your Xcode project for .java files (or use the Implementation files smart group) and drag and drop from Xcode directly to Eclipse.

It will ask if you would like to overwrite the existing files, choose Yes To All to replace the default WOLips files.

If you use the Finder you will need to refresh the Eclipse project using File->Refresh before it will notice the changes to the project.

3. Now copy the WOComponents and other resources into the Eclipse project. You may want to create separate folders in your eclipse project for different types of resources such as images and other resource files, but for the purposes of this tutorial we will just drop them all into the project root folder which is the default. You can use the Finder if you like, or drag and drop from Xcode into the Eclipse project.

If you drag the components like this, the Java files may come along. You'll need to move them to the src folder if they're not already there, or just delete them from the project if they already are in the src folder.

Once all of your resources are in the Eclipse project, it may look like this:

If you have your resources organized in groups in your Xcode project, you will need to recreate this structure in the Eclipse project using folders. At this time, WOLips does not have support for arbitrary groupings of files independent of the file system, but you can setup your file system to match. Here's an example that mimics the Xcode default structure in Eclipse.

4. Add your frameworks to the project by right-clicking WO Frameworks and choosing Configure... Expand the System and Local entries, and check the boxes next to the frameworks you need for this project.

5. Configure your JRE. Right click the JRE System Library and choose Configure... You can select which JRE you would like to build against.

6. Fix any build errors. At this point you need to fix any errors that may show up with a red x in your Problems tab or in the Package Explorer. You may need to move Java classes into appropriate packages or add any additional jars. Jars can be added to the build path by right-clicking on them and choosing Build Path->Add To Build Path

7. Create a Launch configuration. Choose Run->Debug... and select the WOApplication entry and create a new entry with right-click or by clicking the New button at the top of the dialog. Fill in the Name field, then click the Browse button and select your new project. Then click the Search button by the Main class: text field, and select your main application class. Click Debug and your WO Application should launch.

  • No labels