@throws PageException
179105
private void doUpdateRestMapping() throws PageException {
	admin.updateRestMapping(getString("admin", action, "virtual"), getString("admin", action, "physical"), getBool("admin", action, "default"));
	store();
	adminSync.broadcast(attributes, config);

	RestUtil.release(config.getRestMappings());
    }
234420
public void init(PageContext pageContext) {

        ServletContext servCtx = pageContext.getServletContext();
        ServletConfig servConfig = pageContext.getServletConfig();

        init(servCtx, servConfig);
    }
962633
public void actionUpload() throws PageException {
	FormItem item = getFormItem(pageContext, filefield);
	Struct cffile = _actionUpload(pageContext, securityManager, item, strDestination, nameconflict, accept, strict, mode, attributes, acl, serverPassword);
	if (StringUtil.isEmpty(result)) {
	    pageContext.undefinedScope().set(KeyConstants._file, cffile);
	    pageContext.undefinedScope().set("cffile", cffile);
	}
	else {
	    pageContext.setVariable(result, cffile);
	}
    }
1220998
@Override
    public Object get(PageContext pc, Collection.Key key) throws PageException {
	return get(key);
    }
834329
private void actionInfo() throws PageException {
	if (variable == null) throw new ApplicationException("attribute variable is not defined for tag file");
	pageContext.setVariable(variable, getInfo(pageContext, file, serverPassword));

    }
181374
private void actionDelete() throws PageException {
	checkFile(pageContext, securityManager, file, serverPassword, false, false, false, false);
	setACL(pageContext, file, acl);
	try {
	    if (!file.delete()) throw new ApplicationException("can't delete file [" + file + "]");
	}
	catch (Throwable t) {
	    ExceptionUtil.rethrowIfNecessary(t);
	    throw new ApplicationException(t.getMessage());
	}
    }
1264088
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"));
	}
    }
119780
private void doResetPassword() throws PageException {
	try {
	    admin.removePassword(getString("contextPath", null));
	}
	catch (Exception e) {
	    SystemOut.printDate(e);
	}
	store();
    }
332693
private void doUpdateSerial() throws PageException {
	admin.updateSerial(getString("admin", action, "serial"));
	store();
	pageContext.serverScope().reload();
    }
769998
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 id = getString("id", null);
	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, name, cd, host, dsn, database, port, username, password, null, 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(id, 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);
    }
949641
private void doDelete() throws PageException {
	try {
	    RegistryQuery.deleteValue(branch, entry);
	}
	catch (Exception e) {
	    throw Caster.toPageException(e);
	}
    }
9732
private void doGetDatasource() throws PageException {

	String name = getString("admin", action, "name");
	Map ds = config.getDataSourcesAsMap();
	Iterator it = ds.keySet().iterator();

	while (it.hasNext()) {
	    String key = (String) it.next();
	    if (key.equalsIgnoreCase(name)) {
		DataSource d = (DataSource) ds.get(key);
		Struct sct = new StructImpl();
		ClassDefinition cd = d.getClassDefinition();

		sct.setEL(KeyConstants._name, key);
		sct.setEL(KeyConstants._host, d.getHost());
		sct.setEL("classname", cd.getClassName());
		sct.setEL("class", cd.getClassName());
		sct.setEL("bundleName", cd.getName());
		sct.setEL("bundleVersion", cd.getVersionAsString());
		sct.setEL("dsn", d.getDsnOriginal());
		sct.setEL("database", d.getDatabase());
		sct.setEL("port", d.getPort() < 1 ? "" : Caster.toString(d.getPort()));
		sct.setEL("dsnTranslated", d.getDsnTranslated());
		sct.setEL("timezone", toStringTimeZone(d.getTimeZone()));
		sct.setEL("password", d.getPassword());
		sct.setEL("passwordEncrypted", ConfigWebUtil.encrypt(d.getPassword()));
		sct.setEL("username", d.getUsername());
		sct.setEL("readonly", Caster.toBoolean(d.isReadOnly()));
		sct.setEL("select", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_SELECT)));
		sct.setEL("delete", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_DELETE)));
		sct.setEL("update", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_UPDATE)));
		sct.setEL("insert", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_INSERT)));
		sct.setEL("create", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_CREATE)));
		sct.setEL("insert", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_INSERT)));
		sct.setEL("drop", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_DROP)));
		sct.setEL("grant", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_GRANT)));
		sct.setEL("revoke", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_REVOKE)));
		sct.setEL("alter", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_ALTER)));

		sct.setEL("connectionLimit", d.getConnectionLimit() < 1 ? "-1" : Caster.toString(d.getConnectionLimit()));
		sct.setEL("connectionTimeout", d.getConnectionTimeout() < 1 ? "" : Caster.toString(d.getConnectionTimeout()));
		sct.setEL("metaCacheTimeout", Caster.toDouble(d.getMetaCacheTimeout()));
		sct.setEL("custom", d.getCustoms());
		sct.setEL("blob", Boolean.valueOf(d.isBlob()));
		sct.setEL("clob", Boolean.valueOf(d.isClob()));
		sct.setEL("validate", Boolean.valueOf(d.validate()));
		sct.setEL("storage", Boolean.valueOf(d.isStorage()));
		if (d instanceof DataSourceImpl) {
		    DataSourceImpl di = ((DataSourceImpl) d);
		    sct.setEL("literalTimestampWithTSOffset", Boolean.valueOf(di.getLiteralTimestampWithTSOffset()));
		    sct.setEL("alwaysSetTimeout", Boolean.valueOf(di.getAlwaysSetTimeout()));

		    sct.setEL("dbdriver", Caster.toString(di.getDbDriver(), ""));
		}
		pageContext.setVariable(getString("admin", action, "returnVariable"), sct);
		return;
	    }
	}
	throw new ApplicationException("there is no datasource with name [" + name + "]");
    }
