Search in sources :

Example 36 with QueryImpl

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

the class Admin method doGetRestMappings.

private void doGetRestMappings() throws PageException {
    lucee.runtime.rest.Mapping[] mappings = config.getRestMappings();
    lucee.runtime.type.Query qry = new QueryImpl(new String[] { "physical", "strphysical", "virtual", "hidden", "readonly", "default" }, mappings.length, "query");
    lucee.runtime.rest.Mapping m;
    for (int i = 0; i < mappings.length; i++) {
        m = mappings[i];
        int row = i + 1;
        qry.setAt("physical", row, m.getPhysical());
        qry.setAt("strphysical", row, m.getStrPhysical());
        qry.setAt("virtual", row, m.getVirtual());
        qry.setAt("hidden", row, Caster.toBoolean(m.isHidden()));
        qry.setAt("readonly", row, Caster.toBoolean(m.isReadonly()));
        qry.setAt("default", row, Caster.toBoolean(m.isDefault()));
    }
    pageContext.setVariable(getString("admin", action, "returnVariable"), qry);
}
Also used : QueryImpl(lucee.runtime.type.QueryImpl) Mapping(lucee.runtime.Mapping) Query(lucee.runtime.type.Query)

Example 37 with QueryImpl

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

the class Admin method doGetPlugins.

private void doGetPlugins() throws PageException {
    Resource dir = config.getPluginDirectory();
    String[] list = dir.list(new XMLConfigAdmin.PluginFilter());
    lucee.runtime.type.Query qry = new QueryImpl(new Collection.Key[] { KeyConstants._name }, list.length, getString("admin", action, "returnVariable"));
    pageContext.setVariable(getString("admin", action, "returnVariable"), qry);
    for (int i = 0; i < list.length; i++) {
        int row = i + 1;
        qry.setAtEL(KeyConstants._name, row, list[i]);
    }
}
Also used : QueryImpl(lucee.runtime.type.QueryImpl) Resource(lucee.commons.io.res.Resource) BundleCollection(lucee.loader.osgi.BundleCollection) Collection(lucee.runtime.type.Collection) XMLConfigAdmin(lucee.runtime.config.XMLConfigAdmin) Query(lucee.runtime.type.Query)

Example 38 with QueryImpl

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

the class Admin method doGetJDBCDrivers.

private void doGetJDBCDrivers() throws PageException {
    JDBCDriver[] drivers = config.getJDBCDrivers();
    lucee.runtime.type.Query qry = new QueryImpl(new Key[] { KeyConstants._label, KeyConstants._class, KeyConstants._bundleName, KeyConstants._bundleVersion }, drivers.length, "jdbc");
    JDBCDriver driver;
    for (int row = 0; row < drivers.length; row++) {
        driver = drivers[row];
        qry.setAt(KeyConstants._label, row, driver.label);
        qry.setAt(KeyConstants._class, row, driver.cd.getClassName());
        qry.setAt(KeyConstants._bundleName, row, driver.cd.getName());
        qry.setAt(KeyConstants._bundleVersion, row, driver.cd.getVersion().toString());
    }
    pageContext.setVariable(getString("admin", action, "returnVariable"), qry);
}
Also used : QueryImpl(lucee.runtime.type.QueryImpl) JDBCDriver(lucee.runtime.db.JDBCDriver) Query(lucee.runtime.type.Query)

Example 39 with QueryImpl

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

the class Admin method doGetCFXTags.

/**
 * @throws PageException
 */
