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;
}
Aggregations