Search in sources :

Example 81 with StructImpl

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

the class ConfigImpl method listCTCache.

public Struct listCTCache() {
    Struct sct = new StructImpl();
    if (ctPatchCache == null)
        return sct;
    Iterator<Entry<String, InitFile>> it = ctPatchCache.entrySet().iterator();
    Entry<String, InitFile> entry;
    while (it.hasNext()) {
        entry = it.next();
        sct.setEL(entry.getKey(), entry.getValue().getPageSource().getDisplayPath());
    }
    return sct;
}
Also used : DumpWriterEntry(lucee.runtime.dump.DumpWriterEntry) Entry(java.util.Map.Entry) GatewayEntry(lucee.runtime.gateway.GatewayEntry) StructImpl(lucee.runtime.type.StructImpl) InitFile(lucee.runtime.customtag.InitFile) Struct(lucee.runtime.type.Struct)

Example 82 with StructImpl

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

the class RemoteClientImpl method getId.

@Override
public String getId(Config config) {
    if (id != null)
        return id;
    Struct attrColl = new StructImpl();
    attrColl.setEL(KeyConstants._action, "getToken");
    Struct args = new StructImpl();
    args.setEL(KeyConstants._type, getType());
    args.setEL(RemoteClientTask.PASSWORD, getAdminPasswordEncrypted());
    args.setEL(RemoteClientTask.CALLER_ID, "undefined");
    args.setEL(RemoteClientTask.ATTRIBUTE_COLLECTION, attrColl);
    try {
        WSClient rpc = WSClient.getInstance(null, getUrl(), getServerUsername(), getServerPassword(), getProxyData());
        Object result = rpc.callWithNamedValues(config, KeyConstants._invoke, args);
        return id = IdentificationImpl.createId(securityKey, Caster.toString(result, null), false, null);
    } catch (Throwable t) {
        ExceptionUtil.rethrowIfNecessary(t);
        return null;
    }
}
Also used : StructImpl(lucee.runtime.type.StructImpl) WSClient(lucee.runtime.net.rpc.client.WSClient) Struct(lucee.runtime.type.Struct)

Example 83 with StructImpl

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

the class ReferenceReference method touch.

@Override
public Object touch(PageContext pc) throws PageException {
    Object parent = reference.touch(pc);
    Object o = pc.getCollection(parent, key, null);
    if (o != null)
        return o;
    return pc.set(parent, key, new StructImpl());
}
Also used : StructImpl(lucee.runtime.type.StructImpl)

Example 84 with StructImpl

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

the class VariableReference method touchEL.

@Override
public Object touchEL(PageContext pc) {
    Object o;
    if (coll instanceof Query) {
        o = ((Query) coll).getColumn(key, null);
        if (o != null)
            return o;
        return setEL(pc, new StructImpl());
    }
    o = coll.get(key, null);
    if (o != null)
        return o;
    return setEL(pc, new StructImpl());
}
Also used : StructImpl(lucee.runtime.type.StructImpl) Query(lucee.runtime.type.Query)

Example 85 with StructImpl

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

the class ArgumentImpl method toStruct.

/*
	public void setNamedArguments(boolean namedArguments) {
		this.namedArguments=namedArguments;
	}
	public boolean isNamedArguments() {
		return namedArguments;
	}
*/
/**
 * converts a argument scope to a regular struct
 * @param arg argument scope to convert
 * @return resulting struct
 */
public static Struct toStruct(Argument arg) {
    Struct trg = new StructImpl();
    StructImpl.copy(arg, trg, false);
    return trg;
}
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