596062
final public function prepare(PageRequest $request)
	{
		$this->request = $request;
		$this->response = $this->createBlockResponse($request);
		
		$this->properties = $request->getBlockPropertySet()
				->getBlockPropertySet($this->block);

		try {
			$this->doPrepare();
		} catch (\Exception $e) {
			$this->exception = $e;
		}
	}
1365617
private void actionWrite() throws PageException {
	if (output == null) throw new ApplicationException("attribute output is not defined for tag file");
	checkFile(pageContext, securityManager, file, serverPassword, createPath, true, false, true);
	if (file.exists()) {
	    // Error
	    if (nameconflict == NAMECONFLICT_ERROR) throw new ApplicationException("destination file [" + file + "] already exist");
	    // SKIP
	    else if (nameconflict == NAMECONFLICT_SKIP) return;
	    // OVERWRITE
	    else if (nameconflict == NAMECONFLICT_OVERWRITE) file.delete();
	}

	setACL(pageContext, file, acl);
	try {
	    if (output instanceof InputStream) {
		IOUtil.copy((InputStream) output, file, false);
	    }
	    else if (Decision.isCastableToBinary(output, false)) {
		IOUtil.copy(new ByteArrayInputStream(Caster.toBinary(output)), file, true);
	    }
	    else {
		String content = Caster.toString(output);
		if (fixnewline) content = doFixNewLine(content);
		if (addnewline) content += SystemUtil.getOSSpecificLineSeparator();

		IOUtil.write(file, content, CharsetUtil.toCharset(charset), false);

	    }
	}
	catch (UnsupportedEncodingException e) {
	    throw new ApplicationException("Unsupported Charset Definition [" + charset + "]", e.getMessage());
	}
	catch (IOException e) {

	    throw new ApplicationException("can't write file " + file.getAbsolutePath(), e.getMessage());
	}
	setMode(file, mode);
	setAttributes(file, attributes);
    }
846089
private void doUpdateJavaCFX() throws PageException {
	String name = getString("admin", action, "name");
	if (StringUtil.startsWithIgnoreCase(name, "cfx_")) name = name.substring(4);
	lucee.runtime.db.ClassDefinition cd = new ClassDefinitionImpl(getString("admin", action, "class"), getString("bundleName", null), getString("bundleVersion", null),
		config.getIdentification());
	admin.updateJavaCFX(name, cd);
	store();
	adminSync.broadcast(attributes, config);
    }
452210
public static String call(PageContext pc, Object object) throws PageException {
	return call(pc, object, null, true, 9999, null, null, null, null, 9999, true, true);
    }
488393
@Override
	public void nextPage() {
		if (!paged) {			
			this.firstPage();
			paged = true;
		} else if (!isLast()) {
			offset = (getPageNumber() + 1) * pageSize;

			execute();
		}
	}