You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by co...@apache.org on 2008/02/05 23:02:01 UTC

[CONF] Apache Tuscany: SCA Java implementation.widget (page edited)

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=0&revisedVersion=1

Comment:
---------------------------------------------------------------------



Change summary:
---------------------------------------------------------------------



Change summary:
---------------------------------------------------------------------



Change summary:
---------------------------------------------------------------------



Change summary:
---------------------------------------------------------------------



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

h3.Introduction

Implementation.widget extends the SCA programming model to web 2.0 client applications. 


As for creating a SCA component, below is an sample SCDL

{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="ufservices/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>
    
	<component name="Catalog">
	    <implementation.java class="services.CatalogImpl"/> 
	    <property name="currencyCode">USD</property>
	    <service name="Catalog">
                <t:binding.jsonrpc/>
   	    </service>
	    <reference name="currencyConverter" target="CurrencyConverter"/>	
	</component> 
 	
	<component name="ShoppingCart">
	    <implementation.java class="services.ShoppingCartImpl"/>
	    <service name="Collection">
	        <t:binding.atom/>
	    </service>    	
	</component>
    
	<component name="CurrencyConverter">
		<implementation.java class="services.CurrencyConverterImpl"/>
		<property name="rate">0.7256</property>
	</component>     

</composite>
{code}

Declaring SCA references using JavaScript can be done with the syntax below. This references will get properly introspected by the implementation.widget and wired.

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

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

The client application will need to include a generated js, that has the same name as the  component being used.

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

Right now there is support for JSONRPC and Atom, and you can see all of this in in action in sca/samples/store.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org