use of lucee.runtime.type.QueryImpl in project Lucee by lucee.
the class Admin method doGetRemoteClientUsage.
private void doGetRemoteClientUsage() throws PageException {
lucee.runtime.type.Query qry = new QueryImpl(new String[] { "code", "displayname" }, new String[] { "varchar", "varchar" }, 0, "usage");
Struct usages = config.getRemoteClientUsage();
// Key[] keys = usages.keys();
Iterator<Entry<Key, Object>> it = usages.entryIterator();
Entry<Key, Object> e;
int i = -1;
while (it.hasNext()) {
i++;
e = it.next();
qry.addRow();
qry.setAt(KeyConstants._code, i + 1, e.getKey().getString());
qry.setAt(KeyConstants._displayname, i + 1, e.getValue());
// qry.setAt("description", i+1, usages[i].getDescription());
}
pageContext.setVariable(getString("admin", action, "returnVariable"), qry);
}
use of lucee.runtime.type.QueryImpl in project Lucee by lucee.
the class Admin method doGetTimeZones.
/**
* @throws PageException
*/
private void doGetTimeZones() throws PageException {
String strLocale = getString("locale", "english (united kingdom)");
Locale locale = LocaleFactory.getLocale(strLocale);
String[] timeZones = TimeZone.getAvailableIDs();
lucee.runtime.type.Query qry = new QueryImpl(new String[] { "id", "display" }, new String[] { "varchar", "varchar" }, timeZones.length, "timezones");
Arrays.sort(timeZones);
TimeZone timeZone;
for (int i = 0; i < timeZones.length; i++) {
timeZone = TimeZone.getTimeZone(timeZones[i]);
qry.setAt("id", i + 1, timeZones[i]);
qry.setAt("display", i + 1, timeZone.getDisplayName(locale));
}
pageContext.setVariable(getString("admin", action, "returnVariable"), qry);
}
use of lucee.runtime.type.QueryImpl in project Lucee by lucee.
the class Admin method getSSLCertificate.
public static Query getSSLCertificate(Config config, String host, int port) throws PageException {
Resource cacerts = config.getSecurityDirectory();
CertificateInstaller installer;
try {
installer = new CertificateInstaller(cacerts, host, port);
} catch (Exception e) {
throw Caster.toPageException(e);
}
X509Certificate[] certs = installer.getCertificates();
X509Certificate cert;
Query qry = new QueryImpl(new String[] { "subject", "issuer" }, certs.length, "certificates");
for (int i = 0; i < certs.length; i++) {
cert = certs[i];
qry.setAtEL("subject", i + 1, cert.getSubjectDN().getName());
qry.setAtEL("issuer", i + 1, cert.getIssuerDN().getName());
}
return qry;
}
use of lucee.runtime.type.QueryImpl in project Lucee by lucee.
the class Admin method doGetJavaCFXTags.
/**
* @throws PageException
*/
private void doGetJavaCFXTags() throws PageException {
Map map = config.getCFXTagPool().getClasses();
lucee.runtime.type.Query qry = new QueryImpl(new Collection.Key[] { KeyConstants._displayname, KeyConstants._sourcename, KeyConstants._readonly, KeyConstants._name, KeyConstants._class, KeyConstants._bundleName, KeyConstants._bundleVersion, KeyConstants._isvalid }, 0, "query");
Iterator it = map.keySet().iterator();
int row = 0;
while (it.hasNext()) {
CFXTagClass tag = (CFXTagClass) map.get(it.next());
if (tag instanceof JavaCFXTagClass) {
row++;
qry.addRow(1);
JavaCFXTagClass jtag = (JavaCFXTagClass) tag;
qry.setAt(KeyConstants._displayname, row, tag.getDisplayType());
qry.setAt(KeyConstants._sourcename, row, tag.getSourceName());
qry.setAt(KeyConstants._readonly, row, Caster.toBoolean(tag.isReadOnly()));
qry.setAt(KeyConstants._isvalid, row, Caster.toBoolean(tag.isValid()));
qry.setAt(KeyConstants._name, row, jtag.getName());
qry.setAt(KeyConstants._class, row, jtag.getClassDefinition().getClassName());
qry.setAt(KeyConstants._bundleName, row, jtag.getClassDefinition().getName());
qry.setAt(KeyConstants._bundleVersion, row, jtag.getClassDefinition().getVersionAsString());
}
}
pageContext.setVariable(getString("admin", action, "returnVariable"), qry);
}
use of lucee.runtime.type.QueryImpl in project Lucee by lucee.
the class Admin method doGetDatasourceDriverList.
private void doGetDatasourceDriverList() throws PageException {
Resource luceeContext = ResourceUtil.toResourceExisting(pageContext, "/lucee/admin/dbdriver/");
Resource[] children = luceeContext.listResources(new ExtensionResourceFilter(Constants.getComponentExtensions()));
String rtnVar = getString("admin", action, "returnVariable");
lucee.runtime.type.Query qry = new QueryImpl(new String[] { "name" }, children.length, rtnVar);
for (int i = 0; i < children.length; i++) {
qry.setAt("name", i + 1, children[i].getName());
}
pageContext.setVariable(rtnVar, qry);
}
Aggregations