Search in sources :

Example 51 with StructImpl

use of lucee.runtime.type.StructImpl in project Lucee by lucee.

the class Admin method doGetOutputSetting.

private void doGetOutputSetting() throws PageException {
    Struct sct = new StructImpl();
    pageContext.setVariable(getString("admin", action, "returnVariable"), sct);
    sct.set("suppressContent", Caster.toBoolean(config.isSuppressContent()));
    sct.set("contentLength", Caster.toBoolean(config.contentLength()));
    // sct.set("showVersion",Caster.toBoolean(config.isShowVersion()));
    sct.set("allowCompression", Caster.toBoolean(config.allowCompression()));
    int wt = config.getCFMLWriterType();
    String cfmlWriter = "regular";
    if (wt == ConfigImpl.CFML_WRITER_WS)
        cfmlWriter = "white-space";
    else if (wt == ConfigImpl.CFML_WRITER_WS_PREF)
        cfmlWriter = "white-space-pref";
    sct.set("cfmlWriter", cfmlWriter);
    sct.set("bufferOutput", Caster.toBoolean(config.getBufferOutput()));
}
Also used : StructImpl(lucee.runtime.type.StructImpl) Struct(lucee.runtime.type.Struct)

Example 52 with StructImpl

use of lucee.runtime.type.StructImpl in project Lucee by lucee.

the class Admin method doGetRestSettings.

private void doGetRestSettings() throws PageException {
    Struct sct = new StructImpl();
    sct.set(KeyConstants._list, Caster.toBoolean(config.getRestList()));
    // sct.set(KeyImpl.init("allowChanges"), Caster.toBoolean(config.getRestAllowChanges()));
    pageContext.setVariable(getString("admin", action, "returnVariable"), sct);
}
Also used : StructImpl(lucee.runtime.type.StructImpl) Struct(lucee.runtime.type.Struct)

Example 53 with StructImpl

use of lucee.runtime.type.StructImpl in project Lucee by lucee.

the class Admin method doGetSpoolerTasks.

private void doGetSpoolerTasks() throws PageException {
    int startrow = getInt("startrow", 1);
    if (startrow < 1)
        startrow = 1;
    int maxrow = getInt("maxrow", -1);
    String result = getString("result", null);
    SpoolerEngineImpl engine = (SpoolerEngineImpl) config.getSpoolerEngine();
    Query qry = engine.getAllTasksAsQuery(startrow, maxrow);
    pageContext.setVariable(getString("admin", action, "returnVariable"), qry);
    if (!StringUtil.isEmpty(result)) {
        Struct sct = new StructImpl();
        pageContext.setVariable(result, sct);
        sct.setEL("open", engine.getOpenTaskCount());
        sct.setEL("closed", engine.getClosedTaskCount());
    }
/*
		 * SpoolerTask[] open = config.getSpoolerEngine().getOpenTasks(); SpoolerTask[] closed = config.getSpoolerEngine().getClosedTasks(); String v="VARCHAR";
		 * lucee.runtime.type.Query qry=new QueryImpl( new
		 * String[]{"type","name","detail","id","lastExecution","nextExecution","closed","tries","exceptions","triesmax"}, new
		 * String[]{v,v,"object",v,d,d,"boolean","int","object","int"}, open.length+closed.length,"query");
		 * 
		 * int row=0; row=doGetRemoteClientTasks(qry,open,row); doGetRemoteClientTasks(qry,closed,row);
		 * pageContext.setVariable(getString("admin",action,"returnVariable"),qry);
		 */
}
Also used : StructImpl(lucee.runtime.type.StructImpl) Query(lucee.runtime.type.Query) SpoolerEngineImpl(lucee.runtime.spooler.SpoolerEngineImpl) Struct(lucee.runtime.type.Struct)

Example 54 with StructImpl

use of lucee.runtime.type.StructImpl in project Lucee by lucee.

the class Admin method doGetApplicationListener.

private void doGetApplicationListener() throws PageException {
    Struct sct = new StructImpl();
    pageContext.setVariable(getString("admin", action, "returnVariable"), sct);
    ApplicationListener appListener = config.getApplicationListener();
    sct.set("type", AppListenerUtil.toStringType(appListener));
    sct.set("mode", AppListenerUtil.toStringMode(appListener.getMode()));
// replaced with encoding outputsct.set("defaultencoding", config.get DefaultEncoding());
}
Also used : StructImpl(lucee.runtime.type.StructImpl) ApplicationListener(lucee.runtime.listener.ApplicationListener) Struct(lucee.runtime.type.Struct)

Example 55 with StructImpl

use of lucee.runtime.type.StructImpl in project Lucee by lucee.

the class QueryStruct method toQueryStruct.

public static QueryStruct toQueryStruct(lucee.runtime.type.Query q, Key columnName) throws PageException {
    QueryStruct qs = new QueryStruct(q.getName(), q.getSql(), q.getTemplate());
    qs.setCacheType(q.getCacheType());
    qs.setColumnNames(q.getColumnNames());
    qs.setExecutionTime(q.getExecutionTime());
    qs.setUpdateCount(q.getUpdateCount());
    int rows = q.getRecordcount();
    if (rows == 0)
        return qs;
    Key[] columns = q.getColumnNames();
    Struct tmp;
    for (int r = 1; r <= rows; r++) {
        tmp = new StructImpl();
        qs.set(Caster.toKey(q.getAt(columnName, r)), tmp);
        for (Key c : columns) {
            tmp.setEL(c, q.getAt(c, r, null));
        }
    }
    return qs;
}
Also used : StructImpl(lucee.runtime.type.StructImpl) Struct(lucee.runtime.type.Struct)

Aggregations

StructImpl (lucee.runtime.type.StructImpl)251 Struct (lucee.runtime.type.Struct)216 PageException (lucee.runtime.exp.PageException)40 Entry (java.util.Map.Entry)34 Key (lucee.runtime.type.Collection.Key)28 Array (lucee.runtime.type.Array)25 ArrayImpl (lucee.runtime.type.ArrayImpl)24 ApplicationException (lucee.runtime.exp.ApplicationException)21 IOException (java.io.IOException)19 Map (java.util.Map)19 Resource (lucee.commons.io.res.Resource)18 Iterator (java.util.Iterator)17 PageContextImpl (lucee.runtime.PageContextImpl)14 QueryImpl (lucee.runtime.type.QueryImpl)13 Collection (lucee.runtime.type.Collection)11 Query (lucee.runtime.type.Query)11 DateTimeImpl (lucee.runtime.type.dt.DateTimeImpl)11 HashMap (java.util.HashMap)9 PageSource (lucee.runtime.PageSource)8 Element (org.w3c.dom.Element)8