SCA Java implementation.widget (TUSCANY) edited by Luciano Resende
      Page: 
http://cwiki.apache.org/confluence/display/TUSCANY/SCA+Java+implementation.widget
   Changes: 
http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=75841&originalVersion=2&revisedVersion=3






Content:
---------------------------------------------------------------------

h3.Introduction

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


h3.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.

{code}
<composite      xmlns="http://www.osoa.org/xmlns/sca/1.0";
                xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0";
                targetNamespace="http://store";                  
                name="store">
                
       <component name="store">
           <t:implementation.widget location="contents/store.html"/>
           <service name="Widget">
               <t:binding.http/> 
           </service>
           <reference name="catalog" target="Catalog">
               <t:binding.jsonrpc/>
           </reference>
           <reference name="shoppingCart" target="ShoppingCart">
               <t:binding.atom/>
           </reference>
        </component>
    
        .....
</composite>
{code}


h3. 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.

{code}
//@Reference
var catalog = new Reference("catalog");

//@Reference
var shoppingCart = new Reference("shoppingCart");
{code}


h3.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.


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

h3.Supported binding types

Currently, you can define references to remote services using the following 
bindings :
* [ATOM|SCA Java binding.atom]
* [JSON-RPC|SCA Java binding.jsonrpc]
* [HTTP|SCA Java binding.http]

h3.References
[http://incubator.apache.org/tuscany/getting-started-with-tuscany.html]





---------------------------------------------------------------------
CONFLUENCE INFORMATION
This message is automatically generated by Confluence

Unsubscribe or edit your notifications preferences
   http://cwiki.apache.org/confluence/users/viewnotifications.action

If you think it was sent incorrectly contact one of the administrators
   http://cwiki.apache.org/confluence/administrators.action

If you want more information on Confluence, or have a bug to report see
   http://www.atlassian.com/software/confluence


Reply via email to