You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Stephen C <st...@stephenjc.com> on 2013/08/08 14:38:47 UTC

backends - parse/backendless/roll your own

I am curious to get the groups feelings on these cloud backends with air
projects. Like parse and backendless, i have played with these, and i am
toying with the idea of moving to one so i do not have to maintain my
php/mysql backend and let someone else deal with it.

I would also be interested in others.

Thank You,
Stephen C
-All of my email addresses go to the same place
-Save Paper, think before you print
-PGP Public Key<https://docs.google.com/file/d/0B0JeFeQj5XjkZC0talFuRExyc0E/edit?usp=sharing>

Re: backends - parse/backendless/roll your own

Posted by Arne Broedel <ar...@googlemail.com>.
Is there anyone who tested backendless? It looks really promising to me but
I have difficulties to query my data.


2013/8/27 Jerry Hamby <je...@vdex.com>

> Just wanted to followup on the statement I made about not being able to do
> "PUT" and "DELETE" in Flex.
> I have found a way to make it happen, just thought I would share.
>
> Instead of using HTTPService, I had to use URLRequest.
>
> The code issues a PUT REST command to the Apigee Usergrid NoSQL system:
> It assumes you have a collection(table) named "stores" and you are
> updating an entity(record) that has a UUID of "23kdlerj494slmfas-944jfksg"
>
> I now can stop sending my "PUT" and "DELETE" commands through a 3rd party
> server,
> Jerry
>
>
> ============= sample code ==================
> mBuildPutObjects("23kdlerj494slmfas-944jfksg", "theshoestore_23");
>
>
> public function mBuildPutObjects(vEntityUUID:String, vNewData:String):void{
>     var vObj:Object = new Object();
>     vObj.storename = vNewData;
>     mPutToEntity(vEntityUUID, vObj);
>     break;
> }
>
>
> public function mPutToEntity(vUUID:String, vObj:Object):void{
>                 var vTempJSONString:String =
>  com.adobe.serialization.json.JSON.encode(vObj);
>                 var url:String = ('https://api.usergrid.com/'
>                         + pMyOrgName
>                         +'/'
>                         + pTheAppName
>                         + '/stores/'
>                         + vUUID
>                         + '?ql=');
>                 var vRequest:URLRequest = new URLRequest(url);
>                 vRequest.method = URLRequestMethod.PUT;
>                 vRequest.contentType = 'application/x-www-form-urlencoded';
>                 vRequest.data = vTempJSONString;
>                 var loader:URLLoader = new URLLoader();
>                 loader.dataFormat = URLLoaderDataFormat.TEXT;
>                 loader.addEventListener(Event.COMPLETE, mAuthenticated);
>                 loader.addEventListener(IOErrorEvent.IO_ERROR,
> mIOerrorHandler);
>                 loader.load(vRequest);
>
>         //------------------
>         function mIOerrorHandler(event:Event):void{
>                 trace("mPutToEntity mIOerrorHandler IN RESPONSE ");
>         }
>
>         //------------------
>         function mAuthenticated(event:Event):void{
>                 var vTempJSON:Object =
>  com.adobe.serialization.json.JSON.decode(event.currentTarget.data as
> String, false);
>                 trace("mPutToEntity mGoodResults
> vTempJSON.entities[0].name) = "+vTempJSON.entities[0].name);
>         }
> }
>
>
>
>
> On Aug 8, 2013, at 10:40 AM, OmPrakash Muppirala wrote:
> >>
> > Have you tried the as3httpclient library?  [1]
> >
> > Thanks,
> > Om
> >
> > [1] https://github.com/gabriel/as3httpclient/blob/master/EXAMPLES.md
>

Re: backends - parse/backendless/roll your own

Posted by Harbs <ha...@gmail.com>.
Yup. HTTPService is nice for basic stuff, but if you need anything more complex (like handling binary data), it falls short.

On Aug 27, 2013, at 4:11 AM, Jerry Hamby wrote:

> Instead of using HTTPService, I had to use URLRequest.


Re: backends - parse/backendless/roll your own

Posted by Jerry Hamby <je...@vdex.com>.
Just wanted to followup on the statement I made about not being able to do "PUT" and "DELETE" in Flex.
I have found a way to make it happen, just thought I would share.

Instead of using HTTPService, I had to use URLRequest.

The code issues a PUT REST command to the Apigee Usergrid NoSQL system:
It assumes you have a collection(table) named "stores" and you are updating an entity(record) that has a UUID of "23kdlerj494slmfas-944jfksg"

I now can stop sending my "PUT" and "DELETE" commands through a 3rd party server,
Jerry


