Return-Path: X-Original-To: apmail-airavata-dev-archive@www.apache.org Delivered-To: apmail-airavata-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 04086CB83 for ; Thu, 20 Mar 2014 06:29:21 +0000 (UTC) Received: (qmail 97118 invoked by uid 500); 20 Mar 2014 06:29:20 -0000 Delivered-To: apmail-airavata-dev-archive@airavata.apache.org Received: (qmail 96998 invoked by uid 500); 20 Mar 2014 06:29:18 -0000 Mailing-List: contact dev-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list dev@airavata.apache.org Received: (qmail 96991 invoked by uid 99); 20 Mar 2014 06:29:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Mar 2014 06:29:16 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of shameerainfo@gmail.com designates 209.85.216.42 as permitted sender) Received: from [209.85.216.42] (HELO mail-qa0-f42.google.com) (209.85.216.42) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Mar 2014 06:29:12 +0000 Received: by mail-qa0-f42.google.com with SMTP id k15so397954qaq.1 for ; Wed, 19 Mar 2014 23:28:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=XKQtXrm3rJx2W04OkfMKWk5O4l8fs+vp/Zm+aFU67XU=; b=K87H5ooOck691jQrqqZfndt2PicHuNn0eKVdy512GnHq+ltpgQoHJC1SWNUq/SRdaR cCLAEOKvfZChaeuFcXnAtaAogmLgxV7dxLQhX9DfNwxP4zEjsxr6PnWKa+DPL0IXkxr8 G6ZH6DWnR71Uf7E8EbTZBLvWEQEAkFmCzDfitWZjrRDrn6br37ARZvSoKeC3eB5ueGIa j3jL6vOorA3RGGRdTrJLnZRqNZthItEV86jET9TGDL+B8G8fDZn+ClF/BveRKo1flL5B hBhY65YGh6OTdvBL/7b4+LOnm/Edrx6J/IJt9CZq8QSq0+bkdCiZqBkUKYJrysQEVqUB WxcA== X-Received: by 10.224.30.70 with SMTP id t6mr48666763qac.30.1395296931904; Wed, 19 Mar 2014 23:28:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.96.3.97 with HTTP; Wed, 19 Mar 2014 23:28:31 -0700 (PDT) In-Reply-To: References: <023BC7CF-BB72-4F7A-B936-0784342E61F2@apache.org> <445CCEE7-DB6E-4EDE-BFA1-6AA3C7A35EBE@apache.org> From: Shameera Rathnayaka Date: Thu, 20 Mar 2014 11:58:31 +0530 Message-ID: Subject: Re: Integrating a thrift javascript client sdk with angularjs To: dev Content-Type: multipart/alternative; boundary=047d7bdca66afb9c3204f503e101 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bdca66afb9c3204f503e101 Content-Type: text/plain; charset=ISO-8859-1 Hi Vijayendra, My idea is, first connect the gap what we have with our previous project using the suggested approach, which is write a angular service by wrapping the exiting JS client. But saying that, i also +1 for completely implement the angular service by wrapping Thrift JS client in one go. That is the ultimate goal here. and -1 for implement the same thing with angular $http. Because this is tightly couple to the angular and it require special care for maintain, when ever there is any API addition or change. But we can avoid this complexity for some extend if we go with thrift JS api. Thanks, Shameera. On Wed, Mar 19, 2014 at 9:48 PM, Vijayendra Grampurohit < vijayendra.sdm@gmail.com> wrote: > Hi All > > @Shameera : It would be better if we come up with new javascript client in > AngularJS instead of wraping exiting javaScript client as angular > service. We faced lot of issues last time doing this. Do you remember? > > Currently I am looking into Thrift API. > > Can we have a concrete plan on > 1) Integrating different modules. For this we have to rewrite the > Javascript API in Angularjs. > 2) writing thrift client in Angularjs > > > Regards > Vijayendra > > > > > > On Wed, Mar 19, 2014 at 8:50 AM, Suresh Marru wrote: > >> Hi Supun, >> >> Since there are no further comments on this thread, I would encourage you >> to start working on the GSoC proposal. Just start a proposal on google >> melegenge portal, make it publicly readable and share it on the dev list >> for comments. >> >> Suresh >> On Mar 17, 2014, at 3:24 PM, Suresh Marru wrote: >> >> > Thanks Supun for taking the initiative. I echo Shameera that this seem >> to be a good working stop-gap strategy. But I am not knowledgable enough to >> judge on this topic and would like to listen critical feedback from others. >> > >> > Suresh >> > >> > On Mar 17, 2014, at 2:58 PM, Shameera Rathnayaka < >> shameerainfo@gmail.com> wrote: >> > >> >> Hi Supun, >> >> >> >> This is great, I too found this $scope.apply()[1] would solve our >> issue . And i was going to follow this[2] and come up with a sample demo >> but you already have done it :) (didn't check it, will do). For now we can >> wrap exiting javaScript client as angular service and use it inside the >> angular. But for long run It would be good to use Thrift generated JS >> client instead exiting JS client. @Sanchit and all WDYT? >> >> >> >> [1] >> https://github.com/angular/angular.js/wiki/When-to-use-$scope.$apply%28%29 >> >> [2] http://jimhoskins.com/2012/12/17/angularjs-and-apply.html >> >> >> >> >> >> Thanks, >> >> Shameera. >> >> >> >> >> >> >> >> >> >> On Tue, Mar 18, 2014 at 12:07 AM, Supun Nakandala < >> supun.nakandala@gmail.com> wrote: >> >> Hi All, >> >> >> >> I was able to do successful POC on the $subject (the source code is >> available at [1]). I implemented a simple thrift API (thrift descriptor >> [2]) for echo function. The server side was implemented in java and for the >> client side I used javascript. >> >> >> >> Important points WRT to thrift >> >> ->Thrift javascript client can be used only against a http server. >> So I wrapped the EchoServiceHandler.java[3] inside EchoServlet.java[4] and >> deployed in tomcat server. >> >> ->Thrift client sdk currently supports only AJAX based >> communication. >> >> >> >> Important points WRT to thrift client and angular integration >> >> ->Thrift js client can be used for the communication with the >> server within angular. But the problem is, since thrift client is not part >> of angular, when we do the ajax communication and update the model the >> changes will not be updated in the DOM. The reason is angular is not aware >> of the events triggered outside of the framework. But this can be overcome >> by wrapping thrift client inside an angular service and using promises in >> angular to notify the success of ajax calls and then manually updating the >> DOM. >> >> >> >> The thrift client that I created for this service can be found at[5]. >> This thrift client is wrapped inside this angular service[6] and that >> service is used in controller [7]. I have also attached screen shots of the >> demo. >> >> >> >> Hope Shameera, Sanchit, Viknes or Vijayendra can provide feedback on >> this POC and evaluate whether this POC is sound enough to guaranty that web >> based experiment builder can be integrated with the thrift client sdk. >> >> >> >> Thank you. >> >> Supun Nakandala >> >> >> >> [1] - https://github.com/scnakandala/echo_service >> >> [2] - >> https://github.com/scnakandala/echo_service/blob/master/Echo.thrift >> >> [3] - >> https://github.com/scnakandala/echo_service/blob/master/src/echo/EchoServiceHandler.java >> >> [4] - >> https://github.com/scnakandala/echo_service/blob/master/src/echo/EchoServlet.java >> >> [5] - >> https://github.com/scnakandala/echo_service/blob/master/WebContent/Web/app/lib/echo_service/echo_client.js >> >> >> >> [6] - >> https://github.com/scnakandala/echo_service/blob/master/WebContent/Web/app/js/services.js >> >> >> >> [7] - >> https://github.com/scnakandala/echo_service/blob/master/WebContent/Web/app/js/controllers.js >> >> >> >> >> >> >> >> >> >> >> >> -- >> >> Best Regards, >> >> Shameera Rathnayaka. >> >> >> >> email: shameera AT apache.org , shameerainfo AT gmail.com >> >> Blog : http://shameerarathnayaka.blogspot.com/ >> > >> >> > -- Best Regards, Shameera Rathnayaka. email: shameera AT apache.org , shameerainfo AT gmail.com Blog : http://shameerarathnayaka.blogspot.com/ --047d7bdca66afb9c3204f503e101 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi = Vijayendra,

My idea is, first connect the gap what we have with our previous proj= ect using the suggested approach, which is write a angular service by wrapp= ing the exiting JS client. But saying that, i also +1 for completely implem= ent the angular service by wrapping Thrift JS client in one go. That is the= ultimate goal here. and -1 for implement the same thing with angular $http= . Because this is tightly couple to the angular and it require special care= for maintain, when ever there is any API addition or change. But we can av= oid this complexity for some extend if we go with thrift JS api.

Thanks,
Shameera.


= On Wed, Mar 19, 2014 at 9:48 PM, Vijayendra Grampurohit &= lt;vijayendra= .sdm@gmail.com> wrote:
Hi All

@= Shameera : It would be better if we come up with new javascript client in A= ngularJS instead of=A0=A0wrapi= ng exiting javaScript client as angular service. We faced lot of issues las= t time doing this. Do you remember?

Currently I am looking into Thrift API.=A0

Can we have a concrete plan on=A0
1) Integrating different modules. For= this we have to rewrite the Javascript API in Angularjs.
= 2) writing thrift client in Angularjs


