Search in sources :

Example 26 with ClassDefinition

use of lucee.runtime.db.ClassDefinition in project Lucee by lucee.

the class Admin method doUpdateMonitor.

/*
	 * private void doUpdateUpdateLogSettings() throws PageException { int level=LogUtil.toIntType(getString("admin", "updateUpdateLogSettings", "level"), -1);
	 * String source=getString("admin", "updateUpdateLogSettings", "path"); if(source.indexOf("{")==-1){ Resource res =
	 * ResourceUtil.toResourceNotExisting(pageContext, source, false); String tmp=SystemUtil.addPlaceHolder(res, config, null);
	 * 
	 * 
	 * if(tmp!=null) source=tmp; else source=ContractPath.call(pageContext, source); }
	 * 
	 * admin.updateLogSettings( getString("admin", "updateUpdateLogSettings", "name"), level, source, getInt("admin", "updateUpdateLogSettings", "maxfile"),
	 * getInt("admin", "updateUpdateLogSettings", "maxfilesize") ); store(); adminSync.broadcast(attributes, config); }
	 */
private void doUpdateMonitor() throws PageException {
    ClassDefinition cd = new ClassDefinitionImpl(getString("admin", action, "class"), getString("bundleName", null), getString("bundleVersion", null), config.getIdentification());
    admin.updateMonitor(cd, getString("admin", "updateMonitor", "monitorType"), getString("admin", "updateMonitor", "name"), getBool("admin", "updateMonitor", "logEnabled"));
    store();
    adminSync.broadcast(attributes, config);
}
Also used : ClassDefinitionImpl(lucee.transformer.library.ClassDefinitionImpl) ClassDefinition(lucee.runtime.db.ClassDefinition)

Example 27 with ClassDefinition

use of lucee.runtime.db.ClassDefinition in project Lucee by lucee.

the class Admin method doVerifyDatasource.

/**
 * @throws PageException
 */
private void doVerifyDatasource() throws PageException {
    ClassDefinition cd = new ClassDefinitionImpl(Caster.toString(attributes.get("classname", null), null), Caster.toString(attributes.get("bundleName", null), null), Caster.toString(attributes.get("bundleVersion", null), null), config.getIdentification());
    String connStr = (String) attributes.get("connStr", null);
    if (StringUtil.isEmpty(connStr))
        connStr = (String) attributes.get("dsn", null);
    if (cd.hasClass() && connStr != null) {
        _doVerifyDatasource(cd, connStr, getString("admin", action, "dbusername"), getString("admin", action, "dbpassword"));
    } else {
        _doVerifyDatasource(getString("admin", action, "name"), getString("admin", action, "dbusername"), getString("admin", action, "dbpassword"));
    }
}
Also used : ClassDefinitionImpl(lucee.transformer.library.ClassDefinitionImpl) ClassDefinition(lucee.runtime.db.ClassDefinition)

Example 28 with ClassDefinition

use of lucee.runtime.db.ClassDefinition in project Lucee by lucee.

the class Admin method doUpdateORMEngine.

private void doUpdateORMEngine() throws PageException {
    ClassDefinition cd = new ClassDefinitionImpl(getString("admin", action, "class"), getString("bundleName", null), getString("bundleVersion", null), config.getIdentification());
    admin.updateORMEngine(cd);
    store();
    adminSync.broadcast(attributes, config);
}
Also used : ClassDefinitionImpl(lucee.transformer.library.ClassDefinitionImpl) ClassDefinition(lucee.runtime.db.ClassDefinition)

Example 29 with ClassDefinition

use of lucee.runtime.db.ClassDefinition in project Lucee by lucee.

the class Admin method doUpdateDatasource.

/**
 * @throws PageException
 */
