CR1 JIRAs
by Kris Borchers
Hey all, Thursday is or almost is over for everyone and there are still 22 unassigned JIRAs. These should all at least be assigned since we were all supposed to review JIRAs by end of day today. I guess if everything isn't assigned by the end of my day since I'm the latest timezone, I'll just assign them all to the reporter and then they will be forced to deal with it (fix, reassign, move fix version, etc).
Thoughts?
10 years, 2 months
AGPropertyListStorage implementation
by Christos Vasilakis
Hi team,
fyi,
in order to have some long-term storage of data (for example storing the OTP secret), I am writing a simple PropertyList based implementation of AGStore. It will provide the same interface as the AGStore that is save, read and remove of data and internally will use the Property List mechanism for iOS. As with all other implementations, a configuration object will be used to passed in the parameters (e.g. filename of the archive etc.) . A ticket has been opened to track this [1].
More info as I progress.
Thanks,
Christos
[1] https://issues.jboss.org/browse/AEROGEAR-783
10 years, 2 months
Custom JS Builder
by Lucas Holmquist
from this gist:https://gist.github.com/4485018
Custom Aerogear.js Builder
Prototype here: http://aerogearjsbuilder-lholmqui.rhcloud.com/
myrepo: git@github.com:lholmquist/aerogearjsbuilder.git
There is still a couple of minor tweaks that i need, like better error handling and CORS support possible. although it uses an iframe, so maybe not
This is the way it works.
client side
once you submit, the code builds the query params, then sends it to the server( duh ) using an iframe( atm )
Server side
Server side is a node.js server running on option shift
There is a "base" grunt.js file that has "markers" for the src and destination, This gets read in, replacements are made and then saved( customhash.js ) to a temporary directory( date in millis ). Then a node child proccess, runs grunt using this new custom grunt file, while overiding the "base", where the src files are, and the "config", where the custom grunt file is
once grunt is finished creating the files, the server then zips them up and sends that back to the client.
and then deletes the temporary directory
Src File Storage
The src files are currently stored in the OPENSHIFT_DATA_DIR, this is used for persistent storage and doesn't get recreated after every build.
Currently i need to ssh on to the server and do a git pull to update the repo in this directory.
Not really sure if there is a better way, perhaps a cron, or something.
Originally i had the src files in the project itself, but then moved them out to this persistent directory.
Another idea could when the user does a submit to get the file, it checks to see if the repo is up to date, then if not, updates it. Probably have a time aspect to it, so it only does it everyday for instance
looking for idea's here for the src files
-luke
10 years, 2 months
iOS projects name
by Daniel Passos
Hi Guys
I have a little question about the iOS project. Why are the projects
named aerogear-xxx-ios and not aerogear-ios-xxx. That would make a natural
grouping
Att,
Daniel Passos
10 years, 2 months
Debugging your Aerogear Application remotly with Weinre
by Sebastien Blanc
Hi,
A few weeks ago, on the IRC channel there was a question about Weinre . For
those who don't know what Weinre is (definition from Weinre's homepage) :
weinre is a debugger for web pages, like FireBug (for FireFox) and Web
Inspector (for WebKit-based browsers), except it's designed to work *
remotely*, and in particular, to *allow you debug web pages on a mobile
device such as a phone*.
So it's extremely useful and totally in the scope of Aerogear (Web/Hybrid)
which targets mobile development .
It's easy to setup :
1. Install the Weinre server , if you have npm : sudo npm -g install weinre
2. Start the Weinre server : weinre --httPort 8081
3. Instrument your web page to act as a debug target by adding the
following :
<script src="http://a.b.c:8081/target/target-script-min.js"></script>
To make things even easier, I've created a new branch on the kitchensink
app where step 3 is not needed anymore[1]. Instead of this you can just
activate remote debugging by passing an parameter in the URL :
http://a.b.c:8080/jboss-as-kitchensink-aerogear-js/index.html?debug=d.e.f...
Where d.e.f is the IP of the server where Weinre is running.
Then you can access the debug page : http://localhost:8081/client
The little tweak I made give more flexibility on how you can integrate your
app with Weinre :
- No hardcoding in your script.
- You can easily change the IP of the debug server
- The client makes only make requests to the debug servers (and there are a
lot of requests :) ) if debugging is activated.
If more people find this useful maybe we could merge it for the next
release. comments welcome !
Seb
[1] http://people.apache.org/~pmuellr/weinre/docs/latest/)
[2]
https://github.com/sebastienblanc/as-quickstarts/tree/weinre/kitchensink-...
10 years, 2 months
iOS/CoreData - API proposal - AGEntityMapper
by Matthias Wessendorf
CoreData: API proposal - AGEntityMapperBackground
Mapping JSON representations to a "rich" domain model in ObjC is a bit
cumbersome <http://matthiaswessendorf.wordpress.com/2012/11/19/objc-json/>.
Similar is true when mapping a JSON data/response to a NSMangedObject (and
vise versa). There is a base framework for "remote persistence", via the
CoreData API, by leveraging a custom NSIncrementalStore ->
AFIncrementalStore <https://github.com/AFNetworking/AFIncrementalStore>.
For that,... a similar *two-way-mapping* is required, as described
here<http://matthiaswessendorf.wordpress.com/2013/01/02/coredata-data-mapping-...>
.
AeroGear and CoreData
Our CoreData offerings are leveraging the AFIncrementalStore, therefore (as
with other frameworks/libraries) we need a mapping as well. We need to know
the name of the entity and we need a NSDictionary that covers the actual
JSON/property mapping. It could be done with the vanialla ObjC classes:
// some mappers:NSDictionary *task_mapper =
[NSDictionary
dictionaryWithObjectsAndKeys:@"description",@"desc",@"id",@"myId",
nil];NSDictionary *project_mapper =
[NSDictionary dictionaryWithObjectsAndKeys:@"id",@"myId", nil];
// create a schema out of the mappers:NSDictionary *schema =
[NSDictionary dictionaryWithObjectsAndKeys:task_mapper, @"Task",
project_mapper, @"Project", nil];
// pass the schema to the AGCoreDataHelper class, when doing the init...
Proposal for a custom API
I'd like to introduce a new wrapper type, called AGEntityMapper:
@interface AGEnityMapper : NSObject
@property NSString *name;@property NSDictionary *mapper;
-(id) initWithName:(NSString *) name mapper:(NSDictionary *) mapper;@end
This AGEntityMapper would be applied onto the AGCoreDataConfig:
@protocol AGCoreDataConfig <NSObject>
@property (strong, nonatomic) NSManagedObjectModel
*managedObjectModel;@property (strong, nonatomic) NSURL *baseURL;
-(void)applyEntityMappers:(AGEnityMapper *)firstObject, ...
NS_REQUIRES_NIL_TERMINATION;
@end
The actual code, would look like this:
EnityMapper *taskMapper =
[[EnityMapper alloc] initWithName:@"Task"
// mapping the properties on the "entity" (NSManagedObject)
// to the external representation (e.g. JSON)
mapper:@{ @"desc": @"description",
@"myId": @"id"}];
EnityMapper *projectMapper =
[[EnityMapper alloc] initWithName:@"Project"
// mapping the properties on the "entity" (NSManagedObject)
// to the external representation (e.g. JSON)
mapper:@{ @"myId": @"id"}];
AGCoreDataHelper *helper = [[AGCoreDataHelper alloc]
initWithConfig:^(id<AGCoreDataConfig> config) {
[config setBaseURL:[NSURL URLWithString:@"http://server.com"]];
[config applyEntityMappers:
taskMapper,
projectMapper,
nil // terminate the varargs.
];}];
--
Matthias Wessendorf
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
10 years, 2 months
[aerogear-controller] Request Parameter support
by Daniel Bevenius
We've pushed a version of AeroGear Controller with support for request
parameters (AEROGEAR-671 <https://issues.jboss.org/browse/AEROGEAR-671>) to
openshift<http://controllerdemo-danbev.rhcloud.com/aerogear-controller-demo/>
.
This demo has the following new route added to it:
route()
.from("/cars")
.on(RequestMethod.GET)
.produces(MediaType.JSON.toString(), "application/custom")
.to(Home.class).get(param("color", "pink"), param("brand", "mini"));
The target method for the above route is named get and takes two
parameters, *color*, and *brand*. Both parameters are option and if not
specified the default values will be used (pink is the default value for *
color*, and*mini* is the default value for brand).
Home.class has a new method named get:
public Car get(String color, String brand) {
return new Car(color, brand);}
You can try these out using the examples below:
Example of specifying both query parameters:
curl -i --header "Accept: application/json"
"http://controllerdemo-danbev.rhcloud.com/aerogear-controller-demo/cars?co..."
Example of specifying one query parameter:
curl -i --header "Accept: application/json"
"http://controllerdemo-danbev.rhcloud.com/aerogear-controller-demo/cars?co..."
Example of specifying no query parameters:
curl -i --header "Accept: application/json"
"http://controllerdemo-danbev.rhcloud.com/aerogear-controller-demo/cars"
Example of returning a custom media type:
curl -i --header "Accept: application/custom"
"http://controllerdemo-danbev.rhcloud.com/aerogear-controller-demo/cars?co..."
A custom media type is an example of a custom responder in AeroGear
Controller. In this case it only returns a string but could really do
anything needed with the object returned from the target method.
public class CustomMediaTypeResponder extends AbstractRestResponder {
public static final String MEDIA_TYPE = "application/custom";
public CustomMediaTypeResponder() {
super(MEDIA_TYPE);
}
public void writeResponse(Object entity, RouteContext routeContext)
throws Exception {
routeContext.getResponse().getWriter().write("CustomMediaTypeResponder
returned: " + entity);
}
@Override
public String mediaType() {
return MEDIA_TYPE;
}
}
Please try this out, and if you find any issue let us know, or simply
create jira bug reports.
Thanks,
/Dan
10 years, 3 months