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 classPdfTestServices.TestScenarioOutputstatic classPdfTestServices.TestScenarioOutputError
-
Field Summary
Fields Modifier and Type Field Description protected PdfExtractionServiceextractionServiceprotected step.attachments.FileResolverfileResolverprotected PdfTestScenarioServicespdfScenarioServicesprotected PdfToImageServicepdfToImageServicesprotected step.core.miscellaneous.ReportNodeAttachmentManagerreportNodeAttachmentManagerprotected PdfTestSessionServicessessionServices
-
Constructor Summary
Constructors Constructor Description PdfTestServices()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringextractRegionText(String sessionid, RegionDefinion regionDef)Set<Integer>getPageIdsWithAnchors(String sessionId)StringgetPdfFilename(String sessionid)javax.ws.rs.core.ResponsegetPdfPageAsImage(String sessionid, Integer pageid)IntegergetPdfPageCount(String sessionid)DimensiongetPdfPageCount(String sessionid, Integer pageid)ScenariogetScenario(String sessionid)protected FilegetWorkingDir()voidinit()voidloadPdf(String sessionId, String filename)voidsaveScenario(String sessionid, Scenario scenario)PdfTestServices.TestScenarioOutputtestScenario(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:
initin 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.JsonGenerationExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionIOException
-
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.JsonGenerationExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionIOException
-
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
-
-