Package org.openbravo.client.kernel
Interface ComponentProvider
-
- All Known Implementing Classes:
ApplicationComponentProvider
,APRMApplicationProvider
,BaseComponentProvider
,DataSourceComponentProvider
,HTMLWidgetComponentProvider
,KernelComponentProvider
,MyOpenbravoComponentProvider
,QueryListComponentProvider
,SelectorComponentProvider
,SmartClientComponentProvider
,WidgetsCollectionComponentProvider
public interface ComponentProvider
A ComponentProvider is responsible for generating a component on the basis of a request and its parameters. AComponent
can be anything from a visualization of a single field to a full ui with forms and grids. The component provider is responsible for creating the component on the basis of the component type, its id and additional parameters. One application can have several component providers. There is at most one component provider for a component type.- Author:
- mtaal
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ComponentProvider.Qualifier
Defines the qualifier used to register a component provider.static class
ComponentProvider.Selector
A class used to select the correct component provider.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Component
getComponent(String componentId, Map<String,Object> parameters)
List<BaseComponentProvider.ComponentResource>
getGlobalComponentResources()
List<String>
getGlobalResources()
Deprecated.implement getGlobalComponentResourcesModule
getModule()
String
getVersionParameters(String resource)
Computes parameters to add to a link of a resource.
-
-
-
Method Detail
-
getComponent
Component getComponent(String componentId, Map<String,Object> parameters)
- Returns:
- the JavaScript code to create this datasource on the client
-
getGlobalComponentResources
List<BaseComponentProvider.ComponentResource> getGlobalComponentResources()
- Returns:
- the global resources which are needed to be present on every page.
-
getGlobalResources
@Deprecated List<String> getGlobalResources()
Deprecated.implement getGlobalComponentResources- Returns:
- the global resources which are needed to be present on every page.
-
getModule
Module getModule()
- Returns:
- the Module to which this provider belongs
-
getVersionParameters
String getVersionParameters(String resource)
Computes parameters to add to a link of a resource. The parameters include the version and language of the user. The version computation logic depends on if the module is in development (Module.isInDevelopment()
. If in developers mode then theSystem.currentTimeMillis()
is used. If not in developers mode then theModule.getVersion()
is used. These values are prepended with the language id of the user. This makes it possible to generate language specific components on the server.- Parameters:
resource
- , the resource to compute the version string for, is typically a resource provided by the getGlobalResources method- Returns:
- the version parameter string, a concatenation of the version and language with parameter names
- See Also:
KernelConstants.RESOURCE_VERSION_PARAMETER
,KernelConstants.RESOURCE_LANGUAGE_PARAMETER
-
-