First cut of Orcid Integration is working
This commit is contained in:
parent
fb63559aa6
commit
1d7812ed28
11 changed files with 56 additions and 14 deletions
BIN
webapp/lib/cxf-xjc-runtime-2.6.2.jar
Normal file
BIN
webapp/lib/cxf-xjc-runtime-2.6.2.jar
Normal file
Binary file not shown.
BIN
webapp/lib/cxf-xjc-ts-2.6.2.jar
Normal file
BIN
webapp/lib/cxf-xjc-ts-2.6.2.jar
Normal file
Binary file not shown.
BIN
webapp/lib/fluent-hc-4.3.2.jar
Normal file
BIN
webapp/lib/fluent-hc-4.3.2.jar
Normal file
Binary file not shown.
Binary file not shown.
BIN
webapp/lib/httpclient-4.3.2.jar
Normal file
BIN
webapp/lib/httpclient-4.3.2.jar
Normal file
Binary file not shown.
Binary file not shown.
BIN
webapp/lib/httpcore-4.3.1.jar
Normal file
BIN
webapp/lib/httpcore-4.3.1.jar
Normal file
Binary file not shown.
BIN
webapp/lib/javax.json-1.0.4.jar
Normal file
BIN
webapp/lib/javax.json-1.0.4.jar
Normal file
Binary file not shown.
BIN
webapp/lib/javax.json-api-1.0.jar
Normal file
BIN
webapp/lib/javax.json-api-1.0.jar
Normal file
Binary file not shown.
|
@ -2,7 +2,7 @@
|
|||
|
||||
package edu.cornell.mannlib.vitro.webapp.controller.freemarker;
|
||||
|
||||
import static javax.mail.Message.RecipientType.*;
|
||||
import static javax.mail.Message.RecipientType.TO;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
|
@ -36,6 +36,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.TemplateProcessing
|
|||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Route;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ExceptionResponseValues;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ForwardResponseValues;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.NotAuthorizedResponseValues;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.RdfResponseValues;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.RedirectResponseValues;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
|
||||
|
@ -43,7 +44,6 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.Tem
|
|||
import edu.cornell.mannlib.vitro.webapp.email.FreemarkerEmailFactory;
|
||||
import edu.cornell.mannlib.vitro.webapp.email.FreemarkerEmailMessage;
|
||||
import edu.cornell.mannlib.vitro.webapp.freemarker.config.FreemarkerConfiguration;
|
||||
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.Tags;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.User;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.menu.MainMenu;
|
||||
|
@ -229,7 +229,9 @@ public class FreemarkerHttpServlet extends VitroHttpServlet {
|
|||
response.setStatus(statusCode);
|
||||
}
|
||||
|
||||
if (values instanceof ExceptionResponseValues) {
|
||||
if (values instanceof NotAuthorizedResponseValues) {
|
||||
doNotAuthorized(vreq, response, (NotAuthorizedResponseValues)values);
|
||||
} else if (values instanceof ExceptionResponseValues) {
|
||||
doException(vreq, response, values);
|
||||
} else if (values instanceof TemplateResponseValues) {
|
||||
doTemplate(vreq, response, values);
|
||||
|
@ -247,6 +249,14 @@ public class FreemarkerHttpServlet extends VitroHttpServlet {
|
|||
}
|
||||
}
|
||||
|
||||
private void doNotAuthorized(VitroRequest vreq,
|
||||
HttpServletResponse response, NotAuthorizedResponseValues values) {
|
||||
// This method does a redirect if the required authorizations are
|
||||
// not met (and they won't be), so just return.
|
||||
isAuthorizedToDisplayPage(vreq, response, values.getUnauthorizedAction());
|
||||
return;
|
||||
}
|
||||
|
||||
protected void doTemplate(VitroRequest vreq, HttpServletResponse response,
|
||||
ResponseValues values) throws TemplateProcessingException {
|
||||
|
||||
|
@ -548,4 +558,5 @@ public class FreemarkerHttpServlet extends VitroHttpServlet {
|
|||
// to set up the data model.
|
||||
new FreemarkerComponentGenerator(request);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
||||
|
||||
/**
|
||||
* This allows processRequest() in sub-classes of FreemarkerHttpServlet to
|
||||
* decide that the request is not authorized, and properly handle the
|
||||
* redirection.
|
||||
*/
|
||||
public class NotAuthorizedResponseValues extends BaseResponseValues {
|
||||
/**
|
||||
* If logging is turned on, this will be written to the log as a reason for
|
||||
* rejecting the servlet.
|
||||
*/
|
||||
private final String logMessage;
|
||||
|
||||
public NotAuthorizedResponseValues(String logMessage) {
|
||||
this.logMessage = logMessage;
|
||||
}
|
||||
|
||||
public RequestedAction getUnauthorizedAction() {
|
||||
return new RequestedAction() {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Servlet not authorized: " + logMessage;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue