use of lucee.runtime.type.StructImpl in project Lucee by lucee.
the class Admin method doGetProxy.
private void doGetProxy() throws PageException {
Struct sct = new StructImpl();
pageContext.setVariable(getString("admin", action, "returnVariable"), sct);
ProxyData pd = config.getProxyData();
String port = pd == null || pd.getPort() <= 0 ? "" : Caster.toString(pd.getPort());
// sct.set("enabled",Caster.toBoolean(config.isProxyEnable()));
sct.set("port", port);
sct.set("server", pd == null ? "" : emptyIfNull(pd.getServer()));
sct.set("username", pd == null ? "" : emptyIfNull(pd.getUsername()));
sct.set("password", pd == null ? "" : emptyIfNull(pd.getPassword()));
}
use of lucee.runtime.type.StructImpl in project Lucee by lucee.
the class CFTag method release.
@Override
public void release() {
super.release();
hasBody = false;
// filename=null;
// .clear();
attributesScope = new StructImpl();
callerScope = new CallerImpl();
if (thistagScope != null)
thistagScope = null;
if (ctVariablesScope != null)
ctVariablesScope = null;
isEndTag = false;
// cfc=null;
source = null;
}
use of lucee.runtime.type.StructImpl in project Lucee by lucee.
the class CFTag method cfcEndTag.
private int cfcEndTag() throws PageException {
boolean exeAgain = false;
try {
String output = null;
Object rtn = Boolean.FALSE;
if (cfc.contains(pageContext, ON_END_TAG)) {
try {
output = bodyContent.getString();
bodyContent.clearBody();
// rtn=cfc.call(pageContext, ON_END_TAG, new Object[]{attributesScope,pageContext.variablesScope(),output});
Struct args = new StructImpl(Struct.TYPE_LINKED);
args.set(KeyConstants._ATTRIBUTES, attributesScope);
setCaller(pageContext, args);
args.set(GENERATED_CONTENT, output);
rtn = cfc.callWithNamedValues(pageContext, ON_END_TAG, args);
} finally {
writeEnclosingWriter();
}
} else
writeEnclosingWriter();
exeAgain = Caster.toBooleanValue(rtn, false);
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
isEndTag = true;
throw Caster.toPageException(t);
}
return exeAgain ? EVAL_BODY_BUFFERED : SKIP_BODY;
}
use of lucee.runtime.type.StructImpl in project Lucee by lucee.
the class CFTag method cfmlStartTag.
private int cfmlStartTag() throws PageException {
callerScope.initialize(pageContext);
// thistag
if (thistagScope == null)
thistagScope = new StructImpl(Struct.TYPE_LINKED);
thistagScope.set(GENERATED_CONTENT, "");
thistagScope.set(EXECUTION_MODE, "start");
thistagScope.set(EXECUTE_BODY, Boolean.TRUE);
thistagScope.set(KeyConstants._HASENDTAG, Caster.toBoolean(hasBody));
ctVariablesScope = new VariablesImpl();
ctVariablesScope.setEL(KeyConstants._ATTRIBUTES, attributesScope);
ctVariablesScope.setEL(KeyConstants._CALLER, callerScope);
ctVariablesScope.setEL(KeyConstants._THISTAG, thistagScope);
// include
doInclude();
return Caster.toBooleanValue(thistagScope.get(EXECUTE_BODY)) ? EVAL_BODY_BUFFERED : SKIP_BODY;
}
use of lucee.runtime.type.StructImpl in project Lucee by lucee.
the class Cache method doGet.
private void doGet() throws PageException, IOException {
required("cache", "id", id);
required("cache", "name", name);
String id = Caster.toString(this.id);
if (metadata == null) {
pageContext.setVariable(name, CacheGet.call(pageContext, id, throwOnError, cachename));
} else {
lucee.commons.io.cache.Cache cache = CacheUtil.getCache(pageContext, cachename, Config.CACHE_TYPE_OBJECT);
CacheEntry entry = throwOnError ? cache.getCacheEntry(CacheUtil.key(id)) : cache.getCacheEntry(CacheUtil.key(id), null);
if (entry != null) {
pageContext.setVariable(name, entry.getValue());
pageContext.setVariable(metadata, entry.getCustomInfo());
} else {
pageContext.setVariable(metadata, new StructImpl());
}
}
}
Aggregations