Skip to content

UI Handler WEB

Carsten Stocklöw edited this page Apr 27, 2018 · 3 revisions

Table of Contents

Black box description

This artefact provides a web interface mainly intended to offer uSpace configuration possibility from outside world.

Web UI Handler is used for interacting with a system via web interface. it is intended for both elderly, careguivers and managers to access remotely to interface and or configure applications or the uSpace.

Bundles

Artefact: UI HTML5 Web Handler
Maven artefact org.universAAL.ui / ui.handler.web.html
Pax Composite bundle scan-composite:mvn:org.universAAL.ui/ui.handler.web.html/x.y.0/composite
Karaf Feature uAAL-UI.handler.web.html
Maven Site https://universaal.github.io/ui/ui.handler.web.html/index.html

Features

  • converts HTTP requests into UI Responses
  • converts UI Requests into HTML output to be shown in browser
  • caches resources so they can be offered outside.

Design decisions

Configuration

The configuration of the handler is mainly done in the .properties file located in <configurations></configurations>/ui.handler.web.html folder (where <configurations></configurations> is the configuration folder of the container).

  • html.properties
css.location: The location (URL) of the CSS sheet to use. default will be set to a copy of this file created if not found in the resources.dir.
tip: You may also use the default template or edit it to change the look and feel of the html output.
resources.dir: The location (URL) of where the cached resources will be copied to. By default this location will be set to <configurations>/ui.handler.web.html/resources/</configurations> (where <configurations> is the configuration folder of the container).
tip: set this location to a non-critical folder in the file system (like a partition backed by HDD, instead of a SSD) or a temp folder (resources will be copied if not found so if the folder is empty or does not exists it will create a new cache).
service.relURL: This is the suffix to use when accessing the servlet, must start with "/". Default "/universAAL"
session.timeout: The time elapsed, in milliseconds, to consider the session finished. default is 300000 (5 minutes)
tip: do not set a very long timeout or the session will be kept alive causing security issues, but do not set it too short or the user may need to log in each time.

Implementation

This component has been developed from scratch in universAAL and will build on the experience of developing the ui.handler.gui.swing adapted to the http particularities.

The handler is accessible by entering <protocol>://<ip>:<port>/<service.relURL> in any browser (best results with chromium browser).

  • The <ip></ip> and <port></port> are determined by the configuration used by servlet container (Jetty through the ri.servicegateway library). The <ip></ip> may also be mapped to a dns, read the Exporting Features guideline.
  • <protocol></protocol> by default is http, but the Jetty configuration also allows secure http protocol (https), recommended for external usage.
  • <service.relurl></service.relurl> is set as a configuration parameter, by default is "universAAL".
to configure Jetty make sure you read how to configure your specific version of this component for the specific container, but generaly:
  • In Apache Felix this means editing the system properties (..runner/felix/system.properties) with parameter org.osgi.service.http.port.
  • In Apache Karaf this means editing the Jetty.xml file (in etc/ folder) the tag for jetty.port.