Components - Quick start guide

Printer-friendly versionSend to friendPDF version

The Components suite includes the following:

  • Premium components
  • GUI Toolkit components
  • Middle-End APIs & Connectors.....

Components basics

Include principle

The premium and GUI toolkits components shall be included within your application using the "include" technology.
The basic inclusion flow is the following:

  • Set the component's parameters using stzRequest.addRequestAttribute(String, Object)
  • Include the component page using <include rspfile="componentpage.rsp">
  • Clean the parameters stzRequest.removeRequestAttribute(String, Object)
 

The include processing flow does not change anything in the client-server interactions. The included page is processed in the same thread as the main page and the result of the processing is still one main stream.
The result is just the same as having copy-pasted the code of the included page in the main page.

 
 

Components deliverable

Each component deliverable includes:

  • The component itself as a JAR file. This JAR actually includes pre-compiled RSP pages.
  • The component HTML documentation and eventually associated javadoc.
  • A sample use of the component.

To use the component, simply add the JAR file in your project as a client and/or server library. You can now include the component's RSP pages (you do not have to add extra RSP pages into your project since the component's RSP pages are in fact included in the JAR).

View/Content model

Most of the components are composed of at least 2 RSP pages : a "View" page that contains the static part of the component (graphical assets references and static logic), and a "Content" page that conveys the dynamic content into the view.
The View part contains that static data, i.e. data that does not vary with the content. The View part aims at being cached locally for along period of time
The Content part contains the content and as few as possible logic items. The Content part is suposed to be fetched on the server side (no cache or cached for a short period of time)

Component customization

To customize a component you have to pass parameters to it before including one of its page.
These parameters have to be passed as request attributes before calling the include directive:

stzRequest.addAttribute("ButtonWidth", "30");

To avoid mistakes in attributes naming, some components offers Java constants classes for the parameters strings:

stzRequest.addAttribute(MediaPlayerView.BUTTON_WIDTH, "30");

The components parameters are usually of three different kinds:

  • Layout parameters : graphical assets references, witdh/height, etc...
  • Integration parameters : how the component's nodes will integrate into the main page (root node, def prefixes, etc...)
  • Callback parameters : specify some startable nodes to be started upon component's events (on focus, off focus, etc...)

Middle End APIs

We propose a set of Middle End APIs and connector implementation to simplify your applications developments:

  • Skin Model & Connector : to manage your skinning graphical assets.
  • Device properties Connector : to externalize some device related properties
  • Components data model : model used by some components to encapsulate their content (Catalog, SearchResults, Music, etc..)

Check out the Middle End specific documentation and Javadocs for more information about these APIs.

Utilities

We propose some utility libraries to simplify your applications development and components usage:

  • Utils : some useful methods to use request parameters, predefined shapes generation, type conversions, etc...
  • Layout Manager : a key library to achieve smart adaptation of your application to various screen sizes.
Share this