Search in sources :

Example 36 with DumpTable

use of lucee.runtime.dump.DumpTable in project Lucee by lucee.

the class QueryArray method toDumpData.

@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
    DumpTable dt = (DumpTable) super.toDumpData(pageContext, maxlevel, dp);
    StringBuilder comment = new StringBuilder();
    // table.appendRow(1, new SimpleDumpData("SQL"), new SimpleDumpData(sql.toString()));
    String template = getTemplate();
    if (!StringUtil.isEmpty(template))
        comment.append("Template: ").append(template).append("\n");
    int top = dp.getMaxlevel();
    comment.append("Execution Time: ").append(Caster.toString(FormatUtil.formatNSAsMSDouble(getExecutionTime()))).append(" ms \n");
    comment.append("Record Count: ").append(Caster.toString(size()));
    if (size() > top)
        comment.append(" (showing top ").append(Caster.toString(top)).append(")");
    comment.append("\n");
    comment.append("Cached: ").append(isCached() ? "Yes\n" : "No\n");
    if (isCached()) {
        String ct = getCacheType();
        comment.append("Cache Type: ").append(ct).append("\n");
    }
    SQL sql = getSql();
    if (sql != null)
        comment.append("SQL: ").append("\n").append(StringUtil.suppressWhiteSpace(sql.toString().trim())).append("\n");
    dt.setTitle("Array (from Query)");
    if (dp.getMetainfo())
        dt.setComment(comment.toString());
    return dt;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SQL(lucee.runtime.db.SQL)

Example 37 with DumpTable

use of lucee.runtime.dump.DumpTable in project Lucee by lucee.

the class QueryStruct method toDumpData.

@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
    DumpTable dt = (DumpTable) super.toDumpData(pageContext, maxlevel, dp);
    StringBuilder comment = new StringBuilder();
    // table.appendRow(1, new SimpleDumpData("SQL"), new SimpleDumpData(sql.toString()));
    String template = getTemplate();
    if (!StringUtil.isEmpty(template))
        comment.append("Template: ").append(template).append("\n");
    int top = dp.getMaxlevel();
    comment.append("Execution Time: ").append(Caster.toString(FormatUtil.formatNSAsMSDouble(getExecutionTime()))).append(" ms \n");
    comment.append("Record Count: ").append(Caster.toString(size()));
    if (size() > top)
        comment.append(" (showing top ").append(Caster.toString(top)).append(")");
    comment.append("\n");
    comment.append("Cached: ").append(isCached() ? "Yes\n" : "No\n");
    if (isCached()) {
        String ct = getCacheType();
        comment.append("Cache Type: ").append(ct).append("\n");
    }
    SQL sql = getSql();
    if (sql != null)
        comment.append("SQL: ").append("\n").append(StringUtil.suppressWhiteSpace(sql.toString().trim())).append("\n");
    dt.setTitle("Struct (from Query)");
    if (dp.getMetainfo())
        dt.setComment(comment.toString());
    return dt;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SQL(lucee.runtime.db.SQL)

Example 38 with DumpTable

use of lucee.runtime.dump.DumpTable in project Lucee by lucee.

the class ComponentScopeShadow method toDumpData.

@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
    DumpTable cp = StructUtil.toDumpTable(this, "Component Variable Scope", pageContext, maxlevel, dp);
    cp.setComment("Component: " + component.getPageSource().getComponentName());
    return cp;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable)

Example 39 with DumpTable

use of lucee.runtime.dump.DumpTable in project Lucee by lucee.

the class ComponentScopeThis method toDumpData.

@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
    DumpTable cp = StructUtil.toDumpTable(this, "This Scope", pageContext, maxlevel, dp);
    cp.setComment("Component: " + component.getPageSource().getComponentName());
    return cp;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable)

Example 40 with DumpTable

use of lucee.runtime.dump.DumpTable in project Lucee by lucee.

the class PageExceptionImpl method toDumpData.

