From photark-dev-return-1449-apmail-incubator-photark-dev-archive=incubator.apache.org@incubator.apache.org Fri Aug 12 17:38:53 2011 Return-Path: X-Original-To: apmail-incubator-photark-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-photark-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 30A708575 for ; Fri, 12 Aug 2011 17:38:53 +0000 (UTC) Received: (qmail 86353 invoked by uid 500); 12 Aug 2011 17:38:53 -0000 Delivered-To: apmail-incubator-photark-dev-archive@incubator.apache.org Received: (qmail 86330 invoked by uid 500); 12 Aug 2011 17:38:52 -0000 Mailing-List: contact photark-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: photark-dev@incubator.apache.org Delivered-To: mailing list photark-dev@incubator.apache.org Received: (qmail 86182 invoked by uid 99); 12 Aug 2011 17:38:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Aug 2011 17:38:52 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of subashsdm@gmail.com designates 209.85.216.47 as permitted sender) Received: from [209.85.216.47] (HELO mail-qw0-f47.google.com) (209.85.216.47) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Aug 2011 17:38:45 +0000 Received: by qwh5 with SMTP id 5so1801575qwh.6 for ; Fri, 12 Aug 2011 10:38:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=JJBiX7i7nIkamrnZ3hWcvHDGldfuxM0naqIchba5Ldc=; b=GGvHhDoE+nrymmxYGx208h6nsJraSLUl5o19RheXu1G91v3NggM3erC04SrnT5H2Cy 1xc7sovsV53F8VVx3mD/cdT5/RMmVg9k/S8cmECRQ2dLZGyyNzgSKHRgfReCXkXExi3u IIrQaxaQmnY0ip3oKbGPakoHEmMwaJI0ywuG4= MIME-Version: 1.0 Received: by 10.229.224.145 with SMTP id io17mr802751qcb.267.1313170704271; Fri, 12 Aug 2011 10:38:24 -0700 (PDT) Received: by 10.229.109.193 with HTTP; Fri, 12 Aug 2011 10:38:24 -0700 (PDT) In-Reply-To: References: Date: Fri, 12 Aug 2011 23:08:24 +0530 Message-ID: Subject: Re: Problem in using org.apache.tuscany.sca.data.collection.Entry in my service callback method. From: Subash Chaturanga To: photark-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=00163646dad45b891c04aa5261f9 X-Virus-Checked: Checked by ClamAV on apache.org --00163646dad45b891c04aa5261f9 Content-Type: text/plain; charset=ISO-8859-1 Got it :-) Those key value pairs can be easily accessible by entries[i].key and entries[i].data. On Fri, Aug 12, 2011 at 9:35 PM, Subash Chaturanga wrote: > > > On Tue, Jul 26, 2011 at 9:27 AM, Luciano Resende wrote: > >> On Mon, Jul 25, 2011 at 10:49 AM, Subash Chaturanga >> wrote: >> > Hi all, >> > I am using the org.apache.tuscany.sca.data.collection.Entry as the >> return >> > type of one my service methods. I am having problems in using them in >> the >> > callback method >> > The return type of the calling method is Entry[] . >> > >> > So here is my callback method. >> > >> > function facebook_ff_callback(items, exception) { >> > if(exception) { >> > alert("Err"); >> > } else { >> > alert(items[0].getData()); >> > } >> > } >> > >> > And I am getting no response. Is this the correct way to iterate >> > through Entry[] ? >> > >> >> Here are some examples on how to iterate trough a Tuscany collection in JS >> >> >> https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/applications/store/src/main/resources/uiservices/store.html > > > Hi Luciano, I looked in to this example code. This is what i captured. What > I am returning is a Entry which has key value pairs. I am not > getting what is "entries[i].getElementsByTagName("content")[0]" and "..... > .firstChild.nodeValue" ??? > > var entries = feed.getElementsByTagName("entry"); > var list = ""; > for (var i=0; i var content = entries[i].getElementsByTagName("content")[0]; > var name = content.getElementsByTagName("name")[0].firstChild.nodeValue; > var price = content.getElementsByTagName("price")[0].firstChild.nodeValue; > list += name + ' - ' + price + '
'; > } > > > >> >> >> >> >> -- >> >> Luciano Resende >> http://people.apache.org/~lresende >> http://twitter.com/lresende1975 >> http://lresende.blogspot.com/ >> > > > Thanks > -- > Subash Chaturanga > Department of Computer Science & Engineering > University of Moratuwa > Sri Lanka > > Blog - http://subashsdm.blogspot.com/ > Twitter - http://twitter.com/subash89 > > > -- Subash Chaturanga Department of Computer Science & Engineering University of Moratuwa Sri Lanka Blog - http://subashsdm.blogspot.com/ Twitter - http://twitter.com/subash89 --00163646dad45b891c04aa5261f9--