27.03.2014 Views

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Interaction State<br />

Set<br />

Structure<br />

Data Item<br />

CD title<br />

…CD (title, artist name, year, price,<br />

availability, álbum cover, country,<br />

type of music, record company)<br />

1..N (add to the<br />

shopping basket)<br />

Figure 1. UID Example [6]<br />

User Entry<br />

Interaction State Transition<br />

Element Selection<br />

System Output<br />

Option Selection<br />

III. JAVA SERVER FACES (JSF)<br />

Java Server Faces (JSF) is a framework for developing web<br />

applications using the Java t echnology. It follows the design<br />

pattern MVC (Model-View-Control) and its m ost important<br />

differential is the separation between the business model and<br />

the visualization [5].<br />

The FacesServelt class is the JSF controller and every<br />

request submitted to the system must to be sent to it. For each<br />

HTML page instantiated, its com ponents are stored in a tree<br />

called View ID. Theses trees, in their turn, are stored in a<br />

FacesContext object, which m aintains all the inform ation the<br />

framework needs in order to manage the components of a page.<br />

Each JSF page usually contains a Java object representing<br />

its state that is called Managed Bean. The Managed Bean stores<br />

the values of each page field and is responsible for binding the<br />

model to the view.<br />

As each JSF visual component has a direct representation in<br />

a HTML component, the fram ework supports the direct<br />

rendering of HTM L pages from JSF components. M oreover,<br />

the framework also supports th e implementation of renderers<br />

that create interfaces in other languages, increasing even more<br />

the flexibility of the application.<br />

The JSF components relevant to this work are:<br />

• form: represents a form for sending data through the<br />

JSF servlet;<br />

• panelGrid: produces a table to provide an organized<br />

arrangement of the elements grouped in it;<br />

• panelGroup: groups a set of JSF elements. W hen it is<br />

converted to HTML it is mapped to a SPAN or a DIV<br />

element;<br />

• column: represents a column of a table;<br />

• dataTable: shows a collection of objects organized as a<br />

table;<br />

• outputText: represents a simple text returned by the<br />

system;<br />

• outputLabel: represents a label corresponding to a field<br />

of a user input;<br />

• inputText: represents a field of a text entry;<br />

• outputLink: produces a hyperlink that takes the user to<br />

another page, or another part of the current page,<br />

without producing an action event;<br />

• commandLink: it also produces a hyperlink, however<br />

it produces an action event and/or the calling of a<br />

method of the ManagedBean object;<br />

• commandButton: has the same functionality as the<br />

commandLink, but it has the appearance of a button;<br />

• selectManyCheckbox: represents a set of checkboxes<br />

from which the user can select a subset;<br />

• selectOneRadio: represents a set of radio buttons from<br />

which the user can select only one.<br />

Other components defined in the JSF HTM L Tablib (such<br />

as outputFormat, message, messages, graficImage,<br />

inputTextArea inputSecret, i nputHidden, selectManyMenu,<br />

selectBooleanCheckbox, selectManyListbox, selectOneMenu,<br />

and selectOneListbox) were not utilized here either because<br />

they have similar functionality to the previous com ponents or<br />

because they do not have a direct relation to UID elements.<br />

IV. MAPPING RULES<br />

During the definition of rules for m apping UID elements to<br />

JSF components, our initial idea was to divide the process in<br />

two steps: first m ap the U ID elements to abstract w idgets, as<br />

defined in [7], and then to map abstract widgets to JSF<br />

components. The abstract widgets that would be used in this<br />

mapping belong to the Abstract Widget Ontology defined in<br />

[8]. This ontology is used to specify abstract interfaces that<br />

show the inform ation exchange between the user and system,<br />

with no reference to technologies neither to the appearance of<br />

navigational objects. However, we r ealized that a l ot of the<br />

relevant information available in UIDs had been lost after<br />

mapping UID elements to abst ract widgets. Such loss of<br />

information compromised the autom atic mapping of U ID<br />

elements to JSF components ma inly because a particular<br />

abstract widget could end up being represented by different JSF<br />

components.<br />

We realized w e needed to define rules that m ap UID<br />

elements directly to JSF components. These rules are presented<br />

in Table 1. They were based on the mapping of UIDs elements<br />

to abstract widgets, the possi ble representations of JSF<br />

components as abstract widgets, and the relevant information<br />

available in UIDs.<br />

TABLE I.<br />

text<br />

UID Elements<br />

data item (system<br />

output)<br />

Structure (system<br />

output)<br />

MAPPING FROM UIDS ELEMENTS TO JSF COMPONENTS<br />

JSF Components<br />

outputText;<br />

if the data item is the source of any<br />

transition, it is m apped to a<br />

commandLink;<br />

otherwise, it is mapped to an<br />

outputText;<br />

if the structure is not the source of any<br />

transition and does not contain<br />

elements, it is mapped to an outputText;<br />

606

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!