Quantcast
Channel: Developers Guide – Ephesoft WIKI
Viewing all 1237 articles
Browse latest View live

Scripting Guide

$
0
0

Scripting functionality in Ephesoft is supported where a custom requirement can be handled. Ephesoft includes power to perform custom functionality during different stages of batch processing. This functionality is supported through the scripts present inside batch class folder in Scripts folder. These scripts are Java scripts which access batch.xml through two techniques: DOM Parser and JDOM Parser. All the scripts present should be developed using one of the earlier mentioned parser only.

Batch Instance Group Feature

This feature is used to provide the roles on the batch instance. If user role have an access to batch instance using batch instance group feature than that batch will display on the BatchList screen. User will able to review/validate the same batch instance.

For this feature we are introduced the new database table “batch_instance_groups” for storing the batch instance identifier and user roles. This table stores all the mapped user roles with the batch instances.

Database Structure:

BatchInstanceGroupDb

Method for assigning roles in batch instance group table:

public void assignedBatchInstanceGroup(String batchInstanceIdentifier, String userRole) throws DCMAException

Configurable parameters:

BatchInstanceGroupParams

Example file: ScriptDocumentAssembler_BatchInstanceGroupFeature.java

Force Review Feature

The following is the implementation of the ForceReview feature:

  1. A new tag is added to the batch.xml for any document level field by the name ForceReview. Assumption: This “ForceReview“ tag will come into play only if the document containing it is invalid.
  2. This tag is not mandatory. If it does not exist(or the value of it is not “true”) for a document level field, the functionality will work as earlier.
  3. When this batch opens on the RV Screen, and this tag is found with a value “true” (for an invalid document):
    1. Before the user saves the document once(by pressing CTRL+s/S or CTRL+q/Q) this field will appear RED(irrespective of REGEX validation).
    2. Once the user presses CTRL+s/S or CTRL+q/Q on a certain field, we will make the value of the tag forceReview “False” for that field and the field will now get validated according to the earlier functionality (REGEX validation).

It is expected that it will be the responsibility of the script to handle the setting of the ForceReview tag in sync with the document validity setting.

The ForceReview tag of a field will not make a document invalid. It will only prevent a document level field from getting validated(in a document in an invalid state) if set to true.

This ForceReview tag won’t exist by default(before validation).

Provided is a sample script for the generation of this ForceReview tag(or modifying it if it is already present) with a value “true” for every alternate(note the i+=2 in the script) document level field encountered in a batch.xml.

Example file: Force_Review_Feature_SampleScript.java

ScriptAddNewTable.java

The Add New Table script is useful for being able to generate a predefined table on the fly in the Validation view.

Example Scenario:

If you are processing invoice documents and have defined table extraction during the normal means, it is still possible that if the document is of poor image quality the table you have defined for extraction may not be detected, or may be incomplete. In this case, you can use the Add New Table script to automatically generate a table for your invoice document type with the click of a button. You could create a new empty table of your required structure, or even a populated one… using other extracted values from the documents fields to populate the table values from a database table.

Example file: ScriptAddNewTable.java

ScriptAutomaticValidation.java

The Automatic Validation script is executed in the Ephesoft Batch Class work flow prior to reaching the Validation stage. This is the opportune time to implement any custom logic you may require by running verification against the values that have been extracted for the fields defined.

Example Scenario:

You may wish you to retrieve the extracted value from one field, perhaps a Social Security Number, and use it to perform a look-up operation to an external database, retrieving an associated name. You could then in turn us the results of these SQL query to populate the values of other document level fields defined in Ephesoft.

Example location: {Ephesoft_install_directory}\SharedFolders\BC1\scripts

Example file: ScriptAutomaticValidation.java

ScriptDocumentAssembler.java

The Document Assembler script is executed in the Ephesoft Batch Class work flow following the Page Processing Module, and Prior to reaching the Document Review stage. At this point the batch .xml has undergone Ephesoft’s classification routines and the batch’s contents are structured into documents, with confidence scores assigned. However, perhaps you have a unique situation where the default Ephesoft classification behavior alone will not organize your batch’s documents as your require. This script is the ideal location to implement any logic to customize the classification organization of your batch. Although Document Level Fields are not yet present in the batch .xml at this point, page level fields are making Script

Example Scenario:

You may be using cover sheets to aid in the classification accuracy for your documents. However by the time the work flow reaches the ScriptDocumentAssembler Ephesoft’s classification routines have already worked their magic and you may no longer have any use for the cover sheets. You can use this script to define some logic to remove the first page of every document, which in this case would be the cover sheets.

We’ve provided as an example resource, a script that does exactly this: ScriptDocumentAssembler_remove-1st-page.java

ScriptExport.java

The Export script is executed in the Ephesoft Batch Class work flow during the processing of the Export Module. At this point all of Ephesoft’s separation, classification, extraction, and validation have been performed and the batch is in the process of leaving the Ephesoft system. Consequently, ScriptExport.java is the ideal place to implement logic facilitating custom export requirements.

Example Scenario #1: As a batch is leaving the Ephesoft system, you may intend to import its .xml and image files into a document repository system. Your targeted system may have its own internal XML schema for describing its contents, and to make the transition a seamless one you want to consider applying an XSLT translation to the Ephesoft batch .xml so that it can be automatically imported and recognized by its destination system without manual effort.

Example Scenario #2: Perhaps you have a specific document management system such as FileBound in mind. FileBound uses Divider and Separator values to index its contents. Ephesoft provides a FileBound Plugin in the Export Module. However, in addition to this you can implement logic in the ScriptExport.java file to populate the batch documents’ divider and separator fields based on a captured extraction value, barcode, or other means. Through Ephesoft scripting you could use an extracted barcode value as a look up key in a SQL query to an external database table to retrieve the appropriate divider and separator values for a given document type.

Example location: {Ephesoft_install_directory}\SharedFolders\BC1\scripts

Example file: ScriptExport.java

ScriptExtraction.java

The Extraction script, although similar in sequence position to the ScriptAutomaticValidation.java, is useful for the purpose of separating extraction from validation.

Example Scenario:

Assume you have some OMR field extraction defined to extract check boxes denoting credit card type. For example there could three boxes total, signifying a choice of visa, american express, or mastercard. If filled out correctly the form should only have a check mark in one of the boxes. RecoStar OMR extraction will represent these three check boxes as a three character string of binary values, with the box containing a mark being represented by a “1” value (the others, “0”). Your Extraction script function could analyze the binary values to determine which of the three credit card vendors is being represented and set a document level field value to a string value of “visa”, “amex”, or “mastercard”.

Example location: {Ephesoft_install_directory}\SharedFolders\BC1\scripts

ScriptFieldValueChange.java

The Field Value Change script can be toggled through the Ephesoft Validation Module, and when enabled will fire when the value of a field is changed in the user Validation View. This can be extremely useful if you want to have the changes you make to one field automatically produce a change in value of one or more other fields.

Example Scenario #1:

Consider the case where you have a field that is of the drop down list type. This field contains a list of various departments within an organization (eg: HR, IT, etc). In addition to this field you have another drop down field that serves as a list of users. You can use the Field Change script to implement logic such that change the department value for field #1 will automatically update the drop down list of field #2 with users that correspond to that newly selected department.

Example Scenario #2:

Perhaps you have had a document arrive in Validation View with a loan number field that has been extracted, and some corresponding fields that contain information related to the loan number. However, consider if the loan number is incorrect, and your user manually needs to change it. Instead of having to also manually look up and change all of the corresponding fields, the Field Change Value script could make it so that changing the Loan Number field value automatically performs a look up operation to a database and populates the additional fields with the information on file for that loan number.

Example location: {Ephesoft_install_directory}\SharedFolders\BC1\scripts

Example file: ScriptFieldValueChange.java

FunctionKey.java

The Function Key script allows for multiple methods to be defined within the FunctionKey.java and have these individual methods bound to keys on the users keyboard to act as keyboard shortcuts for executing pieces of custom functionality.

Example Scenario:

Consider that you may have a default set of values for a given document type that you want the option to populate its fields with in Validation View at the push of a button. In FunctionKey.java you would implement a method to set the fields of that document type to a set of default values. In the Ephesoft Validation Module you can define the Function Key that you want to associate with this method. You must specify both the name of the function as well as the key that you wish you bind it to. Having done so you should now see the Function Key that you specified as an icon in the Validation View. The custom function key method can now be invoked by clicking this button or striking the specified key itself.

Example location: {Ephesoft_install_directory}\SharedFolders\BC1\scripts

Example file: ScriptFunctionKey.java

ScriptPageProcessing.java

The Page Processing script is useful for conducting operations on the XML representation of a batch’s pages before they have undergone classification and encapsulation into documents.

Example Scenario:

To reduce batch processing time it is possible to use ScriptPageProcessing to remove pages that are ‘garbarge’ and don’t contain valid OCR data. You could implement a function that would iterate through the collection of pages, and from each page element retrieve the corresponding OCR file (.html) and image file name. If the OCR data for the page is nonexistent, and the original image size is below a certain threshold you can deem the page to be junk and remove it from the batch .xml. By removing these useless pages your batch will be able to traverse the rest of the batch class workflow more efficiently and with an improved processing time.

Example location: {Ephesoft_install_directory}\SharedFolders\BC1\scripts

ScriptValidation.java

The Validation script differs from the Automatic Validation script in that it is run during the user Validation User Interface experience, where as Automatic Validation executes and performs custom validation steps immediately before the batch is presented to the user in the Validation UI. The benefit is this is that as the user is making changes to the document field values in the Valdiation UI, the Validation Script can be triggered to run after each change to ensure that the changes are put through custom validation processing requirements.

Example Scenario:

You may have some a document level field, AccountNum, where the value being extracted should correspond to an existing account number in an external database. Perhaps due to poor image quality, the OCR’d value for the account number is either incomplete or incorrect and so the document appears in Validation with its field highlighted in red. The user is able to see the corresponding image and keys in what they believe to the the account number appearing on the image, but you want to ensure that they haven’t made a mistake and what they are inputting is indeed a valid account number. In this case it is possible to implement a function that takes the value of the AccountNum field and performs a database look up to verify that the value does in fact exist. This check can run each time after the user has modified the AccountNum document field value and attempts to save their changes.

Example location: {Ephesoft_install_directory}\SharedFolders\BC1\scripts


extractKV

$
0
0

This API will extract the document level fields for the corresponding Key Value pattern provided using input XML. This API will take the HOCR file as input. If the Key Value pattern is not found in the HOCR file then it will create the empty document level fields.

Request Method POST

Input Parameters

Input Parameter Values Descriptions
AdvancedKV Either “true”/”false” This parameter is used to specifying the KeyValue extraction is perform by advanced key value or not.
LocationType This value should be one of the following:

TOP, RIGHT, LEFT, BOTTOM, TOP_RIGHT, TOP_LEFT, BOTTOM_LEFT, BOTTOM_RIGHT

 

This parameter will fetch the Value pattern of the particular key pattern on the location provided.
NoOfWords Should be Integer This parameter is used for specify in case of AdvancedKV is false. This parameter is used for adding number word of RIGHT location in the result of the value pattern found in the HOCR.
KeyPattern This value should not be empty.

This value should be valid regex expression.

 

This is used for verify the Key pattern present in given HOCR.
ValuePattern This value should not be empty.

This value should be valid regex expression.

 

This is used for verify the Value pattern present in given HOCR for that particular Key Pattern.
KVFetchValue This value should be one of the following:

ALL, FIRST, LAST

This parameter is used to specify the whether we need fetch all, first or last value pattern found.

 

 

Multiplier This value should be float and should be in between 0 to 1 This value is used to multiply with confidence for updating the confidence of the fields extracted using advanced KV.
Length This value should be integer For getting length value use Ephesoft Admin Screen as display screen shot above
Width This value should be integer For getting width value use Ephesoft Admin Screen as display screen shot above
Xoffset This value should be integer For getting xoffset value use Ephesoft Admin Screen as display screen shot above
Yoffset This value should be integer For getting yoffset value use Ephesoft Admin Screen as display screen shot above
Weight This value should be float and should be in between 0 to 1 This value is used to set the weightage for a extraction rule for a particular document level field.
KeyFuzziness This value should be float and should be in between 0 to 1 This value is used to define the acceptable fuzziness in the key generated from HOCR
hocrFileName This value should be string This value should be having HOCR file name passing for processing in XML file format.

Along these parameters hocrFileName string parameter is also to be supplied containing the name of the HOCR file uploaded.

Web Service URL: http://{serverName}:{port}/dcma/rest/extractKV

CheckList:

  • For using Advance KV user should have admin access to fetch the accurate value of Length, Width, Xoffset and Yoffset. Before using AdvancedKV, please test the image with Ephesoft Admin Screen and note the values of Length, Width, Xoffset, Yoffset and LocationType for the particular KeyValue pattern.
  • If AdvancedKV is true than NoOfWords is not use and all other parameters is used.
  • If AdvancedKV is false than NoOfWords, KeyPattern, ValuePattern and LocationType will work.

Format for XML:

<ExtractKVParams>

<Params>

<AdvancedKV>true</AdvancedKV>

<LocationType>BOTTOM_LEFT</LocationType>

<NoOfWords>0</NoOfWords>

<KeyPattern>Invoice</KeyPattern>

<ValuePattern> [a-zA-Z]{10,15}</ValuePattern>

<KVFetchValue>ALL</KVFetchValue>

<Multiplier>1</Multiplier>

<Length>384</Length>

<Width>251</Width>

<Xoffset>284</Xoffset>

<Yoffset>105</Yoffset>

<Weight>0.1</Weight>

<KeyFuzziness>0.2</KeyFuzziness>

</Params>

</ExtractKVParams>

 

Sample client code using apache commons http client:-

private static void extractKV() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/extractKV";
		PostMethod mPost = new PostMethod(url);
		// Adding XML for the input.
		File f1 = new File("C:\\sample\\ExtractKVParam.xml");
		// Adding HOCR for processing.
		File f2 = new File("C:\\sample\\US-Invoice_HOCR.xml");
		Part[] parts = new Part[3];
		try {
			parts[0] = new FilePart(f1.getName(), f1);
			parts[1] = new FilePart(f2.getName(), f2);
			parts[2] = new StringPart("hocrFileName", f2.getName());
			MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
			mPost.setRequestEntity(entity);
			int statusCode = client.executeMethod(mPost);
			if (statusCode == 200) {
				System.out.println("Web service executed successfully.");
				String responseBody = mPost.getResponseBodyAsString();
				// Generating result as responseBody.
				System.out.println(statusCode + " *** " + responseBody);
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password.");
			} else {
				System.out.println(mPost.getResponseBodyAsString());
			}
		} catch (FileNotFoundException e) {
			System.err.println("File not found for processing.");
		} catch (HttpException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (mPost != null) {
				mPost.releaseConnection();
			}
		}
	}	}

4030_Performance_Reports

Web Services API

$
0
0

Web Services API

Overview

This document gives detailed explanation of web services exposed by Ephesoft application.

Authenticated client calls code sample

Here is the code for making authenticated client calls via Ephesoft Web Services:-

Credentials defaultcreds = new UsernamePasswordCredentials(“username”, “password”);

client.getState().setCredentials(new AuthScope(“serverName”, 8080), defaultcreds);

client.getParams().setAuthenticationPreemptive(true);

List of API’s exposed in Ephesoft Product

Image Processing Web Service

createSearchablePDF

This API will generate the searchable pdf. It takes the input tif/tiff files and rsp file for processing. Input parameters will used to specify the output pdf is searchable or color.

Web Service urlhttp://{serverName}:{port}/dcma/rest/createSearchablePDF

Input Parameter
Value
Description
isColorImage
Either “true”/”false” Generates the color pdf if input image is color and value is “true”.
isSearchableImage
Either “true”/”false” Generates the searchable pdf if value is “true”.
outputPDFFileName
String value should ends with .pdf extension Output pdf file name generated using API.
ocrEngine
Engine used for OCRing-Nuance/Recostar Engine used for OCRing.
projectFile
String value should ends with .rsp extension RSP file used as recostar processing.

Checklist:

  1. Input only tiff, tif files for generating searchable pdf.
  2. RSP file is mandatory for generating the searchable pdf in case of Recostar.

Sample Input Used:

ephesoft-web-services\create-searchable-pdf.zip

Sample client code using apache commons http client:-

   private static void createSearchablePDF() {
   HttpClient client = new HttpClient();
   // URL for webservice of create searchable pdf
   String url = "http://localhost:8080/dcma/rest/createSearchablePDF";
   PostMethod mPost = new PostMethod(url);
   // adding file for sending</nowiki>
   // Adding tif images for processing
   File file1 = new File("C:\\sample\\sample1.tif");
   File file2 = new File("C:\\sample\\sample2.tif");
   File file3 = new File("C:\\sample\\sample3.tif");
   File file4 = new File("C:\\sample\\sample4.tif");
   // Adding rsp file for recostar for processing
   File file5 = new File("C:\\sample\\Fpr.rsp");
   Part[] parts = new Part[9];
   try {
           parts[0] = new FilePart(file1.getName(), file1);
           parts[1] = new FilePart(file2.getName(), file2);
           parts[2] = new FilePart(file3.getName(), file3);
           parts[3] = new FilePart(file4.getName(), file4);
           parts[4] = new FilePart(file5.getName(), file5);
           // adding parameter for color switch
           parts[5] = new StringPart("isColorImage", "false");
           // adding parameter for searchable switch
           parts[6] = new StringPart("isSearchableImage", "true");
           // adding parameter for outputPDFFileName
           parts[7] = new StringPart("outputPDFFileName", "OutputPDF.pdf");
           // adding parameter for projectFile
           parts[8] = new StringPart("projectFile", "Fpr.rsp");
           parts[9] = new StringPart("ocrEngine", "Recostar");
           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           mPost.setRequestEntity(entity);
           int statusCode = client.executeMethod(mPost);
           if (statusCode == 200) {
               InputStream inputStream = mPost.getResponseBodyAsStream();
               // output file path for saving result
               String outputFilePath = "C:\\sample\\serverOutput.zip";
               // retrieving the searchable pdf file
               File file = new File(outputFilePath);
               FileOutputStream fileOutputStream = new FileOutputStream(file);
               try {
                   byte[] buf = new byte[1024];
                   int len = inputStream.read(buf);
                   while (len > 0) {
                         fileOutputStream.write(buf, 0, len);
                         len = inputStream.read(buf);
                                   }
                          } finally {
                          if (fileOutputStream != null) {
                          fileOutputStream.close();
                           }
                           }
                           System.out.println("Web service executed successfully.");
                           } else if (statusCode == 403) {
                           System.out.println("Invalid username/password.");
                           } else {
                           System.out.println(mPost.getResponseBodyAsString());
                           }
                           } catch (FileNotFoundException e) {
                           System.err.println("File not found for processing.");
                           } catch (HttpException e) {
                            e.printStackTrace();
                           } catch (IOException e) {
                            e.printStackTrace();
                            } finally {
                              if (mPost != null) {
                              mPost.releaseConnection();
                            }
                            }
               }

convertTiffToPdf

This API will generates the pdf for the input tiffs. If 5 input tiffs are provided then 5 pdf will return using this api. This API will have following parameter for configuration.

Web Service URL : http://{serverName}:{port}/dcma/rest/convertTiffToPdf

Input Parameter
Value
Description
inputParams
This value can be empty. Reference for image magick parameter. http://www.imagemagick.org/script/command-line-options.php This are the image magick input parameters used for processing the input and output file.
outputParams
This value can be empty. Reference for image magick parameter. http://www.imagemagick.org/script/command-line-options.php This are the image magick output parameters used for optimizing the output file.
pdfGeneratorEngine
Either “IMAGE_MAGICK”/”ITEXT” This will used for pdf generator engine.

Checklist:

  1. Input only tiff, tif files for generating pdf.
  2. If pdfGeneratorEngine is “IMAGE_MAGICK”, than only input params and output params are works.
  3. If Input tiff is multipage tiff than single multipage pdf is generated as output.

Sample Input Used: ephesoft-web-services\convert-tiff-to-pdf.zip