============= sample code ==================
mBuildPutObjects("23kdlerj494slmfas-944jfksg", "theshoestore_23");


public function mBuildPutObjects(vEntityUUID:String, vNewData:String):void{
    var vObj:Object = new Object();
    vObj.storename = vNewData;
    mPutToEntity(vEntityUUID, vObj);
    break;
}


public function mPutToEntity(vUUID:String, vObj:Object):void{
		var vTempJSONString:String =  com.adobe.serialization.json.JSON.encode(vObj);
		var url:String = ('https://api.usergrid.com/'
			+ pMyOrgName
			+'/'
			+ pTheAppName
			+ '/stores/'
			+ vUUID
			+ '?ql=');
		var vRequest:URLRequest = new URLRequest(url);
		vRequest.method = URLRequestMethod.PUT;
		vRequest.contentType = 'application/x-www-form-urlencoded';
		vRequest.data = vTempJSONString;
		var loader:URLLoader = new URLLoader();
		loader.dataFormat = URLLoaderDataFormat.TEXT;
		loader.addEventListener(Event.COMPLETE, mAuthenticated);
		loader.addEventListener(IOErrorEvent.IO_ERROR, mIOerrorHandler);
		loader.load(vRequest);
	
	//------------------
	function mIOerrorHandler(event:Event):void{
		trace("mPutToEntity mIOerrorHandler IN RESPONSE ");
	}
	
	//------------------
	function mAuthenticated(event:Event):void{
		var vTempJSON:Object =  com.adobe.serialization.json.JSON.decode(event.currentTarget.data as String, false);
		trace("mPutToEntity mGoodResults vTempJSON.entities[0].name) = "+vTempJSON.entities[0].name);
	}
}




On Aug 8, 2013, at 10:40 AM, OmPrakash Muppirala wrote:
>> 
> Have you tried the as3httpclient library?  [1]
> 
> Thanks,
> Om
> 
> [1] https://github.com/gabriel/as3httpclient/blob/master/EXAMPLES.md

Re: backends - parse/backendless/roll your own

Posted by Prem Radhakrishnan <go...@gmail.com>.
Thank you Jerry, much appreciated.

http://www.39dn.com
Perfection is achieved, not when there is nothing more to add, but when
there is nothing left to take away.
  - Antoine de Saint-Exupery


On Wed, Aug 14, 2013 at 12:38 PM, Jerry Hamby <je...@vdex.com> wrote:

