@throws PageException
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 + "]");
    }
927764
protected void init() throws JspException {

        // initialize OpenCms access objects
        m_controller = CmsFlexController.getController(pageContext.getRequest());
        m_cms = m_controller.getCmsObject();

        try {
            // get the resource name from the selected container
            m_element = OpenCms.getADEManager().getCurrentElement(pageContext.getRequest());
            m_element.initResource(m_cms);
            if (m_cms.getRequestContext().getCurrentProject().isOnlineProject()
                && !m_element.isReleasedAndNotExpired()) {
                throw new CmsException(
                    Messages.get().container(
                        Messages.ERR_RESOURCE_IS_NOT_RELEASE_OR_EXPIRED_1,
                        m_element.getResource().getRootPath()));
            }
            if (m_locale == null) {
                // no locale set, use locale from users request context
                m_locale = m_cms.getRequestContext().getLocale();
            }

            // load content and store it
            CmsJspContentAccessBean bean;
            if ((m_element.isInMemoryOnly() || m_element.isTemporaryContent())
                && (m_element.getResource() instanceof CmsFile)) {
                I_CmsXmlDocument xmlContent = CmsXmlContentFactory.unmarshal(
                    m_cms,
                    m_element.getResource(),
                    pageContext.getRequest());
                bean = new CmsJspContentAccessBean(m_cms, m_locale, xmlContent);
            } else {
                bean = new CmsJspContentAccessBean(m_cms, m_locale, m_element.getResource());
            }
            storeAttribute(getVar(), bean);

            if (m_value != null) {
                // if the optional "val" parameter has been set, store the value map of the content in the page context scope
                storeAttribute(getVal(), bean.getValue());
            }

            if (m_rdfa != null) {
                // if the optional "rdfa" parameter has been set, store the rdfa map of the content in the page context scope
                storeAttribute(getRdfa(), bean.getRdfa());
            }

        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
            m_controller.setThrowable(e, m_cms.getRequestContext().getUri());
            throw new JspException(e);
        }
    }
220893
protected void showErrorPage(Object editor, Exception exception) throws JspException {

        // save initialized instance of the editor class in request attribute for included sub-elements
        getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, editor);

        // reading of file contents failed, show error dialog
        setAction(ACTION_SHOW_ERRORMESSAGE);
        setParamTitle(key(Messages.GUI_TITLE_EDIT_1, new Object[] {CmsResource.getName(getParamResource())}));
        if (exception != null) {
            getJsp().getRequest().setAttribute(ATTRIBUTE_THROWABLE, exception);
            if (CmsLog.getLog(editor).isWarnEnabled()) {
                CmsLog.getLog(editor).warn(exception.getLocalizedMessage(), exception);
            }
        }
        // include the common error dialog
        getJsp().include(FILE_DIALOG_SCREEN_ERRORPAGE);
    }
277855
private void doGetDefaultPassword() throws PageException {
	Password password = admin.getDefaultPassword();

	pageContext.setVariable(getString("admin", action, "returnVariable"), password == null ? "" : password.getPassword());
    }
1304157
private void doGetTLDs() throws PageException {
	lucee.runtime.type.Query qry = new QueryImpl(
		new String[] { "displayname", "namespace", "namespaceseparator", "shortname", "type", "description", "uri", "elclass", "elBundleName", "elBundleVersion",
			"source" },
		new String[] { "varchar", "varchar", "varchar", "varchar", "varchar", "varchar", "varchar", "varchar", "varchar", "varchar", "varchar" }, 0, "tlds");

	int dialect = "lucee".equalsIgnoreCase(getString("dialect", "cfml")) ? CFMLEngine.DIALECT_LUCEE : CFMLEngine.DIALECT_CFML;

	TagLib[] libs = config.getTLDs(dialect);
	for (int i = 0; i < libs.length; i++) {
	    qry.addRow();
	    qry.setAt("displayname", i + 1, libs[i].getDisplayName());
	    qry.setAt("namespace", i + 1, libs[i].getNameSpace());
	    qry.setAt("namespaceseparator", i + 1, libs[i].getNameSpaceSeparator());
	    qry.setAt("shortname", i + 1, libs[i].getShortName());
	    qry.setAt("type", i + 1, libs[i].getType());
	    qry.setAt("description", i + 1, libs[i].getDescription());
	    qry.setAt("uri", i + 1, Caster.toString(libs[i].getUri()));
	    qry.setAt("elclass", i + 1, libs[i].getELClassDefinition().getClassName());
	    qry.setAt("elBundleName", i + 1, libs[i].getELClassDefinition().getName());
	    qry.setAt("elBundleVersion", i + 1, libs[i].getELClassDefinition().getVersionAsString());
	    qry.setAt("source", i + 1, StringUtil.emptyIfNull(libs[i].getSource()));
	}
	pageContext.setVariable(getString("admin", action, "returnVariable"), qry);
    }
983888
public void setType(String type) throws PageException {
	if (type == null) return;
	try {
	    this.type = toType(type);
	}
	catch (SearchException e) {
	    throw Caster.toPageException(e);
	}
    }
119780
private void doResetPassword() throws PageException {
	try {
	    admin.removePassword(getString("contextPath", null));
	}
	catch (Exception e) {
	    SystemOut.printDate(e);
	}
	store();
    }