private void doUpdateDatasource() throws PageException {
    int allow = (getBoolV("allowed_select", false) ? DataSource.ALLOW_SELECT : 0) + (getBoolV("allowed_insert", false) ? DataSource.ALLOW_INSERT : 0) + (getBoolV("allowed_update", false) ? DataSource.ALLOW_UPDATE : 0) + (getBoolV("allowed_delete", false) ? DataSource.ALLOW_DELETE : 0) + (getBoolV("allowed_alter", false) ? DataSource.ALLOW_ALTER : 0) + (getBoolV("allowed_drop", false) ? DataSource.ALLOW_DROP : 0) + (getBoolV("allowed_revoke", false) ? DataSource.ALLOW_REVOKE : 0) + (getBoolV("allowed_grant", false) ? DataSource.ALLOW_GRANT : 0) + (getBoolV("allowed_create", false) ? DataSource.ALLOW_CREATE : 0);
    if (allow == 0)
        allow = DataSource.ALLOW_ALL;
    String cn = getString("admin", action, "classname");
    if ("com.microsoft.jdbc.sqlserver.SQLServerDriver".equals(cn)) {
        cn = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
    }
    ClassDefinition cd = new ClassDefinitionImpl(cn, getString("bundleName", null), getString("bundleVersion", null), config.getIdentification());
    // customParameterSyntax
    Struct sct = getStruct("customParameterSyntax", null);
    ParamSyntax ps = (sct != null && sct.containsKey("delimiter") && sct.containsKey("separator")) ? ParamSyntax.toParamSyntax(sct) : ParamSyntax.DEFAULT;
    // 
    boolean literalTimestampWithTSOffset = getBoolV("literalTimestampWithTSOffset", false);
    boolean alwaysSetTimeout = getBoolV("alwaysSetTimeout", false);
    String dsn = getString("admin", action, "dsn");
    String name = getString("admin", action, "name");
    String newName = getString("admin", action, "newName");
    String username = getString("admin", action, "dbusername");
    String password = getString("admin", action, "dbpassword");
    String host = getString("host", "");
    String timezone = getString("timezone", "");
    String database = getString("database", "");
    int port = getInt("port", -1);
    int connLimit = getInt("connectionLimit", -1);
    int connTimeout = getInt("connectionTimeout", -1);
    long metaCacheTimeout = getLong("metaCacheTimeout", 60000);
    boolean blob = getBoolV("blob", false);
    boolean clob = getBoolV("clob", false);
    boolean validate = getBoolV("validate", false);
    boolean storage = getBoolV("storage", false);
    boolean verify = getBoolV("verify", true);
    Struct custom = getStruct("custom", new StructImpl());
    String dbdriver = getString("dbdriver", "");
    // config.getDatasourceConnectionPool().remove(name);
    DataSource ds = null;
    try {
        ds = new DataSourceImpl(config, null, name, cd, host, dsn, database, port, username, password, connLimit, connTimeout, metaCacheTimeout, blob, clob, allow, custom, false, validate, storage, null, dbdriver, ps, literalTimestampWithTSOffset, alwaysSetTimeout, config.getLog("application"));
    } catch (Exception e) {
        throw Caster.toPageException(e);
    }
    if (verify)
        _doVerifyDatasource(ds, username, password);
    // print.out("limit:"+connLimit);
    admin.updateDataSource(name, newName, cd, dsn, username, password, host, database, port, connLimit, connTimeout, metaCacheTimeout, blob, clob, allow, validate, storage, timezone, custom, dbdriver, ps, literalTimestampWithTSOffset, alwaysSetTimeout);
    store();
    adminSync.broadcast(attributes, config);
}
Also used : ClassDefinitionImpl(lucee.transformer.library.ClassDefinitionImpl) StructImpl(lucee.runtime.type.StructImpl) DataSourceImpl(lucee.runtime.db.DataSourceImpl) ClassDefinition(lucee.runtime.db.ClassDefinition) ParamSyntax(lucee.runtime.db.ParamSyntax) PageException(lucee.runtime.exp.PageException) SecurityException(lucee.runtime.exp.SecurityException) IOException(java.io.IOException) DeprecatedException(lucee.runtime.exp.DeprecatedException) BundleException(org.osgi.framework.BundleException) MalformedURLException(java.net.MalformedURLException) SMTPException(lucee.runtime.net.mail.SMTPException) ApplicationException(lucee.runtime.exp.ApplicationException) Struct(lucee.runtime.type.Struct) DataSource(lucee.runtime.db.DataSource)

Example 30 with ClassDefinition

use of lucee.runtime.db.ClassDefinition in project Lucee by lucee.

the class Admin method doUpdateCacheHandler.

private void doUpdateCacheHandler() throws PageException {
    ClassDefinition cd = new ClassDefinitionImpl(getString("admin", action, "class"), getString("bundleName", null), getString("bundleVersion", null), config.getIdentification());
    admin.updateCacheHandler(getString("admin", "updateCacheHandler", "id"), cd);
    store();
    adminSync.broadcast(attributes, config);
}
Also used : ClassDefinitionImpl(lucee.transformer.library.ClassDefinitionImpl) ClassDefinition(lucee.runtime.db.ClassDefinition)

Aggregations

ClassDefinition (lucee.runtime.db.ClassDefinition)41 ClassDefinitionImpl (lucee.transformer.library.ClassDefinitionImpl)24 Element (org.w3c.dom.Element)15 ApplicationException (lucee.runtime.exp.ApplicationException)12 lucee.aprint (lucee.aprint)11 Struct (lucee.runtime.type.Struct)10 CFXTagClass (lucee.runtime.cfx.customtag.CFXTagClass)9 CPPCFXTagClass (lucee.runtime.cfx.customtag.CPPCFXTagClass)9 JavaCFXTagClass (lucee.runtime.cfx.customtag.JavaCFXTagClass)9 PageException (lucee.runtime.exp.PageException)9 BundleException (org.osgi.framework.BundleException)9 IOException (java.io.IOException)8 Map (java.util.Map)8 ClassException (lucee.commons.lang.ClassException)8 SecurityException (lucee.runtime.exp.SecurityException)8 InvocationTargetException (java.lang.reflect.InvocationTargetException)7 MalformedURLException (java.net.MalformedURLException)7 HashMap (java.util.HashMap)7 Entry (java.util.Map.Entry)7 StructImpl (lucee.runtime.type.StructImpl)7