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()));
}
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);
}
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);
*/
}
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());
}
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;
}
Aggregations