Package org.sgx.yuigwt.yui.yql

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


    "<table>" +
    "  <tr><td class=\"title\">TableShow Name: </td><td></td></tr>" +
    "</table>";
   
    //yql desc answers.getquestion
    YQL yql1 = Y.newYQL("desc answers.getquestion", new YQLCallback() {     
      @Override
      public void call(YQLResult r) {   
       
        if(r.error()!=null) {
          console.log("YQL ERROR:"+r.error().description());
View Full Code Here


        gallery.render();   
      }
    };
    JsObject yqlParams2 = JsObject.one("env", "http://datatables.org/alltables.env");  
    yqlParams2.objPut("format", "json");
    YQL yql2 = Y.newYQL(query2, yqlCallback2, yqlParams2);
    }
    else {
      //only for devel/testing - load a local copy
      String text = TestResources.instance.data1().getText();
      console.log("data length: "+text.length());
View Full Code Here

  yqlParams = YQLParams.create()
    .env("http://datatables.org/alltables.env")
    .format("json").diagnostics("true");
 
  final String query1 = "select * from yui.gallery.all";
  YQL yql1 = Y.newYQL(query1, new YQLCallback() {     
    @Override
    public void call(YQLResult r) {       
      if(r.error()!=null) {
        console.log("YQL ERROR while requesting show tables"+r.error().description());
        return ;
View Full Code Here


protected void doShowOwnerDescription(String owner) {
  final String query2 = "select * from yui.gallery.user where username='"+owner+"'";
//final String query2 = "select * from yui.gallery.user";// where username='davglass'";
YQL yql2 = Y.newYQL(query2, new YQLCallback() {     
  @Override
  public void call(YQLResult r) {       
    if(r.error()!=null) {
      console.log("YQL ERROR while requesting show tables"+r.error().description());
      return ;
View Full Code Here

        .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() {     
      @Override
      public void call(YQLResult r) {
        if(r.error()!=null)
          console.log("ERROR (it is ok..):"+r.error().description());
      }
View Full Code Here




private void selectRecord1() {
  YQL yql1 = Y.newYQL("select * from yql.storage where name=\""+selectUrl+"\"", new YQLCallback() {     
  @Override
  public void call(YQLResult r) {
    
    StorageAdminResult result = r.query().results().cast();
//    StorageAdminResultInserted inserted = result.inserted();
View Full Code Here

  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) {       
      if(r.error()!=null) {
        console.log("YQL ERROR while requesting show tables"+r.error().description());
        return ;
View Full Code Here

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) {       
      if(r.error()!=null) {
        console.log("YQL ERROR while requesting: "+query+" : "+r.error().description());
        return ;
View Full Code Here

TOP

Related Classes of org.sgx.yuigwt.yui.yql.YQL

Copyright © 2018 www.massapicom. 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.