Fork me on GitHub


Java API for generating HTML from EClass metadata, including annotations, and EObject data.

This is work in progress. The general idea is to have adapter factories which adapt EObject’s to different UI generation participants as outlined below:

  • Target EObject is adapted to Application. Customization of this adapter will change a general appearance of the application.
  • Target EObject is adapted to ApplicationBuilder.
  • Default adapter creates ActionApplicationBuilder.
  • The adapter adapts the target EObject to Action.
  • It also adapts the target EObject to different view parts - header, navigation bar, navigation panel, content panel, section, footer. This would require differentiation of ViewParts by role which can be done by creating marker interfaces extending ViewPart.
  • EObject action would adapt EObject to property source. EReferences will also be converted to property sources, this would require an interface something like EReferencePropertySourceProvider with PropertySource adapt(EReference) method. EObject would be adapted to this interface to obtain EReference property sources.

In the case of dynamic web applications access to servlet API’s such as request/response may also be done through the adapter mechanisim.

Context actions for EObject would include Edit/Delete, subject to the principal permissions and model modifiability. E.g. in the case of generated documentation neither edit nor delete would be available.

For references context actions would include creation of a new reference element.

EOperations may also be used as context actions. For this EOperations and EParameters should be annotated or have an entry in the configuration model (see below).

The factories will be registered with EClass as a key, i.e. factory selection will be based on the target EObject class hierarchy. There will be a default catch-all implementation for each factory/adapter type. This approach will allow fine-grained customization of the generation process.

Adapters may be using EMF metadata, model annotations, and resource bundles so a good deal of UI customization may require no coding. Also in the future a generator may be provided similar to Codegen ECore Web UI to generate adapters from a configuration model instead of creating them manually.

In dynamic web applications adapters with resolved metadata and security permissions may be cached in the web session. In this case they need to be keyed by CDOID and adapter type. Adapters may also cache already generated pieces. Such pieces shall have associated view timestamp and be used only if there were no changes in the view. The cache might be memory-sensitive - soft-referenced. Some adapters which do not hold principal-specific data may be cached at the application level instead of the session level.