Package step.plugins.pdftest
Class PdfTestServices
- java.lang.Object
-
- step.core.deployment.AbstractServices
-
- step.plugins.pdftest.PdfTestServices
-
@Singleton @Path("/pdftest") public class PdfTestServices extends step.core.deployment.AbstractServices
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PdfTestServices.TestScenarioOutput
static class
PdfTestServices.TestScenarioOutputError
-
Field Summary
Fields Modifier and Type Field Description protected PdfExtractionService
extractionService
protected step.attachments.FileResolver
fileResolver
protected PdfTestScenarioServices
pdfScenarioServices
protected PdfToImageService
pdfToImageServices
protected step.core.miscellaneous.ReportNodeAttachmentManager
reportNodeAttachmentManager
protected PdfTestSessionServices
sessionServices
-
Constructor Summary
Constructors Constructor Description PdfTestServices()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
extractRegionText(String sessionid, RegionDefinion regionDef)
Set<Integer>
getPageIdsWithAnchors(String sessionId)
String
getPdfFilename(String sessionid)
javax.ws.rs.core.Response
getPdfPageAsImage(String sessionid, Integer pageid)
Integer
getPdfPageCount(String sessionid)
Dimension
getPdfPageCount(String sessionid, Integer pageid)
Scenario
getScenario(String sessionid)
protected File
getWorkingDir()
void
init()
void
loadPdf(String sessionId, String filename)
void
saveScenario(String sessionid, Scenario scenario)
PdfTestServices.TestScenarioOutput
testScenario(String sessionId, Scenario.TestScenario testScenario)
-
-
-
Field Detail
-
extractionService
protected PdfExtractionService extractionService
-
pdfScenarioServices
protected PdfTestScenarioServices pdfScenarioServices
-
sessionServices
protected PdfTestSessionServices sessionServices
-
pdfToImageServices
protected PdfToImageService pdfToImageServices
-
reportNodeAttachmentManager
protected step.core.miscellaneous.ReportNodeAttachmentManager reportNodeAttachmentManager
-
fileResolver
protected step.attachments.FileResolver fileResolver
-
-
Method Detail
-
init
@PostConstruct public void init() throws Exception
- Overrides:
init
in classstep.core.deployment.AbstractServices
- Throws:
Exception
-
loadPdf
@POST @Path("/session/{sessionid}/load") public void loadPdf(@PathParam("sessionid") String sessionId, @QueryParam("filename") String filename) throws Exception
- Throws:
Exception
-
getPageIdsWithAnchors
@GET @Path("/scenario/{sessionid}/pagesIdsWithAnchors") public Set<Integer> getPageIdsWithAnchors(@PathParam("sessionid") String sessionId) throws Exception
- Throws:
Exception
-
testScenario
@POST @Path("/scenario/{sessionid}/test") public PdfTestServices.TestScenarioOutput testScenario(@PathParam("sessionid") String sessionId, Scenario.TestScenario testScenario) throws Exception
- Throws:
Exception
-
getWorkingDir
protected File getWorkingDir()
-
getPdfPageAsImage
@GET @Path("/pdf/{sessionid}/page/{pageid}") @Produces("application/octet-stream") public javax.ws.rs.core.Response getPdfPageAsImage(@PathParam("sessionid") String sessionid, @PathParam("pageid") Integer pageid) throws Exception
- Throws:
Exception
-
extractRegionText
@POST @Path("/pdf/{sessionid}/zone/text") @Consumes("application/json") public String extractRegionText(@PathParam("sessionid") String sessionid, RegionDefinion regionDef) throws Exception
- Throws:
Exception
-
saveScenario
@POST @Path("/pdf/{sessionid}/scenario") @Consumes("application/json") public void saveScenario(@PathParam("sessionid") String sessionid, Scenario scenario) throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, IOException
- Throws:
com.fasterxml.jackson.core.JsonGenerationException
com.fasterxml.jackson.databind.JsonMappingException
IOException
-
getScenario
@GET @Path("/pdf/{sessionid}/scenario") @Consumes("application/json") public Scenario getScenario(@PathParam("sessionid") String sessionid) throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, IOException
- Throws:
com.fasterxml.jackson.core.JsonGenerationException
com.fasterxml.jackson.databind.JsonMappingException
IOException
-
getPdfPageCount
@GET @Path("/pdf/{sessionid}/pagecount") public Integer getPdfPageCount(@PathParam("sessionid") String sessionid) throws Exception
- Throws:
Exception
-
getPdfPageCount
@GET @Path("/pdf/{sessionid}/pdf/page/{pageid}/dimension") public Dimension getPdfPageCount(@PathParam("sessionid") String sessionid, @PathParam("pageid") Integer pageid) throws Exception
- Throws:
Exception
-
-