+++ /dev/null
-package org.collectionspace.services.common.servlet;
-
-import java.io.IOException;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * Servlet implementation class HelloServlet
- */
-public class PublishedResourcesServlet extends HttpServlet {
- private static final long serialVersionUID = 1L;
-
- /**
- * @see HttpServlet#HttpServlet()
- */
- public PublishedResourcesServlet() {
- super();
- }
-
- /**
- * @see Servlet#init(ServletConfig)
- */
- public void init(ServletConfig config) throws ServletException {
- super.init(config);
- }
-
- /**
- * @see Servlet#destroy()
- */
- public void destroy() {
- super.destroy();
- }
-
- /**
- * @see Servlet#getServletConfig()
- */
- public ServletConfig getServletConfig() {
- return super.getServletConfig();
- }
-
- /**
- * @see Servlet#getServletInfo()
- */
- public String getServletInfo() {
- return super.getServletInfo();
- }
-
- /**
- * @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response)
- */
- protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- super.service(request, response);
- }
-
- /**
- * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
- */
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- //super.doGet(request, response);
- response.setStatus(200);
- }
-
- /**
- * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
- */
- protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- super.doPost(request, response);
- }
-
- /**
- * @see HttpServlet#doPut(HttpServletRequest, HttpServletResponse)
- */
- protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- super.doPut(request, response);
- }
-
- /**
- * @see HttpServlet#doDelete(HttpServletRequest, HttpServletResponse)
- */
- protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- super.doDelete(request, response);
- }
-
- /**
- * @see HttpServlet#doHead(HttpServletRequest, HttpServletResponse)
- */
- protected void doHead(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- super.doHead(request, response);
- }
-
- /**
- * @see HttpServlet#doOptions(HttpServletRequest, HttpServletResponse)
- */
- protected void doOptions(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- super.doOptions(request, response);
- }
-
- /**
- * @see HttpServlet#doTrace(HttpServletRequest, HttpServletResponse)
- */
- protected void doTrace(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- super.doTrace(request, response);
- }
-
-}
public Response invokeReport(
ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
String csid,
- InvocationContext invContext) throws Exception {
+ InvocationContext invContext,
+ boolean isPublishing) throws Exception {
RepositoryInstance repoSession = null;
boolean releaseRepoSession = false;
repoClient.releaseRepositorySession(ctx, repoSession);
}
}
- return buildReportResponse(csid, params, reportFileName);
+ return buildReportResponse(csid, params, reportFileName, isPublishing);
}
- private Response buildReportResponse(String reportCSID, HashMap<String, Object> params, String reportFileName)
+ private Response buildReportResponse(String reportCSID, HashMap<String, Object> params, String reportFileName, boolean isPublishing)
throws Exception {
Connection conn = null;
Response response = null;
// export report to pdf and build a response with the bytes
byte[] pdfasbytes = JasperExportManager.exportReportToPdf(jasperprint);
+ if (isPublishing == tru) {
+
+ } else {
// Need to set response type for what is requested...
- response = Response.ok(pdfasbytes, "application/pdf").build();
+ response = Response.ok(pdfasbytes, "application/pdf").build();
+ }
return response;
} catch (SQLException sqle) {