tuscany-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luciano Resende <luckbr1...@gmail.com>
Subject Re: Progress - Enhancing WIdget Support for Tuscany
Date Fri, 23 Aug 2013 19:07:18 GMT
On Fri, Aug 23, 2013 at 10:47 AM, Akhil Anil <akhil.karun@gmail.com> wrote:

> Hi,
>
> I was unable to understand basics on how the dojo.js appears in the store
> application. I went through
> http://tuscany.apache.org/sca-java-bindingjsonrpc.html
>
>
In the store application, the javascript files are added in the store.html.
What Tuscany does automatically is to make dojo library available to the
runtime (if things are on the classpath)

https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/applications/store/src/main/resources/uiservices/store.html


> So as of now I'm trying to follow a top down approach by taking the the
> store example, then adding the jquery file directly in the header in the
> html file and trying to make the the ajax call to the references. Once I
> get a working protocol I could move the jquery js to be invoked via tuscany
> and gerenerate the portion that makes the call.
>
> I couldn't also understand
> __tuscany.sca.referenceMap.catalog =* new
> dojo.rpc.JsonService("/Catalog/?smd");
> *
>

This is how Dojo "discover" the interface of the service. Our JSON-RPC
binding have support for the $smd and return the expected information to
Dojo.
More info here :
http://dojotoolkit.org/reference-guide/1.9/dojox/rpc/Service.html



> **
>
> below is the screenshot of calls going on the initial loading of the
> store.html page.
>
> [image: Inline images 1]
>
>
>    - why/how is the call to 'catalog' made 2 time the init() function is
>    called only once rt. And how is it done the second time without the *
>    "?smd"* suffix.
>
> Dojo calls the ?smd to figure out the "interface/methods available" and
then call the operations it need after that

>
>    -
>    - why the "*?smd*" is passed in the url while the call is made? i know
>    its called service mapping description. but how/where is it handled by
>    tuscany?
>
> ?smd is required by dojo. And Tuscany handled that in the dojo-rpc binding
servlet code
https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JsonRpcServlet.java


>
>    -
>    - It sort of trims of "?smd" portion from this url. How/why does this
>    happen?
>
> *Another point of interest. *
> *
> *
> Currently, the html page is where a user specify about using dojo. So is
> it wise if we use it as a place to specify the framework to use. We can
> totally avoid changing anything in the composite file.
>
> If the foo.html file includes
>
> *<script type="text/javascript" src="../dojo/dojo.js"></script> *
>
> the application would use dojo. If it includes
> *<script type="text/javascript" src="../jquery/jquery.js"></script> *
> *
> *
>

That might be an option, but what if for some reason the app is using both
? How do you decide what to generate ?


> **
> then the application knows it should use jquery. This doesn't cause any
> syntax issues as all js framework dependent code is generated only in the
> store.js by tuscany. We just need to make the changes in store.js file
> generated.
>
>
There might be some timing issue, but i guess this can be resolved...



>
> --
>
> Thanks and regards....
>
> May God Bless us!
>
> *AkH!L.*
>
> *http://akhilspassion.blogspot.com*
>



-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/

Mime
View raw message