@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
    // FFFFCF
    DumpTable htmlBox = new DumpTable("exception", "#ff9900", "#FFCC00", "#000000");
    htmlBox.setTitle(Constants.NAME + " [" + pageContext.getConfig().getFactory().getEngine().getInfo().getVersion() + "] - Error (" + StringUtil.ucFirst(getTypeAsString()) + ")");
    // Message
    htmlBox.appendRow(1, new SimpleDumpData("Message"), new SimpleDumpData(getMessage()));
    // Detail
    String detail = getDetail();
    if (!StringUtil.isEmpty(detail, true))
        htmlBox.appendRow(1, new SimpleDumpData("Detail"), new SimpleDumpData(detail));
    // additional
    Iterator<Key> it = additional.keyIterator();
    Collection.Key k;
    while (it.hasNext()) {
        k = it.next();
        htmlBox.appendRow(1, new SimpleDumpData(k.getString()), new SimpleDumpData(additional.get(k, "").toString()));
    }
    Array tagContext = getTagContext(pageContext.getConfig());
    // Context MUSTMUST
    if (tagContext.size() > 0) {
        // Collection.Key[] keys=tagContext.keys();
        Iterator<Object> vit = tagContext.valueIterator();
        // Entry<Key, Object> te;
        DumpTable context = new DumpTable("#ff9900", "#FFCC00", "#000000");
        // context.setTitle("The Error Occurred in");
        // context.appendRow(0,new SimpleDumpData("The Error Occurred in"));
        context.appendRow(7, new SimpleDumpData(""), new SimpleDumpData("template"), new SimpleDumpData("line"));
        try {
            boolean first = true;
            while (vit.hasNext()) {
                Struct struct = (Struct) vit.next();
                context.appendRow(1, new SimpleDumpData(first ? "called from " : "occurred in"), new SimpleDumpData(struct.get(KeyConstants._template, "") + ""), new SimpleDumpData(Caster.toString(struct.get(KeyConstants._line, null))));
                first = false;
            }
            htmlBox.appendRow(1, new SimpleDumpData("Context"), context);
            // Code
            String strCode = ((Struct) tagContext.get(1, null)).get(KeyConstants._codePrintPlain, "").toString();
            String[] arrCode = ListUtil.listToStringArray(strCode, '\n');
            arrCode = ListUtil.trim(arrCode);
            DumpTable code = new DumpTable("#ff9900", "#FFCC00", "#000000");
            for (int i = 0; i < arrCode.length; i++) {
                code.appendRow(i == 2 ? 1 : 0, new SimpleDumpData(arrCode[i]));
            }
            htmlBox.appendRow(1, new SimpleDumpData("Code"), code);
        } catch (PageException e) {
        }
    }
    // Java Stacktrace
    String strST = getStackTraceAsString();
    String[] arrST = ListUtil.listToStringArray(strST, '\n');
    arrST = ListUtil.trim(arrST);
    DumpTable st = new DumpTable("#ff9900", "#FFCC00", "#000000");
    for (int i = 0; i < arrST.length; i++) {
        st.appendRow(i == 0 ? 1 : 0, new SimpleDumpData(arrST[i]));
    }
    htmlBox.appendRow(1, new SimpleDumpData("Java Stacktrace"), st);
    return htmlBox;
}
Also used : Struct(lucee.runtime.type.Struct) DumpTable(lucee.runtime.dump.DumpTable) Array(lucee.runtime.type.Array) Key(lucee.runtime.type.Collection.Key) SimpleDumpData(lucee.runtime.dump.SimpleDumpData) Collection(lucee.runtime.type.Collection) Key(lucee.runtime.type.Collection.Key)

Aggregations

DumpTable (lucee.runtime.dump.DumpTable)48 SimpleDumpData (lucee.runtime.dump.SimpleDumpData)39 DumpData (lucee.runtime.dump.DumpData)6 PageException (lucee.runtime.exp.PageException)5 Collection (lucee.runtime.type.Collection)4 Key (lucee.runtime.type.Collection.Key)4 SQL (lucee.runtime.db.SQL)3 DumpRow (lucee.runtime.dump.DumpRow)3 PageRuntimeException (lucee.runtime.exp.PageRuntimeException)3 Struct (lucee.runtime.type.Struct)3 IOException (java.io.IOException)2 Iterator (java.util.Iterator)2 Binding (javax.wsdl.Binding)2 BindingOperation (javax.wsdl.BindingOperation)2 Operation (javax.wsdl.Operation)2 Port (javax.wsdl.Port)2 QName (javax.xml.namespace.QName)2 DumpProperties (lucee.runtime.dump.DumpProperties)2 DumpWriter (lucee.runtime.dump.DumpWriter)2 ExpressionException (lucee.runtime.exp.ExpressionException)2