2016/05/28 - Apache Tuscany has been retired.

For more information, please explore the Attic.

 Apache Tuscany > Home > SCA Overview > SCA Java > Java SCA Documentation Menu > SCA Java implementation.widget User List | Dev List | Issue Tracker  


The Tuscany Widget Implementation extends the SCA programing model to HTML and/or Web 2.0 client applications.

Using Implementation.Widget to model your Web 2.0 component

This component type allows you to model your HTML and/or Web 2.0 as an SCA component, the implementation artifact would be html resource that represents the application, and you can define SCA References, that would be wired to server side services.

<composite	xmlns="http://www.osoa.org/xmlns/sca/1.0"
       <component name="store">
           <t:implementation.widget location="contents/store.html"/>
           <service name="Widget">
	   <reference name="catalog" target="Catalog">
	   <reference name="shoppingCart" target="ShoppingCart">

Defining references in HTML resources

The widget implementation introduces SCA annotations to JavaScript code using the syntax below. These references will get properly introspected by the implementation.widget and wired to the proper server side services.

var catalog = new Reference("catalog");

var shoppingCart = new Reference("shoppingCart");

Including generated JavaScript client proxy

The client application will need to include a generated JavaScript that will contain the necessary client proxy used to access the server side services. The name of the generated JavaScript is the same as the HTML resource being specified as the implementation artifact.

<!-- one js include per sca component -->
<script type="text/javascript" src="store.js"></script>

Supported binding types

Currently, you can define references to remote services using the following bindings :



website stats