-
1. Re: HELP : Errai CDI Decoupled for Mobile Clients
edewit Aug 21, 2013 9:07 AM (in response to chaluwa)Hi Charles,
So why is your app decouled from the "CDI-powered chat relay server" are you not planning on using Touch4j together with Errai for the client? Because if you would use Errai on the client and the server it would be a lot easier to develop a chat client. You can use a broadcast event so that all connected clients are informed who is there. I also don't see why the "same origin policy" would be a problem in this case as the clients will only talk to the server and the server will relay the message. Hope that helps.
Cheers,
Erik Jan
-
2. Re: HELP : Errai CDI Decoupled for Mobile Clients
chaluwa Aug 21, 2013 3:43 PM (in response to edewit)Thanks for this prompt response. I am grateful.
Maybe am confused over nothing, but my point is simple. An Errai app (like every other GWT app) has a server-side (chat-relay in my case) and a client-side (Touch4j UI). When his app (a singlle war file) gets deployed to the server (opnenshift in our case), we'll have he relay-service ready for use, but how can the mobile app (Touch4j client part of the same single app that got deployed) be dowloaded and insalled on mobile devices.
My thinking is to have them as separate GWT / Errai projects. Maybe a core (defines jax-rs interfaces in shared package), a server-side that will be deployed to OpenShift (recieves CDI messages from clients and broadcastst to oher clients via REST URLs if possible), and then the mobile client (uses classes from shared package of core to post messages via REST too) which can then be packaged and deployed to App stores (Google Play e.t.c)
If this is correct, the question posed now is if CDI can enable this sort of cross-app messaging via RESTful endpoints, and how it can be done. I am looking at the Errai sample here : https://github.com/errai/errai-tutorial/archive/master.zip it appears its possible. Please advice.
Thanks again.
-
3. Re: HELP : Errai CDI Decoupled for Mobile Clients
edewit Aug 21, 2013 4:09 PM (in response to chaluwa)Hi Charles,
Right, so you don't need 2 seperate projects per se. GWT projects on the client are just javascript and html, when you want them as an downloadable / installable application you can use cordova this is a native application that wraps a brower window. To be able to use that with Errai we have a maven plugin that you can install and then maven will create an installable app of your war project. You will have to supply it with an url of the server so that the client can connect. But then you can use events, jpa sync and the bus like any other Errai project.
Hope this answers your question,
Erik Jan
-
4. Re: HELP : Errai CDI Decoupled for Mobile Clients
chaluwa Aug 21, 2013 8:08 PM (in response to edewit)Yes, that's right. I just created a project with the Errai-Cordova archetype from http://goo.gl/xZrfB6, but importing it into eclipse has not been successfull. I am getting error markers on the first two lines of the pom.xm file.
-
5. Re: HELP : Errai CDI Decoupled for Mobile Clients
edewit Aug 22, 2013 1:53 AM (in response to chaluwa)Hi Charles,
The errai-tutorial that you had before is also already setup for mobile. I think that that is a much nicer starting point.
Cheers,
Erik Jan
-
6. Re: HELP : Errai CDI Decoupled for Mobile Clients
chaluwa Aug 22, 2013 6:33 AM (in response to edewit)Thanks, that was very helpful. But I am having trouble with it already. The error paste is here : http://ur1.ca/f5wmx
-
7. Re: HELP : Errai CDI Decoupled for Mobile Clients
edewit Aug 22, 2013 7:29 AM (in response to chaluwa)Hi Charles,
If you add the jsr305 to your pom?
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>1.3.9</version>
</dependency>