1. Plug-in creation wizard
2. Generation result
3. Use the Sample Service
4. Changing Sample Service parameters
Introduction
This user guide explains how to generate a default contribution to the Topcased Bus. In other words, it gives the steps to follow to create, configure and use a Sample Service.
1. Plug-in creation wizard
- Start creating a new plug-in project : File > New > Project > Plug-in Project.
From the first page, click 'Next' button two times to obtain the page bellow.
-
Select the last template from the list : this Topcased template allows to create a full sample service. Then, click on the 'Next' button to switch to the last page.
-
On this last page, you have the possibility to configure three parameters. Before clicking on 'Finish' button, enter you surname, your last name and set a name to your future sample service.
-
The parameter described in the first tab is not considered as service parameter. So it means that the service name could not be changed further.
-
The parameters described in the second tab represent service parameters which means that surname and last name could be changed later thanks to a preference page.
-
The action 'Finish' launches the code generation of the service. At the end, a new Eclipse project is created in your current workspace. You can use it without making any modification. You can also open the different classes and inspect their content to better understand service mechanism.
2. Generation result
- The package action contains the class executed when the contextual menu entry is selected. This action directly calls the service.
- The package dialog contains the classes defining the dialog box.
- The package preferences contains the class representing the page displayed when the Eclipse preferences are displayed.
- The package services defines the actions to perform. In this case, it consists in displaying the dialog box. We recommend to take a look to the source code of the SampleService.java file.
- The plugin.xml file uses three extension points : one for the preference page, one for the contextual menu and one for the service.
3. Use the Sample Service
To use the generated service, start launching a new instance of your environment and open the contextual menu from a project.
Note : the name displayed in the menu corresponds to the value entered in the last page of the creation wizard (Cf. Illustration 4).
When this dialog box is displayed, it means your service is running. It just a example in order to illustrate the notion of service. The service will finish when the user will click on the 'Finish' button.
4. Changing Sample Service parameters
A preference page has also been generated with the sample service. It enables to change service parameters, i.e surname and last name in this context. The goal of this page is just to show a complete Topcased service mechanism (configuration, call, execution).
- Change the two parameter values.
- Click on 'Apply' then 'OK' buttons.
- Execute one more time the Sample Service and observe that the surname and the last name have changed.
By Sebastien GABEL, Communication & System
Created August, 3 2007