use of lucee.commons.lang.types.RefBoolean in project Lucee by lucee.
the class MixedAppListener method onRequest.
@Override
public void onRequest(PageContext pc, PageSource requestedPage, RequestListener rl) throws PageException {
RefBoolean isCFC = new RefBooleanImpl(false);
PageSource appPS = getApplicationPageSource(pc, requestedPage, mode, isCFC);
if (isCFC.toBooleanValue())
_onRequest(pc, requestedPage, appPS, rl);
else
ClassicAppListener._onRequest(pc, requestedPage, appPS, rl);
}
use of lucee.commons.lang.types.RefBoolean in project Lucee by lucee.
the class ModernAppListener method initApplicationContext.
private ModernApplicationContext initApplicationContext(PageContextImpl pc, Component app) throws PageException {
// use existing app context
RefBoolean throwsErrorWhileInit = new RefBooleanImpl(false);
ModernApplicationContext appContext = new ModernApplicationContext(pc, app, throwsErrorWhileInit);
pc.setApplicationContext(appContext);
// scope cascading
if (pc.getRequestDialect() == CFMLEngine.DIALECT_CFML && ((UndefinedImpl) pc.undefinedScope()).getScopeCascadingType() != appContext.getScopeCascading()) {
pc.undefinedScope().initialize(pc);
}
// ORM
if (appContext.isORMEnabled()) {
boolean hasError = throwsErrorWhileInit.toBooleanValue();
if (hasError)
pc.addPageSource(app.getPageSource(), true);
try {
ORMUtil.resetEngine(pc, false);
} finally {
if (hasError)
pc.removeLastPageSource(true);
}
}
return appContext;
}
use of lucee.commons.lang.types.RefBoolean in project Lucee by lucee.
the class DumpStruct method call.
public static Struct call(PageContext pc, Object object, double maxLevel, String show, String hide, double keys, boolean metainfo, boolean showUDFs, String label) {
if (show != null && "all".equalsIgnoreCase(show.trim()))
show = null;
if (hide != null && "all".equalsIgnoreCase(hide.trim()))
hide = null;
Set<String> setShow = (show != null) ? ListUtil.listToSet(show.toLowerCase(), ",", true) : null;
Set<String> setHide = (hide != null) ? ListUtil.listToSet(hide.toLowerCase(), ",", true) : null;
DumpProperties properties = new DumpProperties((int) maxLevel, setShow, setHide, (int) keys, metainfo, showUDFs);
DumpData dd = DumpUtil.toDumpData(object, pc, (int) maxLevel, properties);
if (!StringUtil.isEmpty(label)) {
DumpTable table = new DumpTable("#ffffff", "#cccccc", "#000000");
table.appendRow(1, new SimpleDumpData(label));
table.appendRow(0, dd);
dd = table;
}
RefBoolean hasReference = new RefBooleanImpl(false);
Struct sct = toStruct(dd, object, hasReference);
sct.setEL("hasReference", hasReference.toBoolean());
addMetaData(sct, object);
return sct;
}
use of lucee.commons.lang.types.RefBoolean in project Lucee by lucee.
the class ScopeContext method invalidateUserScope.
public void invalidateUserScope(PageContextImpl pc, boolean migrateSessionData, boolean migrateClientData) throws PageException {
ApplicationContext appContext = pc.getApplicationContext();
RefBoolean isNew = new RefBooleanImpl();
// get in memory scopes
Map<String, Scope> clientContext = getSubMap(cfClientContexts, appContext.getName());
UserScope oldClient = (UserScope) clientContext.get(pc.getCFID());
Map<String, Scope> sessionContext = getSubMap(cfSessionContexts, appContext.getName());
UserScope oldSession = (UserScope) sessionContext.get(pc.getCFID());
// remove Scopes completly
removeCFSessionScope(pc);
removeClientScope(pc);
pc.resetIdAndToken();
if (oldSession != null)
migrate(pc, oldSession, getCFSessionScope(pc, isNew), migrateSessionData);
if (oldClient != null)
migrate(pc, oldClient, getClientScope(pc), migrateClientData);
}
use of lucee.commons.lang.types.RefBoolean in project Lucee by lucee.
the class SelectParser method column.
private Expression column(ParserString raw) throws SQLParserException {
RefBoolean hb = new RefBooleanImpl(false);
String name = identifier(raw, hb);
if (name == null)
return null;
if (!hb.toBooleanValue()) {
if ("true".equalsIgnoreCase(name))
return ValueBoolean.TRUE;
if ("false".equalsIgnoreCase(name))
return ValueBoolean.FALSE;
if ("null".equalsIgnoreCase(name))
return ValueNull.NULL;
}
ColumnExpression column = new ColumnExpression(name, name.equals("?") ? columnIndex++ : 0);
raw.removeSpace();
while (raw.forwardIfCurrent(".")) {
raw.removeSpace();
String sub = identifier(raw, hb);
if (sub == null)
throw new SQLParserException("invalid column definition");
column.setSub(sub);
}
raw.removeSpace();
if (raw.forwardIfCurrent('(')) {
return new OperationN(column.getFullName(), readArguments(raw));
}
return column;
}
Aggregations