Skip to content

Instantly share code, notes, and snippets.

View lholmquist's full-sized avatar

Lucas Holmquist lholmquist

View GitHub Profile
@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) {
@lholmquist
lholmquist / todoerrors
Created October 11, 2012 16:26
TODO errors
This is based off the most recent branch of the TODO app( my fork ) located here: https://github.com/lholmquist/TODO
start jboss server
run: mvn clean install on TODO app
access TODO app at http://localhost:8080/todo
log in with john/123
@lholmquist
lholmquist / piplinejsonp
Created October 10, 2012 17:01
Pipeline jsonp
//https://github.com/lholmquist/WoWAerogear if you have yeoman installed, you should be able to do yeoman server, might have to do yeoman build first though
//excerpt from app.js
pipeline.add( {
name: "wowPipe",
settings: {
baseURL: "http://us.battle.net/api/wow/",
endpoint: "achievement/2144", //this should be in the read method, need datamanager for that?
jsonp: true,
//was - worked
securePipe.read({
error: function( data, message ) {
equal( message, "Error: Authentication Required", "Initial Page load Auth Failure" );
start();
}
});