Ripla

Rich Platform project for Java web applications.

This project is maintained by aktion-hip

Use Case Service

For a detailed description how to implement a Use Case Bundle, see the documentation describing the creation of a Ripla application.

This section concentrates on the interface defining the Use Case Service and other interfaces depending on this service.

A use case provider has to implement the following interface:

public interface IUseCase {
    Package getControllerClasses();    
    IControllerSet getControllerSet();    
    IMenuItem getMenu();   
    IMenuSet[] getContextMenus();  
}

The methods IUseCase.getControllerClasses() and IUseCase.getControllerSet() return the controller classes activated when the user clicks an entry in the main or context menu.

The method IUseCase.getMenu() defines the menu that will be displayed in the application's main menu bar. The method returns the root node of the main menu. An arbitrary nested structure of submenus might be attached to this root node.

The method IUseCase.getContextMenus() defines the context menus used by the use case. The menu returns an array of context menu sets. Each of these sets contains one or more context menu items.

For that the declared service can be registered at the OSGi container's service registery, the component has to provide a component description. In the following example, the component description defines the implementation class org.ripla.web.demo.widgets.scr.UseCaseComponent as provider for the service org.ripla.web.services.IUseCase:

<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.ripla.web.demo.widgets.usecase">
   <implementation class="org.ripla.web.demo.widgets.scr.UseCaseComponent"/>
   <service>
      <provide interface="org.ripla.web.services.IUseCase"/>
   </service>
</scr:component>