Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed entire approach and created new one adhering to comments from Luciano.

...

Proposal Content Details :

Current Intentions

1.

...

<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.jquery/>
</reference>
...
</component>

.....
</composite>

...

Code the file for implementation-widget-runtime-jquery

In the model of implementation-widget-runtime-pojo

2. Add some kind of switch on the composite file to change the classpath dependencies

add composite file switch

3. Use the jQuery native ajax calls

<\!-\- one js include per sca component --> <script type="text/javascript" src="jQuery.tuscany.js"></script>jQuery&nbsp;plugins extends the core jQuery nature \[1\]&nbsp;. This file would be generated by a generator function in the server side.&nbsp;
Wiki Markup
Following are the popular ajax request present in jQuery&nbsp;\[1\]

  • load(): Load a piece of html into a container DOM.
  • $.getJSON(): Load a JSON with GET method.
  • $.getScript(): Load a JavaScript.
  • $.get(): Use this if you want to make a GET call and play extensively with the response.
  • $.post(): Use this if you want to make a POST call and don’t want to load the response to some container DOM.
  • $.ajax(): Use this if you need to do something when XHR fails, or you need to specify ajax options (e.g. cache: true) on the fly.

Wiki Markup
\[1\]
Book Reference :
&nbsp;
jQuery in Action, Chapter 8

3. Defining html In Resources

The user can write everything in under jQuery syntax and we will have code to handle it in the generated plugin file.

For Eg:

var ref2 = $.tuscanyReferenceCall.("catalog");

http://net.tutsplus.com/tutorials/javascript-ajax/5-ways-to-make-ajax-calls-with-jquery/var ref2 = $.tuscanyReferenceCall.("shoppingCart");