What is the GwtDocumentBridge mentioned in the realtime drive docs? - gwt

The API docs give a tantalizing hint of GWT bindings for the realtime service, but I can't find other mention of them.
Parameters:
gapi.drive.realtime.GwtDocumentBridge bridge — The driver for the GWT collaborative libraries.
I'm in the process of writing a GWT app with the realtime API and there's a bunch of complex plumbing that would be great to avoid! Is this GWT collaborative libraries reference to something that is already out there?

Sorry, but that is just an implementation detail. There is not a GWT API available at this time, just the javascript one.

Related

Where is the documentation for the Google Analytics API JavaScript client library?

I have spent days looking for proper comprehensive documentation for the JavaScript client library for the Google Analytics API. The only bits I could find was this page: https://developers.google.com/analytics/devguides/reporting/core/v4/rest/ which has all of ~20 completely uninformative words on the page, and https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/web-js, which does have some actual JavaScript, but nothing like documentation. It just illustrates two or three functions using the client API.
Is there nowhere that they actually list the full API? How are we supposed to know what functionality is available?!
Then there are the pages in this section: https://developers.google.com/analytics/devguides/reporting/core/v4/basics#request_body which list a lot of query samples, but don't explain how to use any of this in a client library. Is there any practical information on how to get started with accessing the Analytics API anywhere?
Thanks
The Analytics API is language agnostic, the google js client library docs apply to all of Google's APIs. Every client libarary is built around the discovery service API which describes the entirety of whats is available.
V3 API discovery call
Analytics Reporting Discovery call
How to use a client library is centrally documented and applies to every Google API.
Analytics Specific
There are lots of languages and client libraries and the Analytics API team cannot support every language. Instead they make available comprehensive reference docs which describe what endpoints are available. Once you learn how to use a particular client library calling the individual API endpoints happen in the same why.
That being said every endpoint they have is documented in JS.
The Analytics Mangement API is well documented in JavaScript. the Open source Google deomos and tools is built with it.
The Analytics Reporting API Samples page has documentated examples in JavaScript. You even linked to a Quickstart guide which should help you understand how to use the client library.
Can you expound more on what you'd expect in terms of documentation?
Final tip
If you load the analytics client library
gapi.client.load('analytics', 'v3').then(...)
In the chrome console you can then just start playing with it dynamically:
gapi.client.analytics.managment.[hit tab]
will list all the management API methods available.

How to create an API REST?

