XForms and PageFlows:
The Last Mile of a Service Oriented Architecture

Martin Holzner

Developer, exteNd™ R&D

Novell, Inc.

Session Abstract

A Service Oriented Architecture (SOA) is a collection of interacting services that combine for a common purpose. Simple Object Access Protocol (SOAP) and XML Extensible Markup Language (XML) have become the predominate technologies for enabling one kind of operating system to communicate with a program in the same or another kind of operating system. But what happens when these services are delivered to people, rather than just a machine? In this presentation, attendees will learn how to develop SOA-based end-user graphical applications using two new technologies in exteNd 5 - XForms and PageFlow. Technical demonstrations will demonstrate the concepts covered in this presentation.

What You Will Learn

You will learn how to develop SOA-based GUI applications using two new technologies in exteNd 5 - XForms and PageFlow (since 5.0)

Target Audience

Developers

Interested in creating XForms and Page Flows using SOA

Assumptions

Understanding of Web service concepts

Comfortable with XML

High level familiarity with related XML technologies such as Schema, Namespaces, CSS, etc.

Agenda

Service-oriented Architecture Defined

Introducing XForms

Authoring XForms with exteNd

Using XForms with exteNd PageFlow

Service-oriented Architecture Defined

What is a Service

Logical unit of work performed by a service producer to achieve a desired end result for a service consumer

Work is performed via an exchange of messages

Service

Producer

Ship this package

Service

Consumer

Package has been shipped

What is a Service-oriented
Architecture?

Distributed software model

Collection of Services

Goal is to achieve loose coupling among interacting software agents

Motivation for SOA

Over 40 Years of Software Development

Reuse and Repurpose not Rip and Replace

No one single platform or technology

Been There, Done That

SOA is not a new idea

Some early attempts

DCOM

CORBA ORBs

RMI

But This Time It’s Different

SOAP and XML

No binary dependency

Small Set of simple and ubiquitous interfaces universally available for all providers and consumers

Exchange of descriptive (not instructive) messages constrained by an extensible schema

Components vs. Services

Business concepts and requirements

Documents, processes

Coarse-grain

Larger, richly typed,
self-contained documents

Services

Low-level technical concepts

APIs, data types,
platforms

Fine-grain

Small, simple messgaes

Components

Web Services from SOA

Interfaces must be based on Internet protocols

HTTP, FTP, SMTP, etc.

Messages must be defined in XML

Web Services enables a developer to isolate logical units of work, and expose these units of work in a way that makes it possible for them to be used and reused for many different purposes.

Web Services Defined

Request

Response

Web
service

SOA Model

SOA

Tasks

Outcomes

Roles

SOA Roles

Service Producer

Expose specific technology components as services

Makes these services available for discovery

Provider of the service

Service Consumer

Discovers relevant services that satisfy requirements

Assembles and invokes services

Requestor of the service

Service Registry

Where Service Producers publish services

Where Service Consumers discover services

Searchable repository for services

SOA Tasks

Publish

Advertises services to a registry

Removes services from a registry

Find

Discovers specific services

Bind

Locate, connect, and invoke services

SOA Outcomes

Service

The implementation of a Web service

A deployed component available to accept requests

Service Description

Contains the specifications needed for invoking the service

What the service does

How to invoke it

Where it is located

Published to a service registry

Interactions in a SOA

Service

Producer

Service

Consumer

Service

Registry

Publish

Bind

Find

Service

Service

Description

Service

Description

Demo

Introducing XForms

What Are Forms

General term for all different kinds of technologies used to gather information from users.

XForms

Provides online interaction between a person and a software agent

Next generation of forms for the web

Successor to HTML forms

Forms module for XHTML 2.0

W3C Recommendation

October 14, 2003

Standards Based

XML

XML Namespaces

XPath

XML Schema

XML Events

Limitations of HTML Forms

Dependent on scripting languages for all but the simplest of forms

Initialization of form data is difficult to manage and is control specific

Form data is represented as a flat data structure

Not easily routable through a workflow

Targeted specifically for an HTML browser

Advantages of XForms

Improves the user experience

It is XML, and it can submit XML

Combines existing XML technologies

Device independent

Easier to author complicated forms

Internationalized

Accessible

XForms

XForms is not a free-standing document type

Designed to run as components within a host language

XHTML

SVG

XForms Structure

What it should do

XForms Model

How it should look

XForms User Interface

Where it should go

XForms submit protocol

<xforms:model>

…

</xforms:model>

XForms Model

Represents the definition of the form

Instance Data

Constraints

Submission

Can have more than one Model

Appears in the head section of an XHTML document

XForms Model: Instance Data

Contains or references instance data

Can have more than one per Model

<xforms:model>

