Package step.plugins.compare
Class DocumentCompareServices
- java.lang.Object
-
- step.framework.server.AbstractServices<step.core.access.User>
-
- step.core.deployment.AbstractStepServices
-
- step.plugins.compare.DocumentCompareServices
-
- Direct Known Subclasses:
ImageCompareServices
,PdfTestServices
@Singleton public abstract class DocumentCompareServices extends step.core.deployment.AbstractStepServices
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
DocumentCompareServices.LanguageEntity
static class
DocumentCompareServices.TestScenarioOutput
static class
DocumentCompareServices.TestScenarioOutputError
-
Field Summary
Fields Modifier and Type Field Description protected CompareScenarioServices
compareScenarioServices
protected AbstractDocumentToImageService
docToImageServices
protected step.attachments.FileResolver
fileResolver
protected step.core.miscellaneous.ReportNodeAttachmentManager
reportNodeAttachmentManager
protected CompareSessionServices
sessionServices
-
Constructor Summary
Constructors Constructor Description DocumentCompareServices()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.String
extractRegionText(java.lang.String sessionid, java.lang.String lang, RegionDefinion regionDef)
jakarta.ws.rs.core.Response
getDocumentPageAsImage(java.lang.String sessionid, java.lang.Integer pageid)
protected abstract AbstractExtractionService
getExtractionService()
Dimension
getPageDimensionInPt(java.lang.String sessionid, java.lang.Integer pageid)
java.util.Set<java.lang.Integer>
getPageIdsWithAnchors(java.lang.String sessionId)
java.lang.String
getPdfFilename(java.lang.String sessionid)
java.lang.Integer
getPdfPageCount(java.lang.String sessionid)
Scenario
getScenario(java.lang.String sessionid)
protected abstract java.lang.String
getScenarioDirProperty()
protected abstract java.io.File
getSessionDir(java.lang.String sessionid)
protected abstract DocumentCompareServices.LanguageEntity
getSupportedLanguages()
DocumentCompareServices.LanguageEntity
getSupportedLanguages(java.lang.String sessionid)
protected java.io.File
getWorkingDir()
protected abstract java.lang.String
getWorkingDirPath()
void
init()
protected abstract void
initDocToImageService()
void
loadDocument(java.lang.String sessionId, java.lang.String filename)
void
saveScenario(java.lang.String sessionid, Scenario scenario)
DocumentCompareServices.TestScenarioOutput
testScenario(java.lang.String sessionId, java.lang.String lang, Scenario.TestScenario testScenario)
-
Methods inherited from class step.core.deployment.AbstractStepServices
checkRightsOnBehalfOf, getAuthorizationManager, getContext, getExecutionRunnable, getObjectEnricher, getObjectFilter, getScheduler
-
-
-
-
Field Detail
-
compareScenarioServices
protected CompareScenarioServices compareScenarioServices
-
sessionServices
protected CompareSessionServices sessionServices
-
docToImageServices
protected AbstractDocumentToImageService docToImageServices
-
reportNodeAttachmentManager
protected step.core.miscellaneous.ReportNodeAttachmentManager reportNodeAttachmentManager
-
fileResolver
protected step.attachments.FileResolver fileResolver
-
-
Method Detail
-
getScenarioDirProperty
protected abstract java.lang.String getScenarioDirProperty()
-
initDocToImageService
protected abstract void initDocToImageService()
-
getExtractionService
protected abstract AbstractExtractionService getExtractionService()
-
getSessionDir
protected abstract java.io.File getSessionDir(java.lang.String sessionid)
-
getWorkingDirPath
protected abstract java.lang.String getWorkingDirPath()
-
init
@PostConstruct public void init() throws java.lang.Exception
- Overrides:
init
in classstep.core.deployment.AbstractStepServices
- Throws:
java.lang.Exception
-
loadDocument
@POST @Path("/session/{sessionid}/load") public void loadDocument(@PathParam("sessionid") java.lang.String sessionId, @QueryParam("filename") java.lang.String filename) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getPageIdsWithAnchors
@GET @Produces("application/json") @Path("/scenario/{sessionid}/pagesIdsWithAnchors") public java.util.Set<java.lang.Integer> getPageIdsWithAnchors(@PathParam("sessionid") java.lang.String sessionId) throws java.lang.Exception
- Throws:
java.lang.Exception
-
testScenario
@POST @Consumes("application/json") @Produces("application/json") @Path("/scenario/{sessionid}/test") public DocumentCompareServices.TestScenarioOutput testScenario(@PathParam("sessionid") java.lang.String sessionId, @QueryParam("lang") java.lang.String lang, Scenario.TestScenario testScenario) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getWorkingDir
protected java.io.File getWorkingDir()
-
getDocumentPageAsImage
@GET @Path("/doc/{sessionid}/page/{pageid}") @Produces("application/octet-stream") public jakarta.ws.rs.core.Response getDocumentPageAsImage(@PathParam("sessionid") java.lang.String sessionid, @PathParam("pageid") java.lang.Integer pageid)
-
extractRegionText
@POST @Path("/doc/{sessionid}/zone/text") @Consumes("application/json") @Produces("text/plain") public java.lang.String extractRegionText(@PathParam("sessionid") java.lang.String sessionid, @QueryParam("lang") java.lang.String lang, RegionDefinion regionDef) throws java.lang.Exception
- Throws:
java.lang.Exception
-
saveScenario
@POST @Path("/doc/{sessionid}/scenario") @Consumes("application/json") public void saveScenario(@PathParam("sessionid") java.lang.String sessionid, Scenario scenario) throws java.io.IOException
- Throws:
java.io.IOException
-
getScenario
@GET @Path("/doc/{sessionid}/scenario") @Consumes("application/json") @Produces("application/json") public Scenario getScenario(@PathParam("sessionid") java.lang.String sessionid) throws java.io.IOException
- Throws:
java.io.IOException
-
getPdfPageCount
@GET @Path("/doc/{sessionid}/pagecount") public java.lang.Integer getPdfPageCount(@PathParam("sessionid") java.lang.String sessionid) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getPageDimensionInPt
@GET @Path("/doc/{sessionid}/doc/page/{pageid}/dimension") public Dimension getPageDimensionInPt(@PathParam("sessionid") java.lang.String sessionid, @PathParam("pageid") java.lang.Integer pageid) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getPdfFilename
@GET @Produces("text/plain") @Path("/doc/{sessionid}/doc/filename") public java.lang.String getPdfFilename(@PathParam("sessionid") java.lang.String sessionid)
-
getSupportedLanguages
protected abstract DocumentCompareServices.LanguageEntity getSupportedLanguages()
-
getSupportedLanguages
@GET @Path("/doc/supportedLanguages") public DocumentCompareServices.LanguageEntity getSupportedLanguages(@PathParam("sessionid") java.lang.String sessionid)
-
-