Eclipse Summit Europe 2008 Equinox Hackathon
The Eclipse Summit Europe presents a great opportunity to get together and look at and hack on code. This year we are doing an Equinox Hackathon. The idea is that given a base of Equinox code, folks at the conference (and elsewhere for that matter) can create their own bundles to add function or modify the base to do different things. You might be motivated just to play around, to put your project's technology to work or to use this as a reason to try some other project's technology. Whatever the reason, the goal is to hack Equinox code.
The application to be used is Toast, a telematics system that is being used as the example application for the upcoming Equinox OSGi book. Some folks may have seen previous versions of Toast demonstrated at various conferences (and undoubtedly it will be shown several times at ESE). The current function is roughly the same but the internals have changed considerably. The UI is now all SWT, the service interactions all DS, p2 is used to do provisioning, ...
Information for Hackathon participants
Getting the code
To develop Toast you need two things, the target and the code. Download the target archive (~50MB) and then use File > Import... > Existing projects into Workspace and specify the downloaded archive as the input. Once the target project is in your workspace, open toast.target and click on the Set as target platform link in the top right corner of the Overview page of the target editor.
The easiest way to get the Toast code is to check it out from the CVS repo. For the Hackathon we set up a SourceForge project. You don't need to have a SourceForge account to play, just add the following CVS repo location in Eclipse.
Host: equinoxosgi.cvs.sourceforge.net Repo path: /cvsroot/equinoxosgi
Using the CVS repo view, navigate to the "hackathon" folder and check out all the projects you find there (about 66).
You should now have a workspace full of Toast.
Toast has two parts, a client and a backend. The client is the in-dash display that you would have in a vehicle. The backend is a control center that administers and manages vehicles. To run Toast you need to start the backend, then start the client.
- The client and backend are each described in a .product file. Open the files using Ctrl+Shift+R and filter *.product. Multi-select backend.product and client.product.
- On the Overview page of backend.product, click the Launch an Eclipse Application" link. You should see a console open with various messages related to servlet registrations etc. Good.
- Now launch the client.product using the same technique. You should see a UI that looks something like the ones at the top of this page.
- See the description below for descriptions of each function
- When you are done, close the client window and kill the backend by typing "exit" in the console.
- Trigger an emergency in one of the following ways:
- On the client, you should see a pop-up indicating that help is on its way.
- Click the audio button on the top button bar of the client.
- You can manipulate the various buttons and switch between the radio and CD subscreens.
- Keep in mind that the controls are not connected to your computers audio hardware.
- Click the climate button on the top button bar of the client.
- You can manipulate the various buttons and switches.
- Click the navigation button on the top button bar of the client.
- It takes a few seconds for the client to download the map data from the server. After that, you should see a red dot representing your vehicle on a map of Washington, DC.
- The follow-vehicle button causes the map to rotate according to the vehicle’s heading.
- The center-on-vehicle button keeps the vehicle in the center of the map.
- The info button allows you to click various points of interest on the map to reveal their label.
- The center-on-click button allows you to click the map to center it on any point.
- The zoom buttons allows you to zoom the map in or out.
- Try moving your vehicle around the map by moving the GPS on the device simulator.
- Point your web browser at localhost:8081/client/devices
- Select the GPS device and click the buttons under Latitude/Longitude/Heading
- You should see the car moving around on the map
- From the navigation screen, click the guidance button on the bottom of the control panel on the left.
- A list of destinations will appear. Select a destination.
- You should see a route appear as a yellow line on the map.
- The vehicle immediately starts to drive along that route at 50 kph.
- You can adjust the vehicle’s speed and location from the device simulator.
- Point your web browser at localhost:8081/client/devices
- Select the Routing device and click the various buttons to alter the vehicle’s behavior.
- To stop the routing, click on the guidance button again. Then instead of selecting another destination, click the cancel button .
Running from the workspace is fun but does not give you a chance to exercise the provisioning support etc. To export Toast you really just have to export the products plus some support code.
- Close the client.product file to avoid confusion and then open base_client.product and build.product.
- For each of the three products (do build.product last)
- Click on the Eclipse Product export wizard link on the Overview page
- Clear the Root Directory field
- Set the destination to an archive file /EquinoxOSGi/ToastBuild/toast.zip
- Uncheck the Synchronize before exporting box
- Check the Generate metadata repository box
- Click Finish NOTE: We actually don't care about the archive file that is produced so you can safely use the same zip file name for each export and simply answer 'yes' when asked to overwrite the existing file.
- Having done all three, run the Toast Backend Deployer launch config. NOTE: Assuming you used the ToastBuild specified above, you should not have to change anything and will end up with a ToastBackend dir beside ToastBuild. The ToastBackend has your backend server
- Run the backend server (double click on the Toast Backend executable (e.g., Toast Backend.exe) in /EquinoxOSGi/ToastBackend), you should see a number of servlets being registered in console
- Using a web browser browse to http://localhost:8080/toast
- Fill in ABC123 in the text box and click Create. This provisions a new vehicle in the /EquinoxOSGi/ToastClient/ABC123 dir
- Start /EquinoxOSGi/ToastClient/ABC123/Crust.exe. Notice now that the vehicle UI comes up empty.
- In the browser, note that the management portal is now showing your various installation functions for the vehicle. You can go and look at the vehicle profile and manage the install.
- Now you can subscribe and unsubscribe features (e.g. audio, emergency, etc) from the management portal and things should show up correctly in the client user interface.