General architecture

Alveole Studio Web Project is composed of a main plugin package, named AlveoleWebDesigner. This document only targets this plugin package. Other parts of the project are very little and do not need to be fully documented.

Object model

Plugin deal with three types of components:

  • Actions,
  • Views,
  • Packages.

Actions are close to struts 2 actions. They represents controller parts in MVC framework.

Views represent web views (html pages, jsp, freemarker templates...).

Packages group these components together to organize your code hierarchically.

These three types of components are implemented in java package com.alveole.studio.web.data . This package contains all plugin data model.

  • NodeAction is the base implementation of Actions in the MVC project,
  • NodeView is the base implementation of views in MVC project,
  • NodePackage is the base implementation of packages.

These three classes inherit from NodeContainer class.

If you look at JavaDoc , you will see a few other classes in that package:

  • NodeLink represents a generic link between two nodes on the graph,
  • Project represents the whole project file,
  • LinksManager is a toolset for managing links between nodes.

This object model is not intended to be overloaded. Instead, each node type (except NodePackage) contains a reference to specificProperties and specificObject in NodeView, of customObject and customProperties in NodeAction. (See NodeView and NodeAction javadoc).

Extending the data-model consists in creating a new specific type of custom-objects or properties stored inside NodeView or NodeAction.

Specific implementations

As explained upper, Actions and Views are generic objects in project. They must be specifically extended to perform some specific actions. For example, plugin currently implements specific parts for struts 2.

To enable these specific implementations, MVC Web Project defines a few extension points. These points enable to plug some specific features, names "managers". These managers are defined in com.alveole.interfaces . There are currently 3 types of managers:

  • ActionManager is used to define specific features on NodeAction,
  • ViewManager is used to define specific features on NodeView,
  • LinkManager is used to define specific links between nodes.

A node specific instance contains a custom (or specific) properties set, and a custom object reference, but it also contains a reference to a specific manager (field mgrId in NodeAction and NodeView ).

MVC Web Project use this manager to perform actions on a given node, and it use specific properties or object to store specific node's data.

Managers have the ability to add some extended services on nodes. For example, managers may implement a getAdapter() method that furnishes a service given a node and a target class. One of these services commonly used is UrlManager. Some nodes may be accessed by a simple URL. This is the case of Struts2 actions and JSP views. These managers are then able to adapt nodes to UrlManagers. Some link managers are able to use UrlManagers. For example, it is possible to create a link between a JSP view and any Url'callable node. That's the way UrlManagers are used: when trying to link JSP to another node, its link manager queries target node do determine if it can be adapted to UrlManager.

Since version 0.2.0 , NodePackage class may also be extended using a PackageExtensionManager interface. Contrary to actions and views, packages are not specialized. They remain generic, and they can define multiple PackageExtensionManager at the same time. PackageExtensionManager is usually used to store some extended properties (such as common struts2 properties) that may be used by contained specific actions and views.

Serialization in XML

As you can see on ActionManager , ViewManager , LinkManager and PackageExtensionManager that are defined to extends data model, extensions are responsible for serializing their configuration to ASWP XML file.

Extensions are required (in prevision to future versions that may use XML validation) to use their own XML namespace to serialize data. Future versions may also require a XSD schema file accompanying extensions.

Links

Links between nodes are also specific. For example, a link from a struts 2 action to a JSP view doesn't have the same meaning as a link from a JSP view to an action. Each link also have a specific part to store specific data, and have a specific LinkManager to perform actions on the link.

Utility class com.alveole.studio.web.data.LinksManager is toolset that discovers available LinkManagers and enable to look for an available LinkManager that is able to create and manage a link between two nodes. It simply instanciate all available LinkManagers and ask each one if it is able to create a link (method canLink ).