Sample client code using apache commons http client:- privatestaticvoid convertTiffToPdf() {

       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/convertTiffToPdf";
       PostMethod mPost = new PostMethod(url);
       // adding image file for processing.
       File file1 = new File("C:\\sample\\sample1.tif");
       File file2 = new File("C:\\sample\\sample2.tif");
       Part[] parts = new Part[5];
       try {
           parts[0] = new FilePart(file1.getName(), file1);
           parts[1] = new FilePart(file2.getName(), file2);
           // adding parameter for input params
           parts[2] = new StringPart("inputParams", "");
           // adding parameter for output params
           parts[3] = new StringPart("outputParams", "");
           // adding parameter for pdfGeneratorEngine
           parts[4] = new StringPart("pdfGeneratorEngine", "IMAGE_MAGICK");
           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           mPost.setRequestEntity(entity);
           int statusCode = client.executeMethod(mPost);
           if (statusCode == 200) {
               System.out.println("Web service executed successfully..");
               InputStream in = mPost.getResponseBodyAsStream();
               // output file path for saving results.
               String outputFilePath = "C:\\sample\\serverOutput.zip";
               // retrieving the searchable pdf file
               File f = new File(outputFilePath);
               FileOutputStream fos = new FileOutputStream(f);
               try {
                   byte[] buf = newbyte[1024];
                   int len = in.read(buf);
                   while (len > 0) {
                       fos.write(buf, 0, len);
                       len = in.read(buf);
                   }
               } finally {
                   if (fos != null) {
                       fos.close();
                   }
               }
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password..");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }
       } catch (FileNotFoundException e) {
           System.err.println("File not found for processing.");
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (mPost != null) {
               mPost.releaseConnection();
           }
       }
   }

splitMultipageFile

This API will break the pdf and multipage tiff into single page tiff. This will used the image magick and ghost script for splitting the input file. This API will have following parameter for configuration.

Web Service URL : [ http://{serverName}:{port}/dcma/rest/splitMultipageFile]

Input Parameter
Value
Description
inputParams
For Image MagicK:

This value can be empty. Reference for image magick parameter. http://www.imagemagick.org/script/command-line-options.php

For Ghost Script:

This value should not be empty. Reference for ghost script input parameter : http://ghostscript.com/doc/8.54/Use.htm#Output_deviceThis parameter will used for both image magick and ghost script.

outputParams
For Image MagicK: This value can be empty. Reference for image magick parameter. http://www.imagemagick.org/script/command-line-options.phpThis are the image magick output parameters used for optimizing the output file.

isGhostscript
Either “true”/”false”This parameter is used to specified the weather ghost script is using for breaking the pdf/multipage tiff into single page tiff.Checklist:
  1. Input only tiff and pdf file only.
  2. If “isGhostscript” is “true”, than only input params will works and file only break PDF files.
  3. If “isGhostscript” is “false”, than input params and output params will works.

Sample Input Used:

ephesoft-web-services\split-multipage-file.zip

Sample client code using apache commons http client:-

privatestaticvoid splitMultiPageFile() {
       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/splitMultipageFile";
       PostMethod mPost = new PostMethod(url);
       File file1 = new File("C:\\sample\\sample.pdf");
       File file2 = new File("C:\\sample\\sample.tif");
       Part[] parts = new Part[5];
       try {
           parts[0] = new FilePart(file1.getName(), file1);
           parts[1] = new FilePart(file2.getName(), file2);
           parts[2] = new StringPart("inputParams", "gswin32c.exe -dNOPAUSE -r300 -sDEVICE=tiff12nc -dBATCH");
           parts[3] = new StringPart("isGhostscript", "true");
           parts[4] = new StringPart("outputParams", "");
           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           mPost.setRequestEntity(entity);
           int statusCode = client.executeMethod(mPost);
           if (statusCode == 200) {
               InputStream in = mPost.getResponseBodyAsStream();
               File file = new File("C:\\sample\\serverOutput.zip");
               FileOutputStream fos = new FileOutputStream(file);
               try {
                   byte[] buf = newbyte[1024];
                   int len = in.read(buf);
                   while (len > 0) {
                       fos.write(buf, 0, len);
                       len = in.read(buf);
                   }
               } finally {
                   if (fos != null) {
                       fos.close();
                   }
               }
               System.out.println("Web service executed successfully..");
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password..");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }
       } catch (FileNotFoundException e) {
           System.err.println("File not found for processing..");
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (mPost != null) {
               mPost.releaseConnection();
           }
       }
   }

createMultipageFile

This API will create the multipage tif/pdf using “Image MagicK”, “IText” and “GhostScript”. This API works only for tif/tiff files and provided XML file for input parameters. This API will have following parameter for configuration.

Web Service URLhttp://{serverName}:{port}/dcma/rest/createMultiPageFile

Input Parameter
Value
Description
imageProcessingAPI
Either “IMAGE_MAGICK” /”GHOSTSCRIPT”/”ITEXT” This parameter is used for generating pdf using image_magick , itext and ghost script.
pdfOptimizationParams
This value should not be empty. Reference for ghost script input parameter : http://ghostscript.com/doc/8.54/Use.htm#Output_device This are the ghost script output parameters used for optimizing the output file.
multipageTifSwitch
Either “ON”/”OFF” This parameter is used for generating multipage tif along with multipage pdf.
pdfOptimizationSwitch
Either “ON”/”OFF” This switch is used for generated optimized pdf.
ghostscriptPdfParameters
This value should not be empty. Reference for ghost script input parameter : http://ghostscript.com/doc/8.54/Use.htm#Output_device This are the ghost script parameter used for creating multipage pdf.

Checklist:

  1. Input only tiff file for processing and xml file for inputs.
  2. If “imageProcessingAPI” is “GHOSTSCRIPT”, than only ghostscriptPdfParameters will works.
  3. If “pdfOptimizationSwitch” is “ON”, than pdfOptimizationParams will works.

Sample Input Used:

ephesoft-web-services\ create-multipage-file.zip

Format for XML:

<WebServiceParams>

 <Params>
   <Param>
     <Name>imageProcessingAPI</Name>
     <Value>GHOSTSCRIPT</Value>
   </Param>
   <Param>
     <Name>pdfOptimizationSwitch</Name>
     <Value>on</Value>
   </Param>
  <Param>
        <Name>pdfOptimizationParams</Name>
        <Value>-q -dNODISPLAY -P- -dSAFER -dDELAYSAFER -- pdfopt.ps</Value>
   </Param>
   <Param>
     <Name>multipageTifSwitch</Name>
     <Value>on</Value>
   </Param>
  <Param>
     <Name>ghostscriptPdfParameters</Name>
     <Value>-dQUIET -dNOPAUSE -r300 -sDEVICE=pdfwrite -dBATCH</Value>
   </Param>
 </Params>

</WebServiceParams>

Sample client code using apache commons http client:-

privatestaticvoid createMultiPage() {
       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/createMultiPageFile";
       PostMethod mPost = new PostMethod(url);
       // Adding XML file for parameters
       File file1 = new File("C:\\sample\\WebServiceParams.xml");
       // Adding tif file for processing
       File file2 = new File("C:\\sample\\sample1.tif");
       File file3 = new File("C:\\sample\\sample2.tif");
       Part[] parts = new Part[3];
       try {
           parts[0] = new FilePart(file1.getName(), file1);
           parts[1] = new FilePart(file2.getName(), file2);
           parts[2] = new FilePart(file3.getName(), file3);
           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           mPost.setRequestEntity(entity);
           int statusCode = client.executeMethod(mPost);
           if (statusCode == 200) {
               InputStream inputStream = mPost.getResponseBodyAsStream();
               // Retrieving file from result
               File file = new File("C:\\sample\\serverOutput.zip");
               FileOutputStream fos = new FileOutputStream(file);
               try {
                   byte[] buf = newbyte[1024];
                   int len = inputStream.read(buf);
                   while (len > 0) {
                       fos.write(buf, 0, len);
                       len = inputStream.read(buf);
                   }
               } finally {
                   if (fos != null) {
                       fos.close();
                   }
               }
               System.out.println("Web service executed successfully..");
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password..");
           } else {
               System.out.println(statusCode + " *** " + mPost.getResponseBodyAsString());
           }
       } catch (FileNotFoundException e) {
           System.err.println("File not found for processing..");
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (mPost != null) {
               mPost.releaseConnection();
           }
       }
   }

Classification Web Service

classifyImage

This API classify the input image as per batch class identifier provided. This API will depend on the three plugin for completion “CREATE_THUMBNAILS_PLUGIN”, “CLASSIFY_IMAGES_PLUGIN” and “DOCUMENT_ASSEMBLER_PLUGIN”. If any batch class doesn’t have those plugin than classify image api will not work.

Web Service URLhttp://{serverName}:{port}/dcma/rest/classifyImage

Input Parameter
Value
Description
batchClassId
This value should not be empty and it should be batch class identifier as like BC1. This parameter is used for providing batch class identifier on which classify image will perform.

Sample Input Used:

ephesoft-web-services\classify-image.zip

Checklist:

  1. Input file should be single page tif/tiff file only.
  2. batchClassId should be valid batch class identifier and must have the “CREATE_THUMBNAILS_PLUGIN”, “CLASSIFY_IMAGES_PLUGIN” and “DOCUMENT_ASSEMBLER_PLUGIN”.

Sample client code using apache commons http client:-

privatestaticvoid classifyImage() {

       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/classifyImage";
       PostMethod mPost = new PostMethod(url);
       // Adding tif file for processing
       File file1 = new File("C:\\sample\\US-Invoice.tif");
       Part[] parts = new Part[2];
       try {
           parts[0] = new FilePart(file1.getName(), file1);
           // Adding parameter for batchClassId
           parts[1] = new StringPart("batchClassId", "BC1");
           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           mPost.setRequestEntity(entity);
           int statusCode = client.executeMethod(mPost);
           if (statusCode == 200) {
               System.out.println("Web service executed successfully..");
               String responseBody = mPost.getResponseBodyAsString();
               System.out.println(statusCode + " *** " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password..");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }
       } catch (FileNotFoundException e) {
           System.err.println("File not found for processing..");
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if(mPost != null) {
               mPost.releaseConnection();
           }
       }
   }

classifyHOCR

This API will classify the input HOCR as per batch class identifier provided. This API will depend on the following plugins “SEARCH_CLASSIFICATION_PLUGIN”, “DOCUMENT_ASSEMBLER_PLUGIN” and the learning done on the batch class. If any batch class doesn’t have those plugins than classify hocr will not work.

Web Service URL : [ http://{serverName}:{port}/dcma/rest/classifyHOCR]

Input Parameter
Value
Description
batchClassId
This value should not be empty and it should be batch class identifier as like BC1. This parameter is used for providing batch class identifier on which classify HOCR will perform.

Checklist:

  1. Input file should be html file only.
  2. batchClassId should be valid batch class identifier and must have the “SEARCH_CLASSIFICATION_PLUGIN” and “DOCUMENT_ASSEMBLER_PLUGIN”.

Sample Input Used:

ephesoft-web-services\classify-hocr.zip

Sample client code using apache commons http client:-

privatestaticvoid classifyHocr() {

       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/classifyHocr";
       PostMethod mPost = new PostMethod(url);
       // Adding HTML file for processing
       File file1 = new File("C:\\sample\\US-Invoice.html");
       Part[] parts = new Part[2];
       try {
           parts[0] = new FilePart(file1.getName(), file1);
           // Adding parameter for batchClassId
           parts[1] = new StringPart("batchClassId", "BC1");
           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           mPost.setRequestEntity(entity);
           int statusCode = client.executeMethod(mPost);
           if (statusCode == 200) {
               System.out.println("Web service executed successfully..");
               String responseBody = mPost.getResponseBodyAsString();
               System.out.println(statusCode + " *** " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password..");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }
       } catch (FileNotFoundException e) {
           System.err.println("File not found for processing..");
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (mPost != null) {
               mPost.releaseConnection();
           }
       }
   }

classifyMultiPageHOCR

This API will classify the input HOCR as per batch class identifier provided. This API will depend on the following plugins “SEARCH_CLASSIFICATION_PLUGIN”, “DOCUMENT_ASSEMBLER_PLUGIN” and the learning done on the batch class. If any batch class doesn’t have those plugins than classify hocr will not work.

Web Service URL : [ http://{serverName}:{port}/dcma/rest/classifyHOCR]

Input Parameter
Value
Description
batchClassId
This value should not be empty and it should be batch class identifier as like BC1. This parameter is used for providing batch class identifier on which classify HOCR will perform.

Checklist:

  1. Input file should be zip file containing HTML’s in it.
  2. batchClassId should be valid batch class identifier and must have the “SEARCH_CLASSIFICATION_PLUGIN” and “DOCUMENT_ASSEMBLER_PLUGIN”.

Sample client code using apache commons http client:-

privatestaticvoid classifyMultiPageHocr() {

HttpClient client = new HttpClient();

String url = “http://localhost:8080/dcma/rest/classifyMultiPageHocr“;

PostMethod mPost = new PostMethod(url);

// Adding ZIP file for processing

File file1 = new File(“D:\\sample\\New folder.zip”);

Part[] parts = new Part[2];

try {

parts[0] = new FilePart(file1.getName(), file1);

// Adding parameter for batchClassId

parts[1] = new StringPart(“batchClassId”, “BC1”);

MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());

mPost.setRequestEntity(entity);

int statusCode = client.executeMethod(mPost);

String responseBody = mPost.getResponseBodyAsString();

System.out.println(statusCode + “***” + responseBody);

mPost.releaseConnection();

catch (FileNotFoundException e) {

e.printStackTrace();

catch (HttpException e) {

e.printStackTrace();

catch (IOException e) {

e.printStackTrace();

}

}

classifyBarcodeImage

This API is used to classify the input image as per specified batch class. Image file should have barcode and barcode value should be document type which is present in the batch class.

Web Service URLhttp://{serverName}:{port}/dcma/rest/classifyBarcodeImage

Input Parameter
Value
Description
batchClassId
This value should not be empty and it should be batch class identifier as like BC1. This parameter is used for providing batch class identifier on which classify HOCR will perform.

Checklist:

  1. Input file should be tif/tiff file only.
  2. batchClassId should be valid batch class identifier and must have the “BARCODE_READER_PLUGIN” .

Sample client code using apache commons http client:-

privatestaticvoid classifyBarcodeImage(){
       HttpClient client = new HttpClient();
       String url = "http://locahost:8080/dcma/rest/classifyBarcodeImage";
       PostMethod mPost = new PostMethod(url);       
       // Adding image file for processing the barcode classification
       File file1 = new File("C:\\sample\\US-Invoice.tif");
       Part[] parts = new Part[2];
       try {
           parts[0] = new FilePart(file1.getName(), file1);
           // Adding batchClassId for which barcode classification to be perform.
           parts[1] = new StringPart("batchClassId", "BC1");
           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           mPost.setRequestEntity(entity);
           int statusCode = client.executeMethod(mPost);                   
           if (statusCode == 200) {
               System.out.println("Web service executed successfully..");
               String responseBody = mPost.getResponseBodyAsString();
               System.out.println(statusCode + "  ***  " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password..");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }
       } catch (FileNotFoundException e) {
           System.err.println("File not found for processing..");
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (mPost != null) {
               mPost.releaseConnection();
           }
       }
   }

Extraction Web Service

extractKV

This API will extract the document level fields for the corresponding Key Value pattern provided using input XML. This API will take the HOCR file as input. If the Key Value pattern is not found in the HOCR file than it will create the empty document level fields.

Web Service URLhttp://{serverName}:{port}/dcma/rest/extractKV

Batch Class List >>Recostar Mail Room [BC1] >>Application-Checklist >>Invoice Date >>New KV Extraction

[[image:|511x197px]]

Input Parameter
Value
Description
AdvancedKV
Either “true”/”false” This parameter is used to specifying the KeyValue extraction is perform by advanced key value or not.
LocationType
This value should be one of the following: TOPRIGHTLEFTBOTTOMTOP_RIGHTTOP_LEFTBOTTOM_LEFT,BOTTOM_RIGHT This parameter will fetch the Value pattern of the particular key pattern on the location provided.
NoOfWords
Should be Integer This parameter is used for specify in case of AdvancedKV is false. This parameter is used for adding number word of RIGHT location in the result of the value pattern found in the HOCR.
KeyPattern
This value should not be empty. This value should be valid regex expression. This is used for verify the Key pattern present in given HOCR.
ValuePattern
This value should not be empty. This value should be valid regex expression. This is used for verify the Value pattern present in given HOCR for that particular Key Pattern.
KVFetchValue
This value should be one of the following: ALLFIRSTLAST This parameter is used to specify the whether we need fetch all, first or last value pattern found.
Multiplier
This value should be float and should be in between 0 to 1 This value is used to multiply with confidence for updating the confidence of the fields extracted using advanced KV.
Length
This value should be integer For getting length value use Ephesoft Admin Screen as display screen shot above
Width
This value should be integer For getting width value use Ephesoft Admin Screen as display screen shot above
Xoffset
This value should be integer For getting xoffset value use Ephesoft Admin Screen as display screen shot above
Yoffset
This value should be integer For getting yoffset value use Ephesoft Admin Screen as display screen shot above
hocrFileName
This value should be string This value should be having HOCR file name passing for processing in XML file format.


CheckList
:

  1. For using Advance KV user should have admin access to fetch the accurate value of Length, Width, Xoffset and Yoffset. Before using AdvancedKV, please test the image with Ephesoft Admin Screen and note the values of Length, Width, Xoffset, Yoffset and LocationType for the particular KeyValue pattern.
  2. If AdvancedKV is true than NoOfWords is not use and all other parameters is used.
  3. If AdvancedKV is false than NoOfWords, KeyPattern, ValuePattern and LocationType will work.

Sample Input Used:

ephesoft-web-services\extractkv.zip

Format for XML:

<ExtractKVParams>

   <Params>
       <AdvancedKV>true</AdvancedKV>
       <LocationType>BOTTOM_LEFT</LocationType>
       <NoOfWords>0</NoOfWords>
       <Weight>0</Weight>
       <KeyPattern>APPLICATION</KeyPattern>
       <ValuePattern>[a-zA-Z]{10,15}</ValuePattern>
       <KVFetchValue>ALL</KVFetchValue>
       <Multiplier>1</Multiplier>
       <Length>384</Length>
       <Width>251</Width>
       <Xoffset>284</Xoffset>
       <Yoffset>105</Yoffset>
   </Params>

</ExtractKVParams>

Sample client code using apache commons http client:- privatestaticvoid extractKV() {

       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/extractKV";
       PostMethod mPost = new PostMethod(url);
       // Adding XML for the input.
       File f1 = new File("C:\\sample\\extractKV.xml");
       // Adding HOCR for processing.
       File f2 = new File("C:\\sample\\Application-Checklist.xml ");
       Part[] parts = new Part[3];
       try {
           parts[0] = new FilePart(f1.getName(), f1);
           parts[1] = new FilePart(f2.getName(), f2);
           parts[2] = new StringPart("hocrFileName", f2.getName());
           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           mPost.setRequestEntity(entity);
           int statusCode = client.executeMethod(mPost);
           if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               String responseBody = mPost.getResponseBodyAsString();
               // Generating result as responseBody.
               System.out.println(statusCode + "  ***  " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }
       } catch (FileNotFoundException e) {
           System.err.println("File not found for processing.");
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (mPost != null) {
               mPost.releaseConnection();
           }
       }
   }

extractFixedForm

Ephesoft Fixed Form Extraction Web Service API[edit]

Overview

This API extracts the value of document level fields present in the given document type from the image provided. The extraction of the pages will be done based on the project processing file mapped to the pages first, second, third and last. For Windows a default page processing file is picked from the default location as defined in the environment variables in case no file is mapped. In case of Linux if no files are mapped against the pages, no extraction is performed.

Input Parameters

Input parameters to the Web Service API would be two files

  • Tiff/PNG (single page or multipage)
  • XML file, with document type and batch class identifier as parameters.

Web Service URL http://{serverName}:{port}/dcma/rest/extractFixedForm

Example- http://localhost:8080/dcma/rest/extractFixedForm

Sample for XML

<WebServiceParams>
   <Params>
        <Param>
            <Name>batchClassIdentifier</Name>
            <Value>BCI</Value>
         </Param>
    <Param>
             <Name>docType</Name>
             <Value>Application-CheckList</Value>
          </Param>
    </Params>
</WebServiceParams

CheckList:

  • If colorSwitch is ON then image should be PNG.
  • If colorSwitch is OFF then image should be Tif/Tiff.
  • For Linux Operating System, the color switch is set to OFF, by default.
  • In case the color switch is ON and the uploaded image is a Tiff, it is internally converted into a PNG for processing.

Sample client code using apache commons http client:-

 private static void extractFixedForm() {
      HttpClient client = new HttpClient();
      String url = "http://localhost:8080/dcma/rest/extractFixedForm";
      PostMethod mPost = new PostMethod(url);
      // adding file for sending
      File file1 = new File("C:\\sample\\fixedForm.xml");
      File file2 = new File("C:\\sample\\Image.tif");
      Part[] parts = new Part[2];
      try {
          parts[0] = new FilePart(file1.getName(), file1);
          parts[1] = new FilePart(file2.getName(), file2);
          MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
          mPost.setRequestEntity(entity);
          int statusCode = client.executeMethod(mPost);
          if (statusCode == 200) {
              System.out.println("Web service executed successfully.");
              String responseBody = mPost.getResponseBodyAsString();
              // Generating result as responseBody.
              System.out.println(statusCode + " *** " + responseBody);
          } else if (statusCode == 403) {
              System.out.println("Invalid username/password.");
          } else {
              System.out.println(mPost.getResponseBodyAsString());
          }
      } catch (FileNotFoundException e) {
          System.err.println("File not found for processing.");
      } catch (HttpException e) {
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      } finally {
          if (mPost != null) {
              mPost.releaseConnection();
          }
      }
  }

extractFieldFromHocr[edit]

This API will extract the KV pattern for the given word in the given HOCR.

Web Service URL :

[ http://{serverName}:{port}/dcma/rest/extractFieldFromHocr]

Input Parameter
Value
Description
fieldValue
This should not be empty. This parameter is used for extracting the Key Value pattern for the word provided.

CheckList:

  1. fieldValue is provided for the word on which Key Value pattern would be found.

Sample Input Used:

ephesoft-web-services\extract-field-from-hocr.zip

Sample client code using apache commons http client:-

   private static void extractFieldFromHocr() {
       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/extractFieldFromHocr";
       PostMethod mPost = new PostMethod(url);
       // Adding HTML for extracting field
       File file1 = new File("C:\\sample\\Application-Checklist.html");
       Part[] parts = new Part[2];
       try {
           parts[0] = new FilePart(file1.getName(), file1);
           // Adding field value for extracting Key Value Pattern.
           parts[1] = new StringPart("fieldValue", "APPLICATION");
           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           mPost.setRequestEntity(entity);
           int statusCode = client.executeMethod(mPost);
           if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               String responseBody = mPost.getResponseBodyAsString();
               System.out.println(statusCode + " *** " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }
       } catch (FileNotFoundException e) {
           System.err.println("File not found for processing.");
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (mPost != null) {
               mPost.releaseConnection();
           }
       }
   }

 

extractFieldFromHocr

This API will extract the KV pattern for the given word in the given HOCR.

Web Service URL :

http://{serverName}:{port}/dcma/rest/extractFieldFromHocr]

Input Parameter
Value
Description
fieldValue
This should not be empty. This parameter is used for extracting the Key Value pattern for the word provided.

CheckList:

  1. fieldValue is provided for the word on which Key Value pattern would be found.

Sample Input Used:

ephesoft-web-services\extract-field-from-hocr.zip

Sample client code using apache commons http client:-

   private static void extractFieldFromHocr() {
       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/extractFieldFromHocr";
       PostMethod mPost = new PostMethod(url);
       // Adding HTML for extracting field
       File file1 = new File("C:\\sample\\Application-Checklist.html");
       Part[] parts = new Part[2];
       try {
           parts[0] = new FilePart(file1.getName(), file1);
           // Adding field value for extracting Key Value Pattern.
           parts[1] = new StringPart("fieldValue", "APPLICATION");
           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           mPost.setRequestEntity(entity);
           int statusCode = client.executeMethod(mPost);
           if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               String responseBody = mPost.getResponseBodyAsString();
               System.out.println(statusCode + " *** " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }
       } catch (FileNotFoundException e) {
           System.err.println("File not found for processing.");
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (mPost != null) {
               mPost.releaseConnection();
           }
       }
   }

extractFuzzyDB

This API will create the document level fields for the document type for the specified batch class for HOCR file passing it.

Web Service URLhttp://{serverName}:{port}/dcma/rest/extractFuzzyDB

Input Parameter
Value
Description
documentType
This should not be empty and valid document type for that batch class This parameter is used for generating document level fields for defined document type.
batchClassIdentifier
This should not be empty and valid batch class identifier This parameter used for fetching the information of the document for defined document type
hocrFile
This value should not and empty and should have same name as HOCR file attached for processing. This parameter is used for verifying the HOCR file name.

CheckList:-

  1. hocrFile should have same HOCR file name that are passed for processing.
  2. BatchClass having that batchClassIdentifier should have fuzzyDB plugin for processing.
  3. DocumentType should have document level fields for specified document type.

Sample Input Used:

ephesoft-web-services\extract-fuzzy-db.zip

Sample client code using apache commons http client:-

privatestaticvoid extractFuzzyDB() {
       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/extractFuzzyDB";
       PostMethod mPost = new PostMethod(url);
       // Adding HOCR file for processing
       File file = new File("C:\\sample\\Application-Checklist_000.html");
       Part[] parts = new Part[4];
       try {
           parts[0] = new FilePart(file.getName(), file);
           // Adding parameter for docuement type.
           parts[1] = new StringPart("documentType", "Application-Checklist");
           // Adding parameter for batch class.
           parts[2] = new StringPart("batchClassIdentifier", "BC1");
           parts[3] = new StringPart("hocrFile", "Application-Checklist.html");
           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           mPost.setRequestEntity(entity);
           int statusCode = client.executeMethod(mPost);
           if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               String responseBody = mPost.getResponseBodyAsString();
               // Generating result as responseBody.
               System.out.println(statusCode + " *** " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }
       } catch (FileNotFoundException e) {
           System.err.println("File not found for processing.");
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (mPost != null) {
               mPost.releaseConnection();
           }
       }
   }

barcodeExtraction

This API will create the document level fields for the document type for the specified batch class for barcode in tiff files passing it.

Web Service URL :

http://{serverName}:{port}/dcma/rest/barcodeExtraction]

Input Parameter
Value
Description
documentType
This should not be empty and valid document type for that batch class This parameter is used for generating document level fields for defined document type.
batchClassIdentifier
This should not be empty and valid batch class identifier This parameter used for fetching the information of the document for defined document type
imageName
This value should not and empty. On this file extraction operation will be performed.

CheckList:-

  1. BatchClass having that batchClassIdentifier should have Barcode Extraction plugin for processing.
  2. DocumentType should have document level fields for specified document type.
  3. Image name should have valid extension i.e. TIF/TIFF.

Sample Input Used:

<WebServiceParams> <Params>

  <Param>
    <Name>batchClassIdentifier</Name>
    <Value>BC1</Value>
  </Param>
  <Param>
    <Name>imageName</Name>
    <Value>US-Invoice.tif</Value>
  </Param>
 <Param>
       <Name>docType</Name>
       <Value>DocTypeName</Value>
  </Param>
  </Params>

</WebServiceParams>

ephesoft-web-services\barcodeExtraction.zip

Sample client code using apache commons http client:-

privatestaticvoid barcodeExtraction() {

       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/barcodeExtraction";
       PostMethod mPost = new PostMethod(url);
       File file1 = new File("C:\\sample\\sample.tif");
       // adding xml file for taking input
       File file2 = new File("C:\\sample\\WebServiceParams-barcodeExtraction.xml");
       Part[] parts = new Part[2];
try {
           parts[0] = new FilePart(file1.getName(), file1);
           parts[1] = new FilePart(file2.getName(), file2);
           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           mPost.setRequestEntity(entity);
int statusCode = client.executeMethod(mPost);
if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               System.out.println(mPost.getResponseBodyAsString());
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
if (mPost != null) {
               mPost.releaseConnection();
           }
       }

}

regularRegexExtraction

This API will extract the document level fields for the document type for the specified batch class.

Web Service URL : [ http://{serverName}:{port}/dcma/rest/extractFieldsUsingRegex]

Input Parameter
Value
Description
documentType
This should not be empty and valid document type for that batch class This parameter is used for generating document level fields for defined document type.
batchClassIdentifier
This should not be empty and valid batch class identifier This parameter used for fetching the information of the document for defined document type.
hocrFile
This value should not be empty. XML file name for which document level fields will be extracted.

””CheckList:-

  1. This batch class specified should have Regular Regex plugin defined for it.
  2. DocumentType should have document level fields for specified document type.
  3. HOCR file name should have valid extension, i.e., XML.

<WebServiceParams> <Params>

  <Param>
    <Name>batchClassIdentifier</Name>
    <Value>BC4</Value>
  </Param>
 <Param>
       <Name>documentType</Name>
       <Value>Application-Checklist</Value>
  </Param>
  </Params>

</WebServiceParams>

Sample Input Used:

ephesoft-web-services/regularRegexExtraction.zip

Sample client code using apache commons http client:-

privatestaticvoid extractFieldsUsingRegex() {

       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/extractFieldsUsingRegex";
       PostMethod mPost = new PostMethod(url);
       File file1 = new File("C:\\sample\\sample1.xml");
       // adding xml file for taking input
       File file2 = new File("C:\\sample\\WebServiceParams.xml");
       Part[] parts = new Part[3];
try {
           parts[0] = new FilePart(file1.getName(), file1);
           parts[1] = new FilePart(file2.getName(), file2);

parts[2] = new StringPart(“hocrFileName”, file1.getName());

           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           mPost.setRequestEntity(entity);
int statusCode = client.executeMethod(mPost);
if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               System.out.println(mPost.getResponseBodyAsString());
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
if (mPost != null) {
               mPost.releaseConnection();
           }
       }
   }

commonAPIForExtraction

This API is required to set the Header in the client for which the extraction to be performed. Rest of the information for the individual api found above.

Input for Extraction Type:

Pass the name of extraction api that is to use in the client header as shown in following example: BARCODE_EXTARCTIONRECOSTAR_EXTARCTIONREGULAR_REGEX_EXTRACTIONKV_EXTRACTIONFUZZY_DB , NUANCE_EXTRACTION

Here’s the sample client code using Regular Regex Extraction:

privatestaticvoid extractFields() {

       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/extractFields";
       PostMethod mPost = new PostMethod(url);
       File file1 = new File("C:\\sample\\input\\sample1.html");
       // adding xml file for taking input
       File file2 = new File("C:\\sample\\input\\WebServiceParams.xml");
       Part[] parts = new Part[2];
try {
           parts[0] = new FilePart(file1.getName(), file1);
           parts[1] = new FilePart(file2.getName(), file2);
           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           /* Pass the name of extraction api that is to used: 
BARCODE_EXTARCTION
RECOSTAR_EXTARCTION
REGULAR_REGEX_EXTRACTION
KV_EXTRACTION
FUZZY_DB
NUANCE_EXTARCTION*/
           Header header = new Header("extractionAPI", "REGULAR_REGEX_EXTRACTION");
           mPost.addRequestHeader(header);
           mPost.setRequestEntity(entity);
if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               System.out.println(mPost.getResponseBodyAsString());
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }        } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
if (mPost != null) {
               mPost.releaseConnection();
           }
       }
   }

ExtractKVForDocumentType

This Web Service API is used to perform Key Value Extraction for the Document type of the specified Batch Class, on the Basis of HOCR XML provided as an input.

Request Method POST

Web Service URL:

http://{serverName}:{port}/dcma/rest/batchClass/ExtractKVForDocumentType]

Input Parameter
Value
Description
BATCH_CLASS_IDENTIFIER This value should be an existing batch class Id. This Parameter specifies the Batch Class Id for key Value extraction needs to be performed.
DOCUMENT_TYPE This should be an existing document type. This tag should contain name of document type of the Batch Class Identifier

for which KV extraction to be performed through Web service API.HOCR_ZIP_FILEHOCR XML/(s) zipped to a folder name should be specifiedZIP file which is uploaded, containing HOCR XML’s on basis

of which extraction is performed. For example HOCR.zip. Please add .zip extension to file name.

Check List:-

  1. Batch_Class_Identifier should be existing and non-empty.
  2. DOCUMENT_TYPE should be existing and non-empty.
  3. HOCR_ZIP_FILE should contain file*_HOCR.xml zipped directly to a folder

Sample Input XML:

<KV_Extraction_DocType>

<Batch_Class>BATCH_CLASS_IDENTIFIER</Batch_Class>    <Document_Type>DOCUMENT_TYPE</Document_Type>

<HOCR_File>HOCR_ZIP_FILE</HOCR_File>

</KV_Extraction_DocType>

Note: Values highlighted in blue should be replaced with corresponding values while executing the Web service for performing key value extraction.

Sample client code using apache commons http client:-

privatestaticvoid performKeyValueExtraction() {

HttpClient client = new HttpClient();

String url = “http://localhost:8080/dcma/rest/batchClass/ExtractKVForDocumentType“;

PostMethod mPost = new PostMethod(url);

// Adding Input XML file for processing

File file = new File(“C:\\sample\\Input.xml”);

File hocrZipFile = new File(“C:\\sample\\Input_HOCR.zip”);

Part[] parts = new Part[2];

try {

parts[0] = new FilePart(file.getName(), file);

parts[1] = new FilePart(hocrZipFile.getName(),hocrZipFile);

MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());

mPost.setRequestEntity(entity);

int statusCode = client.executeMethod(mPost);

if (statusCode == 200) {

System.out.println(“Web service executed successfully.”);

String responseBody = mPost.getResponseBodyAsString();

// Generating result as responseBody.

System.out.println(statusCode + ” *** ” + responseBody);

elseif (statusCode == 403) {

System.out.println(“Invalid username/password.”);

else {

System.out.println(mPost.getResponseBodyAsString());

}

catch (FileNotFoundException e) {

System.err.println(“File not found for processing.”);

catch (HttpException e) {

e.printStackTrace();

catch (IOException e) {

e.printStackTrace();

finally {

if (mPost != null) {

mPost.releaseConnection();

}

}

}

OCR Web Service

createOCR

This API will generates the OCR result for the specified sample image file. This API works for tif and png file. If processing the color image we accept the png/tif file as input and for black and white image we processing tif file as input.

Web Service URL :

http://{serverName}:{port}/dcma/rest/createOCR]

Input Parameter
Value
Description
ocrEngine
Either “recostar”/”tesseract/nuance” This parameter is used for configuring the ocrEngine to be used
colorSwitch
Either “ON”/”OFF” This parameter is used
tesseractVersion
Currently we are supporting “tesseract_version_3” This parameter is used for tesseract version to be used.
cmdLanguage
Either “tha”/”eng” This parameter is used for configure the language that has been learnt by tessearact
projectFile
This can be empty in case of tesseract ocrEngine This parameter is validating the RSP used for OCRing in case of recostar

CheckList:-

  1. In case of ocrEngine is recostar, than colorSwitch and projectFile is mandatory parameters.
  2. In case of ocrEngine is tesseract than colorSwitch, tesseractVersion and cmdLanguage is mandatory parameters.
  3. If colorSwitch is ON, input image can be tif/png.
  4. If colorSwitch is OFF than input image should be TIFF.

Sample Input Used:

ephesoft-web-services\create-ocr.zip

File format for XML file:

Sample Input Used:

<WebServiceParams>
<Params>
  <Param>
    <Name>ocrEngine</Name>
    <Value>recostar</Value>
  </Param>
  <Param>
    <Name>colorSwitch</Name>
    <Value>off</Value>
  </Param>
  <Param>
    <Name>tesseractVersion</Name>
    <Value>tesseract_version_3</Value>
  </Param>
   <Param>
    <Name>cmdLanguage</Name>
    <Value>eng</Value>
  </Param>
   <Param>
    <Name>projectFile</Name>
    <Value>Fpr.rsp</Value>
  </Param>
</Params>
</WebServiceParams>

Format for RSP file:

<_Project MajorRevision=”1″ MinorRevision=”0″ Timeout=”180000″>

 <_Collection Name="Libraries">
   <_Library Type="Dll" BaseName="ImageProcess"/>
   <_Library Type="Dll" BaseName="ImageProcess2"/>
   <_Library Type="Dll" BaseName="Recognition"/>
 </_Collection>
 <FullPageOperator Name="Operator" SetupImageFileName="" Country="USA" TextReading="true" ResultCoordinates="OriginalImage" ResultImage="RecoImage" ResultGraphicalObjects="false" DiagnosticsMode="OnError" DiagnosticsFileName="">
   <ImageSequence2Operator Name="ImageProcessing" SetupImageFileName="" RegisterImage="true" DiagnosticsMode="OnError" DiagnosticsFileName="" ConfigurationFileName="" Geometry="-1 0 1683 0 1 2190">
     <LoadImageOperator Name="ImageSourceOperator" FileName="" FileFormat="Unknown" Resolution="200" UnifyResolution="true" RepairResolution="true" AutoRotate="false" IgnorePalette="false" ScaleToGray="0"/>
     <ExtractGrayFromRgbOperator Name="ColorFilterOperator" LumaRed="0.299" LumaGreen="0.587" LumaBlue="0.114"/>
     <BinarizeEdgeAdaptiveOperator Name="BinarizeOperator" EdgeThreshold="80" DoubleResolution="false"/>
     <_Collection Name="BinaryImageSequence">
       <RemoveShadingOperator Name="RemoveShading" MinRegionWidth="10.00" MinRegionHeight="3.00"/>
       <DetectPaperAreaOperator Name="DetectPaperArea" KeepBlackFrame="false" SafetyClass="Medium" DetectTextSkew="true"/>
       <BinaryAutoRotateOperator Name="AutoRotate" DocumentOrientation="Unknown" InputOrientation="MostlyCorrect"/>
       <ProtectBarCodesOperator Name="ProtectBarCodes" SafetyClass="Medium" SearchRegion=""/>
       <RemoveLineSystemOperator Name="RemoveLineSystem" HorizontalLineLength="10.00" VerticalLineLength="12.00" DashedLineLength="30.00" MaxLineWidth="1.50" MaxGapWidth="1.00" BoxSeparatorHeight="4.00" InvertedRegionWidth="12.00" InvertedRegionHeight="4.00" LineQuality="Medium"/>
     </_Collection>
   </ImageSequence2Operator>
   <LayoutOperator Name="LayoutOperator" FindTextBlocks="true"/>
   <FullPageField Name="TextField" Zone="0 0 0 0 0 1" ReaderSelection="Voter" Orientation="Normal" SyntaxMode="Alphanumerical" NumberOfLines="TextLineSegments" MachinetypeHeight="Unknown" MachinetypePitch="Unknown" MachinetypeMinConfidence="100" LogicalContext="On" TrigramMode="On" DictionaryFileName="" DictionaryMode="Incomplete" DictionaryCandidates="Words" CharacterSet="" Pattern="" PassThroughID="None"/>
   <FormGenerator Name="Generator"/>
 </FullPageOperator>

</_Project>

Sample client code using apache commons http client:-

privatestaticvoid createOCR() {

       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/createOCR";
       PostMethod mPost = new PostMethod(url);
       // adding image file for processing
       File file1 = new File("C:\\sample\\sample1.tif");
       // adding xml file for taking input
       File file2 = new File("C:\\sample\\WebServiceParams.xml");
       // adding rsp file used for creating OCR in case of recostar
       File file3 = new File("C:\\sample\\Fpr.rsp");
       Part[] parts = new Part[3];
       try {
           parts[0] = new FilePart(file1.getName(), file1);
           parts[1] = new FilePart(file2.getName(), file2);
           parts[2] = new FilePart(file3.getName(), file3);
           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           mPost.setRequestEntity(entity);
           int statusCode = client.executeMethod(mPost);
           if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               InputStream in = mPost.getResponseBodyAsStream();
               // saving result generated.
               File outputFile = new File("C:\\sample\\serverOutput.zip");
               FileOutputStream fos = new FileOutputStream(outputFile);
               try {
                   byte[] buf = newbyte[1024];
                   int len = in.read(buf);
                   while (len > 0) {
                       fos.write(buf, 0, len);
                       len = in.read(buf);
                   }
               } finally {
                   if (fos != null) {
                       fos.close();
                   }
               }
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }
       } catch (FileNotFoundException e) {
           System.err.println("File not found for processing.");
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (mPost != null) {
               mPost.releaseConnection();
           }
       }
   }

Create_HOCR_XML_for Batch_Class

This Web Service API is used to create HOCR XML of Batch Class of single page tiff/tif passes as an input. This Web Service API requires two Inputs i.e. Input Sample and tif/tiff file to create HOCR_xml.

On the basis of Batch Class Identifier provided as an input,this API will Extract plugin configuration settings of RECOSTAR_HOCR/TESSERACT_HOCR plugin in Page Process module, if property named “Recostar Switch” value is turned ON then process of OCRing will be done from Recostar and its corresponding plugin configurations will be used else Tesseract will be used to perform process of OCRing.

Request Method POST

Web Service URL:

http://{serverName}:{port}/dcma/rest/batchClass/createHOCRforBatchClass]

Input parameters required for the batch class creation are as follows:

Input Parameter
Value
Description
batchClassIdentifier
It should contain a value of an existing batch Class Identifier.
The identifier of the Batch Class whose HOCR_XML needs to be created.
imageName
This should be a non-empty Value containing file name with tif/tiff extension.
This parameter value should contain name tif/tiff file for which HOCR XML need to be created with extension specified .For example Application-Checklist.tif

Check list:

  1. Batch Class Identifier should be an existing one.
  2. Only single page tif/tiff should be passed as an input.

Sample Input XML:

<WebServiceParams>

<Params>
  <Param>
     <Name>batchClassIdentifier</Name>
     <Value>BATCH_CLASS_ID</Value>
  </Param>
  <Param>
     <Name>imageName</Name>
     <Value>FILE_NAME</Value>
  </Param>
</Params>

</WebServiceParams>

Note: Values highlighted in blue should be replaced with corresponding values while executing the Web service for creating HOCR XML for Batch Class.

Sample client code using apache commons http client:-

privatestaticvoid createHOCRXML() {

HttpClient client = new HttpClient();

String url = “http://localhost:8080/dcma/rest/batchClass/copybatchClass“;

PostMethod mPost = new PostMethod(url);

// Adding Input XML file for processing

File file = new File(“C:\\sample\\Input.xml”);

File imageFile = new File(“C:\\sample\\SampleImage.tif”);

Part[] parts = new Part[2];

try {

parts[0] = new FilePart(file.getName(), file);

parts[1] = new FilePart(imageFile.getName(),imageFile);

MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());

mPost.setRequestEntity(entity);

int statusCode = client.executeMethod(mPost);

if (statusCode == 200) {

System.out.println(“Web service executed successfully.”);

String responseBody = mPost.getResponseBodyAsString();

// Generating result as responseBody.

System.out.println(statusCode + ” *** ” + responseBody);

elseif (statusCode == 403) {

System.out.println(“Invalid username/password.”);

else {

System.out.println(mPost.getResponseBodyAsString());

}

catch (FileNotFoundException e) {

System.err.println(“File not found for processing.”);

catch (HttpException e) {

e.printStackTrace();

catch (IOException e) {

e.printStackTrace();

finally {

if (mPost != null) {

mPost.releaseConnection();

}

}

}

Users and Groups Web Service

getBatchInstanceForRole

This API is used to fetch all batch instance list having accessed by the specified role. This API is GET api, works with web url and client code.

Web Service URL :

http://{serverName}:{port}/dcma/rest/getBatchInstanceForRole/{role}]

Input Parameter
Value
Description
role
This value should not be empty.

This parameter is used for specifying the role name for which batch instance list to be fetched.

Sample client code using apache commons http client:-

privatestaticvoid getBatchInstanceForRole() {

       HttpClient client = new HttpClient();
       // URL path to be hit for getting the batch instance list having accessed by the role specified.
       String url = "http://localhost:8080/dcma/rest/getBatchInstanceForRoles/admin";
       GetMethod getMethod = new GetMethod(url);
int statusCode;
try {
           statusCode = client.executeMethod(getMethod);
if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               String responseBody = getMethod.getResponseBodyAsString();
               System.out.println(statusCode + " *** " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(getMethod.getResponseBodyAsString());
           }
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
if (getMethod != null) {
               getMethod.releaseConnection();
           }
       }
   }

getBatchClassForRole:

This API is used to fetch all batch class list having accessed by the specified role. This API is GET api, works with web url and client code.

Web Service URL :

http://{serverName}:{port}/dcma/rest/getBatchClassForRole/{role}]

Input Parameter
Value
Description
role
This value should not be empty.

This parameter is used for specifying the role name for which batch class list to be fetched.

Sample client code using apache commons http client:-

privatestaticvoid getBatchClassForRole() {

       HttpClient client = new HttpClient();
       // URL path to be hit for getting the batch class list having accessed by the role specified.
       String url = "http://localhost:8080/dcma/rest/getBatchClassForRole/admin";
       GetMethod getMethod = new GetMethod(url);
int statusCode;
try {
           statusCode = client.executeMethod(getMethod);
if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               String responseBody = getMethod.getResponseBodyAsString();
               System.out.println(statusCode + " *** " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(getMethod.getResponseBodyAsString());
           }
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
if (getMethod != null) {
               getMethod.releaseConnection();
           }
       }
   }

Reporting Web Service

runReporting

This API is used to run reporting on using web services. This web service takes server side installer path as an input and performs synchronizing the report database.

Web Service URL :

http://{serverName}:{port}/dcma/rest/runReporting]

Input Parameter
Value
Description
installerPath
This value should be valid path. This parameter is used for specifying path fie build.xml for reporting present on the server side.

Checklist :-

  1. This path should be valid file path and must be server path for the build.xml file.

Sample Input Used:

ephesoft-web-services\run-reporting.zip

””Format for inputXML file :

<ReportingOptions>

<installerPath>C:\\testing</installerPath>

</ReportingOptions>

Sample client code using apache commons http client:-

privatestaticvoid runReporting() {

       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/runReporting";
       PostMethod mPost = new PostMethod(url);
       File file1 = new File("C:\\sample\\reporting.xml");
       Part[] parts = new Part[1];
try {
           parts[0] = new FilePart(file1.getName(), file1);
           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           mPost.setRequestEntity(entity);
int statusCode = client.executeMethod(mPost);
if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               String responseBody = mPost.getResponseBodyAsString();
               System.out.println(statusCode + " *** " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }
       } catch (FileNotFoundException e) {
           System.out.println("File not found for processing.");
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
if (mPost != null) {
               mPost.releaseConnection();
           }
       }
   }

Batch Instance Management Web Service

getBatchInstanceList

This api will return the batch instance list of the batch instance status accessed for the specific role using in the authentication. This API is GET api, works with client code and URL directly.

Web Service URL :

http://{serverName}:{port}/dcma/rest/BatchInstanceList/{status}]

Input Parameter
Value
Description
status
This values can be NEW, LOCKED,READY,ERROR, FINISHED,ASSIGNED, RUNNING, READY_FOR_REVIEW,

READY_FOR_VALIDATION, RESTARTED, DELETED, TRANSFERRED, RESTART_IN_PROGRESSThis parameter is used for specifying the batch instance status for which batch instance list to be fetched.

Checklist:-

  1. Status should have status provided above in the list.

Sample client code using apache commons http client:-

privatestaticvoid getBatchInstanceList() {

       HttpClient client = new HttpClient();
       // URL path to be hit for getting the batch instance identifier list having status specified.
       String url = "http://localhost:8080/dcma/rest/BatchInstanceList/RUNNING";
       GetMethod getMethod = new GetMethod(url);
int statusCode;
try {
           statusCode = client.executeMethod(getMethod);
if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               String responseBody = getMethod.getResponseBodyAsString();
               System.out.println(statusCode + " *** " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(getMethod.getResponseBodyAsString());
           }
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
if (getMethod != null) {
               getMethod.releaseConnection();
           }
       }

}

getAllModulesWorkflowNameByBatchClass

This API will returns the module workflow names and the module names of the specified batch class identifier. This API is GET API, works with client code and web url.

Web Service URL :

http://{serverName}:{port}/dcma/rest/getAllModulesWorkflowNameByBatchClass/{batchClassIdentifier}]

Input Parameter
Value
Description
batchClassIdentifier
This value should not be empty. This parameter is used for specifying the batch class identifier for which module name to be fetched.

Sample client code using apache commons http client:-

privatestaticvoid getAllModulesWorkflowNameByBatchClass() {

       HttpClient client = new HttpClient();
       // URL path to be hit for getting the mdoule workflow name of the specified batch class identifier
       String url = "http://localhost:8080/dcma/rest/getAllModulesWorkflowNameByBatchClass/BC1";
       GetMethod getMethod = new GetMethod(url);
int statusCode;
try {
           statusCode = client.executeMethod(getMethod);
if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               String responseBody = getMethod.getResponseBodyAsString();
               System.out.println(statusCode + " *** " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(getMethod.getResponseBodyAsString());
           }
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
if (getMethod != null) {
               getMethod.releaseConnection();
           }
       }
   }

restartBatchInstance

This API is used to restart the batch instance from specified module. User can restart those batch instances those are accessible by their role. This API is GET api, works with client code and web url.

Web Service URL :

http://{serverName}:{port}/dcma/rest/restartBatchInstance/{batchInstanceIdentifier}/{restartAtModuleName}]

Input Parameter
Value
Description
batchInstanceIdentifier
This value should be valid batch instance identifier. This parameter is used to specifying the batch instance identifier for which batch instance to be restart.
restartAtModuleName
This value should not be empty. This parameter is used specifying the module name from where batch to be restart.

Checklist:-

  1. Batch Instance identifier should be valid identifier and having access by the user which are authenticate the web service.
  2. restartAtModuleName this value should valid module name and it can be differ with batch class.

””Sample client code using apache commons http client:-

privatestaticvoid restartBatchInstance() {

       HttpClient client = new HttpClient();
       // URL path to be hit for restarting batch instance identifier from specified module.
       // User can restart only those batch instance having status "ERROR", "READY_FOR_REVIEW", "READY_FOR_VALIDATION", "RUNNING"
       String url = "http://{serverName}:{port}/dcma/rest/restartBatchInstance/BI1/Folder_Import_Module";
       GetMethod getMethod = new GetMethod(url);
int statusCode;
try {
           statusCode = client.executeMethod(getMethod);
if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               String responseBody = getMethod.getResponseBodyAsString();
               System.out.println(statusCode + " *** " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(getMethod.getResponseBodyAsString());
           }
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
if (getMethod != null) {
               getMethod.releaseConnection();
           }
       }
   }

deleteBatchInstance

This API is used to delete the batch instance for specified batch instance identifier. This API will delete that batch instance having accessed by the authenticated user.

Web Service URL :

http://{serverName}:{port}/dcma/rest/deleteBatchInstance/{identifier}]

Input Parameter
Value
Description
batchInstanceIdentifier
This value should be valid batch instance identifier. This parameter is used to specifying the batch instance identifier to be deleted.

Sample client code using apache commons http client:- privatestaticvoid deleteBatchInstance() {

       HttpClient client = new HttpClient();
       // URL path to be hit for deleting the batch instance having access to the authenticated user.
       // User can delete only those batch instance having status "ERROR", "READY_FOR_REVIEW", "READY_FOR_VALIDATION", "RUNNING"
       String url = "http://localhost:8080/dcma/rest/deleteBatchInstance/BI1";
       GetMethod getMethod = new GetMethod(url);
       int statusCode;
       try {
           statusCode = client.executeMethod(getMethod);
           if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               String responseBody = getMethod.getResponseBodyAsString();
               System.out.println(statusCode + " *** " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(getMethod.getResponseBodyAsString());
           }
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (getMethod != null) {
               getMethod.releaseConnection();
           }
       }
   }

restartAllBatchInstance

This API is used to restart all the batch instance having status READY_FOR_REVIEW and READY_FOR_VALIDATION and having access by the authenticated user. This API is GET API, works with clinet code and web url. RestartAll switch should be set to “TRUE” in properties file.

Web Service URL : [ http://{serverName}:{port}/dcma/rest/restartAllBatchInstance]

Checklist:-

  1. Only those batch will restart having status READY_FOR_REVIEW and READY_FOR_VALIDATION which are accessible by authenticated user.

Sample client code using apache commons http client:- privatestaticvoid restartAllBatchInstance() {

       HttpClient client = new HttpClient();
       // URL path to be hit for restarting the batch instance having access to the authenticated user.
       // User can restart only those batch instance having status "READY_FOR_REVIEW", "READY_FOR_VALIDATION"
       String url = "http://localhost:8080/dcma/rest/restartAllBatchInstance";
       GetMethod getMethod = new GetMethod(url);
       int statusCode;
       try {
           statusCode = client.executeMethod(getMethod);
           if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               String responseBody = getMethod.getResponseBodyAsString();
               System.out.println(statusCode + " *** " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(getMethod.getResponseBodyAsString());
           }
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (getMethod != null) {
               getMethod.releaseConnection();
           }
       }
   }

addUserRolesToBatchInstance

This API is used to adding roles to batch instance identifier. This API takes batch instance identifier and role name as an input and adding it to the database. This API is GET api, works with client code and web browser both.

Web Service URL :

http://{serverName}:{port}/dcma/rest/AddUserRolesToBatchInstance/{batchInstanceIdentifier}/{userRole}]

Input Parameter
Value
Description
batchInstanceIdentifier
This value should be valid batch instance identifier. This parameter is used to specifying the batch instance identifier for which roles to be added.
userRole
This value should not be empty. This parameter is used specifying the role to be added on the specified batch instance identifier.

Sample client code using apache commons http client:- privatestaticvoid addUserRolesToBatchInstance() {

       HttpClient client = new HttpClient();
       // URL path to be hit for adding user roles to batch instance identifier
       String url = "http://localhost:8080/dcma/rest/addUserRolesToBatchInstance/BI45/admin";
       GetMethod getMethod = new GetMethod(url);
       int statusCode;
       try {
           statusCode = client.executeMethod(getMethod);
           if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               String responseBody = getMethod.getResponseBodyAsString();
               System.out.println(statusCode + " *** " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(getMethod.getResponseBodyAsString());
           }
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (getMethod != null) {
               getMethod.releaseConnection();
           }
       }
   }

Run Batch Instance

This API is used to run the batch instance from READY_FOR_REVIEW or READY_FOR_VALIDATION module to next phase in workflow. User can restart those batch instances those are accessible by their role. Request Method: GET Web Service URL: [ http://{serverName}:{port}/dcma/rest/runBatchInstance/{batchInstanceIdentifier]} Input Parameters for the Web Service are as follows:

Input Parameter
Value
Description
batchInstanceIdentifier It should contain a value of an existing batch instance Identifier. The parameter value should contain of the Batch Class whose document type is copied.

Note: Value highlighted curly braces in input URL should be replaces with corresponding values.Module name should end with _module. Sample client code using apache commons http client:- privatestaticvoid runBatchInstance() { HttpClient client = new HttpClient(); String url = “http://localhost:8080/dcma/rest/runBatchInstance/BI15”PostMethod mPost = new PostMethod(url);

// Adding Input XML file for processing

File file = new File(“C:\\sample\\Input.xml”); Part[] parts = new Part[1]; try { parts[0] = newFilePart(file.getName(), file); MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams()); mPost.setRequestEntity(entity); int statusCode = client.executeMethod(mPost);if (statusCode == 200) { System.out.println(“Web service executed successfully.”); String responseBody = mPost.getResponseBodyAsString();

// Generating result as responseBody.

System.out.println(statusCode + ” *** ” + responseBody); } elseif (statusCode == 403) { System.out.println(“Invalid username/password.”); } else { System.out.println(mPost.getResponseBodyAsString()); } } catch(FileNotFoundException e) { System.err.println(“File not found for processing.”); } catch (HttpException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (mPost != null) { mPost.releaseConnection(); } } }

Batch Class Management Web Service

importBatchClass

This API is used for importing batch class to the ephesoft. This API takes XML for input parameters and exported batch class data as an input. Exported batch class is in zip format as exported by Ephesoft.

Web Service URL :

http://{serverName}:{port}/dcma/rest/importBatchClass]

Input Parameter
Value
Description
RolesImported
Either “true”/”false” This value is used for importing roles with batch class or not.
EmailAccounts
Either “true”/”false” This value is used for importing email accounts with batch class or not.
UseSource
Either “true”/”false” This value is used for saving the information of source batch class to be imported
cmisPluginProperties
Either “true”/”false” This value is used for importing cmisPluginProperties with batch class or not.
Name
This value should not be empty This value is used to configure the batch class name of the imported batch class.
Description
This value should not be empty This value is used to configure the description of the imported batch class.
Priority
This value should lie in between 1 to 100. This value indicates the priority of batch class.
UseExisting
Either “true”/”false” This value is used for overwrite the existing batch class with new batch class.
UncFolder
This value should not be empty and have any string value that specified directory path These values specify the UNC folder path for batch class to be imported along with batch class.
Script
This tag is configured for ScriptFile to be imported This tag is configured for which Script file to be imported
Folder
This tag is configured for Folder to be imported This tag is configured for which folder to be imported along with batch class

Checklist:-

  1. If UseExisting is “true”, existing batch class will be overwriting with the Folders and Script as well as others parameter.
  2. If UseExisting is “false”, new batch class will created and Folders and Scripts will be used as false.
  3. If UseSource is “true”, new batch class will have same Name, Description and Priority as source batch class.
  4. If UseSource is “false”, new batch class will have property like Name, Description and Priority configured.

SampleInputXML:

<ImportBatchClassOptions>

   <RolesImported>false</RolesImported>
   <EmailAccounts>true</EmailAccounts>
   <UseSource>false</UseSource>
   <Name>BatchClassName</Name>
   <Description>Description</Description>
   <cmisPluginProperties>cmisPluginProperties</cmisPluginProperties>
   <Priority>10</Priority>
   <UseExisting>true</UseExisting>
   <UncFolder>C:\ephesoft-data\Test-UNC</UncFolder>
   <BatchClassDefinition>
       <Scripts>
           <Script>
               <FileName>ScriptDocumentAssembler.java</FileName>
               <Selected>true</Selected>
           </Script>
           <Script>
               <FileName>ScriptPageProcessing.java</FileName>
               <Selected>true</Selected>
           </Script>
       </Scripts>       
       <Folders>
           <Folder>
               <FileName>image-classification-sample</FileName>
               <Selected>false</Selected>
           </Folder>            
       </Folders>
       <BatchClassModules>
           <BatchClassModule>
               <ModuleName></ModuleName>
               <PluginConfiguration>true</PluginConfiguration>
           </BatchClassModule>
       </BatchClassModules>
   </BatchClassDefinition>

</ImportBatchClassOptions>

””Sample client code using apache commons http client:-

privatestaticvoid importBatchClass() {

       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/importBatchClass";
       PostMethod mPost = new PostMethod(url);
       mPost.setDoAuthentication(true);
       // Input XML for adding parameter.
       File file1 = new File("C:\\sample\\importbatchclass.xml");
       // Input zip file for importing batch class.
       File file2 = new File("C:\\sample\\BC1_050712_1714.zip");
       Part[] parts = new Part[2];
       try {
           parts[0] = new FilePart(file1.getName(), file1);
           parts[1] = new FilePart(file2.getName(), file2);
           MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
           mPost.setRequestEntity(entity);
           int statusCode = client.executeMethod(mPost);           
           if (statusCode == 200) {
               System.out.println("Batch class imported successfully");
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }
       } catch (FileNotFoundException e) {
           System.out.println("File not found for processing.");
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (mPost != null) {
               mPost.releaseConnection();
           }
       }
   }

exportBatchClass

This API is used for exporting existing batch class. This method will take the batch class identifier and learnt-sample to be exported with the batch class.

Web Service URL :

http://{serverName}:{port}/dcma/rest/exportBatchClass]

Input Parameter
Value
Description
identifier
This value should not be empty and valid batch class identifier. This parameter is used for identifying which batch class is to be exported.
lucene-search-classification-sample
Either “true”/”false” This parameter is used to configure the lucene learnt sample is exported with batch class or not.
image-classification-sample
Either “true”/”false” This parameter is used to configure the image classification sample is exported with batch class or not.

CheckList:-

  1. Identifier should be batch class identifier.

Sample client code using apache commons http client:- privatestaticvoid exportBatchClass() {

       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/exportBatchClass";
       PostMethod mPost = new PostMethod(url);
       mPost.addParameter("identifier", "BC1");
       mPost.addParameter("lucene-search-classification-sample", "true");
       mPost.addParameter("image-classification-sample", "false");
       int statusCode;
       try {
           statusCode = client.executeMethod(mPost);
           if (statusCode == 200) {
               System.out.println("Batch class exported successfully");
               InputStream in = mPost.getResponseBodyAsStream();
               File f = new File("C:\\sample\\serverOutput.zip");
               FileOutputStream fos = new FileOutputStream(f);
               try {
                   byte[] buf = newbyte[1024];
                   int len = in.read(buf);
                   while (len > 0) {
                       fos.write(buf, 0, len);
                       len = in.read(buf);
                   }
               } finally {
                   if (fos != null) {
                       fos.close();
                   }
               }
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (mPost != null) {
               mPost.releaseConnection();
           }
       }
              }

getBatchClassList

This API returns all the batch class having accessible by the authenticated user. This API is GET API, works with the client code and web url.

Web Service URL :

http://{serverName}:{port}/dcma/rest/getBatchClassList]

Sample client code using apache commons http client:-

privatestaticvoid getBatchClassList() {

       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/getBatchClassList";
       GetMethod mGet = new GetMethod(url);
       int statusCode;
       try {
           statusCode = client.executeMethod(mGet);
           if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               String responseBody = mGet.getResponseBodyAsString();
               System.out.println(statusCode + " *** " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(mGet.getResponseBodyAsString());
           }
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (mGet != null) {
               mGet.releaseConnection();
           }
       }
   }

getRoles

This API is used to get the roles of the specified batch class. This API is GET API, works with the client code and web url.

Web Service URL :

http://{serverName}:{port}/dcma/rest/getRoles/{batchClassIdentifier}]

Input Parameter
Value
Description
identifier
This value should not be empty and valid batch class identifier. This parameter is used for identifying which batch class roles to be fetched.

CheckList:-

  1. Identifier should be batch class identifier.

Sample client code using apache commons http client:-

privatestaticvoid getRoles () {

       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/getRoles/BC1";
       GetMethod mGet = new GetMethod(url);
       int statusCode;
       try {
           statusCode = client.executeMethod(mGet);
           if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
               String responseBody = mGet.getResponseBodyAsString();
               System.out.println(statusCode + " *** " + responseBody);
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(mGet.getResponseBodyAsString());
           }
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (mGet != null) {
               mGet.releaseConnection();
           }
       }

}

Uploading a Batch through a Web Service

uploadBatch

This API is for uploading a new batch to a watch folder for a given batch class. It executes the new batch with supplied tif, tiff or pdf files. User need to be authorized to execute a batch for a particular batch class otherwise an error message would be generated. All the files would be copied to the unc folder of the requested batch class with the folder name supplied by the user as input.

Web Service URL :

http://{serverName}:{port}/dcma/rest/uploadBatch]/{batchClassIdentifier}/{batchInstanceName

Input Parameter
Description
batchClassIdentifier
The identifier of the batch class in which user wishes to upload its batch.
batchInstanceName
This name with which user wishes to upload the batch.

CheckList:-

  1. The value for batchClassIdentifier is compulsory and should be valid with permissions to the user to run the batch on it.
  2. The value for batchInstanceName is compulsory and if left empty then it will send an error.

Sample client code using apache commons http client:- privatestaticvoid uploadBatch () {

       HttpClient client = new HttpClient();
       String url = "http://localhost:8080/dcma/rest/uploadBatch/{BatchClassIdentifier}/{BatchInstanceName} ";
       PostMethod mPost = new PostMethod(url); 
   // adding image file for processing
   File file1 = new File("C:\\sample\\sample1.tif");
   Part[] parts = new Part[1];
   try {
       parts[0] = new FilePart(file1.getName(), file1);

MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());

           mPost.setRequestEntity(entity);
           int statusCode = client.executeMethod(mPost);
           String responseBody = mPost.getResponseBodyAsString();
           // Generating result as responseBody.
           System.out.println(statusCode + "***" + responseBody);
           if (statusCode == 200) {
               System.out.println("Web service executed successfully.");
           } elseif (statusCode == 403) {
               System.out.println("Invalid username/password.");
           } else {
               System.out.println(mPost.getResponseBodyAsString());
           }
       } catch (FileNotFoundException e) {
           System.err.println("File not found for processing.");
       } catch (HttpException e) {
           e.printStackTrace();
       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           if (mPost != null) {
               mPost.releaseConnection();
           }
       }

}

Batch Class Web service

CopyBatchClass

This API will create the copy of an existing batch class whose identifier is provided as input/source. Other parameters required for the batch class creation are as follows: Request Method POST

Web Service URL:

http://{serverName}:{port}/dcma/rest/batchClass/copyBatchClass]

Input Parameter
Value
Description
batchClassName The Name of batch class should not be empty or contains characters like space(“ “) or hyphen(“-“) and should not be more than 255 characters. The unique character is used for naming the new copied batch class.
batchClassDescription This should be a non-empty Value This parameter is the description of the new copied batch class.
batchClassPriority The batch class priority cannot be null or empty and should be between 1 and 100 inclusive of both. The priority of the batch class.
batchUNCFolder The UNC folder name for the batch class. This UNC folder name for the new copied batch class.
copyBatchClassIdentifier This value should be non-empty and a preexisting Batch Class Idenitifer The identifier of the Batch Class which is used as reference for copying.
gridWorkflow Can be true or false States the workflow, is the batch class deployed as grid workflow or normal workflow.

Sample Input XML :

<?xml version="1.0" encoding="UTF-8"?> <WebServiceParams>
 <Params>
   <Param>
     <Name>batchClassName</Name>
     <Value>NEW_BATCH_CLASS_NAME</Value>
   </Param>
   <Param>
     <Name>batchClassDescription</Name>
     <Value>NEW_BATCH_CLASS_DESCIPTION</Value>
   </Param>
   <Param>
     <Name>batchClassPriority</Name>
     <Value>NEW_BATCH_CLASS_PRIORITY</Value>
   </Param>
    <Param>
     <Name>batchUNCFolder</Name>
     <Value>NEW_BATCH_CLASS_UNC_FOLDER_NAME</Value>
   </Param>
      <Param>
     <Name> copyBatchClassIdentifier </Name>
     <Value>EXISTING_BATCH_CLASS_ID</Value>
   </Param>
 </Params>
</WebServiceParams>

Note: Values highlighted in blue should be replaced with corresponding values while executing the Web service for copying an existing batch Class.

Sample client code using apache commons http client:- privatestaticvoid createDocumentType() { HttpClient client = new HttpClient(); String url = “http://{serverName}:{port}/dcma/rest/batchClass/copyBatchClass”; PostMethod mPost = new PostMethod(url);

// Adding Input XML file for processing

File file = new File(“C:\\sample\\Input.xml”); Part[] parts = new Part[1]; try { parts[0] = newFilePart(file.getName(), file); MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams()); mPost.setRequestEntity(entity); int statusCode = client.executeMethod(mPost);if (statusCode == 200) { System.out.println(“Web service executed successfully.”); String responseBody = mPost.getResponseBodyAsString();

// Generating result as responseBody.

System.out.println(statusCode + ” *** ” + responseBody); } elseif (statusCode == 403) { System.out.println(“Invalid username/password.”); } else { System.out.println(mPost.getResponseBodyAsString()); } } catch(FileNotFoundException e) { System.err.println(“File not found for processing.”); } catch (HttpException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (mPost != null) { mPost.releaseConnection(); } } }

Learn File

This API will learn all the files present in the batch class folders for the batch class whose identifier is provided as input. Request Method POST Web Service URL: [ http://{serverName}:{port}/dcma/rest/batchClass/learnFile/{BatchClassIdentifier}]

Input Parameter
Value
Description
BatchClassIdentifier This value should be nonempty and a pre-existing Batch Class’s identifier. The value is provided in the URL only. The identifier of the batch class for which learning has to be done.

Note: – Replace the parameter BatchClassIdentifier in the input URL for which learning should be performed.

Sample client code using apache commons http client:-

privatestaticvoid fileLearningService() { HttpClient client = new HttpClient(); String url = “http://localhost:8080/dcma/rest/batchClass/learnFile/{BatchClassIdentifier}“;

PostMethod mPost = new PostMethod(url);

try { int statusCode = client.executeMethod(mPost); if (statusCode == 200) { System.out.println(“Web service executed successfully.”); String responseBody = mPost.getResponseBodyAsString();

// Generating result as responseBody.

System.out.println(statusCode + ” *** ” + responseBody); } elseif (statusCode == 403) { System.out.println(“Invalid username/password.”); } else { System.out.println(mPost.getResponseBodyAsString()); } } catch (HttpException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (mPost != null) { mPost.releaseConnection(); } }

}

Document Type Creator

This API will create the new document type for the specified batch class supplied as an input. Request Method POST

Web Service URL:

http://{serverName}:{port}/dcma/rest/batchClass/documentTypeCreator]

Input Parameter
Value
Description
documentTypeName The document type name should be nonempty and should not contain ‘*’ symbol. This parameter is the unique name of the new document type to be create
documentTypeDescription This should be a non-empty Value This parameter is the description of the new document type created
minConfidenceThreshold The minimum confidence threshold cannot be null and should be between 0 and 100 inclusive of both. The minimum threshold value for the documents recognition
formProcessingProjectFile The name of the RSP/ZON file for recostar/nuance extraction This file would be used for KV extraction by Recostar/Nuance engine
batchClassIdentifier This value should be nonempty and a pre-existing Batch Class Identifier The identity of the Batch Class Identifier under which document type is to be created
Hidden Can be true or false This parameter signifies whether new document type created should be hidden or not.

Check List:-

  1. documentTypeName should be unique and non-empty.
  2. minConfidenceThreshold should be a value between 0 and 100.
  3. formProcessingProjectFile should be a name of pre-existing RSP file.
  4. batchClassIdentifier should be an identity of pre-existing Batch Class.

Sample Input XML: <?xml version=“1.0” encoding=“UTF-8”?> <WebServiceParams>

 <Params>
   <Param>
     <Name>documentTypeName</Name>
     <Value>NEW_DOCUMENT_TYPE_NAME</Value>
   </Param>
   <Param>
     <Name>documentTypeDescription</Name>
     <Value>NEW_DOCUMENT_TYPE_DESCRIPTION</Value>
   </Param>
   <Param>
     <Name>minConfidenceThreshold</Name>
     <Value>CONFIDENCE_THRESHOLD</Value>
   </Param>
    <Param>
     <Name>firstPageProjectFile</Name>
     <Value>RSP_FILE_NAME</Value>
   </Param>
    <Param>
     <Name>firstPageProjectFile</Name>
     <Value>RSP_FILE_NAME</Value>
   </Param>
      <Param>
     <Name>batchClassIdentifier</Name>
     <Value>BATCH_CLASS_ID</Value>
   </Param>
      <Param>
     <Name>hidden</Name>
     <Value>TRUE/FALSE</Value>
   </Param>
 </Params>

</WebServiceParams>

Note: Values highlighted in blue should be replaced with corresponding values while executing the Web service for copying an existing batch Class.

Sample client code using apache commons http client:- privatestaticvoid createDocumentType() { HttpClient client = new HttpClient(); String url = “http://localhost:8080/dcma/rest/batchClass/documentTypeCreator“; PostMethod mPost = new PostMethod(url);

// Adding Input XML file for processing

File file = new File(“C:\\sample\\Input.xml”); Part[] parts = new Part[1]; try { parts[0] = newFilePart(file.getName(), file); MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams()); mPost.setRequestEntity(entity); int statusCode = client.executeMethod(mPost);if (statusCode == 200) { System.out.println(“Web service executed successfully.”); String responseBody = mPost.getResponseBodyAsString();

// Generating result as responseBody.

System.out.println(statusCode + ” *** ” + responseBody); } elseif (statusCode == 403) { System.out.println(“Invalid username/password.”); } else { System.out.println(mPost.getResponseBodyAsString()); } } catch(FileNotFoundException e) { System.err.println(“File not found for processing.”); } catch (HttpException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (mPost != null) { mPost.releaseConnection(); } } }Document Type Creator

Upload files for learning files

This API will upload learning files for a particular batch class to Shared Folder\ [BatchClassID]\lucene-search-classification-sample folder [Document-Type] _First_Page

     [Document-Type] _Middle_Page
    [Document-Type] _Last_Page

Or image-classification-sample folder [Application-Installed-Path]\Shared Folder\ [BatchClassID]\image-classification-sample folder [Document-Type] _First_Page

     [Document-Type] _Middle_Page
    [Document-Type] _Last_Page

Or, both depending upon input supplied.

This Web Service API can upload files (tif, tiff or zip file containing tif/tiff files) for multiple document type of a batch class. Only files will be uploaded without performing any operation.

The upload instruction will be in the form of specific xml format.

””Request Method POST

Web Service URL:

http://{serverName}:{port}/dcma/rest/batchClass/uploadLearningFile]

Input Parameter
Value
Description
batch_class_id This value should be an existing batch class Id. This Parameter specifies the Batch Class Id for which learning files need to be uploaded.
doc_type_name This should be an existing document type. This parameter specifies the document for which files are getting uploaded. In a single XML file can have multiple doc type name, as we can upload document for more than one doc type at a time.
learning_type Its value can be ‘’lucene’’, ‘’Image’’ or ‘’both’’.
If learning type is selected as Lucene file will be uploaded under  Lucene-search-classification-sample folder  only, if learning type is image than file will be uploaded under image-classification-sample folder only. For learning_type value as ‘Both’, files will be uploaded under Lucene as well as Image folder.
file_name Valid FileName. File can be either of tif, tiff extension or zip extension. In case of zip file the files compressed must be of extension tif, tiff. This API accepts learning files in the form of tif, tiff files or an archive of tif, tiff files. To upload multiple files to a directory user can either use multiple file_name tag or create an archive of all files and upload that archive (.zip file). The structure ofr archive is fixed. It needs to be upload.zip > upload > {file1, file 2, file 3}.

””Other than above parameters specified in xml files, user need to upload a complete and accurate XML with other learning files(tif, tiff, zip files).

Sample XML file format:

<upload_learning_files> <batch_class_id>BATCH_CLASS_ID</batch_class_id>

   <doc_type>            
       <doc_type_name>DOCUMENT_TYPE_NAME_1</doc_type_name>
        <learning_type>LEARNING_TYPE</learning_type>
<page_type_first>
           <files_to_be_uploaded>
               <file_name>FILE_NAME_1</file_name>
               <file_name> FILE_NAME_2</file_name>
           </files_to_be_uploaded>
         </page_type_first>
         <page_type_middle>
           <files_to_be_uploaded>
               <file_name>FILE_NAME_1</file_name>
               <file_name> FILE_NAME_2</file_name>
           </files_to_be_uploaded>
       </page_type_middle>
       <page_type_last>
           <files_to_be_uploaded>
               <file_name>FILE_NAME_1</file_name>
               <file_name> FILE_NAME_2</file_name>
           </files_to_be_uploaded>
       </page_type_last>

</doc_type>

   <doc_type>            
   </doc_type>        

</upload_learning_files>

Note:

  • Values highlighted in blue should be replaced with corresponding values while executing the Web service for uploading Files for learning.
  • Parameters page_type_first, page_type_middle, page_type_last are not mandatory.

Check List:-

Before uploading following points need to ensured first:

  1. XML and other required learning files are attached with the request.
  2. Name of learning files mentioned in the XML must match with the file name uploaded with the request.
  3. XMl format must be same as it shown in Sample XML format. Don’t rearrange the xml elements.
  4. batch_class_id, doc_type_name, learning_type, are mandatory information and must need to be specified. User cannot omit these fields.
  5. If user don’t upload file for particular page type(first, middle and last). He can omit the whole block. (Starting from page_type_first, page_type_middle or page_type_last ).
  6. All the upload information need to be uploaded in single XML file. User cannot split information across different XML and then upload all of them. Only 1 xml will be allowed at a time.
  7. In a xml file there needs to be single batch_class_id, but there can be multiple <doc_type>. Inside a doc_typethere can only one doc_type_name, learning_type , page_type_first, page_type_middle, page_type_last block.
  8. If learning files for a particular page folder(ex. First page) are getting uploaded in a single file zip. Zip folder need to follow a specific structure. {zipfileName.zip} > {zipFileName folder} >{file1, file 2, file3 and so on}. Zip file name and first folder name inside zip file needs to be same.

Sample client code using apache commons http client:- privatestaticvoid learnFile() { HttpClient client = newHttpClient(); String url = “http://localhost:8080/dcma/rest/batchClass/uploadLearningFile“; PostMethod mPost = new PostMethod(url);

// Adding Input XML file for processing File file = new File(“C:\\sample\\Input.xml”); File file1 = newFile(“C:\\sample\\first.tif”); File file2 = new File(“C:\\sample\\second.tif”); Part[] parts = new Part[number of files need to be uploaded]; try { parts[0] = new FilePart(file.getName(), file); parts[1] = new FilePart(file1.getName(), file1); parts[2] = new FilePart(file2.getName(), file2); parts[n] = new FilePart(filen.getName(), filen); MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams()); mPost.setRequestEntity(entity); // send post request to serverint statusCode = client.executeMethod(mPost); if(statusCode == 200) { System.out.println(“Web service executed successfully.”); String responseBody = mPost.getResponseBodyAsString();

// Generating result as responseBody. System.out.println(statusCode + ” *** ” + responseBody); } elseif (statusCode == 403) { System.out.println(“Invalid username/password.”); } else { System.out.println(mPost.getResponseBodyAsString()); } }catch (HttpException e) { e.printStackTrace(); } catch(IOException e) { e.printStackTrace(); } finally { if (mPost != null) { mPost.releaseConnection(); } } }

CopyDocumentType

This Web Service API is used to copy an Existing document type for a batch class to create new document type. It takes an XML as input containing information like Existing Document type Name, New Document type name its Description and confidence threshold and output of this API is new document type in line with existing document type.

Request Method: POST

Web Service URL:

http://{serverName}:{port}/dcma/rest/batchClass/copyDocumentType]

Input Parameters for the Web Service a as follows:

Input Parameter
Value
Description
BATCH_CLASS_ID It should contain a value of an existing batch Class Identifier. The identifier of the Batch Class whose document type is copied.
EXISTING_DOC_TYPE_NAME This should be a non-empty Value containing existing document type name. This parameter should contain name of document type of the Batch Class Identifier

which is to be copied through Web service API.NEW_DOC_TYPE_NAMEThis value should be unique name for new document type created.This parameter should unique name for new document type which is to be created.NEW_DOC_TYPE_DESCRIPTIONThis value should contain description for new document type created.This parameter should description for new document type which is to be created.CONFIDENCE_THRESHOLDValue should be between 0.0 to 100.0 inclusive of both values.This parameter should contain confidence threshold value, between 0 to 100 for new document type.

””Sample Input XML :

<Copy_Document_Type>

    <Batch_Class_Id>BATCH_CLASS_ID</Batch_Class_Id> 
    <Existing_Doc_Type_Name>EXISTING_DOC_TYPE_NAME</Existing_Doc_Type_Name>
    <New_Document_Type>
         <Name>NEW_DOC_TYPE_NAME</Name>
         <Description>NEW_DOC_TYPE_DESCRIPTION</Description>
       <Confidence_Threshold>CONFIDENCE_THRESHOLD</Confidence_Threshold>
    </New_Document_Type>

</Copy_Document_Type>

Note: Values highlighted in blue should be replaced with corresponding values while executing the Web service for copying an existing document type for a batch Class.

Sample client code using apache commons http client:- privatestaticvoid copyDocumentType() { HttpClient client = new HttpClient(); String url = “http://localhost:8080/dcma/rest/batchClass/copyDocumentType“; PostMethod mPost = new PostMethod(url);

// Adding Input XML file for processing

File file = new File(“C:\\sample\\Input.xml”);

Part[] parts = new Part[1]; try { parts[0] = new FilePart(file.getName(), file); MultipartRequestEntity entity = newMultipartRequestEntity(parts, mPost.getParams()); mPost.setRequestEntity(entity); int statusCode = client.executeMethod(mPost); if (statusCode == 200) { System.out.println(“Web service executed successfully.”); String responseBody = mPost.getResponseBodyAsString(); // Generating result as responseBody. System.out.println(statusCode + ” *** ” + responseBody); } elseif (statusCode == 403) { System.out.println(“Invalid username/password.”); } else { System.out.println(mPost.getResponseBodyAsString()); } } catch(FileNotFoundException e) { System.err.println(“File not found for processing.”); } catch (HttpException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (mPost != null) { mPost.releaseConnection(); } } }

Web Services Added/Updated with Ephesoft v4.0.6.1

/advBarcodeExtraction

This web service performs barcode extraction on the input document PDF or a ZIP file (enclosed single page or multipage tiff/tif or pdf). Advanced Barcode Extraction plugin is fetched from the batch class corresponding to the input batch class identifier. The extraction is performed based on configurations of the extraction plugins and rules configured for the particular batch class.

Web Service URL

http://<HOSTNAME>:8080/dcma/rest/advBarcodeExtraction

Example-localhost:8080/dcma/rest/advBarcodeExtraction

Input Parameters

Input parameters to this Web Service API are:

  • PDF File: (single or multipage)/TIFF File (single or multipage)/ ZIP File (zip file may contain single page or multipage tif/tiff or pdf)
  • Batch Class Identifier: String parameter for batch class identifier
  • Document Type Name (optional parameter): if user enters a document type name, then no document classification is performed otherwise classification of the document is performed

Output Parameters:

Batch XML is the output for this web service.

Checklist

  • Extraction is done only if Extraction module is configured for the particular batch class.
  • Extraction is performed only if the advanced barcode extraction plugin is present in particular batch class, with its switch ON.

Sample Code

private static void advancedBarcodeExtraction() {

                                HttpClient client = new HttpClient();

                                String url = “http://localhost:8080/dcma/rest/advancedBarcodeExtraction“;

                                PostMethod mPost = new PostMethod(url);

                                File file1 = new File(“C:\\sample\\sample.xml”);

                                // adding xml file for taking input

                                File file2 = new File(“C:\\sample\\US-Invoice.tif”);

                                Part[] parts = new Part[2];

                                try {

                                                parts[0] = new FilePart(file1.getName(), file1);

                                                parts[1] = new FilePart(file2.getName(), file2);

                                                MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());

                                                mPost.setRequestEntity(entity);

                                                int statusCode = client.executeMethod(mPost);

                                                if (statusCode == 200) {

                                                                System.out.println(“Web service executed successfully.”);

                                                                System.out.println(mPost.getResponseBodyAsString());

                                                } else if (statusCode == 403) {

                                                                System.out.println(“Invalid username/password.”);

                                                } else {

                                                                System.out.println(mPost.getResponseBodyAsString());

                                                }

                                } catch (HttpException e) {

                                                e.printStackTrace();

                                } catch (IOException e) {

                                                e.printStackTrace();

                                } finally {

                                                if (mPost != null) {

                                                                mPost.releaseConnection();

                                                }

                                }

                }

/extractFieldsForFuzzyDB

This web service extracts index fields as per the batch class configuration for Fuzzy DB. This takes into account both document level and field Fuzzy configuration.

Web Service URL

http://<HOSTNAME>:8080/dcma/rest/extractFieldsForFuzzyDB

Example-localhost:8080/dcma/rest/extractFieldsForFuzzyDB

Input Parameters

Input parameters to this Web Service API are:

  • Batch Class Identifier (Mandatory)
  • Document Type Name (Mandatory)
  • List of HOCR Page(s) (Optional)
  • List of Index Field Name
  • Index Field Value

Sample Code

private static void extractFieldsForFuzzyDB() {

HttpClient client = new HttpClient();

String url = “http://localhost:8080/dcma/rest/extractFieldsForFuzzyDB“;

PostMethod mPost = new PostMethod(url);

// adding file for sending

File webServInputFile = new File(“C:\\sample\\FuzzyDBExtract_Input.xml”);

File hocrZipFile = new File(“C:\\sample\\HOCR_XML.zip”);

 

Part[] parts = new Part[2];

try {

parts[0] = new FilePart(webServInputFile.getName(), webServInputFile);

parts[1] = new FilePart(hocrZipFile.getName(), hocrZipFile);

 

MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());

mPost.setRequestEntity(entity);

int statusCode = client.executeMethod(mPost);

if (statusCode == 200) {

System.out.println(“Web service executed successfully.”);

String responseBody = mPost.getResponseBodyAsString();

// Generating result as responseBody.

System.out.println(statusCode + ” *** ” + responseBody);

else if (statusCode == 403) {

System.out.println(“Invalid username/password.”);

else {

System.out.println(mPost.getResponseBodyAsString());

}

catch (FileNotFoundException e) {

System.err.println(“File not found for processing.”);

catch (HttpException e) {

e.printStackTrace();

catch (IOException e) {

e.printStackTrace();

finally {

if (mPost != null) {

mPost.releaseConnection();

}

}

}

/searchTextForDocFuzzy

This web service searches the input text passed as a parameter for Document Fuzzy.

Web Service URL

http://<HOSTNAME>:8080/dcma/rest/searchTextForDocFuzzy

Example-localhost:8080/dcma/rest/searchTextForDocFuzzy

Input Parameters

Input parameters to this Web Service API are:

  • Batch Class Identifier
  • Document Type Name
  • Search Text

Sample Code

private static void searchTextForDocFuzzy() {

HttpClient client = new HttpClient();

String url = “http://localhost:8080/dcma/rest/searchTextForDocFuzzy“;

PostMethod mPost = new PostMethod(url);

// adding file for sending

Part[] parts = new Part[4];

try {

parts[0] = new StringPart(“batchClassIdentifier”, “BC1”);

parts[1] = new StringPart(“documentTye”, “Invoice-Table”);

parts[2] = new StringPart(“searchText”, “*”);

parts[3] = new StringPart(“searchType”, “0”);

 

MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());

mPost.setRequestEntity(entity);

int statusCode = client.executeMethod(mPost);

if (statusCode == 200) {

System.out.println(“Web service executed successfully.”);

String responseBody = mPost.getResponseBodyAsString();

// Generating result as responseBody.

System.out.println(statusCode + ” *** ” + responseBody);

else if (statusCode == 403) {

System.out.println(“Invalid username/password.”);

else {

System.out.println(mPost.getResponseBodyAsString());

}

catch (FileNotFoundException e) {

System.err.println(“File not found for processing.”);

catch (HttpException e) {

e.printStackTrace();

catch (IOException e) {

e.printStackTrace();

finally {

if (mPost != null) {

mPost.releaseConnection();

}

}

}

/searchTextForFieldFuzzy

This web service searches the input text passed as a parameter for Field Fuzzy.

Web Service URL

http://<HOSTNAME>:8080/dcma/rest/searchTextForFieldFuzzy

Example-localhost:8080/dcma/rest/searchTextForFieldFuzzy

Input Parameters

Input parameters to this Web Service API are:

  • Batch Class Identifier
  • Document Type Name
  • Index Field Name
  • Search Text

Sample Code

private static void searchTextForFieldFuzzy() {

HttpClient client = new HttpClient();

String url = “http://localhost:8080/dcma/rest/searchTextForFieldFuzzy“;

PostMethod mPost = new PostMethod(url);

// adding file for sending

Part[] parts = new Part[5];

try {

parts[0] = new StringPart(“batchClassIdentifier”, “BC1”);

parts[1] = new StringPart(“documentTye”, “Invoice-Table”);

parts[2] = new StringPart(“searchText”, “*”);

parts[3] = new StringPart(“searchType”, “0”);

parts[4] = new StringPart(“fieldName”, “State”);

MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());

mPost.setRequestEntity(entity);

int statusCode = client.executeMethod(mPost);

if (statusCode == 200) {

System.out.println(“Web service executed successfully.”);

String responseBody = mPost.getResponseBodyAsString();

// Generating result as responseBody.

System.out.println(statusCode + ” *** ” + responseBody);

else if (statusCode == 403) {

System.out.println(“Invalid username/password.”);

else {

System.out.println(mPost.getResponseBodyAsString());

}

catch (FileNotFoundException e) {

System.err.println(“File not found for processing.”);

catch (HttpException e) {

e.printStackTrace();

catch (IOException e) {

e.printStackTrace();

finally {

if (mPost != null) {

mPost.releaseConnection();

}

}

}

/learnFuzzyDatabase

This web service is used for fuzzy database learning based on the input parameters.

Request Method

POST

Web Service URL

http://<HOSTNAME>:8080/dcma/rest/ batchClass/learnFuzzyDatabase

Example-localhost:8080/dcma/rest/learnFuzzyDatabase

Input Parameters

Input Parameter Value Description
batchClassIdentifier It is a mandatory parameter. A valid batch class identifier. For example: BC4. This parameter defines the batch class for which fuzzy database is to be learned.
documentType This parameter is optional. A valid document type for the selected batch class.For example: doc1. This parameter defines that learning is done for the input document type in the selected batch class.
groupNames This parameter is optional. It can have single, multiple group names separated by semi-column, or all groups. A valid group name for the selected batch class.For example: group1;group2.For all groups: ALL This parameter defines that learning is done for the input groups in the selected batch class.

 

Checklist

  • Batch Class having that batchClassIdentifier should have Fuzzy DB plugin configured for processing.
  • Document Type should have document level fields for the specified document type.
  • Group should have proper field level mappings.

Case 1: Input – Batch Class Identifier

In case only batchClassIdentifier is passed as input parameter in the API, learning is done for all the document types within the batch class.

Case 2: Input – Batch Class Identifier and Document Type

In case batchClassIdentifier and documentType is passed as input parameters in the API, Document Fuzzy learning is done for the input document type.

Case 3: Input – Batch Class Identifier, Document Type and Group Name

In case all three parameters are passed in the API, Field Fuzzy learning is done for all the input groups within the document type passed.

  • If multiple groups are required to be passed, then use semi-column separated values (group1;group2).
  • If learning is to be done for all the groups, then pass the value ALL.

Sample Code

private static void learnFuzzyDatabase() {

HttpClient client = new HttpClient();

String url = “http://localhost:8080/dcma/rest/learnFuzzyDatabase“;

PostMethod mPost = new PostMethod(url);

// adding file for sending

Part[] parts = new Part[4];

try {

parts[0] = new StringPart(“batchClassIdentifier”, “BC1”);

parts[1] = new StringPart(“documentTye”, “Invoice-Table”);

parts[2] = new StringPart(“groupNames”, “*”);

 

MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());

mPost.setRequestEntity(entity);

int statusCode = client.executeMethod(mPost);

if (statusCode == 200) {

System.out.println(“Web service executed successfully.”);

String responseBody = mPost.getResponseBodyAsString();

// Generating result as responseBody.

System.out.println(statusCode + ” *** ” + responseBody);

else if (statusCode == 403) {

System.out.println(“Invalid username/password.”);

else {

System.out.println(mPost.getResponseBodyAsString());

}

catch (FileNotFoundException e) {

System.err.println(“File not found for processing.”);

catch (HttpException e) {

e.printStackTrace();

catch (IOException e) {

e.printStackTrace();

finally {

if (mPost != null) {

mPost.releaseConnection();

}

}

}

 

*Authored at time of 4.1 release

restartBatchInstance

$
0
0

This API is used to restart the batch from the specified module. User can restart only those batch instances that are accessible to their role.

Request Method: GET

Input Parameters

Input Parameter Values Descriptions
batchInstanceIdentifier This value should be valid batch instance identifier. This parameter is used to specifying the batch instance identifier for which batch instance to be restart.
restartAtModuleName This value should not be empty.

Example Folder_Import

This parameter is used specifying the module name from where batch needs to be restarted.

 

Web Service URL: http://{serverName}:{port}/dcma/rest/restartBatchInstance/{batchInstanceIdentifier}/{restartAtModuleName}

Checklist:-

  1. Batch Instance identifier should be valid and must be acessible to the user.
  2. restartAtModuleName parameter value should valid module name and it can be differ with batch class.

Sample client code using apache commons http client:-

private static void restartBatchInstance() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/restartBatchInstance/BI1/Folder_Import_Module";
		GetMethod getMethod = new GetMethod(url);
		int statusCode;
		try {
			statusCode = client.executeMethod(getMethod);
			if (statusCode == 200) {
				System.out.println("Web service executed successfully.");
				String responseBody = getMethod.getResponseBodyAsString();
				System.out.println(statusCode + " *** " + responseBody);
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password.");
			} else {
				System.out.println(getMethod.getResponseBodyAsString());
			}
		} catch (HttpException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (getMethod != null) {
				getMethod.releaseConnection();
			}
		}
	}

getBatchClassForRole

$
0
0

This API is used to fetch all batch class list accessable to the specified user role.

Request Method: GET

Input Parameters

Input Parameter Values Descriptions
role This value should not be empty.

 

This parameter is used for specifying the role name for which batch class list to be fetched.

Web Service URL: http://{serverName}:{port}/dcma/rest/getBatchClassForRole/{role}

 

Sample client code using apache commons http client:-

private static void getBatchClassForRole() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/getBatchClassForRole/admin";
		GetMethod getMethod = new GetMethod(url);
		int statusCode;
		try {
			statusCode = client.executeMethod(getMethod);
			if (statusCode == 200) {
				System.out.println("Web service executed successfully.");
				String responseBody = getMethod.getResponseBodyAsString();
				System.out.println(statusCode + " *** " + responseBody);
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password.");
			} else {
				System.out.println(getMethod.getResponseBodyAsString());
			}
		} catch (HttpException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (getMethod != null) {
				getMethod.releaseConnection();
			}
		}
	}

CopyDocumentType

$
0
0

This Web Service API is used to copy an existing document type for a batch class to create new document type. It takes an XML as input containing information of the batch class, Existing Document type Name, New Document type name its Description and confidence threshold and output of this API is new document type in line with existing document type for the mentioned batch class.

Request Method: POST

Web Service URL: http://{serverName}:{port}/dcma/rest/batchClass/copyDocumentType

Input Parameters for the Web Service is as follows:

Input Parameter Values Descriptions
BATCH_CLASS_ID It should contain a value of an existing batch Class Identifier.Eg BC1 The identifier of the Batch Class whose document type is to be copied.
EXISTING_DOC_TYPE_NAME This should be a non-empty Value containing existing document type name.Eg. US Invoice This parameter should contain name of document type of the Batch Class Identifier
which is to be copied.
NEW_DOC_TYPE_NAME This value should be unique name for new document type to be created.Eg. Us Invoice Copy This parameter should unique name for new document type which is to be created.
NEW_DOC_TYPE_DESCRIPTION This value should be unique description for the new document type to be created. This parameter should unique description for new document type which is to be created.
CONFIDENCE_THRESHOLD Values should be between 0.0 and 100.0 inclusive of both values. This parameter should contain confidence threshold value, between 0 and 100 for new document type.

 

Sample Input XML:

<Copy_Document_Type>

<Batch_Class_Id>BC8</Batch_Class_Id>

<Existing_Doc_Type_Name>AsiSeparatorPage</Existing_Doc_Type_Name>

<New_Document_Type>

<Name>test2</Name>

<Description>test2 Description</Description>

<Confidence_Threshold>10</Confidence_Threshold>

</New_Document_Type>

</Copy_Document_Type>

 

Sample client code using apache commons http client:-

private static void copyDocumentType() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/batchClass/copyDocumentType";
		PostMethod mPost = new PostMethod(url);

		// Adding Input XML file for processing
		File file = new File("C:\\sample\\sample.xml");

		Part[] parts = new Part[1];
		try {
		parts[0] = new FilePart(file.getName(), file);
		MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
		mPost.setRequestEntity(entity);

		int statusCode = client.executeMethod(mPost);
		if (statusCode == 200) {
		System.out.println("Web service executed successfully.");
		String responseBody = mPost.getResponseBodyAsString();
		// Generating result as responseBody.
		System.out.println(statusCode + " *** " + responseBody);
		} else if (statusCode == 403) {
		System.out.println("Invalid username/password.");
		} else {
		System.out.println(mPost.getResponseBodyAsString());
		}
		} catch (FileNotFoundException e) {
		System.err.println("File not found for processing.");
		} catch (HttpException e) {
		e.printStackTrace();
		} catch (IOException e) {
		e.printStackTrace();
		} finally {
		if (mPost != null) {
		mPost.releaseConnection();
		}
		}
} 

checkWSStatus Web Service API

$
0
0

Overview
Web service API to query the current running status of the web service. This web service is only useful with initiateOcrClassifyExtract web service. Using this web service the user can figure out the completed state of the ocrClassifyExtract web service request. On running the initiateOcrClassifyExtract web service, a numeric token is returned. The checkWSStatus web service uses this token to determine the current operational state. The various states a web service can be into are
• SPLIT_COMPLETED
• OCRing_COMPLETED
• CLASSIFICATION_COMPLETED

Input Parameters
1. ocrToken: a valid numeric token.
2. downloadHocr: if set to true, API pulls Batch.xml and HOCR file in a Zip file in web-service response. This parameter is optional.

Output Parameters
The outputs to the web service varies as follows.
When the initiateOcrClassifyExtract web service is performing split, OCR or classification results would be SPLIT_COMPLETED, OCRing_COMPLETED and CLASSIFICATION_COMPLETED respectively. When the web service completes the extraction, the result is a valid xml file with extracted fields and values.

Service Request : GET

Web Service URL
http://:8080/dcma/rest/checkWSStatus

Example-
http://localhost:8080/dcma/rest/checkWSStatus

Sample client code using apache commons http client:-

private static void checkWSStatus ()  {
HttpClient client = new HttpClient();
String url = ” http://localhost:8080/dcma/rest/checkWSStatus?ocrToken=1233232323 “;
GetMethod getMethod = new GetMethod(url);
int statusCode; try { statusCode = client.executeMethod(getMethod);
if (statusCode == 200) {
System.out.println(“Web service executed successfully.”);
String responseBody = getMethod.getResponseBodyAsString();
System.out.println(statusCode + ” *** ” + responseBody);
}
else if (statusCode == 403) {
System.out.println(“Invalid username/password.”);
}
else {
System.out.println(getMethod.getResponseBodyAsString());
}

}
catch (HttpException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
finally {
if (getMethod != null)
{
getMethod.releaseConnection();
}
}
}



                       

importBatchClass

$
0
0

This API is used to import an existing batch class. This API takes XML (with input parameters) and batch class to be imported. Batch class is in zip format when exported by Ephesoft which is required by the API

Request Method POST

Web Service URL: http://{serverName}:{port}/dcma/rest/importBatchClass

Inputs to the web service

  • An XML fle for configurations
  • A zip file of batch class

 

 

Input Parameter Values Descriptions
RolesImported Either “true”/”false” This value is used for importing roles with batch class or not.
EmailAccounts Either “true”/”false” This value is used for importing email accounts with batch class or not.
UseSource Either “true”/”false” This value is used for saving the information of source  batch class to be imported
Name This value should not be empty This value is used to configure the batch class name of the imported batch class.
Description This value should not be empty This value is used to configure the description of the imported batch class.
Priority This value should lie in between 1 to 100. This value indicates the priority of batch class.
UseExisting Either “true”/”false” This value is used for overwrite the existing batch class with new batch class.
UncFolder This value should not be empty and have any string value that specified directory path These values specify the UNC folder path for batch class to be imported along with batch class.
BatchClassKey String value to be used as batch class key. The value for batch class key. If algorithm is “NONE” then no value for it is required.
EncryptionAlgorithm Name of encryption algorithm:
  • NONE
  • AES_128
  • AES_256
The type of algorithm to be used for encryption. If “NONE” is set for encryption algorithm then all encryption from batch class is removed. If UseKey value is set as “true” then this tag won’t change anything.
UseKey Either “true”/”false” This parameter is used to specify whether existing batch class encryption key (key used in exported batch class) needs to be used for encrypting batch class or the user wants to provide a new key. In case the value is set as “false”, the user will have to select encryption algorithm and the key to be used for encryption.
Script This tag is configured for ScriptFile to be imported This tag is configured for which Script file to be imported
Folder This tag is configured for Folder to be imported This tag is configured for which folder to be imported along with batch class
importWithLearnFiles Either “true”/”false” This value is used to define if learned files needs to be imported or not

 

Checklist:-

  1. If UseExisting is “true”, existing batch class will be overwriting with the Folders and Script as well as others parameter.
  2. If UseExisting is “false”, new batch class will created and Folders and Scripts will be used as false.
  • If UseSource is “true”, new batch class will have same Name, Description and Priority as source batch class.

 

SampleInputXML:

<ImportBatchClassOptions>

<RolesImported>false</RolesImported>

<EmailAccounts>true</EmailAccounts>

<UseSource>false</UseSource>

<Name>BC9</Name>

<Description>Description </Description>

<Priority>10</Priority>

<UseExisting>false</UseExisting>

<UncFolder>F:\Ephesoft\SharedFolders\bc9unc</UncFolder>

<UseKey>false</UseKey>

<BatchClassKey>key</BatchClassKey>

<EncryptionAlgorithm>NONE</EncryptionAlgorithm>

<importWithLearnFiles>true</importWithLearnFiles> 

<BatchClassDefinition>

<Scripts>

<Script>

<FileName>ScriptDocumentAssembler.java</FileName>

<Selected>true</Selected>

</Script>

<Script>

<FileName>ScriptPageProcessing.java</FileName>

<Selected>true</Selected>

</Script>

</Scripts>

<Folders>

<Folder>

<FileName>image-classification-sample</FileName>

<Selected>false</Selected>

</Folder>

</Folders>

<BatchClassModules>

<BatchClassModule>

<ModuleName></ModuleName>

<PluginConfiguration>true</PluginConfiguration>

</BatchClassModule>

</BatchClassModules>

</BatchClassDefinition>

</ImportBatchClassOptions>

 

Sample client code using apache commons http client:-

private static void importBatchClass() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/importBatchClass";
		PostMethod mPost = new PostMethod(url);
		mPost.setDoAuthentication(true);
		// Input XML for adding parameter.
		File file1 = new File("C:\\sample\\sample.xml");
		// Input zip file for importing batch class.
		File file2 = new File("C:\\sample\\BC4_021315_118.zip");
		Part[] parts = new Part[2];
		try {
			parts[0] = new FilePart(file1.getName(), file1);
			parts[1] = new FilePart(file2.getName(), file2);
			MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
			mPost.setRequestEntity(entity);
			int statusCode = client.executeMethod(mPost);
			if (statusCode == 200) {
				System.out.println("Batch class imported successfully");
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password.");
			} else {
				System.out.println(mPost.getResponseBodyAsString());
			}
		} catch (FileNotFoundException e) {
			System.out.println("File not found for processing.");
		} catch (HttpException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (mPost != null) {
				mPost.releaseConnection();
			}
		}
	}

External Applications

$
0
0

Integrating External Applications with Ephesoft Validation

Ephesoft allows its customers to develop external modules or applications and integrate them to work together with Ephesoft. This section gives in depth details on how to integrate external modules with Ephesoft’s Validation module.

External modules/applications are technology independent and can be written in any language HTML/JavaScript or GWT or JSP/Servelt or combination of both.

Integrated application or module will be displayed in the Review Validation screen as Modal Window. The Right Hand shows the image of the documents where as Left Hand shows the integrated application/module.

Review Validation Screen

BatchDetailScreen

There are shortcut keys as well as buttons defined to fire an External Application for a batch on the Review Validate UI. (App 1, App4, App2, App 3 as can be seen in the above UI)

When the shortcut key or the App button is pressed, the integrated application or module will be displayed in the Review Validation screen as Modal Window.

In the image below, the Right Hand side shows the image of the documents whereas the Left Hand side shows the integrated application/module.

External Application

ExternalApp
IMPORTANT: batch.xml must be updated by the external application. On the click of OK button, Ephesoft simply loads the updated batch.xml.

Follow below steps to for module integration:

1. Let’s assume your application is available at http://localhost:8080/dcma/ExternalApp.html.

2. Login to the Ephesoft Admin Module (Batch Class Management).

3. Navigate to Batch Class -> Modules -> Validate Document module -> Validate Document plugin.

4. Assign URL of the application (http://localhost:8080/dcma/ExternalApp.html) to one of the shortcuts, such as CTRL+8. It is possible to assign multiple applications to multiple shortcuts as you can see below:

External-app-plugin

Closing the external application modal window:

As you can see in the screenshot of the External Application on the review-validate screen, there were two buttons present for closing the external application (earlier).

The OK button provided the functionality of refreshing and displaying refreshed content (on the review-validate screen) for the batch that has been modified through the external application.

The CLOSE button simply goes back to the review-validate screen without refreshing the content of the batch, assuming that no changes have been made to the batch.xml by the external application.

Now we have removed the extra click that the user has to do in case of refreshing the screen or closing the pop updialog window.

Now both the functionalities (i.e. refreshing the screen after batch.xml updates or closing the pop up window without refreshing the Review Validate Screen) will be the implemented via third party applications. We have provided a handle to the externally integrated applications by means of which they can communicate with the Ephesoft Application.

We have removed the ok and close buttons. External applications need to copy the below mentioned method in their code. They need to invoke this method on the respective button (ok or close) calls which they have implemented. External applications will signal Ephesoft to perform respective operations by passing the appropriate operation string in the method argument. Accepted operation strings are listed in the table below.

Method code for GWT based applications:

private native void fireEvent(String operation) /*-{

window.top.postMessage(operation,”*”);

}-*/;

Method code for Javascript based applications:

function fireEvent(var operation) {window.top.postmessage(operation, “*”);}

The action performed by us in accordance to the argument passed to this method in the external application’s code:

Argument Passed by External application Result on our application
“Save” The dialog box containing the external application on the review-validate screen closes and the changes made in batch.xml get reflected on thescreen(The functionality previously provided by the OK button on the dialog box)
“Cancel” The dialog box containing the external application on the review-validate screen closes, without refreshing the RV screen. (The functionality previously provided by the CLOSE button on the dialog box)
Any other string No Change (Dialog box will not disappear)

How to use the External Application:

It is expected that the external application would play around with the data contents of the documents (i.e. the batch) presently being displayed on the review validate screen. (For which the external app is fired)

Hence we provide the external application the following two parameters appended in its URL, using which the external app can fetch/modify/delete the contents of the batch:

  • Path of the batch.xml for the current batch: The batch.xml contains the information regarding the batch. We provide the batch.xml path, which the ::external app can parse and play around with as and when it likes.
The parameter is specified in the URL by: “batch_xml_path”
Encoding of Batch xml path parameter:
The batch xml path is encoded using java.net.URLEncoder and UTF-8 encoding.
  • Document Identifier: The identifier of the document in focus is also passed onto the external application. The parameter is specified in the URL by: “document_id”

Sample URL fired for an external app by Ephesoft:

{Ext. App URL}&document_id={Document Identifier}&batch_xml_path={Path of batch.xml}&ticket={Security Token}

Or

{Ext. App URL}?document_id={Document Identifier}&batch_xml_path={Path of batch.xml}&ticket={Security Token}

External Application and Security:

We are generating a dynamic token for every External Application window which is opened via Ephesoft Application. This token is sent to the External App by appending another parameter “ticket” in the External App URL. Once this token is received by the External App, it can hit the below provided URL for checking the authenticity of the token.

http://{EphesoftServerIP}:{port}/dcma/authenticate?ticket={ticket}

Ephesoft Server in response will send a status code as to whether this ticket is valid or not:

  • Status Code 200 – Authorized
  • 401 – Unauthorized

The token is issued as soon as the user opens the external application window. A valid token becomes invalid once:

  • Token has already been sent to the Ephesoft server for authentication.
  • One hour after this token has been issued.

Configuring the Title of External Applications through the admin UI

We have eliminated the Application URL from the title of External App Window. Title is now configurable through the Admin UI.

deleteBatchInstance

$
0
0

This API is used to delete the batch instance for the specific batch instance identifier. This API will delete that batch instance being accessed by the authenticated user.

Request Method: GET

Web Service URL: http://{serverName}:{port}/dcma/rest/deleteBatchInstance/{identifier}

Input Parameter Values Descriptions
batchInstanceIdentifier This value should be a valid batch instance identifier.Example BI10 This parameter is used to specify the batch instance to be deleted.

 

Sample client code using apache commons http client:-

private static void deleteBatchInstance() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/deleteBatchInstance/BI2";
		GetMethod getMethod = new GetMethod(url);
		int statusCode;
		try {
			statusCode = client.executeMethod(getMethod);
			if (statusCode == 200) {
				System.out.println("Web service executed successfully.");
				String responseBody = getMethod.getResponseBodyAsString();
				System.out.println(statusCode + " *** " + responseBody);
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password.");
			} else {
				System.out.println(getMethod.getResponseBodyAsString());
			}
		} catch (HttpException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (getMethod != null) {
				getMethod.releaseConnection();
			}
		}
	}

getBatchInstanceForRole

$
0
0

This API is used to fetch the list of all batch instance accessable to the specific user role.

Request Method: GET

Input Parameter

Input Parameter Values Descriptions
role This value should not be empty.

 

This parameter is used for specifying the role name for which batch instance list to be fetched.

 

Web Service URL: http://{serverName}:{port}/dcma/rest/getBatchInstanceForRole/{role}

 

Sample client code using apache commons http client:-

private static void getBatchInstanceForRole() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/getBatchInstanceForRole/admin";
		GetMethod getMethod = new GetMethod(url);
		int statusCode;
		try {
			statusCode = client.executeMethod(getMethod);
			if (statusCode == 200) {
				System.out.println("Web service executed successfully.");
				String responseBody = getMethod.getResponseBodyAsString();
				System.out.println(statusCode + " *** " + responseBody);
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password.");
			} else {
				System.out.println(getMethod.getResponseBodyAsString());
			}
		} catch (HttpException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (getMethod != null) {
				getMethod.releaseConnection();
			}
		}
	}

Alert: Download Temporarily Unavailable

$
0
0

Ephesoftlogo

This page is currently being worked on by our Support Staff.

You will be alerted when the Download page is officially available.

restartAllBatchInstance

$
0
0

This API is used to restart all the batches that can be accessed by the authenticated user having status READY_FOR_REVIEW or READY_FOR_VALIDATION.

Request Method: GET

Web Service URL: http://{serverName}:{port}/dcma/rest/restartAllBatchInstance

Checklist:-

  1. Only user accesbile batches will restart whose status is READY_FOR_REVIEW or READY_FOR_VALIDATION.

 

Sample client code using apache commons http client:-

private static void restartAllBatchInstance() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/restartAllBatchInstance";
		GetMethod getMethod = new GetMethod(url);
		int statusCode;
		try {
			statusCode = client.executeMethod(getMethod);
			if (statusCode == 200) {
				System.out.println("Web service executed successfully.");
				String responseBody = getMethod.getResponseBodyAsString();
				System.out.println(statusCode + " *** " + responseBody);
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password.");
			} else {
				System.out.println(getMethod.getResponseBodyAsString());
			}
		} catch (HttpException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (getMethod != null) {
				getMethod.releaseConnection();
			}
		}
	}

Learn File

$
0
0

This API will learn all the files present in the batch class folders for the batch class whose identifier is provided as input.

Request Method POST

Web Service URL: http://{serverName}:{port}/dcma/rest/batchClass/learnFile/{BatchClassIdentifier}

Input Parameter Values Descriptions
BatchClassIdentifier This value should be nonempty and a pre-existing Batch Class’s identifier. The value is provided in the URL only. The identifier of the batch class for which learning has to be done.

Note: – Replace the parameter BatchClassIdentifier in the input URL for which learning should be performed.

Sample client code using apache commons http client:-

private static void fileLearningService() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/batchClass/learnFile/BC5";
		PostMethod mPost = new PostMethod(url);
		try {
			int statusCode = client.executeMethod(mPost);
			if (statusCode == 200) {
				System.out.println("Web service executed successfully.");
				String responseBody = mPost.getResponseBodyAsString();
				// Generating result as responseBody.
				System.out.println(statusCode + " *** " + responseBody);
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password.");
			} else {
				System.out.println(mPost.getResponseBodyAsString());
			}
		} catch (HttpException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (mPost != null) {
				mPost.releaseConnection();
			}
		}
	}

Transact Property File Reference Guide

$
0
0

Ephesoft Transact Property File Reference Guide

This document lists and describes the Ephesoft Transact properties files, to include the path in which each property file is located, with links to additional information.

For additional information about Ephesoft Transact folders, refer to the following resource:

  • Ephesoft Folder Structure

https://wiki.ephesoft.com/ephesoft-folder-structure

Properties Files in Ephesoft Transact

Application.properties (Transact properties)

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF

This file contains many configuration settings for Ephesoft application-level properties. Examples include custom reports settings, user interface display settings, user access and more. The following article has additional information:

  • Application.properties

https://wiki.ephesoft.com/application-properties

application.properties (log monitoring)

Folder:  C:\Ephesoft\Application\monitoring-tool\config

This file is used to configure the Log Monitoring Tool by setting the appropriate properties. The following article has additional information about this properties file and the Log Monitoring Tool:

  • What’s New in Transact 4.5 — Log Monitoring Tool

https://wiki.ephesoft.com/home/documentation/log-monitoring-tool

aspects-mapping.properties

Folder:  SharedFolders\<BC Id>\cmis-plugin-mapping

This file contains aspect mapping for the documents to be uploaded to CMIS export repository.

Multiple Attribute Fields — Transact 4.5.0.0 enhances the CMIS Export plugin to include multi-attribute property support. Now the user can configure CMIS export to populate Multiple/Repeating values into external repositories. Transact 4.5.0.0 successfully processes batches, and values are exported to the fields with the Multiple property set to True on the CMIS side. Transact only supports multiple value configuration for DLF-Attribute- mapping (document-level field mapping).

The following articles have additional information:

  • Ephesoft Wiki Article — CMIS Export Plugin (Revision 3)

http://wiki.ephesoft.com/cmis-export-plugin-3

  • Ephesoft Wiki Article — How to Export to CMIS Export Plugin

https://wiki.ephesoft.com/how-to-export-batch-level-fields-to-cmis-export

  • Ephesoft Transact 4.5.0.0 — Release Notes

http://download.ephesoft.com/Ephesoft_Product/v4.5.0.0/Transact4500-ReleaseNotes-March27-430pm-External.pdf

cas-config.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\CAS-config

This file contains settings that define the CAS server and service host which are used to ensure proper communication between the CAS server and Ephesoft Transact. The following article has additional information:

  • CAS-Based SSO Framework

https://wiki.ephesoft.com/sso-cas-based-sso-framework

catalina.properties

Folder:  C:\Ephesoft\JavaAppServer\conf

This is a regular Java properties file that contains configuration settings for loaders that support Tomcat. This file sets some important class loader paths, security package lists, and some tunable performance properties. This file does not support the bootstrap loader or system loader, both of which are handled by the Java Virtual Machine (JVM). The following article has additional information:

  • properties File Overview

https://www.safaribooksonline.com/library/view/tomcat-the-definitive/9780596101060/ch07s05.html

db-export-mapping.properties

Folder:  C:\Ephesoft\Dependencies\SharedFolderChanges

This sample file is used in each batch class to save the data of document-level fields for a batch instance to the database. The following articles have additional information:

  • DB Export Configuration (How To)

https://wiki.ephesoft.com/db-export-configuration

  • DB Export Plugin (Revision 2)

https://wiki.ephesoft.com/db-export-plugin-2

  • DB Export Mapping Sample

https://wiki.ephesoft.com/db-export-mapping-sample

db-export-mapping.properties (DB Export Plugin Mapping)

Folder:  SharedFolders\<BC Id>\db-export-plugin-mapping

This file is used for saving the data of document-level fields for a batch instance to the database. The following article has additional information about DB export mapping:

  • DB Export Mapping Sample

https://wiki.ephesoft.com/db-export-mapping-sample

dcma-backup-service.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-util

This file defines settings that apply when the batch xml backup file needs to be taken, whether after the execution of every plugin, or after the execution of every module.

The following articles have additional information:

  • Migrating the Ephesoft SharedFolders Location

http://wiki.ephesoft.com/migrating-the-ephesoft-sharedfolders-location

  • Batch Execution Back-up XMLs

https://wiki.ephesoft.com/batch-execution-back-up-xmls-4050

  • KB7918 — Ephesoft OpenLDAP Directory Service 2.4

https://wiki.ephesoft.com/ephesoft-openldap-directory-service-2-4-is-unable-to-start-kb7918

dcma-batch.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-batch

This file contains configuration settings for batch processing and details. The following article has additional information:

  • Batch Instance Progress Bars

https://wiki.ephesoft.com/batch-instance-progress-bars-4040

dcma-box-plugin.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-box-plugin

This file contains configuration settings related to the Box export plugin. The following article has additional information:

  • Configuring and Using the Box Export Plugin (Transact 4.5.0.x)

https://wiki.ephesoft.com/export-configuring-and-using-the-box-export-plugin

dcma-cmis.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-cmis

This file contains configuration settings related to the CMIS export plugin. The following article has additional information:

  • CMIS Export Plugin

https://wiki.ephesoft.com/cmis-export-plugin-3

dcma-cmis-import.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-cmis-import

This file contains configuration settings related to importing files from CMIS. The following article has additional information:

  • CMIS Import

https://wiki.ephesoft.com/cmis-import

dcma-core.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-core

This file contains configuration settings to manage the thread pool. The following article has additional information:

  • B0171512 Long running batches and duplicate RecostarPlugin processes

https://wiki.ephesoft.com/kb0171512-long-running-batches-and-duplicate-recostarplugin-processes

dcma-db.properties (Database)

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-data-access

This file contains configuration settings for database information. The following articles have additional information:

  • How to confirm Ephesoft and report database settings with Heidi Sql

https://wiki.ephesoft.com/kb0009777-confirm-ephesoft-and-report-database-settings-with-heidi-sql

  • Windows Authentication: Ephesoft Database

https://wiki.ephesoft.com/windows-authentication-ephesoft-database

dcma-db.properties (MariaDB)

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-data-access\MariaDB

This file contains configuration settings for the MariaDB database. This file should not be modified in most cases. The following articles have additional information about MariaDB configuration:

  • Ephesoft Transact Installation with Local MariaDB in Azure Environment

https://wiki.ephesoft.com/ephesoft-transact-installation-with-local-mariadb-in-azure-environment

  • Reporting Revamp

http://wiki.ephesoft.com/reporting-revamp

  • Maximum MariaDB Connections

https://wiki.ephesoft.com/maximum-mariadb-connections

dcma-db.properties (MSSQL)

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-data-access\MSSQL

This file contains configuration settings for the MSSQL database. This file should not be modified in most cases. The following articles have additional information about MSSQL configuration:

  • MSSQL Windows Authentication: Setup Ephesoft Database without SQL Server Authentication

http://wiki.ephesoft.com/mssql-windows-authentication-setup-ephesoft-database-without-sql-server-authentication

  • Microsoft SQL Server (MSSQL) Configuration Instruction

http://wiki.ephesoft.com/microsoft-sql-server-mssql-installation-and-configuration-instructions

dcma-db.properties (Oracle)

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-data-access\Oracle

This file contains configuration settings for the Oracle database. This file should not be modified in most cases. The following articles have additional information about Oracle configuration:

  • How to Migrate the Existing Transact Database to Another Server

https://wiki.ephesoft.com/how-to-migrate-the-existing-transact-database-to-another-server

  • Connectivity | Oracle

https://wiki.ephesoft.com/home/documentation/connectivity-oracle

dcma-docushare-export.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-docushare-export

This file contains configuration settings for the Docushare export module. The following article has additional information:

  • Docushare Export Plugin

https://wiki.ephesoft.com/docushare-export-plugin

dcma-encryption.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-encryption

This file contains configuration settings for using encryption in Ephesoft. The following articles have additional information:

  • How to Encrypt Server Configuration Passwords

http://wiki.ephesoft.com/how-to-encrypt-sever-configuration-passwords

  • FAQs – Password Encryption

https://wiki.ephesoft.com/faqs-password-encryption

dcma-export.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-export

This file contains configuration settings for batch export. The following articles have additional information:

  • Copy Batch XML Plugin

https://wiki.ephesoft.com/copy-batch-xml-plugin-2

  • Config Files In 3034 SP

http://wiki.ephesoft.com/config-files-in-3034-sp

dcma-export-webservices.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-export-webservices

This file contains configuration settings for EXPORT_TO_WEB_SERVICE plugin. The following articles have additional information:

  • Custom Export to Web Services Guide

https://wiki.ephesoft.com/home/documentation/custom-export-to-web-services-guide

  • Developer Web Services API Guide

https://www.ephesoft.com/learn/developers/

  • Web Services API

https://wiki.ephesoft.com/web-services-api

dcma-ftp.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-ftp

This file contains configuration settings that define the FTP connection for transferring and retrieving files from an FTP server. The following articles have additional information:

  • How to Encrypt Passwords in Ephesoft files

https://wiki.ephesoft.com/how-to-encrypt-passwords-in-ephesoft-files

  • Grid Computing

http://wiki.ephesoft.com/grid-computing

dcma-ibm-cm.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-ibm-cm

This file contains configuration settings to export Batch XML in IBM content management schema format. The following article has additional information about this properties file and IBM export:

  • IBM CM Plugin

https://wiki.ephesoft.com/ibm-cm-plugin

dcma-import-folder.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-import-folder

This file contains configuration settings related to folder import. The following articles have additional information:

  • How to set Ignored character in the DCMA-import-folder.properties

http://wiki.ephesoft.com/how-to-set-ignored-character-in-the-dcma-import-folder-properties

  • Import batch folder plugin

https://wiki.ephesoft.com/import-batch-folder-plugin

dcma-key-regex.properties (Key Value Learning plugin)

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-key-value-learning

This file contains configuration settings for the key value learning plugin. The following articles have additional information:

  • Using Auto-Learning(Key-Value Rule Creation) Export Plugin

https://wiki.ephesoft.com/using-auto-learningkey-value-rule-creation-export-plugin

  • Key Value Learning Plugin

https://wiki.ephesoft.com/key-value-learning-plugin-2

dcma-key-regex.properties

Folder:  SharedFolders\<BC Id>\key-value-learning (Regex)

This file contains regular expressions for keys in key value learning. If there is no match there, it will take the first word that is more than x characters long, where x is minimum length set in the value expression. The following article has additional information:

  • Key Value Learning Plugin

https://wiki.ephesoft.com/key-value-learning-plugin

dcma-key-value-location.properties (Key Value Learning plugin)

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-key-value-learning

This file contains configuration settings for the key value learning plugin. The following article has additional information:

  • Key Value Configuration (Revision 2)

https://wiki.ephesoft.com/key-value-learning-plugin-2

dcma-key-value-location.properties

Folder:  SharedFolders\<BC Id>\key-value-learning (Key location lookup)

This file determines the location in which to look for the key that corresponds to the value fetched in key value learning. The following articles have additional information about key value learning:

  • Key Value Learning Plugin (2014 article)

https://wiki.ephesoft.com/key-value-learning-plugin

  • Key Value Configuration (Revision 2)

https://wiki.ephesoft.com/key-value-learning-plugin-2

dcma-nsi-export.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-nsi-export

This file contains configuration settings for exporting a zipped file for a batch xml file in a format acceptable by the NSI content management system (CMS). The following article has additional information about using the NSI export plugin:

  • NSI Export Plugin

https://wiki.ephesoft.com/nsi-export-plugin

dcma-paragraph-extraction.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-paragraph-extraction

This file contains configuration settings related to paragraph extraction plugin. The following articles have additional information:

  • Paragraph Extraction — Ephesoft Wiki

http://wiki.ephesoft.com/wp-content/uploads/2016/11/EEN-217-Paragraph_Extraction.pdf

  • Clean-up for Ephesoft Database and report back-up data from File System

https://wiki.ephesoft.com/clean-up-for-ephesoft-database-and-report-back-up-data-from-file-system

dcma-reporting.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-reporting

This file contains information related to reporting. The following articles have additional information:

  • Ephesoft Reporting

https://wiki.ephesoft.com/ephesoft-reporting

  • Reporting Optimization

https://wiki.ephesoft.com/reporting-optimization

dcma-scripting-plugin.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-scripting-plugin

This file contains configuration settings for application-level scripts. The following articles have additional information:

  • Scripting Plugin

https://wiki.ephesoft.com/scripting-plugin

  • Application Level Script

https://wiki.ephesoft.com/application-level-script

dcma-sharepoint-export.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-sharepoint-export

This file contains configuration settings for the Sharepoint export plugin. The following article has additional information:

  • SharePoint Plugin Improvements

https://wiki.ephesoft.com/home/documentation/export-sharepoint-plugin-improvements

dcma-tabbed-pdf.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-tabbed-pdf

This file contains configuration settings for the Tabbed PDF plugin. The following articles have additional information:

  • Tabbed PDF Plugin

https://wiki.ephesoft.com/tabbed-pdf-plugin-2

  • TABBED_PDF Plugin and Ordering Doc Types

http://wiki.ephesoft.com/home/documentation/tabbed_pdf-plugin-and-ordering-doc-types

dcma-tablefinder.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-table-finder

This file contains configuration settings for the Table Extraction plugin. The following article has additional information:

  • Table Extraction Plugin

https://wiki.ephesoft.com/table-extraction-plugin-3

dcma-tempfolder-cleanup.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-tempfolder-cleanup

This file contains configuration settings to free the disc space consumed by the temporary folders within the Shared Folder of the Ephesoft installation directory. This folder may accumulate files that are created and need to be purged on a periodic basis. created over a period of time. The following article has additional information about configuring this file for cleanup functions:

  • Ephesoft Temp Folder Cleanup

http://wiki.ephesoft.com/ephesoft-temp-folder-clean-up

dcma-twain-scanner.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-twain-scanner

This file contains configuration settings for Twain driver-related properties. The following articles have additional information about the Web Scanner and Twain driver settings:

  • Web Scanner Configuration (Revision 2)

https://wiki.ephesoft.com/web-scanner-configuration-2

  • Web Scanner Support

http://wiki.ephesoft.com/web-scanner-support

  • How to Use Web Scanner

https://wiki.ephesoft.com/how-to-use-web-scanner

dcma-value-regex.properties (Key Value Learning plugin)

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-key-value-learning

This file contains configuration settings for the key value learning plugin. The following articles have additional information:

  • Using Auto-Learning (Key-Value Rule Creation) Export Plugin

https://wiki.ephesoft.com/using-auto-learningkey-value-rule-creation-export-plugin

  • Key Value Learning Plugin

https://wiki.ephesoft.com/key-value-learning-plugin-2

dcma-value-regex.properties (Matching values in key value learning)

Folder:  SharedFolders\<BC Id>\key-value-learning

This file contains regular expressions for values that are used in key value learning to find matching value expressions. The following articles have additional information about using this properties file and rule creation:

  • Using Auto-Learning(Key-Value Rule Creation) Export Plugin

https://wiki.ephesoft.com/using-auto-learningkey-value-rule-creation-export-plugin

  • Key Value Learning Plugin

https://wiki.ephesoft.com/key-value-learning-plugin-2

dcma-webscanner.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\gwt-web-scanner

This file contains configuration settings related to the Ephesoft Web Scanner. The following articles have additional information about the Web Scanner:

  • Web Scanner Configuration

https://wiki.ephesoft.com/web-scanner-configuration-2

  • Web Scanner Support

http://wiki.ephesoft.com/web-scanner-support

  • How to Use Web Scanner

https://wiki.ephesoft.com/how-to-use-web-scanner

dcma-workflows.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-workflows

This file contains configuration settings for the Transact application workflow. The following articles have additional information:

  • How To Configure the Workflow Properties

https://wiki.ephesoft.com/how-to-configure-the-workflow-properties

  • KB0014970 — IMAGEMAGICK files filling up temp folder

https://wiki.ephesoft.com/kb0014970-imagemagick-files-filling-up-temp-folder

details.properties

Folder:  C:\Ephesoft\Dependencies\licensing

This file is used to gather details on a specific machine to allow for licensing. The following articles have additional information:

  • Licensing Ephesoft Transact 4.5.0.x

https://wiki.ephesoft.com/licensing-licensing-ephesoft-transact-4-5-0-x

  • KB00y22363 — Regenerate details.properties for Licensing and MAC address Changes

https://wiki.ephesoft.com/kb0022363-regenerate-details-properties-for-licensing-and-mac-address-changes

dictionary_mappings.properties

Folder:  SharedFolders\<BC Id>\machine-learning-dictionaries\knowledge-base\dictionaries

This file contains mappings of the dictionary name, dictionary file and display values used in machine learning extraction. The following article has additional information:

  • Machine Learning | Custom Dictionary Support

https://wiki.ephesoft.com/home/documentation/machine-learning-custom-dictionary-support

DLF-Attribute-mapping.properties (Document property mappings)

Folder:  SharedFolders\<BC Id>\cmis-plugin-mapping

This file contains document properties mapping for the documents to be uploaded to the CMIS repository. The following articles have additional information:

  • Ephesoft Wiki Article — CMIS Export Plugin (Revision 3)

http://wiki.ephesoft.com/cmis-export-plugin-3

  • Ephesoft Wiki Article — How to Export to CMIS Export Plugin

https://wiki.ephesoft.com/how-to-export-batch-level-fields-to-cmis-export

  • Ephesoft Transact 4.5.0.0 — Release Notes

http://download.ephesoft.com/Ephesoft_Product/v4.5.0.0/Transact4500-ReleaseNotes-March27-430pm-External.pdf

DLF-Attribute-mapping.properties (Export properties files for Filenet)

Folder:  SharedFolders\<BC Id>\export-to-HPII-filenet-plugin-mapping

This is the properties file for export to the HPII Filenet plugin. The following article has additional information:

  • Ephesoft Wiki Article — CMIS Export Plugin (Revision 3)

http://wiki.ephesoft.com/cmis-export-plugin-3

etl-variables.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-reporting

This file contains configuration settings for connecting to the report database. By default, it is configured to point to the report database created by Ephesoft. The following articles have additional information:

  • Ephesoft Reports (Revision 3)

http://wiki.ephesoft.com/ephesoft-reports-3

  • Ephesoft Reporting

https://wiki.ephesoft.com/ephesoft-reporting

export-script.properties

Folder:  SharedFolders\property

This file is used to manage the order of bookmarks from the Tabbed PDF plugin, based on the order or priority of document types cited in this file. The following articles have additional information:

  • TABBED_PDF Plugin and Ordering Doc Types

https://wiki.ephesoft.com/home/documentation/tabbed_pdf-plugin-and-ordering-doc-types

  • Tabbed PDF Plugin

https://wiki.ephesoft.com/tabbed-pdf-plugin-2

filebound-mapping.properties

Folder:  SharedFolders\<BC Id>\filebound-plugin-mapping

This file is not used. The FileBound Export plugin has been soft-deleted from the database. It is used for exporting files to the repository. The following article has additional information:

  • Scripting Guide

https://wiki.ephesoft.com/scripting-guide

folder-monitor.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-folder-monitor

This file contains configuration settings for folder monitoring, to include settings that govern the creation of new batch instances. This includes updates to the batch instance database table. The following articles have additional information:

  • KB0012454 – Folder monitoring is not responsive

https://wiki.ephesoft.com/folder-monitoring-is-not-responsive

  • How folder monitor and folder import work together

https://wiki.ephesoft.com/how-folder-monitor-and-folder-import-work-together

format-conversion.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-format-conversion

This file contains configuration settings for format conversion functions in Ephesoft Transact. The following articles have additional information:

  • Field Extraction | Format Conversion

https://wiki.ephesoft.com/home/documentation/field-extraction-format-conversion

  • Format Conversion

http://wiki.ephesoft.com/wp-content/uploads/2016/11/EEN-208-Format_Conversion.pdf

fuzzy-db.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-fuzzydb

This file contains configurations related to fuzzy DB functionality. The following articles have additional information:

  • Fuzzy DB Design Revamp

http://wiki.ephesoft.com/fuzzy-db-design-revamp

  • Fuzzy DB Extraction (Revision 2)

http://wiki.ephesoft.com/how-to-use-the-fuzzy-db-extraction-plugin

  • How to use the Fuzzy DB Extraction Plugin

http://wiki.ephesoft.com/how-to-use-the-fuzzy-db-extraction-plugin

heart-beat.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-heart-beat

This file contains configuration settings that provide the interval to check whether the servers registered in the database are still active. The following article has additional information:

  • Config Files In 3034 SP

http://wiki.ephesoft.com/config-files-in-3034-sp

imagemagick.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-imagemagick

This file contains configuration settings that define the image conversion process. The following articles have additional information:

  • Convert PDFs to TIF Files

https://wiki.ephesoft.com/convert-pdf-to-tif

  • ImageMagick Processing Parameters

https://wiki.ephesoft.com/imagemagick

key_exclusion_list.properties (Key Value Learning plugin)

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-key-value-learning

This file contains configuration settings for key value learning plugin. The following article has additional information:

  • Key Value Learning Plugin

https://wiki.ephesoft.com/key-value-learning-plugin

key_exclusion_list.properties (Regex for exclusion)

Folder:  SharedFolders\<BC Id>\key-value-learning

This file contains a list of regular expressions which are to be excluded for the key in key value learning. The following article has additional information:

  • Key Value Learning Plugin

https://wiki.ephesoft.com/key-value-learning-plugin

license-client.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\ephesoft-license-client

This file stores the license server details for every client in the Transact deployment. The following articles have additional information:

  • Multi-Server Deployment

https://wiki.ephesoft.com/multi-server-deployment

  • Other Configurations

https://wiki.ephesoft.com/3-0-product-documentation#Other_Configurations

logging.properties

Folder:  C:\Ephesoft\JavaAppServer\conf

This file is used to get logging out of web app by creating a logger. The following article has additional information:

  • Changing log locations in Linux

https://wiki.ephesoft.com/changing-log-locations-in-linux

mail-import.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-mail-import

This file contains configuration settings for email import. The following article has additional information:

  • Email Import — Version 4.5.0.0

https://wiki.ephesoft.com/email-import

  • How to Configure Email Import

https://wiki.ephesoft.com/how-to-configure-email-import

notice.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF

This file contains configuration settings related to notice display and verification.

open-office.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-open-office

This file contains properties related to LibreOffice.

regex_mappings.properties

Folder:  SharedFolders\<BC Id>\machine-learning-dictionaries\knowledge-base\regex

This file contains mapping of regex name and regex value used in machine learning extraction. The following article has additional information:

  • Machine Learning | Custom Dictionary Support

https://wiki.ephesoft.com/home/documentation/machine-learning-custom-dictionary-support

tesseract-reader.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-tesseract

This file contains properties related to the Tesseract OCR engine plugin. The following article has additional information about this plugin:

  • Tesseract HOCR Plugin

http://wiki.ephesoft.com/tesseract-hocr-plugin-2

User.properties

Folder:  C:\Ephesoft\Dependencies\licensing

This fil   e holds user-specific licensing details. The following article has additional information about licensing Ephesoft Transact:

  • Licensing Ephesoft Transact 4.5.0.x

https://wiki.ephesoft.com/licensing-licensing-ephesoft-transact-4-5-0-x

user-connectivity.properties

Folder:  C:\Ephesoft\Application\WEB-INF\classes\META-INF\dcma-user-connectivity

This file contains configuration settings for users and group information. Use this file for configuration for LDAP, AD and Tomcat in this file. The following articles have additional information:

  • User Management

https://wiki.ephesoft.com/user-management#user-connectivityproperties

  • How to Administer Ephesoft Users & Groups

https://wiki.ephesoft.com/how-to-administer-ephesoft-users-groups

workers.properties

Folder:  C:\Ephesoft\Apache24\conf

This properties file configures load balancing with Apache. The following articles have additional information:

  • Apache Server SSL setup with Ephesoft on Linux

https://wiki.ephesoft.com/apache-server-ssl-setup-with-ephesoft-on-linux

  • The Apache Tomcat Connectors – Reference Guide

https://tomcat.apache.org/connectors-doc/reference/workers.html

  • Config Files In 3034 SP

http://wiki.ephesoft.com/config-files-in-3034-sp

XssFilter.properties

Folder:  C:\Ephesoft\EphesoftReports\WEB-INF

This file contains filters which are applied to optional URL patterns. If the URL contains the pattern, then the filter characters that follow it are applied.

getAllModulesWorkflowNameByBatchClass

$
0
0

This API will return the module workflow names and the module names for the specified batch class identifier.

Request Method: GET

Input Parameters

Input Parameter Values Descriptions
batchClassIdentifier This value should not be empty. This parameter is used for specifying the batch class identifier for which module name to be fetched.

Web Service URL: http://{serverName}:{port}/dcma/rest/getAllModulesWorkflowNameByBatchClass/{batchClassIdentifier}

Sample client code using apache commons http client:-

private static void getAllModulesWorkflowNameByBatchClass() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/getAllModulesWorkflowNameByBatchClass/BC1";
		GetMethod getMethod = new GetMethod(url);
		int statusCode;
		try {
			statusCode = client.executeMethod(getMethod);
			if (statusCode == 200) {
				System.out.println("Web service executed successfully.");
				String responseBody = getMethod.getResponseBodyAsString();
				System.out.println(statusCode + " *** " + responseBody);
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password.");
			} else {
				System.out.println(getMethod.getResponseBodyAsString());
			}
		} catch (HttpException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (getMethod != null) {
				getMethod.releaseConnection();
			}
		}
	}

classifyBarcodeImage

$
0
0

This API is used to classify the input barcode image according to the specified batch class. Image file should have barcode and barcode value should be document type which is present in the batch class.

Request Method POST

Input Parameters

Input Parameter Values Descriptions
batchClassId This value should not be empty and it should be batch class identifier like BC1. This parameter is used for providing batch class identifier on which classify HOCR will perform.

Web Service URL: http://{serverName}:{port}/dcma/rest/classifyBarcodeImage

Checklist:

  • Input file should be single page tif/tiff file only.
  • batchClassId should be valid batch class identifier and must have the “BARCODE_READER” plugin configured .

Sample client code using apache commons http client:-

private static void classifyBarcodeImage() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/classifyBarcodeImage";
		PostMethod mPost = new PostMethod(url);
		// Adding image file for processing the barcode classification
		File file1 = new File("C:\\sample\\US-Invoice.tif");
		Part[] parts = new Part[2];
		try {
			parts[0] = new FilePart(file1.getName(), file1);
			// Adding batchClassId for which barcode classification to be perform.
			String batchClassId = "BC5";
			parts[1] = new StringPart("batchClassId", batchClassId);
			MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
			mPost.setRequestEntity(entity);
			int statusCode = client.executeMethod(mPost);
			if (statusCode == 200) {
				System.out.println("Web service executed successfully..");
				String responseBody = mPost.getResponseBodyAsString();
				System.out.println(statusCode + " *** " + responseBody);
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password..");
			} else {
				System.out.println(mPost.getResponseBodyAsString());
			}
		} catch (FileNotFoundException e) {
			System.err.println("File not found for processing..");
		} catch (HttpException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (mPost != null) {
				mPost.releaseConnection();
			}
		}
	}

Document Level Field Validation (Script)

$
0
0

Issue:

If a field is not being validated because regular expression does not comply with the value, users can override this by simply pressing CTRL+B.

 

But, is there a way to do that with a function key Script for the entire document?

Example: They may have 100 fields that they would like to override all fields using script. Can we do this by creating a function key script and make the tag a true?

 

 

Solution:

This can be achieved via writing a function key script to set the <valid> tag of the document to true.

This is a Document level XML tag so it basically says all fields are good, skip this document.

Since this is a run time check during the Validation interface, the script needs to be executed when the user is in the Validation and the only way to do that is FunctionKey or Validation Scripting. Both of these scripts can take the Current Document ID so that script can update the correct document in the Batch XML.

blah

createHOCRforBatchClass

$
0
0

Creates HOCR XML for single page/multi-page TIF/TIFF or zip file containing TIF/TIFF or PDF passed as input for a particular Batch Class. This Web Service API requires two inputs: input xml and image file to create HOCR_xml.

On the basis of the Batch Class Identifier provided as an input, this API will extract plugin configuration settings of RECOSTAR_HOCR/TESSERACT_HOCR/NUANCE_HOCR plugin in the Page Process module. If the property named “Recostar Switch” value is turned ON, the process of OCRing will be done for Recostar and its corresponding plugin configurations will be used, else Tesseract will be used to perform OCRing in case of Windows. Similarly, OCRing can be performed on Linux using either Tesseract or Nuance.

Request Type: POST

Request URL: {ProtocolType}://{ServerIP}:{ServerPort}/dcma/rest/batchClass/createHOCRforBatchClass

Sample URL: http://localhost:8080/dcma/rest/batchClass/createHOCRforBatchClass

Body Parameters

Parameter Description Required Notes
XML file File containing parameter tags described below Required This file is used to identify the Batch Class.
TIF/TIFF/ZIP File Input document to be processed Required Supported input file types: TIF/TIFF (single and multi-page), ZIP (containing TIF/TIFF or PDF).

The key should have the same extension as the uploaded file (tif key can be used for both TIF/TIFF files).

 

Parameter Tags in the input XML

Parameter Description Required Notes
batchClassIdentifier String parameter for Batch Class identifier Required Valid identifier of the Batch Class whose configurations are to be utilized to generate HOCR.xml, e.g. BC1.

 

Headers

Header Name Description Required
Authorization The access token that will be used to authorize the request. Required

 

Returns

An HOCR.xml file is returned if input parameters are valid.

 

CheckList

  • Batch Class Identifier should be valid and existing.
  • Single/multi-page TIF/TIFF or a zip file (which may contain single/multipage TIF/TIFF or PDF) should be passed as an input.

 

Sample Input XML:

<WebServiceParams>

  <Params>

      <Param>

         <Name>batchClassIdentifier</Name>

         <Value>BC1</Value>

      </Param>

  </Params>

</WebServiceParams>

 

Sample client code using apache commons http client:-

private static void createHOCRXML() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/batchClass/createHOCRforBatchClass";
		PostMethod mPost = new PostMethod(url);
		// Adding Input XML file for processing
		File file = new File("C:\\sample\\createHOCR.xml");
		File imageFile = new File("C:\\sample\\US-Invoice.tif");
		Part[] parts = new Part[2];
		try {
			parts[0] = new FilePart(file.getName(), file);
			parts[1] = new FilePart(imageFile.getName(), imageFile);
			MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
			mPost.setRequestEntity(entity);
			int statusCode = client.executeMethod(mPost);
			if (statusCode == 200) {
				InputStream in = mPost.getResponseBodyAsStream();
				// saving result generated.
				File outputFile = new File("F:\\sample\\serverOutput.zip");
				FileOutputStream fos = new FileOutputStream(outputFile);
				try {
					byte[] buf = new byte[1024];
					int len = in.read(buf);
					while (len > 0) {
						fos.write(buf, 0, len);
						len = in.read(buf);
					}
				} finally {
					if (fos != null) {
						fos.close();
					}
				}
				System.out.println("Web service executed successfully.");
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password.");
			} else {
				System.out.println(mPost.getResponseBodyAsString());
			}
		} catch (FileNotFoundException e) {
			System.err.println("File not found for processing.");
		} catch (HttpException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (mPost != null) {
				mPost.releaseConnection();
			}
		}
	}
Viewing all 1237 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>