I want to reach the data saved in a mysql server for an Android phone. I thought about to connect directly the phone to the mysql but it is a bad practice because someone can get the user/pass of the DB.
However the REST architecture maybe it's a solution for my problem. I found the toolkit GWT but I don't know if it's the best way to solve my problem and what I need to use the GWT.
And I got 2 questions basically:
The GWT is good for my purpose?
Need a Tomcat server for example to set the GWT code?
One annotation, the data is for an app Android, there is no HTML interface .
Nowadays I'm working at localhost. Thanks for the answers.
As far as I understand, you want to implement a RESTful service (Web API). GWT targets the Web UI to be able to build it using Java and compile it into JavaScript. I think that it's not what you expect.
Here is a link that provides you hints about concepts of REST: https://templth.wordpress.com/2014/12/15/designing-a-web-api/. It will describe you what is a RESTful service and how to design it.
There are several technologies to build RESTful services (server-side frameworks). I can list two of them:
Restlet (see this link http://restlet.com/technical-resources/restlet-framework/tutorials/2.3 and http://restlet.com/products/restlet-framework/)
JAX-RS and its implementations (Restlet, Jersey, EasyRest). See this link for example: https://templth.wordpress.com/2015/03/06/getting-started-with-resteasy/.
Hope it helps you,
Thierry

Writing an api-doc for Swagger

I'm trying to use the Swagger UI, and it says that I should begin by writing an api-doc that describes the exact api for a REST api. The problem is that I have no idea what this means. Is this document written in plain English? Or is there a certain format that will be able to generate the UI?
Thank you!
Swagger is a specification for describing REST APIs. Documentation of the specification can be found here - https://github.com/swagger-api/swagger-spec.
Generally, there are two ways to document your API. If you already have an existing API with code, you can use any of the existing libraries (https://github.com/swagger-api/swagger-spec#additional-libraries) to integrate into your code and generate documentation at run time. Some of those libraries also offer offline generation of such docs.
If you're looking to design an API, or would rather not integrate another library into your application, you can use https://github.com/swagger-api/swagger-editor either locally or with the online version - http://editor.swagger.io.
Once you have the documentation, you can use Swagger UI to visualize and test it.

Firebase and Play Framework (Scala) is it possible?

Hey I love Play Framework Scala and I also am falling in love with Firebase. I was wondering though, I'm planning on building an app using AngularFire and I'm going to need to do some server-side logic/computation and make some server-side queries to Firebase. Is this possible to do with a Play Framework Scala setup? If so what is the recommended approach? If not, is it coming? If so when? I think it's so cool that the Firebase guys used Scala to build Firebase, but I'm bummed there is no Scala API to work with (that I can see). Maybe I could use the Java API somehow, but write still write the app in Scala? Any help would be great. Thanks!
Scala is highly interoperable with Java (compiles to the same bytecode) so you should be able to use the Java API straight-up without any issues.
While some libraries add Scala-specific wrappers to make an API more idiomatic and pleasant for a functional programming style and to smooth some rough edges, it's often not strictly necessary.
If for some reason you didn't want to use the Java client libs, you could also interface with the Firebase REST API via Play 2's very convenience and succinct web services library.
Should be no problem with either their Java SDK (when using Firebase on the backend) or the JavaScript SDK (when using it on the client). But you won't have native support for Scala or Play, especially no support for Iteratee/Enumeratee in Play.
The Java API looks quite good and seems to be event driven. So it should be no problem to integrate it in Play in a scalable way.

GWT or Other Presentation Layer Technologies with Spring WebFlow/MVC Framework

First off, I've never used GWT before. I have good experience in HTML/CSS/JS/JSP.
I'm looking for people's opinions on the suitability of Google Web Toolkit for a brand new web app I'm developing.
A big requirement is that the UI is attractive and well designed (Does not look like a clunky Java/Swing App).
It should look like any typical HTML/CSS/JS based modern website.
It is an internal company application so no SEO is required.
JSF is not an option.
The web app frameworks used will be Spring Webflow and Spring MVC. It will use lightweight controllers to communicate with a service layer.
Would Spring Tiles combined with JSP be an easier or more flexible option than GWT for what I am trying to achieve?
Advantages/Disadvantages of GWT and other options welcome.
Thanks
Advantages of GWT
You don't really need to know any JavaScript, since all your client side code will be in Java
This is usually the main reason people go for GWT. They're backend developers who know Java but don't know Javascript, and they don't really want to learn it. Still, you should be careful about this. GWT is a very complete and complex framework with many concepts that are specific to GWT. Even though you'll be coding in Java you will still have to go through many tutorials and documentation before you can build a clean GWT app
Ready to use widgets, like date pickers, dynamic tables, layout panels, popups
It's not really specific to GWT. Other front end framework, like jQuery or Dojo or whatever also give you these. You can have a look at the GWT Showcase to see what GWT has to offer.
GWT takes care of a lot of complex and potentially dangerous stuff for you.
Stuff like Cross-Browser Support, Internationalization, Image and static resources bundling, Front end security, Ajax communication with a server, Events and MVP (just like MVC) framework support. Have a look at the documentation, it is very well done and very thorough.
Debugging is easy
GWT has two different 'modes'. When you're building your app for production, gwt will compile all the java code for the front-end that you wrote into javascript. This javascript will be executed in your clients' browsers. But when you're developping, you can run your app without compiling your java code to javascript. This lets you use a debugger to debug your interface. It's a very good tool.
Disadvantages of GWT
As I said before, GWT is a full framework, with concepts specific to it. Don't think that just because it's in java and you know java that you won't have to learn new stuff.
Interfacing GWT with back end frameworks is not easy
The most common way for your GWT client code to communicate with a server is by using GWT RPC mechanism. It means that you will need to have servlets that implement specific interfaces. You should definetly read the docs on client-server communication to see if that fits well with Spring. A search on SO or Google should give you pointers to setup your application.