Skip to content

Instantly share code, notes, and snippets.

View lholmquist's full-sized avatar

Lucas Holmquist lholmquist

View GitHub Profile

I wonder if we could put the AeroGear.isArray function in the aerogear.core.js file. for some reason i feel like it used to be there

currently it is in the aerogear.utilities.js file which also has the aerogear.ajax function. if some one makes a custom build of just datamanager, which needs the isArray function but not the ajax stuff, they are getting a little bit of extra code that they don't need.

Actually the core file needs the isArray function, and since everything depends on the core, there will be situations where custom builds will get more than they need.

The size difference is proabably trivial, but smaller is better in mobile

I know we really haven't talked about cordova plugins to much, but i want to just get this thought down so i didn't forget about it.

would it make sense to have a cordova plugin for accessing the core data stuff from our iOS libs, that is once it's ready.

I know cordova has a storage api, but it looks like it is just based on the W3C web storage/web sql specs

i guess i was thinking this is how it would work:

Possibley have an aerogear.js datamanager plugin for the front end that then calls the aerogear ios libs coredata plugin

@lholmquist
lholmquist / gist:4328582
Created December 18, 2012 14:43
aerogear.js to controller POST, with CORS

I'm not sure if this is possible yet, but i'm trying to do a POST to the aerogear-controller-demo from our js libs

$( function() {
var pipeline = AeroGear.Pipeline(
    {
        name: "controllerPipe",
        settings: {
            baseURL: "http://localhost:8080/aerogear-controller-demo",

endpoint: "/cars"

@lholmquist
lholmquist / gist:4287964
Created December 14, 2012 19:32
DevNexus Abstract
Title: Open Source Libraries for Mobile Connectivity
Persistence, Security, Connectivity. All 3 are an important part of an enterprise application.
But how does this translate to the mobile environment. With a range a technologies to support
and develop with, things can get messy quickly. In this session you will see how
AeroGear solves these concerns and how it allows developers
to access server side components using a common API across multiple platforms

Modified this route, and was successful

route()
    .from("/delorean")
    .on(RequestMethod.GET).produces(MediaType.JSON.toString())
    .to(Home.class).anotherPage();

Kept getting the same error with this one though

@lholmquist
lholmquist / gist:4268092
Created December 12, 2012 14:23
Aerogear.js and Controller CORS

CORS with Aerogear.js and AG-Controller

2 things.

So when using aerogear.js to make a cross domain call,

var pipeline = AeroGear.Pipeline();
        cors = pipeline.add( {
            name: "cors",

settings: {

CORS with Aerogear.js and AG-Controller

2 things.

So when using aerogear.js to make a cross domain call,

var pipeline = AeroGear.Pipeline();
        cors = pipeline.add( {
            name: "cors",

settings: {

@lholmquist
lholmquist / ag-crossdomain.md
Created December 6, 2012 19:17
Aerogear.js Crossdomain

This gist relates to AEROGEAR-534, https://issues.jboss.org/browse/AEROGEAR-534

I created a node.js server that handles CORS and jsonp for my testing

###Cross Domain Support

To do cross domain request, i've modified aerogear.js a bit.

I've added a new settings variable, settings.crossdomain, that can be mixed. If set to true, it will default to CORS, to override to jsonp set settings.crossdomain.type = "jsonp"

//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@lholmquist
lholmquist / gist:4072589
Created November 14, 2012 14:59
Trailing slash
//Taken from the AeroGearExample
tasksPipe = [todo pipe:^(id<AGPipeConfig> config) {
[config name:@"status"];
[config endpoint: @"realm/status"]; //endpoint with no trailing slash
[config type:@"REST"];
}];
//when i do the read, i get a 404, since the URL has a trailing slash on it
[tasksPipe read:^(id responseObject) {