On Tue, May 5, 2009 at 4:55 AM, lookman sanni <[email protected]> wrote:
> Hi everyone.
>
>
> I've been deeply reading the getting started with Tuscany, and i''m in
> need of explanations on some points:
>
> What does the Tuscany SCA Data Collection stands for? What's the difference
> between an org.apache.tuscany.sca.data.collection.Entry object  and a
> java.util.Map object?

The Tuscany Data Collection is a SPI that allow users to manipulate a
collection of "things/data" in a way that it can be easily
exposed/mapped as REST style services. You can see that it basically
maps HTTP protocol operations to the SPI (e.g when you do a get
passing a resource id, it maps to get(String id))......

> In the shopping Cart implementation, is it because the component use the
> atom binding, that put, post and delete methods are defined? What about the
> keyring system key = "cart-" + UUID.randomUUID().toString(); in the post
> method? What is it used for?
>

The cart have the CRUD operations, the only difference is that the
method names are following the REST/ATOM PUB/HTTP names instead of
Create, Read, Update and Delete. Again, this is to facilitate exposing
these "things/data" in a REST way...

> In order to handle the shopping cart items posting, and the shopping cart
> total request  from the android app, I'm trying to use the Abdera project.
> As it's going to be run from a mobile platform, i intend to build only the
> needed part of Abdera, and export it to android as a Dex file.
> I'll be posting the cart items like this:
>

Note that shopping cart total is using JSON-RPC and not ATOM, so you
won't need Abdera for that.
As for the atom support, I'd recommend two ways :
   - Verify if there is native support for ATOM in Android (this is
what we did for JSON)
   - Try to use the full Abdera parser...

>
>>
>> Abdera abdera = new Abdera();
>>         AbderaClient client = new AbderaClient(abdera);
>>
>>         Entry entry = abdera.newEntry();
>>
>>         entry.setContent("<entry xmlns='http://www.w3.org/2005/Atom'>" +
>>                 "<title>item</title>" +
>>                 "<content type='text/xml'>" +
>>                     "<Item xmlns='http://services/'>" +
>>                         "<name xmlns=''>" + item.getName()+ "</name>" +
>>                         "<price xmlns=''>" +item.getPrice()+"</price>" +
>>             "</Item></content></entry>");
>>
>>         ClientResponse resp = client.post(ServiceURI,entry);
>
>
> And this requires the following classes:
>>
>> org.apache.abdera.Abdera;
>> org.apache.abdera.model.Entry;
>> org.apache.abdera.model.Feed;
>> org.apache.abdera.protocol.Response.ResponseType;
>> org.apache.abdera.protocol.client.AbderaClient;
>> org.apache.abdera.protocol.client.ClientResponse;
>
>
> I'd like to know if there's a tool i can use to quickly and easily pack
> those classes with their dependencies in a jar file, before sealing them in
> a dex file using the android dx utility.
>
> Surely all this will imply a switch of the shopping cart's binding from atom
> to atom-abdera.
>

There should be no changes needed here....

> Apart from answers to my questions, feel free guys to post any comment or
> helpful advice.
>
>
> Cdlt;
> --
> Lookman SANNI;
>



-- 
Luciano Resende
Apache Tuscany, Apache PhotArk
http://people.apache.org/~lresende
http://lresende.blogspot.com/

Reply via email to