Search in sources :

Example 21 with StructImpl

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()));
}
Also used : StructImpl(lucee.runtime.type.StructImpl) ProxyData(lucee.runtime.net.proxy.ProxyData) Struct(lucee.runtime.type.Struct)

Example 22 with StructImpl

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;
}
Also used : CallerImpl(lucee.runtime.type.scope.CallerImpl) StructImpl(lucee.runtime.type.StructImpl)

Example 23 with StructImpl

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;
}
Also used : StructImpl(lucee.runtime.type.StructImpl) Struct(lucee.runtime.type.Struct)

Example 24 with StructImpl

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;
}
Also used : StructImpl(lucee.runtime.type.StructImpl) VariablesImpl(lucee.runtime.type.scope.VariablesImpl)

Example 25 with StructImpl

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());
        }
    }
}
Also used : StructImpl(lucee.runtime.type.StructImpl) GetHttpTimeString(lucee.runtime.functions.dateTime.GetHttpTimeString) CacheEntry(lucee.commons.io.cache.CacheEntry)

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