478944
private void doSecurityManager() throws PageException {
	String rtnVar = getString("admin", action, "returnVariable");
	String secType = getString("admin", action, "sectype");
	String secValue = getString("secvalue", null);
	boolean isServer = config instanceof ConfigServer;

	if (secValue == null) {
	    if (isServer) {
		pageContext.setVariable(rtnVar, SecurityManagerImpl.toStringAccessValue(SecurityManager.VALUE_YES));
	    }
	    else {
		pageContext.setVariable(rtnVar, SecurityManagerImpl.toStringAccessValue(config.getSecurityManager().getAccess(secType)));
	    }
	    return;
	}
	pageContext.setVariable(rtnVar, Caster.toBoolean(isServer || config.getSecurityManager().getAccess(secType) == SecurityManagerImpl.toShortAccessValue(secValue)));
    }
236193
private void doGetAll() throws PageException {
	if (name == null) throw new ApplicationException("attribute name is required for tag registry, when action is [getAll]");

	try {
	    RegistryEntry[] entries = RegistryQuery.getValues(branch, type);
	    if (entries != null) {
		lucee.runtime.type.Query qry = new QueryImpl(new String[] { "entry", "type", "value" }, new String[] { "VARCHAR", "VARCHAR", "OTHER" }, entries.length, "query");
		for (int i = 0; i < entries.length; i++) {
		    RegistryEntry e = entries[i];
		    int row = i + 1;
		    qry.setAt(KeyConstants._entry, row, e.getKey());
		    qry.setAt(KeyConstants._type, row, RegistryEntry.toCFStringType(e.getType()));
		    qry.setAt(KeyConstants._value, row, e.getValue());
		}

		// sort
		if (sort != null) {
		    String[] arr = sort.toLowerCase().split(",");
		    for (int i = arr.length - 1; i >= 0; i--) {
			String[] col = arr[i].trim().split("\\s+");
			if (col.length == 1) qry.sort(KeyImpl.init(col[0].trim()));
			else if (col.length == 2) {
			    String order = col[1].toLowerCase().trim();
			    if (order.equals("asc")) qry.sort(KeyImpl.init(col[0]), lucee.runtime.type.Query.ORDER_ASC);
			    else if (order.equals("desc")) qry.sort(KeyImpl.init(col[0]), lucee.runtime.type.Query.ORDER_DESC);
			    else throw new ApplicationException("invalid order type [" + col[1] + "]");
			}
		    }
		}

		pageContext.setVariable(name, qry);
	    }
	}
	catch (Exception e) {
	    throw Caster.toPageException(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);
    }
490932
public static String call(PageContext pc, Object var, boolean serializeQueryByColumns, String strCharset) throws PageException {
	Charset cs = StringUtil.isEmpty(strCharset) ? pc.getWebCharset() : CharsetUtil.toCharset(strCharset);
	return _call(pc, var, serializeQueryByColumns, cs);
    }
732953
private void doGet() throws PageException {
	// "HKEY_LOCAL_MACHINE\\SOFTWARE\\Google\\NavClient","installtime"
	if (entry == null) throw new ApplicationException("attribute entry is required for tag registry, when action is [get]");
	if (variable == null) throw new ApplicationException("attribute variable is required for tag registry, when action is [get]");
	// if(type==-1)throw new ApplicationException("attribute type is required for tag registry, when
	// action is [get]");

	try {
	    RegistryEntry re = RegistryQuery.getValue(branch, entry, type);
	    if (re != null) pageContext.setVariable(variable, re.getValue());
	}
	catch (Exception e) {
	    throw Caster.toPageException(e);
	}

    }
350491
public function pageAction()
    {
        if (!$this->action) {
            return;
        }

        $this->suppressView = true;
        $this->execPageAction($this->action, $this->params);
    }
649936
private void doUpdateComponent() throws PageException {

	admin.updateComponentDeepSearch(getBoolObject("admin", action, "deepSearch"));
	admin.updateBaseComponent(getString("admin", action, "baseComponentTemplateCFML"), getString("admin", action, "baseComponentTemplateLucee"));
	admin.updateComponentDumpTemplate(getString("admin", action, "componentDumpTemplate"));
	admin.updateComponentDataMemberDefaultAccess(getString("admin", action, "componentDataMemberDefaultAccess"));
	admin.updateTriggerDataMember(getBoolObject("admin", action, "triggerDataMember"));
	admin.updateComponentUseShadow(getBoolObject("admin", action, "useShadow"));
	admin.updateComponentDefaultImport(getString("admin", action, "componentDefaultImport"));
	admin.updateComponentLocalSearch(getBoolObject("admin", action, "componentLocalSearch"));
	admin.updateComponentPathCache(getBoolObject("admin", action, "componentPathCache"));
	store();
	adminSync.broadcast(attributes, config);
    }
762143
public void setColumns(String columns) throws PageException {
	this.columns = ListUtil.toStringArray(ListUtil.listToArrayRemoveEmpty(columns, ","));
    }
892827
public function init()
    {
        $this->initCommon();

        if (php_sapi_name() !== 'cli') {
            if (!Lb::app()->isAction()) {
                throw new HttpException(self::PAGE_NOT_FOUND, 404);
            }

            $this->initWebApp();
        } else {
            $this->initConsoleApp();
        }
    }
147113
private void doGetMailSetting() throws PageException {
	Struct sct = new StructImpl();
	pageContext.setVariable(getString("admin", action, "returnVariable"), sct);

	int maxThreads = 20;
	SpoolerEngine engine = config.getSpoolerEngine();
	if (engine instanceof SpoolerEngineImpl) {
	    maxThreads = ((SpoolerEngineImpl) engine).getMaxThreads();
	}

	sct.set("spoolEnable", Caster.toBoolean(config.isMailSpoolEnable()));
	sct.set("spoolInterval", Caster.toInteger(config.getMailSpoolInterval()));
	sct.set("maxThreads", Caster.toDouble(maxThreads));
	sct.set("timeout", Caster.toInteger(config.getMailTimeout()));
	sct.set("defaultencoding", config.getMailDefaultCharset().name());

    }