> Prem,
>
> Here are some links to get you started:
>
>
> https://blog.apigee.com/detail/nosql_noproblem_mapping_your_sql_thinking_to_nosql
> http://apigee.com/docs/usergrid/content/quick-start  (open an account)
> http://apigee.com/docs/usergrid/content/what-app-services (overview)
> http://apigee.com/docs/usergrid/content/data-model (data model)
> https://blog.apigee.com/taglist/usergrid (videos and articles)
>
> I think the best thing you can do is to create a free Apigee "App
> Services" account and build some small examples:
>
> Here is small example of how I POST an entity inside a collection (MySQL
> speak: record inside a table)
> Note: encode to JSON before sending and decode after receiving
>
> public function mBuildToDoEntity(vType:String, vMessage:String,
> vGroup:String):void {
>         var vToDo:Object = new Object();
>         vToDo.todotype = vType;
>         vToDo.groupname = vGroup;
>         vToDo.message = vMessage;
>         vToDo.status = "false";
>         mPostToDo(vToDo);
> }
>
>
> public function mPostToDo(vObj:Object):void {
>         var vTempJSONString:String =
> com.adobe.serialization.json.JSON.encode(vObj);
>         var ajax:HTTPService = new HTTPService();
>         ajax.addEventListener( ResultEvent.RESULT, mGoodResults );
>         ajax.addEventListener( FaultEvent.FAULT, mFailedResults );
>         ajax.url = ('https://api.usergrid.com/'
>                 + (YOUR ORG NAME GOES HERE) (example:TeamPrem)
>                 +'/'
>                 + (YOUR APP NAME GOES HERE) (example:sandbox)
>                 + '/todos);
>         ajax.method = "POST";
>         ajax.contentType = "application/json";
>         ajax.resultFormat = "text";
>         ajax.useProxy=false;
>         ajax.request = vTempJSONString;
>         ajax.send(vTempJSONString);
>
>
>         //------------------
>         function mGoodResults(vResponse:Object):void{
>              trace("mPostToDo IN RESPONSE mGoodResults vResponse.result =
> "+vResponse.result);
>              var vTempJSON:Object =
>  com.adobe.serialization.json.JSON.decode(vResponse.result as String,
> false);
>         }
>
>         //------------------
>         function mFailedResults(vResponse:Object):void{
>              trace("mPostToDo IN RESPONSE mFailedResults
> vResponse.statusCode = "+vResponse.statusCode);
>         }
> };
>
> Jerry

Re: backends - parse/backendless/roll your own

Posted by Jerry Hamby <je...@vdex.com>.
Prem,

Here are some links to get you started:

https://blog.apigee.com/detail/nosql_noproblem_mapping_your_sql_thinking_to_nosql
http://apigee.com/docs/usergrid/content/quick-start  (open an account)
http://apigee.com/docs/usergrid/content/what-app-services (overview)
http://apigee.com/docs/usergrid/content/data-model (data model)
https://blog.apigee.com/taglist/usergrid (videos and articles)

I think the best thing you can do is to create a free Apigee "App Services" account and build some small examples:

Here is small example of how I POST an entity inside a collection (MySQL speak: record inside a table)
Note: encode to JSON before sending and decode after receiving 

public function mBuildToDoEntity(vType:String, vMessage:String, vGroup:String):void {
	var vToDo:Object = new Object();
	vToDo.todotype = vType;
	vToDo.groupname = vGroup;
	vToDo.message = vMessage;
	vToDo.status = "false";
	mPostToDo(vToDo);
}


public function mPostToDo(vObj:Object):void {
	var vTempJSONString:String = com.adobe.serialization.json.JSON.encode(vObj);
	var ajax:HTTPService = new HTTPService();
	ajax.addEventListener( ResultEvent.RESULT, mGoodResults );
	ajax.addEventListener( FaultEvent.FAULT, mFailedResults );
	ajax.url = ('https://api.usergrid.com/'
		+ (YOUR ORG NAME GOES HERE) (example:TeamPrem)
		+'/'
		+ (YOUR APP NAME GOES HERE) (example:sandbox)
		+ '/todos);
	ajax.method = "POST";
	ajax.contentType = "application/json";
	ajax.resultFormat = "text";
	ajax.useProxy=false;
	ajax.request = vTempJSONString;
	ajax.send(vTempJSONString);
			
			
	//------------------
	function mGoodResults(vResponse:Object):void{
	     trace("mPostToDo IN RESPONSE mGoodResults vResponse.result = "+vResponse.result);
	     var vTempJSON:Object =  com.adobe.serialization.json.JSON.decode(vResponse.result as String, false);
	}
			
	//------------------
	function mFailedResults(vResponse:Object):void{
	     trace("mPostToDo IN RESPONSE mFailedResults vResponse.statusCode = "+vResponse.statusCode);
	}
};

Jerry

Re: backends - parse/backendless/roll your own

Posted by Prem Radhakrishnan <go...@gmail.com>.
Jerry,
Is there anything you can share about your project as a tutorial / guide
for someone starting off with noSQL ? I do a lot of CFC / SQL Server / Flex
development and looking for a good resource to get started on noSQL.
Cheers
Prem

Perfection is achieved, not when there is nothing more to add, but when
there is nothing left to take away.
  - Antoine de Saint-Exupery


On Thu, Aug 8, 2013 at 2:45 PM, Stephen C <st...@stephenjc.com> wrote:

> you set the urlrequest.method to URLRequestMethod.DELETE or
> URLRequestMethod.PUT
>
> Thank You,
> Stephen C
> -All of my email addresses go to the same place
> -Save Paper, think before you print
> -PGP Public Key<
> https://docs.google.com/file/d/0B0JeFeQj5XjkZC0talFuRExyc0E/edit?usp=sharing
> >
>
>
> On Thu, Aug 8, 2013 at 2:17 PM, Jerry Hamby <je...@vdex.com> wrote:
>
> > Thanks for the links, hopefully I can find some time in the next week to
> > do testing on as3httpclient.
> > Sure would solve my problem if it works.
> > Jerry
> >
> > On Aug 8, 2013, at 10:44 AM, OmPrakash Muppirala wrote:
> >
> > > There is also an example dealing specifally with Amazon S3 [2]
> > >
> > > [2]
> > >
> >
> https://github.com/gabriel/as3httpclient/tree/6fa3591aedefbba37590d5a9266014ce96b97723/test/s3
> > >
> > >
> > >
> > >> Have you tried the as3httpclient library?  [1]
> > >>
> > >> Thanks,
> > >> Om
> > >>
> > >> [1] https://github.com/gabriel/as3httpclient/blob/master/EXAMPLES.md
> > >>
> > >
> >
> >
>

Re: backends - parse/backendless/roll your own

Posted by Stephen C <st...@stephenjc.com>.
you set the urlrequest.method to URLRequestMethod.DELETE or
URLRequestMethod.PUT

Thank You,
Stephen C
-All of my email addresses go to the same place
-Save Paper, think before you print
-PGP Public Key<https://docs.google.com/file/d/0B0JeFeQj5XjkZC0talFuRExyc0E/edit?usp=sharing>


On Thu, Aug 8, 2013 at 2:17 PM, Jerry Hamby <je...@vdex.com> wrote:

> Thanks for the links, hopefully I can find some time in the next week to
> do testing on as3httpclient.
> Sure would solve my problem if it works.
> Jerry
>
> On Aug 8, 2013, at 10:44 AM, OmPrakash Muppirala wrote:
>
> > There is also an example dealing specifally with Amazon S3 [2]
> >
> > [2]
> >
> https://github.com/gabriel/as3httpclient/tree/6fa3591aedefbba37590d5a9266014ce96b97723/test/s3
> >
> >
> >
> >> Have you tried the as3httpclient library?  [1]
> >>
> >> Thanks,
> >> Om
> >>
> >> [1] https://github.com/gabriel/as3httpclient/blob/master/EXAMPLES.md
> >>
> >
>
>

Re: backends - parse/backendless/roll your own

Posted by Jerry Hamby <je...@vdex.com>.
Thanks for the links, hopefully I can find some time in the next week to do testing on as3httpclient.
Sure would solve my problem if it works.
Jerry

On Aug 8, 2013, at 10:44 AM, OmPrakash Muppirala wrote:

> There is also an example dealing specifally with Amazon S3 [2]
> 
> [2]
> https://github.com/gabriel/as3httpclient/tree/6fa3591aedefbba37590d5a9266014ce96b97723/test/s3
> 
> 
> 
>> Have you tried the as3httpclient library?  [1]
>> 
>> Thanks,
>> Om
>> 
>> [1] https://github.com/gabriel/as3httpclient/blob/master/EXAMPLES.md
>> 
> 


Re: backends - parse/backendless/roll your own

Posted by OmPrakash Muppirala <bi...@gmail.com>.
On Thu, Aug 8, 2013 at 10:40 AM, OmPrakash Muppirala
<bi...@gmail.com>wrote:

> On Thu, Aug 8, 2013 at 10:35 AM, Jerry Hamby <je...@vdex.com> wrote:
>
>> I use Apigee UserGrid, also known as App Services. I love it and I won't
>> go back.
>> http://apigee.com/docs/app_services
>>
>> I use to do Coldfusion CFCs and MySQL before I discovered the power and
>> flexibility NoSQL type databases and REST statements.
>> All the open APIs use REST, so this works very well except for one
>> factor, I can't find a way to do REST "PUT" and DELETE" statements in
>> Actionscript.
>> My solution was to set up an Amazon EC2 account, run Node.js (Apigee has
>> a Node SDK) and establish a socket. So I couldn't completely get away
>> from a backend server I did force myself into Javascript. At least my
>> costs are very low and I can build apps using web, desktop or mobile
>> constructing all
>> my business logic inside the client.
>>
>> I also setup a Amazon S3 account and found some Actionscript code to
>> upload my images while storing my image database records on Apigee.
>> Apigee also has file storage but they didn't add that feature until after
>> I had got the S3 stuff working.
>>
>> I got a free year from Amazon and Apigee is free up to some ridiculous
>> amount of calls per month, I think 3 million.
>> I haven't tried Parse or backendless yet. Again the downside to any of
>> these services is the same, Flash doesn't have a native way
>> to handle REST "PUT" and DELETE" statements. If anyone can show my how to
>> get around this issue in Actionscript I would appreciate it.
>>
>> Maybe finding a solution for this REST gap in Actionscript would be a
>> great project for the Apache Flex community.
>>
>>
>
There is also an example dealing specifally with Amazon S3 [2]

[2]
https://github.com/gabriel/as3httpclient/tree/6fa3591aedefbba37590d5a9266014ce96b97723/test/s3



> Have you tried the as3httpclient library?  [1]
>
> Thanks,
> Om
>
> [1] https://github.com/gabriel/as3httpclient/blob/master/EXAMPLES.md
>





>
>
>>
>> On Aug 8, 2013, at 5:38 AM, Stephen C wrote:
>>
>> > I am curious to get the groups feelings on these cloud backends with air
>> > projects. Like parse and backendless, i have played with these, and i am
>> > toying with the idea of moving to one so i do not have to maintain my
>> > php/mysql backend and let someone else deal with it.
>> >
>> > I would also be interested in others.
>> >
>> > Thank You,
>> > Stephen C
>>
>>
>>
>

Re: backends - parse/backendless/roll your own

Posted by Harbs <ha...@gmail.com>.
I had used it for a while, but then discovered that it didn't play very well with https. Also, the need for a socket server was a pain…

I ended up just using HTTPService and URLLoader. I built a wrapper to handle binary and xml type data. I cache the response type and forward that in a custom event…

Harbs

On Aug 8, 2013, at 8:40 PM, OmPrakash Muppirala wrote:

> Have you tried the as3httpclient library?  [1]
> 
> Thanks,
> Om
> 
> [1] https://github.com/gabriel/as3httpclient/blob/master/EXAMPLES.md


Re: backends - parse/backendless/roll your own

Posted by OmPrakash Muppirala <bi...@gmail.com>.
On Thu, Aug 8, 2013 at 10:35 AM, Jerry Hamby <je...@vdex.com> wrote:

> I use Apigee UserGrid, also known as App Services. I love it and I won't
> go back.
> http://apigee.com/docs/app_services
>
> I use to do Coldfusion CFCs and MySQL before I discovered the power and
> flexibility NoSQL type databases and REST statements.
> All the open APIs use REST, so this works very well except for one factor,
> I can't find a way to do REST "PUT" and DELETE" statements in Actionscript.
> My solution was to set up an Amazon EC2 account, run Node.js (Apigee has a
> Node SDK) and establish a socket. So I couldn't completely get away
> from a backend server I did force myself into Javascript. At least my
> costs are very low and I can build apps using web, desktop or mobile
> constructing all
> my business logic inside the client.
>
> I also setup a Amazon S3 account and found some Actionscript code to
> upload my images while storing my image database records on Apigee.
> Apigee also has file storage but they didn't add that feature until after
> I had got the S3 stuff working.
>
> I got a free year from Amazon and Apigee is free up to some ridiculous
> amount of calls per month, I think 3 million.
> I haven't tried Parse or backendless yet. Again the downside to any of
> these services is the same, Flash doesn't have a native way
> to handle REST "PUT" and DELETE" statements. If anyone can show my how to
> get around this issue in Actionscript I would appreciate it.
>
> Maybe finding a solution for this REST gap in Actionscript would be a
> great project for the Apache Flex community.
>
>
Have you tried the as3httpclient library?  [1]

Thanks,
Om

[1] https://github.com/gabriel/as3httpclient/blob/master/EXAMPLES.md


>
> On Aug 8, 2013, at 5:38 AM, Stephen C wrote:
>
> > I am curious to get the groups feelings on these cloud backends with air
> > projects. Like parse and backendless, i have played with these, and i am
> > toying with the idea of moving to one so i do not have to maintain my
> > php/mysql backend and let someone else deal with it.
> >
> > I would also be interested in others.
> >
> > Thank You,
> > Stephen C
>
>
>

Re: backends - parse/backendless/roll your own

Posted by Jerry Hamby <je...@vdex.com>.
I use Apigee UserGrid, also known as App Services. I love it and I won't go back. 
http://apigee.com/docs/app_services

I use to do Coldfusion CFCs and MySQL before I discovered the power and flexibility NoSQL type databases and REST statements. 
All the open APIs use REST, so this works very well except for one factor, I can't find a way to do REST "PUT" and DELETE" statements in Actionscript.
My solution was to set up an Amazon EC2 account, run Node.js (Apigee has a Node SDK) and establish a socket. So I couldn't completely get away
from a backend server I did force myself into Javascript. At least my costs are very low and I can build apps using web, desktop or mobile constructing all
my business logic inside the client.

I also setup a Amazon S3 account and found some Actionscript code to upload my images while storing my image database records on Apigee.
Apigee also has file storage but they didn't add that feature until after I had got the S3 stuff working.

I got a free year from Amazon and Apigee is free up to some ridiculous amount of calls per month, I think 3 million.
I haven't tried Parse or backendless yet. Again the downside to any of these services is the same, Flash doesn't have a native way
to handle REST "PUT" and DELETE" statements. If anyone can show my how to get around this issue in Actionscript I would appreciate it.

Maybe finding a solution for this REST gap in Actionscript would be a great project for the Apache Flex community.   

Jerry


On Aug 8, 2013, at 5:38 AM, Stephen C wrote:

> I am curious to get the groups feelings on these cloud backends with air
> projects. Like parse and backendless, i have played with these, and i am
> toying with the idea of moving to one so i do not have to maintain my
> php/mysql backend and let someone else deal with it.
> 
> I would also be interested in others.
> 
> Thank You,
> Stephen C