Package railo.runtime.dump

Examples of railo.runtime.dump.SimpleDumpData


    if(variable!=null) {
        pageContext.setVariable(variable,new Double(exe));
    }
    else {
      DumpTable table = new DumpTable("#ff9900","#ffcc00","#000000");
      table.appendRow(1,new SimpleDumpData(label==null?"Stopwatch":label),new SimpleDumpData(exe));
      DumpWriter writer=pageContext.getConfig().getDefaultDumpWriter(DumpWriter.DEFAULT_RICH);
      try {
       
        pageContext.forceWrite(writer.toString(pageContext,table,true));
      }
View Full Code Here


  public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
    if(value==null) return super.toDumpData(pageContext, maxlevel,dp);
    DumpTable table = new DumpTable("struct","#9999ff","#ccccff","#000000");
    table.setTitle("Value Struct");
    maxlevel--;
    table.appendRow(1,new SimpleDumpData("value"),DumpUtil.toDumpData(value, pageContext,maxlevel,dp));
    table.appendRow(1,new SimpleDumpData("struct"),super.toDumpData(pageContext, maxlevel,dp));
   
    return table;
  }
View Full Code Here

    int index=0;
    for(int i=0;i<keys.length;i++) {
      if(DumpUtil.keyValid(dp,maxlevel,keys[i])){
        if(maxkeys<=index++)break;
        table.appendRow(1,
            new SimpleDumpData(keys[i].toString()),
            DumpUtil.toDumpData(sct.get(keys[i],null),
            pageContext,maxlevel,dp));
      }
    }
    return table;
View Full Code Here

  public static DumpData toDumpData(Query query,PageContext pageContext, int maxlevel, DumpProperties dp) {
    maxlevel--;
    Collection.Key[] keys=CollectionUtil.keys(query);
    DumpData[] heads=new DumpData[keys.length+1];
    //int tmp=1;
    heads[0]=new SimpleDumpData("");
    for(int i=0;i<keys.length;i++) {
      heads[i+1]=new SimpleDumpData(keys[i].getString());
    }
   
    StringBuilder comment=new StringBuilder();
   
    //table.appendRow(1, new SimpleDumpData("SQL"), new SimpleDumpData(sql.toString()));
    String template=query.getTemplate();
    if(!StringUtil.isEmpty(template))
      comment.append("Template: ").append(template).append("\n");
    //table.appendRow(1, new SimpleDumpData("Template"), new SimpleDumpData(template));

    int top = dp.getMaxlevel();        // in Query dump maxlevel is used as Top

    comment.append("Execution Time: ").append(Caster.toString(FormatUtil.formatNSAsMSDouble(query.getExecutionTime()))).append(" ms \n");
    comment.append("Record Count: ").append(Caster.toString(query.getRecordcount()));
    if ( query.getRecordcount() > top )
      comment.append( " (showing top " ).append( Caster.toString( top ) ).append( ")" );
    comment.append("\n");
    comment.append("Cached: ").append(query.isCached()?"Yes\n":"No\n");
    comment.append("Lazy: ").append(query instanceof SimpleQuery?"Yes\n":"No\n");
   
    SQL sql=query.getSql();
    if(sql!=null)
      comment.append("SQL: ").append("\n").append(StringUtil.suppressWhiteSpace(sql.toString().trim())).append("\n");
   
    //table.appendRow(1, new SimpleDumpData("Execution Time (ms)"), new SimpleDumpData(exeTime));
    //table.appendRow(1, new SimpleDumpData("recordcount"), new SimpleDumpData(getRecordcount()));
    //table.appendRow(1, new SimpleDumpData("cached"), new SimpleDumpData(isCached()?"Yes":"No"));

    DumpTable recs=new DumpTable("query","#cc99cc","#ffccff","#000000");
    recs.setTitle("Query");
    if(dp.getMetainfo())recs.setComment(comment.toString());
    recs.appendRow(new DumpRow(-1,heads));
   
    // body
    DumpData[] items;
    int recordcount=query.getRecordcount();
    int columncount=query.getColumnNames().length;
    for(int i=0;i<recordcount;i++) {
      items=new DumpData[columncount+1];
      items[0]=new SimpleDumpData(i+1);
      for(int y=0;y<keys.length;y++) {
        try {
          Object o=query.getAt(keys[y],i+1);
          if(o instanceof String)items[y+1]=new SimpleDumpData(o.toString());
                    else if(o instanceof Number) items[y+1]=new SimpleDumpData(Caster.toString(((Number)o)));
                    else if(o instanceof Boolean) items[y+1]=new SimpleDumpData(((Boolean)o).booleanValue());
                    else if(o instanceof Date) items[y+1]=new SimpleDumpData(Caster.toString(o));
                    else if(o instanceof Clob) items[y+1]=new SimpleDumpData(Caster.toString(o));               
          else items[y+1]=DumpUtil.toDumpData(o, pageContext,maxlevel,dp);
        } catch (PageException e) {
          items[y+1]=new SimpleDumpData("[empty]");
        }
      }
      recs.appendRow(new DumpRow(1,items));

      if ( i == top - 1 )
View Full Code Here

        }

    public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties properties) {
      DumpTable table = new DumpTable("#669999","#ccffff","#000000");
      table.setTitle("QueryCacheEntry");
      table.appendRow(1,new SimpleDumpData("Value"),DumpUtil.toDumpData(value, pageContext, maxlevel, properties));
      table.appendRow(1,new SimpleDumpData("Creation Date"),DumpUtil.toDumpData(new DateTimeImpl(creationDate,false), pageContext, maxlevel, properties));
      return table;
    }