private void doGetCFXTags() throws PageException {
    Map map = config.getCFXTagPool().getClasses();
    lucee.runtime.type.Query qry = new QueryImpl(new String[] { "displayname", "sourcename", "readonly", "isvalid", "name", "procedure_class", "procedure_bundleName", "procedure_bundleVersion", "keep_alive" }, map.size(), "query");
    Iterator it = map.keySet().iterator();
    int row = 0;
    while (it.hasNext()) {
        row++;
        CFXTagClass tag = (CFXTagClass) map.get(it.next());
        qry.setAt("displayname", row, tag.getDisplayType());
        qry.setAt("sourcename", row, tag.getSourceName());
        qry.setAt("readonly", row, Caster.toBoolean(tag.isReadOnly()));
        qry.setAt("isvalid", row, Caster.toBoolean(tag.isValid()));
        if (tag instanceof CPPCFXTagClass) {
            CPPCFXTagClass ctag = (CPPCFXTagClass) tag;
            qry.setAt(KeyConstants._name, row, ctag.getName());
            qry.setAt("procedure_class", row, ctag.getProcedure());
            qry.setAt("keepalive", row, Caster.toBoolean(ctag.getKeepAlive()));
        } else if (tag instanceof JavaCFXTagClass) {
            JavaCFXTagClass jtag = (JavaCFXTagClass) tag;
            qry.setAt(KeyConstants._name, row, jtag.getName());
            qry.setAt("procedure_class", row, jtag.getClassDefinition().getClassName());
            qry.setAt("procedure_bundleName", row, jtag.getClassDefinition().getName());
            qry.setAt("procedure_bundleVersion", row, jtag.getClassDefinition().getVersionAsString());
        }
    }
    pageContext.setVariable(getString("admin", action, "returnVariable"), qry);
}
Also used : QueryImpl(lucee.runtime.type.QueryImpl) JavaCFXTagClass(lucee.runtime.cfx.customtag.JavaCFXTagClass) Iterator(java.util.Iterator) CFXTagClass(lucee.runtime.cfx.customtag.CFXTagClass) CPPCFXTagClass(lucee.runtime.cfx.customtag.CPPCFXTagClass) JavaCFXTagClass(lucee.runtime.cfx.customtag.JavaCFXTagClass) CPPCFXTagClass(lucee.runtime.cfx.customtag.CPPCFXTagClass) Map(java.util.Map) HashMap(java.util.HashMap) Query(lucee.runtime.type.Query)

Example 40 with QueryImpl

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

the class Admin method doGetMappings.

private void doGetMappings() throws PageException {
    Mapping[] mappings = config.getMappings();
    lucee.runtime.type.Query qry = new QueryImpl(new String[] { "archive", "strarchive", "physical", "strphysical", "virtual", "hidden", "physicalFirst", "readonly", "inspect", "toplevel" }, mappings.length, "query");
    for (int i = 0; i < mappings.length; i++) {
        MappingImpl m = (MappingImpl) mappings[i];
        int row = i + 1;
        qry.setAt("archive", row, m.getArchive());
        qry.setAt("strarchive", row, m.getStrArchive());
        qry.setAt("physical", row, m.getPhysical());
        qry.setAt("strphysical", row, m.getStrPhysical());
        qry.setAt("virtual", row, m.getVirtual());
        qry.setAt("hidden", row, Caster.toBoolean(m.isHidden()));
        qry.setAt("physicalFirst", row, Caster.toBoolean(m.isPhysicalFirst()));
        qry.setAt("readonly", row, Caster.toBoolean(m.isReadonly()));
        qry.setAt("inspect", row, ConfigWebUtil.inspectTemplate(m.getInspectTemplateRaw(), ""));
        qry.setAt("toplevel", row, Caster.toBoolean(m.isTopLevel()));
    }
    pageContext.setVariable(getString("admin", action, "returnVariable"), qry);
}
Also used : QueryImpl(lucee.runtime.type.QueryImpl) Mapping(lucee.runtime.Mapping) MappingImpl(lucee.runtime.MappingImpl) Query(lucee.runtime.type.Query)

Aggregations

QueryImpl (lucee.runtime.type.QueryImpl)82 Query (lucee.runtime.type.Query)65 Collection (lucee.runtime.type.Collection)17 Struct (lucee.runtime.type.Struct)16 StructImpl (lucee.runtime.type.StructImpl)13 PageException (lucee.runtime.exp.PageException)12 Key (lucee.runtime.type.Collection.Key)12 Iterator (java.util.Iterator)11 Map (java.util.Map)10 ApplicationException (lucee.runtime.exp.ApplicationException)10 Array (lucee.runtime.type.Array)10 DatabaseException (lucee.runtime.exp.DatabaseException)9 Stopwatch (lucee.runtime.timer.Stopwatch)9 HashMap (java.util.HashMap)8 Resource (lucee.commons.io.res.Resource)7 BundleCollection (lucee.loader.osgi.BundleCollection)7 Entry (java.util.Map.Entry)6 IOException (java.io.IOException)5 ResultSet (java.sql.ResultSet)5 ArrayImpl (lucee.runtime.type.ArrayImpl)5