Project and Item Wizards - universAAL/tools.eclipse-plugins GitHub Wiki
This universAAL Studio tool is intended to be used by developers of services and platform components. It makes it easy to create new universAAL-compliant projects by providing a skeleton project with all the files you need and initial content to make the project work in universAAL. The item wizards generate new files required or optional to a universAAL project with the proper formatting and template or initial content.
It reduces the time of development since without this tool a developer would need to give the project or files the appropriate format to be universAAL-compliant, with the risk of missing some requirement. By using the wizards it is assured to have well-formatted files and project structures. Otherwise the developer would have to create a new Maven Project (check the Maven plug-in documentation: http://www.sonatype.com/books/m2eclipse-book/reference/creating.html#creating-sect-creating-project). Then the POM file should be edited to add all universAAL dependencies, and later add the appropriate Java classes.
The usage of this tool is not mandatory but recommended. The wizard currently provides setup and configuration options which are useful for typical development projects.
The main access to Project and Item Wizards is through the "File/New" command in Eclipse. Then the proper wizard must be selected. An Eclipse command is available to start the wizards from any menu or other plugin, as well as from the universAAL Studio menu or dashboard.
This plug-in provides wizards for creating universAAL resources in the Eclipse workspace. They can be either items or new projects. With “items” we refer to new universAAL-specific classes inside an existing project in the workspace, which are also known as "wrapper classes" necessary to connect to universAAL environment. These new files would be generated with some initial content in order to be properly formatted, as a template, or configured as defined in the parameters passed in the wizard. These are generated with the New Item Wizard.
On the other hand, the New Project Wizard would generate a blank new universAAL compliant project in the workspace, ready to develop universAAL applications or components upon it. It could be initially configured as described during the wizard, that is, pre-set sample code, dependencies, initial files… The wizard will take care of generating the project hierarchy and structure, and all the mandatory files for the project to be universAAL compliant, as well as any additional file that could be defined by the user in the wizard. There is also a list of pre-set configurations of typical universAALcomponents, like Applications, Context Actuators or UI Handlers, and also the possibility of using the default implementations for some classes provided by the middleware.
This New Project Wizard does always the same: creating a new project in the workspace, based on a very simple set of configurable parameters (Maven information and initial files).
All the fields in the first page correspond to their equivalent tags of Maven POM, as they are required for a Maven project to be built (Name and Description are optional).
In the second page the "Activator package" field is where the user must type the package in which the Activator class will be placed (the Activator class is required for all OSGi bundles to start an interaction, works as an entry point). This package does not necessarily have to be the root one, but it is recommended. Currently it is also where the rest of other initial files will be placed, so it makes sense to be the root one.
The "Middleware Compliance" selector lets developers choose which version of the universAAL Middleware to build against, since the generated files and classes will be different in some cases. The versions available in this selector may be updated in the future with successive releases. It is always (and only) possible to change the version once the project is created by modifying the POM dependencies manually.
The "Full project template" drop-down box allows selecting from a collection of the most basic types of artifacts to develop in universAAL. Depending on which one is selected the checkboxes of the generated classes will be marked or unmarked. It is possible to un/mark them at will after that, but selecting a new template or middleware compliance from the lists will reset them.
When marking the checkbox "Create full project template with sample code" all other checkboxes for the classes will be disabled, because a pre-made sample project will be created implementing the selected template structure from the Full project template drop-down box. This will be a project with a fixed set of classes that contain example code and can in fact be complied and run. It can be used either as example, tutorial, or as starting point for new applications.
The checkboxes below allow to generate one of those universAAL wrapper classes when the project is created. Only one of each marked class will be created (to add more use the New Item Wizard later). They modify the POM and Activator accordingly. If the Service Callee is checked, it also generates a ProvidedService class, which is needed by it. Notice that the classes represented by these checkboxes may vary depending on the selected middleware compliance.
"Service Caller" and "Context Publisher" can be set to "Default Implementation" with the checkbox attached next to them if selected. This will instantiate one of the default implementations included in the middleware (DeafultServiceCaller or DefaultContextPublisher) in the Activator, instead of generating a new class. These default implementations are more than enough in most cases, if the developer just wants to "send" something to the bus without caring about special handling. Notice however that if you don´t check "full project template" the generated code by default needs you complete the required parameters to work, such as a ContextProvider for a ContextPublisher constructor.
Once a project is created, the New Item Wizard creates specific items on existing projects and therefore their commands could also be placed in specific contextual menus. Currently it can be accessed either from universAAL Studio commands, the File/New menu, or by right clicking a project/folder and selecting "New..." The Items that can be generated in the current version are the same template files that can be generated when creating a new project.
"Source folder" and "Package" fields specify where exactly the item will be created. They can be browsed from the workspace with the corresponding buttons. If a a project and package were selected prior to starting the wizard (or accessed by right-clicking them and choosing "New..."), these will be the pre-set values.
"Middleware Compliance" works in the same way as when generating a project. Take into account though that the wizard does not check if the version selected here is the same as the one given to the project when created. Please be careful with this. If you accidentally choose the wrong version, just remove the newly created class or, if needed, fix the dependencies versions in the POM.
The field "Class name" gives name to the class that will be created, while the drop-down box selects the kind of Item (universAAL wrapper) to create. In the case of "Service Callee [+Provided]", in addition to a Callee with the given name, the needed accessory class ProvidedService will also be created. It will have the name <nameofthenewitem></nameofthenewitem>ProvidedServices. The types that can be selected depend on the middleware compliance, so the box is reset if you change the middleware version.
In all pages, clicking the "?" button at the bottom-left corner will open a help panel with a link to this page.
- Some template content is not as complete as it could be, but it is operational.
- The managing of Eclipse works (creating project or item) is not performance-perfect but it works.
- Maven nature not properly applied to new projects if Papyrus plug-in is installed
- (The above is actually a problem with the Maven plug-in, not the universAAL Wizards).
- Link to this tool wiki page may not appear when clicking the Help button. (This is a problem of Eclipse)
- In rare cases, due to erroneous installation of Maven Eclipse plugin, the Finish button may not work.
- (The above is a problem with the Maven Eclipse Plugin: Maven Wizard would not work either)
- Add other Items different than wrapper classes - no demand.
- Full-project template not available for IO Handler - low demand.
- Automatic selection of MW compliance for New Items - low return of effort.
- Link to wizard of Ontologies projects - low demand.
- More languages supported - updateable on demand.
- Rename "Context Reasoner" dropdown option because it is not understood - rejected.