View Full Code Here

    public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
      try {
            return _toDumpData(pageContext,maxlevel,dp);
        } catch (Exception e) {
            DumpTable table = new DumpTable("webservice","#ccccff","#cccc00","#000000");
            table.appendRow(1,new SimpleDumpData("webservice"),new SimpleDumpData(wsdlUrl));
            return table;
        }
    }
View Full Code Here

                doc.append(text.getData());
              }
            }
            //parameters = (Parameters)bEntry.getParameters().get(tmpOp);
            functions.appendRow(1,
                new SimpleDumpData(tmpOp.getName()),
                _toHTMLOperation(doc.toString(),(Parameters)bEntry.getParameters().get(tmpOp)));
        }
       
        //box.appendRow(1,new SimpleDumpData(""),functions);
        return functions;
View Full Code Here

    private DumpData _toHTMLOperation(String doc, Parameters parameters) {
      DumpTable table = new DumpTable("#ccccff","#ccff66","#000000");
      DumpTable attributes = new DumpTable("#ccccff","#ccff66","#000000");
        String returns = "void";
        attributes.appendRow(3,new SimpleDumpData("name"),new SimpleDumpData("type"));
       
        for(int j = 0; j < parameters.list.size(); j++) {
            Parameter p = (Parameter)parameters.list.get(j);
           
            QName paramType = org.apache.axis.wsdl.toJava.Utils.getXSIType(p);
            String strType=paramType.getLocalPart();
                       
            switch(p.getMode()) {
            case Parameter.IN:
                attributes.appendRow(0,new SimpleDumpData(p.getName()),new SimpleDumpData(toRailoType(strType)));
            break;
            case Parameter.OUT:
                returns=toRailoType(strType);
            break;
            case Parameter.INOUT:
                attributes.appendRow(0,new SimpleDumpData(p.getName()),new SimpleDumpData(toRailoType(strType)));
                returns=toRailoType(strType);
               
            break;
            }
        }
        Parameter rtn = parameters.returnParam;
        if(rtn!=null) {
            QName paramType = org.apache.axis.wsdl.toJava.Utils.getXSIType(rtn);
            String strType=paramType.getLocalPart();
            returns=toRailoType(strType);
        }
        table.appendRow(1,new SimpleDumpData("arguments"),attributes);
        table.appendRow(1,new SimpleDumpData("return type"),new SimpleDumpData(returns));
        if(doc.length()>0)table.appendRow(1,new SimpleDumpData("hint"),new SimpleDumpData(doc));
       
       
        return table;
       
    }
View Full Code Here

     */
    public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp, int access) {
      DumpTable table = new DumpTable("component","#99cc99","#ccffcc","#000000");
        table.setTitle("Component "+getCallPath()+""+(" "+StringUtil.escapeHTML(top.properties.dspName)));
        table.setComment("Only the functions and data members that are accessible from your location are displayed");
        if(top.properties.extend.length()>0)table.appendRow(1,new SimpleDumpData("Extends"),new SimpleDumpData(top.properties.extend));
        if(top.properties.hint.trim().length()>0)table.appendRow(1,new SimpleDumpData("Hint"),new SimpleDumpData(top.properties.hint));
       
        DumpTable content = _toDumpData(top,pageContext,maxlevel,dp,access);
        if(!content.isEmpty())table.appendRow(1,new SimpleDumpData(""),content);
        return table;
    }
View Full Code Here

      int a=ci.getAccess(key);
      DumpTable box=accesses[a];
      Object o=cw.get(key,null);
      if(o==ci)o="[this]";
      if(DumpUtil.keyValid(dp,maxlevel, key))
        box.appendRow(1,new SimpleDumpData(key.getString()),DumpUtil.toDumpData(o,pc,maxlevel,dp));
    }
   
   
    DumpTable table=new DumpTable("#ffffff","#cccccc","#000000");
   
    // properties
    if(ci.top.properties.persistent || ci.top.properties.accessors){
      Property[] properties=ci.getProperties(false);
      DumpTable prop = new DumpTable("#99cc99","#ccffcc","#000000");

      prop.setTitle("Properties");
      prop.setWidth("100%");
      Property p;
      Object child;
      for(int i=0;i<properties.length;i++) {
        p=properties[i];
        child = ci.scope.get(KeyImpl.init(p.getName()),null);
        DumpData dd;
        if(child instanceof Component) {
          DumpTable t = new DumpTable("component","#99cc99","#ffffff","#000000");
          t.appendRow(1,new SimpleDumpData("Component"),new SimpleDumpData(((Component)child).getCallName()));
          dd=t;
         
        }
        else
          dd=DumpUtil.toDumpData(child, pc, maxlevel-1, dp);
       
       
       
        prop.appendRow(1, new SimpleDumpData(p.getName()),dd);
      }
     
      if(access>=ACCESS_PUBLIC && !prop.isEmpty()) {
        table.appendRow(0,prop);
      }
View Full Code Here

TOP

Related Classes of railo.runtime.dump.SimpleDumpData

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.