Re= gards
Vijayendra




On Wed, Mar 19, 2014 at 8:50 AM, Suresh = Marru <smarru@apache.org> wrote:
Hi Supun,

Since there are no further comments on this thread, I would encourage you t= o start working on the GSoC proposal. Just start a proposal on google meleg= enge portal, make it publicly readable and share it on the dev list for com= ments.

Suresh
On Mar 17, 2014, at 3:24 PM, Suresh Marru <smarru@apache.org>= wrote:

> Thanks Supun for taking the initiative. I echo Shameera that this seem= to be a good working stop-gap strategy. But I am not knowledgable enough t= o judge on this topic and would like to listen critical feedback from other= s.
>
> Suresh
>
> On Mar 17, 2014, at 2:58 PM, Shameera Rathnayaka <shameerainfo@gmail.com> w= rote:
>
>> Hi Supun,
>>
>> This is great, I too found this $scope.apply()[1] would solve our = issue . And i was going to follow this[2] and come up with a sample demo bu= t you already have done it :) (didn't check it, will do). =A0For now we= can wrap exiting javaScript client as angular service and use it inside th= e angular. But for long run It would be good to use Thrift generated JS cli= ent instead exiting JS client. @Sanchit and all WDYT?
>>
>> [1] https://github.com/angular/angul= ar.js/wiki/When-to-use-$scope.$apply%28%29
>> [2] http://jimhoskins.com/2012/12/17/angularjs-and-ap= ply.html
>>
>>
>> Thanks,
>> Shameera.
>>
>>
>>
>>
>> On Tue, Mar 18, 2014 at 12:07 AM, Supun Nakandala <supun.nakandala@gmail.co= m> wrote:
>> Hi All,
>>
>> I was able to do successful POC on the $subject (the source code i= s available at [1]). I implemented a simple thrift API (thrift descriptor [= 2]) for echo function. The server side was implemented in java and for the = client side I used javascript.
>>
>> Important points WRT to thrift
>> =A0 =A0->Thrift javascript client can be used only against a ht= tp server. So I wrapped the EchoServiceHandler.java[3] inside EchoServlet.j= ava[4] and deployed in tomcat server.
>> =A0 =A0->Thrift client sdk currently supports only AJAX based c= ommunication.
>>
>> Important points WRT to thrift client and angular integration
>> =A0 =A0->Thrift js client can be used for the communication wit= h the server within angular. But the problem is, since thrift client is not= part of angular, when we do the ajax communication and update the model th= e changes will not be updated in the DOM. The reason is angular is not awar= e of the events triggered outside of the framework. But this can be overcom= e by wrapping thrift client inside an angular service and using promises in= angular to notify the success of ajax calls and then manually updating the= DOM.
>>
>> The thrift client that I created for this service can be found at[= 5]. This thrift client is wrapped inside this angular service[6] and that s= ervice is used in controller [7]. I have also attached screen shots of the = demo.
>>
>> Hope Shameera, Sanchit, Viknes or Vijayendra can provide feedback = on this POC and evaluate whether this POC is sound enough to guaranty that = web based experiment builder can be integrated with the thrift client sdk.<= br> >>
>> Thank you.
>> Supun Nakandala
>>
>> [1] - https://github.com/scnakandala/echo_service
>> [2] - https://github.com/scnakandala/echo_s= ervice/blob/master/Echo.thrift
>> [3] - https://github.c= om/scnakandala/echo_service/blob/master/src/echo/EchoServiceHandler.java
>> [4] -
https://github.com/scna= kandala/echo_service/blob/master/src/echo/EchoServlet.java
>> [5] - https://github.com/scnakandala/echo_service/blob/master/WebContent/Web/ap= p/lib/echo_service/echo_client.js
>>
>> [6] - https://github.= com/scnakandala/echo_service/blob/master/WebContent/Web/app/js/services.js<= /a>
>>
>> [7] -
https://gith= ub.com/scnakandala/echo_service/blob/master/WebContent/Web/app/js/controlle= rs.js
>>
>>
>>
>>
>>
>> --
>> Best Regards,
>> Shameera Rathnayaka.
>>
>> email: shameera AT apache.org , shameerainfo AT gmail.com
>> Blog : http://shameerarathnayaka.blogspot.com/
>





--
Best Regard= s,
Shameer= a Rathnayaka.

email: shameer= a AT apache.org , shame= erainfo AT gmail.com
Blog : http://shameerarathna= yaka.blogspot.com/
--047d7bdca66afb9c3204f503e101--