Navigation framework

Navigation steps

1/The VDoc server starts

When initializing the main servlet of VDoc, the first object is created. It is named com.axemble.vdp.ui.framework.foundation.Application.

This object is the central point for sharing elements between every HTTP sessions.

2/A user requests for a resource in VDoc

When receiving the first request from a web browser, the system will create an object named com.axemble.vdp.ui.framework.foundation.Navigator and associated to a browser. It represents the web browser on the server.

This Navigator object will be available during all the HTTP session life and will be accessible for all client web/server exchanges.

3/An execution context is associated to the request

When receiving the request, an object of context is created. It corresponds to the "execution context".

This object, available for all the HTTP request duration, implements the interface named : com.axemble.vdp.ui.framework.runtime.IExecutionContext.

A Java interface is used because the VDoc system needs to work in the same way in both environment JBoss and WebSphere Portal Server (servlets containers for JBoss and portlets for WebSphere Portal Server). Indeed, the IExecutionContext interface contains a lot of common methods for HTTP objects of these both containers types.

The ExecutionContext object enables to access to two elements types coming from the dynamic context. It maintains HTTPS objects as :

  • ISession : represents the HTTP session ;
  • IRequest : represents the HTTP request ;
  • IRequestDispatcher : represents the RequestDispatcher HTTP object ;
  • IResponse : represents the HTTP response ;
  • IPreferences (only used for the Portlets JSR#168).

    It contains also information linked to the execution in VDoc context. From this object ExecutionContext the following objects are accessible :

  • ServiceManager : Interface to access the services and Process management ;
  • Properties : every properties specified for initialization;
  • Authentication : authentication object ;
  • And the Navigator object : represents the web browser.
The navigation cycle

4/The system builds the root component by inspecting the request parameters.

The VDoc system inspects the parameters passed in the URL and requests the Navigator object to build a screen implementing the interface named com.axemble.vdp.ui.framework.foundation.screens.IScreen. This screen object (Screen) maintains a unique browsing object implementing the interface named com.axemble.vdp.ui.core.providers.INavigationListenerImpl. This browsing object which represents the displayed screen, is based on a template.

Screen templates are needed to build the graphical interfaces. Several standard templates are available:

  • com.axemble.vdp.ui.framework.composites.base.CtlAbstractExplorer: used in the administration and the application. It allows to display links with their associated views.
  • com.axemble.vdp.ui.framework.composites.base.CtlAbstractForm : it is the simpliest representation of a form with a section including fields and action buttons.
  • com.axemble.vdp.ui.framework.composites.base.CtlAbstractSheet : it is a bit more advanced form with tabs. For each tab field entries and action buttons may be defined.
  • com.axemble.vdp.ui.framework.composites.base.CtlAbstractDocument : it is the template of the process document. It is based on the XML description of the forms defined in the administration section.
  • com.axemble.vdp.ui.framework.composites.base.CtlAbstractSelector : it is the abstract element of selectors.
  • com.axemble.vdp.ui.framework.composites.base.CtlAbstractSingleSelector : single selector of elements such as properties, actors and roles.
  • com.axemble.vdp.ui.framework.composites.base.CtlAbstractMultipleSelector : : multiple selector of elements.
  • com.axemble.vdp.ui.framework.composites.base.CtlAbstractJsp : it is the representation that allows to embed a JSP page.
  • com.axemble.vdp.ui.framework.composites.base.CtlAbstractPortlet : it is the portlets template used in the Websphere Portal Server context.
  • com.axemble.vdp.ui.framework.composites.base.CtlAbstractView : : it is the template of the views.
  • com.axemble.vdp.ui.framework.composites.base.CtlAbstractGroup : : it is the template of the screen groups (examples : [form + view] or [sheet + view]).

    These templates enable the typed-creation of web screens and the handling of available elements as buttons,tabs,fields entries.

    Example

    The code below builds a simple form composed of a header, a footer and a content zone in which there are two TextBox fields.

      // new screen creation 
      IScreen screen = new Screen(); 
      // creation of a form based on a simple template 
      CtlForm fooForm = new CtlForm(“fooForm”); 
      fooForm.setLabel( new CtlText(“Form title”) ); 
      fooForm.setInformation(new CtlText(“Form description”)); 
      // adding fields entries. Each entry is composed of 
      // a title and a graphical component (CtlTextBox, CtlDate, CtlComboBox, etc.) 
      fooForm.addEntry( “fld_1”, 
        new CtlText(“fldLabel_1”),new CtlTextBox(“fld_1 value”) ); 
      fooForm.addEntry( “fld_2”, 
        new CtlText(“fldLabel_2”), new CtlTextBox(“fld_2 value”) ); 
      // position of the form as the main component of the screen 
      screen.setRootWidget( fooForm ); 
      // position of the current screen of the navigator 
      Navigator.getNavigator().setCurrentScreen( screen );

    The execution of this code creates the following screen:

    The VDoc screens are composed of a number of graphical objects such as the header,the footer and a "dynamic" content zone. This "dynamic" zone is built from aroot component.

    In most of VDoc screens, the root component corresponds to one of the following classes:

  • XMLExplorer : enables to build explorer-type screens. These screens are made up of launcher (left part of the screen) and "views" (right part). Each view is associated to one of the launcher link. This screen type is mainly used in the administration and the application contexts;
  • XMLForm : enables to build a simple form. A list of fields is described;
  • XMLSheet : enables to build a tabbed form;
  • XMLWizard : enables to build a wizard composed with pages;
  • XMLDocument :enables to build a process document;
  • XMLView : enables to build a view;
  • XMLGroup : enables to build a screen composed of several screens templates;
  • XMLJsp : enables to embed a JSP page;
  • XMLPortlet : enables to build a portlet respecting the JSR 168 specification.

    Generally, every class prefixed by "XML" and implementing the INavigationListenerImpl interface can be built from an XML definition document.

    In reality, several XML definition documents can be created (declared). They are all merged when loading the server or when refreshing from the Process management administration (Configuration).

5/Building of the graphical interface from the XML definition and request parameters.

The following diagram presents the main objects which allow to implement the VDoc navigation .

This XML definition document is located under the folder « vdoc.ear/vdoc.war/WEB-INF/storage » of the VDoc application. It is named « definition.xml ». It contains the whole XML description of the screens from VDoc application. This definition is valid and global to the VDoc server.

In this XML file, each screen is identified by the attributes « name » and « action ». When a request is processed on the server, the parameters « class » and « method » are assigned. These parameters are compared to the attributes « name » and « method » of the screen and the retrieved screen is built.

Example

The following request http://localhost:8080/vdoc/process?class=DEMO&method=action1 causes the reading of the XML element presented as below (part of the customized XML definition document) and the building of the identified screen, based on the associated template. In our example, the template associated to the "form" tag is a simple form. The final screen will be built with two TextBox fields.

<form name=”DEMO” action=”action1” label=”LG_VIEW_PROP” information=”LG_PUT_VIEW_INFO” provider=”com.axemble.education.providers.demo.DemoFormProvider”> 
        <fields> 
                <field name=”fldLabel_1” label=”LG_LABEL1” ctrl=”com.axemble.vdp.ui.core.document.fields.TextBoxField” mandatory=”false” /> 
                <field name=”fldLabel_2” label=”LG_LABEL2” ctrl=”com.axemble.vdp.ui.core.document.fields.TextBoxField” mandatory= »false » /> 
        </fields> 
</form>

6.Interaction with the created screen

Once the screen is built, the VDoc navigation system provides a way for the developer to interact with the screen. It provides an object called "provider", implementing the interface com.axemble.vdp.ui.core.providers.IProvider. With this object the developer can either fill-in the fields or interact with the user interface. .

The association between the "provider" object and the screen is created via the "provider" attribute in the screens XML definition file. Each provider is specific to the the kind of screen.

Hierarchical relations between all "provider" interfaces

[IProvider] 
        [IDocumentProvider] – gestion des documents génériques (GenericDocument) 
          [IFormProvider] – management of simple forms 
          [ISheetProvider] – management of form with tabs 
          [IProcessDocumentProvider] – management of process documents (CoreDocument) 
          [IWizardProvider] – management of wizards 
        [IExplorerProvider] – management of explorer-type screens 
        [ILauncherProvider] – management of the right part of the explorer screen 
        [IViewProvider] – management of every views 
          [IFilterableViewProvider] – management of views with filters 
          [IPortletProvider] – management of portlets 
        [IJspProvider] – management of screens based on JSP 
        [ISelectorProvider] – management of selectors