Search in sources :

Example 1 with DeprecatedException

use of lucee.runtime.exp.DeprecatedException in project Lucee by lucee.

the class Admin method doStartTag.

@Override
public int doStartTag() throws PageException {
    config = (ConfigImpl) pageContext.getConfig();
    // Action
    Object objAction = attributes.get(KeyConstants._action);
    if (objAction == null)
        throw new ApplicationException("missing attrbute action for tag admin");
    action = StringUtil.toLowerCase(Caster.toString(objAction)).trim();
    // Generals
    if (action.equals("buildbundle")) {
        doBuildBundle();
        return SKIP_BODY;
    }
    if (action.equals("readbundle")) {
        doReadBundle();
        return SKIP_BODY;
    }
    if (action.equals("getlocales")) {
        doGetLocales();
        return SKIP_BODY;
    }
    if (action.equals("gettimezones")) {
        doGetTimeZones();
        return SKIP_BODY;
    }
    if (action.equals("printdebug")) {
        throw new DeprecatedException("action [printdebug] is no longer supported, use instead [getdebugdata]");
    }
    if (action.equals("getdebugdata")) {
        doGetDebugData();
        return SKIP_BODY;
    }
    if (action.equals("adddump")) {
        doAddDump();
        return SKIP_BODY;
    }
    if (action.equals("getloginsettings")) {
        doGetLoginSettings();
        return SKIP_BODY;
    }
    // Type
    type = toType(getString("type", "web"), true);
    // has Password
    if (action.equals("haspassword")) {
        boolean hasPassword = type == TYPE_WEB ? pageContext.getConfig().hasPassword() : pageContext.getConfig().hasServerPassword();
        pageContext.setVariable(getString("admin", action, "returnVariable", true), Caster.toBoolean(hasPassword));
        return SKIP_BODY;
    } else // update Password
    if (action.equals("updatepassword")) {
        try {
            ((ConfigWebImpl) pageContext.getConfig()).updatePassword(type != TYPE_WEB, getString("oldPassword", null), getString("admin", action, "newPassword", true));
        } catch (Exception e) {
            throw Caster.toPageException(e);
        }
        return SKIP_BODY;
    }
    try {
        _doStartTag();
    } catch (IOException e) {
        throw Caster.toPageException(e);
    }
    return Tag.SKIP_BODY;
}
Also used : DeprecatedException(lucee.runtime.exp.DeprecatedException) ApplicationException(lucee.runtime.exp.ApplicationException) IOException(java.io.IOException) 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)

Aggregations

IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 ApplicationException (lucee.runtime.exp.ApplicationException)1 DeprecatedException (lucee.runtime.exp.DeprecatedException)1 PageException (lucee.runtime.exp.PageException)1 SecurityException (lucee.runtime.exp.SecurityException)1 SMTPException (lucee.runtime.net.mail.SMTPException)1 BundleException (org.osgi.framework.BundleException)1