<xforms:instance>

<payment xmlns=“” method=“cc”>

<number/>

<expiration/>

</payment>

</xforms:instance>

</xforms:model>

XForms Model: Submission

Indicates where and how the form data will be submitted

options to control serialization and submission

<model>

<instance>

<payment xmlns=“” method=“cc”>

<number/>

<expiration/>

</ecommerce>

</instance>

<submission action=“…” method=“post” />

</model>

XForms User Interface: Controls

Device-neutral and platform independent

input, secret, text area, output, upload, range, trigger, submit, select, select1

XForms User Interface: Controls

<select1 ref=“@method">

<label>Payment Method:</label>

<choices>

<item>

<label>Cash</label>

<value>C</value>

</item>

<item>

<label>Credit</label>

<value>cc</value>

</item></choices>

</select1>

<input ref="number">

<label>Credit Card Number:</label>

</input>

<input ref="expiration">

<label>Expiration Date:</label>

</input>

XForms User Interface: Binding

Connects the Model and the User Interface to enable data capture

Accomplished using XPath

XForms

Model

XForms

User Interface

Controls

XPath

<select1 ref=“@method">

<label>Payment Method:</label>

<choices>

<item>

<label>Credit</label>

<value>cc</value>

</item></choices>

</choices>

</select1>

<input ref="number">

<label>Credit Card Number:</label>

</input>

<input ref="expiration">

<label>Expiration Date:</label>

</input>

XForms User Interface: Binding

<model>

<instance>

<payment xmlns=“” method=“cc”>

<number/>

<expiration/>

</payment>

</instance>

</model>

Constraining Values

Model item properties

Provides for rich declarative validation of form data

Derived from

XML Schemas

XForms specific properties

required, relevant, readonly, calculate, constraint, type

Events and Actions

Based on XML DOM Event Model

Common client-side interactivity without need for complex scripting

Events

DOMActivate, xforms-value-changed, xforms-ready, …

Actions

Set Value, Revalidate Model, Insert, Delete, …

Authoring XForms with exteNd

Form Designer

An intuitive environment for developing XForms compliant Web forms

Wizards to create Forms from

XML Documents

XML Schema Documents

Rapidly design, develop, manage, and preview XForms

exteNd Form Designer Demo

Using XForms with exteNd PageFlow

What is PageFlow?

Page Flow provides a visual environment for creating portlets that links forms and activities to create a seamless application.

What Does PageFlow Do?

A PageFlow defines the flow of control for a set of pages

Very powerful yet simple to use controller for Model-View-Controller (MVC) applications

Deployed as a standards-based Java Portlet

PageFlow Packaging

PageFlow

Order Confirmation

Place Order

Purchase Order

Java Portlet

Architecture

Design

Server

WS SQL Java

XML

HTML/JScript

Form

XHTML XForms

Client

Pageflow Modeler

XML Connector

Forms Processor

Custom Control Processor

Pageflow Processor

Recommended Sessions

Q & A

Real-world HTML forms are reliant on script to accomplish many common tasks such as marking controls as required, performing validations and calculations, displaying error messages, and managing dynamic layout. This dependency results in complex documents, which are expensive and time-consuming to maintain.

XForms improves the user experience

XForms has been designed to allow much to be checked by the browser, such as types of fields being filled in, that a particular field is required, or that one date is later than another. This reduces the need for round trips to the server or for extensive script-based solutions, and improves the user experience by giving immediate feedback to what is being filled in.

It is XML, and it can submit XML

XForms is properly integrated into XML: it is in XML, the data it collects in the form is XML, it can load external XML documents as initial data, and can submit the results as XML. By including the user in the XML pipeline, it at last means you can have end-to-end XML, right up to the user's desktop.

It combines existing XML technologies

Rather than reinventing the wheel, XForms uses a number of existing XML technologies, such as XPath for addressing and calculating values, and XML Schema for defining data types. This has a dual benefit: ease of learning for people who already know these technologies, and the ability for implementors to use off-the-shelf components to build their systems.

It is device independent

The same form can be delivered without change to a traditional browser, a PDA, a mobile phone, a voice browser, and even some more exotic emerging clients such as an Instant Messenger. This greatly eases providing forms to a wide audience, since forms only need to be authored once.

It is easier to author complicated forms

Because XForms uses declarative markup to declare properties of values, and to build relationships between values, it is much easier for the author to create complicated, adaptive, forms, without having to resort to scripting.

It is internationalized

Because the data submitted is XML, it is properly internationalized.

It is accessible

XForms has been designed so that it will work equally well with accessible technologies (for instance for blind users) as with traditional visual browsers.

XForms and PageFlows

Michael Pellegrini

2004-02-17T19:12:42