Search in sources :

Example 41 with DumpTable

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

the class DebugPageImpl method toDumpData.

@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
    DumpTable table = new DumpTable("#cccc66", "#cccc99", "#000000");
    table.setTitle(file.getAbsolutePath());
    table.appendRow(1, new SimpleDumpData("min (ms)"), new SimpleDumpData(min));
    table.appendRow(1, new SimpleDumpData("avg (ms)"), new SimpleDumpData(getAverageExecutionTime()));
    table.appendRow(1, new SimpleDumpData("max (ms)"), new SimpleDumpData(max));
    table.appendRow(1, new SimpleDumpData("total (ms)"), new SimpleDumpData(all));
    return table;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SimpleDumpData(lucee.runtime.dump.SimpleDumpData)

Example 42 with DumpTable

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

the class PageSourcePool method toDumpData.

@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
    maxlevel--;
    Iterator<PageSource> it = pageSources.values().iterator();
    DumpTable table = new DumpTable("#FFCC00", "#FFFF00", "#000000");
    table.setTitle("Page Source Pool");
    table.appendRow(1, new SimpleDumpData("Count"), new SimpleDumpData(pageSources.size()));
    while (it.hasNext()) {
        PageSource ps = it.next();
        DumpTable inner = new DumpTable("#FFCC00", "#FFFF00", "#000000");
        inner.setWidth("100%");
        inner.appendRow(1, new SimpleDumpData("source"), new SimpleDumpData(ps.getDisplayPath()));
        inner.appendRow(1, new SimpleDumpData("last access"), DumpUtil.toDumpData(new DateTimeImpl(pageContext, ps.getLastAccessTime(), false), pageContext, maxlevel, dp));
        inner.appendRow(1, new SimpleDumpData("access count"), new SimpleDumpData(ps.getAccessCount()));
        table.appendRow(1, new SimpleDumpData("Sources"), inner);
    }
    return table;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SimpleDumpData(lucee.runtime.dump.SimpleDumpData) DateTimeImpl(lucee.runtime.type.dt.DateTimeImpl)

Example 43 with DumpTable

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

the class StaticScope method toDumpData.

@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
    int access = c.getAccess(pageContext);
    DumpTable table = new DumpTable("component", "#99cc99", "#ccffcc", "#000000");
    table.setTitle("Static Scope from Component " + cp.getComponentName());
    table.setComment("Only the functions and data members that are accessible from your location are displayed");
    DumpTable content = _toDumpData(c.top, pageContext, maxlevel, dp, access);
    if (!content.isEmpty())
        table.appendRow(1, new SimpleDumpData(""), content);
    return table;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SimpleDumpData(lucee.runtime.dump.SimpleDumpData)

Example 44 with DumpTable

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

the class HTTPCacheItem method toDumpData.

@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties properties) {
    DumpTable table = new DumpTable("#669999", "#ccffff", "#000000");
    table.setTitle("HTTPCacheEntry");
    table.appendRow(1, new SimpleDumpData("Output"), data.toDumpData(pageContext, maxlevel, properties));
    if (url != null)
        table.appendRow(1, new SimpleDumpData("URL"), DumpUtil.toDumpData(new SimpleDumpData(url), pageContext, maxlevel, properties));
    return table;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SimpleDumpData(lucee.runtime.dump.SimpleDumpData)

Example 45 with DumpTable

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

the class HTTPClient method toDumpData.

@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
    try {
        Array args;
        Struct sct = getMetaData(pageContext), val, a;
        DumpTable cfc = new DumpTable("udf", "#66ccff", "#ccffff", "#000000"), udf, arg;
        cfc.setTitle("Web Service (HTTP)");
        if (dp.getMetainfo())
            cfc.setComment(url.toExternalForm());
        Iterator<Entry<Key, Object>> it = sct.entryIterator();
        Entry<Key, Object> e;
        // Loop UDFs
        while (it.hasNext()) {
            e = it.next();
            val = Caster.toStruct(e.getValue());
            // udf name
            udf = new DumpTable("udf", "#66ccff", "#ccffff", "#000000");
            arg = new DumpTable("udf", "#66ccff", "#ccffff", "#000000");
            cfc.appendRow(1, new SimpleDumpData(e.getKey().getString()), udf);
            // args
            args = Caster.toArray(val.get(KeyConstants._arguments));
            udf.appendRow(1, new SimpleDumpData("arguments"), arg);
            arg.appendRow(7, new SimpleDumpData("name"), new SimpleDumpData("required"), new SimpleDumpData("type"));
            Iterator<Object> ait = args.valueIterator();
            while (ait.hasNext()) {
                a = Caster.toStruct(ait.next());
                arg.appendRow(0, new SimpleDumpData(Caster.toString(a.get(KeyConstants._name))), new SimpleDumpData(Caster.toString(a.get(KeyConstants._required))), new SimpleDumpData(Caster.toString(a.get(KeyConstants._type))));
            }
            // return type
            udf.appendRow(1, new SimpleDumpData("return type"), new SimpleDumpData(Caster.toString(val.get(KeyConstants._returntype))));
        /*
				cfc.appendRow(new DumpRow(0,new DumpData[]{
						new SimpleDumpData(arg.getDisplayName()),
						new SimpleDumpData(e.getKey().getString()),
						new SimpleDumpData(arg.isRequired()),
						new SimpleDumpData(arg.getTypeAsString()),
						def,
						new SimpleDumpData(arg.getHint())}));*/
        }
        return cfc;
    } catch (Throwable t) {
        ExceptionUtil.rethrowIfNecessary(t);
        throw new PageRuntimeException(Caster.toPageException(t));
    }
}
Also used : Array(lucee.runtime.type.Array) DumpTable(lucee.runtime.dump.DumpTable) Entry(java.util.Map.Entry) SimpleDumpData(lucee.runtime.dump.SimpleDumpData) PageRuntimeException(lucee.runtime.exp.PageRuntimeException) Key(lucee.runtime.type.Collection.Key) Struct(lucee.runtime.type.Struct)

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