Examples of YQLParams


Examples of org.sgx.yuigwt.yui.yql.YQLParams

    final Console console = Y.newConsole()
//        .collapsed(true)
        .render().cast();       
       
    /* simple YQL query weather.forecast */
    YQLParams params1 = YQLParams.create()
      .format("json").diagnostics("true");
    YQL yql1 = Y.newYQL("select * from weather.forecast where location=90210", new YQLCallback() {     
      @Override
      public void call(YQLResult r) {
//        console.log(Y.JSON().stringify(r));
        WheatherForecastResult fresult = r.query().results().cast();
        Channel channel = fresult.channel();
        parent.append(
          "<a href=\""+channel.link()+"\">"+
            channel.title()+"</a> - Wind speed: "+channel.wind().speed()+" kph. " +
   
          //or not using any Java API at all, just the js object api 
          "Direction: "+r.query().results().objGetObj("channel").
            objGetObj("wind").objGetString("direction")+
           
          //and because we use diagnostics("true"),  we can access diagnostic info
          "<p>Diagnostic - servicetime: "+r.query().diagnostics().serviceTime()+" ms."
        );        
      }
    }, params1);
   
   
    /* an example using datatables.org, this time yui.gallery.all for information
     * about yui gallery modules. We use the parameter "env". */
   
    String query2 = "select * from yui.gallery.all";
    YQLCallback yqlCallback2 = new YQLCallback() {     
      @Override
      public void call(YQLResult r) {
        JsObject o = r.query().results().objGetObj("json"); //type, count, modules, }
        JsArray<JsObject> modules = o.objGetObj("modules").cast();
        JsObject module0 = modules.get(0);
        console.log("first module title is "+module0.objGetString("title"));         
      }
    };
    YQLParams yqlParams2 = YQLParams.create().env("http://datatables.org/alltables.env");
    yqlParams2.format("json")
    YQL yql2 = Y.newYQL(query2, yqlCallback2, yqlParams2);

   
    /* handle an yql request that gives error */   
    YQL yql3 = Y.newYQL("select * from weather.nonexist123 where nonexists=90210", new YQLCallback() {     
View Full Code Here

Examples of org.sgx.yuigwt.yui.yql.YQLParams

}

protected void doShowTablesThenRenderAutocomplete() {
  console.log("doShowTables");
  String query = "show tables";
  YQLParams yqlParams = YQLParams.create()
    .env("http://datatables.org/alltables.env")
    .format("json").diagnostics("true");
  YQL yql1 = Y.newYQL(query, new YQLCallback() {     
    @Override
    public void call(YQLResult r) {       
View Full Code Here

Examples of org.sgx.yuigwt.yui.yql.YQLParams

  }, yqlParams);
}

private void describeDatatable(String datatableName) {
  final String query = "desc "+datatableName;
  YQLParams yqlParams = YQLParams.create()
    .env("http://datatables.org/alltables.env")
    .format("json").diagnostics("true");
  YQL yql1 = Y.newYQL(query, new YQLCallback() {     
    @Override
    public void call(YQLResult r) {       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.