Clean up unused code.

This commit is contained in:
jeb228 2010-10-13 20:20:11 +00:00
parent 579ce5fdd8
commit dfa7e6e2ea

View file

@ -45,9 +45,6 @@ public class LoginTemplateHelper extends LoginTemplateHelperBase {
public static final String BODY_ERROR_MESSAGE = "errorMessage"; public static final String BODY_ERROR_MESSAGE = "errorMessage";
public static final String BODY_CANCEL_URL = "cancelUrl"; public static final String BODY_CANCEL_URL = "cancelUrl";
/** If no portal is specified in the request, use this one. */
private static final int DEFAULT_PORTAL_ID = 1;
public LoginTemplateHelper(HttpServletRequest req) { public LoginTemplateHelper(HttpServletRequest req) {
super(req); super(req);
} }
@ -56,7 +53,6 @@ public class LoginTemplateHelper extends LoginTemplateHelperBase {
public String showLoginPage(HttpServletRequest request) { public String showLoginPage(HttpServletRequest request) {
VitroRequest vreq = new VitroRequest(request); VitroRequest vreq = new VitroRequest(request);
try { try {
State state = getCurrentLoginState(vreq); State state = getCurrentLoginState(vreq);
log.debug("State on exit: " + state); log.debug("State on exit: " + state);
@ -70,7 +66,7 @@ public class LoginTemplateHelper extends LoginTemplateHelperBase {
} }
} catch (Exception e) { } catch (Exception e) {
log.error(e); log.error(e);
return doTemplate(vreq, showError(request, e)); return doTemplate(vreq, showError(e));
} }
} }
@ -86,19 +82,18 @@ public class LoginTemplateHelper extends LoginTemplateHelperBase {
case LOGGED_IN: case LOGGED_IN:
return null; return null;
case FORCED_PASSWORD_CHANGE: case FORCED_PASSWORD_CHANGE:
//return doTemplate(vreq, showPasswordChangeScreen(vreq), body, config); // return doTemplate(vreq, showPasswordChangeScreen(vreq), body, config);
return showPasswordChangeScreen(vreq); return showPasswordChangeScreen(vreq);
default: default:
//return doTemplate(vreq, showLoginScreen(vreq), body, config); // return doTemplate(vreq, showLoginScreen(vreq), body, config);
return showLoginScreen(vreq); return showLoginScreen(vreq);
} }
} catch (Exception e) { } catch (Exception e) {
log.error(e); log.error(e);
return showError(vreq, e); return showError(e);
} }
} }
/** /**
* User is just starting the login process. Be sure that we have a * User is just starting the login process. Be sure that we have a
* {@link LoginProcessBean} with the correct status. Show them the login * {@link LoginProcessBean} with the correct status. Show them the login
@ -147,7 +142,7 @@ public class LoginTemplateHelper extends LoginTemplateHelperBase {
return trv; return trv;
} }
private TemplateResponseValues showError(HttpServletRequest request, Exception e) { private TemplateResponseValues showError(Exception e) {
TemplateResponseValues trv = new TemplateResponseValues( TemplateResponseValues trv = new TemplateResponseValues(
TEMPLATE_SERVER_ERROR); TEMPLATE_SERVER_ERROR);
trv.put(BODY_ERROR_MESSAGE, "Internal server error:<br /> " + e); trv.put(BODY_ERROR_MESSAGE, "Internal server error:<br /> " + e);
@ -155,8 +150,8 @@ public class LoginTemplateHelper extends LoginTemplateHelperBase {
} }
/** /**
* We processed a response, and want to show a template. * We processed a response, and want to show a template. Version for JSP
* Version for JSP page. * page.
*/ */
private String doTemplate(VitroRequest vreq, TemplateResponseValues values) { private String doTemplate(VitroRequest vreq, TemplateResponseValues values) {
// Set it up like FreeMarkerHttpServlet.doGet() would do. // Set it up like FreeMarkerHttpServlet.doGet() would do.
@ -171,7 +166,6 @@ public class LoginTemplateHelper extends LoginTemplateHelperBase {
return mergeMapToTemplate(values.getTemplateName(), body, config); return mergeMapToTemplate(values.getTemplateName(), body, config);
} }
/** /**
* Where are we in the process? Logged in? Not? Somewhere in between? * Where are we in the process? Logged in? Not? Somewhere in between?
*/ */
@ -213,16 +207,4 @@ public class LoginTemplateHelper extends LoginTemplateHelperBase {
String urlParams = "?login=block&cancel=true"; String urlParams = "?login=block&cancel=true";
return contextPath + "/authenticate" + urlParams; return contextPath + "/authenticate" + urlParams;
} }
/**
* What portal are we currently in?
*/
private String getPortalIdString(HttpServletRequest request) {
String portalIdParameter = request.getParameter("home");
if (portalIdParameter == null) {
return String.valueOf(DEFAULT_PORTAL_ID);
} else {
return portalIdParameter;
}
}
} }