Quantcast
Channel: Ephesoft Docs
Viewing all 478 articles
Browse latest View live

createHOCRforBatchClass

$
0
0

This Web Service API is used to create HOCR XML forsingle page/multipage tiff/tif or zip containg tiff or pdf passed as input for a particular batch class. This Web Service API requires two Inputs i.e. Input xml and image 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/NUANCE_HOCR plugin in Page Process module, if property named “Recostar Switch” value is turned ON then process of OCRing will be done for Recostar and its corresponding plugin configurations will be used else Tesseract will be used to perform OCRingin case of windows.Similarly OCRing can be performed on Linux using either Tesseract or Nunace.

Request Method POST

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

Input Parameter Value Description
batchClassIdentifier It should contain a valid value of an existing batch Class Identifier. The Batch Class name whose configurations are to be utilised to generate HOCR.xml.
imageName Optional parameter This parameter value contain name tif/tiff or ZIP file for which HOCR XML need to be created with extension specified.

 

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

Check list:

  1. Batch Class Identifier should be valid and existing.
  2. Only single page tif/tiff should be passed as an input or a zip file (which may contain single/multipage tiff or pdf).

Sample Input XML:

<WebServiceParams>

<Params>

<Param>

<Name>batchClassIdentifier</Name>

<Value>BC5</Value>

</Param>

<Param>

<Name>imageName</Name>

<Value>US-Invoice.zip</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();
			}
		}
	}

4.0.3.0 Known Issues

$
0
0

Applies to: v4.0.3.0

Following are the known bugs:

1. On Fuzzy DB Plugin Configuration Screen user can enter confidence threshold more than 100.00
2. On Ephesoft upgrade from 3.x to 4.x Fuzzy DB and DB Export settings are not copied.
3. When Batch Class Tree Navigation Panel is collapsed, then user is unable to open Document Type/Index field/Tables using double click or Ctrl + k shortcut or Open button.
4. Fuzzy DB Mapping Configuration: When user resets a mapping from a document type then mappings in other document type with same index field name is also deleted.
5. Minor UI issues on Internet Explorer Version 11.

 


 

 

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();
			}
		}
	}

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 to true then this tag won’t change anything.
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();
			}
		}
	}

exportBatchClass

$
0
0

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

Request Method POST

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

 

Input Parameter Values Descriptions
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 decide if the lucene learnt sample is exported with batch class or not.
image-classification-sample Either “true”/”false” This parameter is used to decide if the image classification sample is exported with batch class or not.

 

CheckList:-

  1. Identifier should be a valid batch class identifier.

Sample client code using apache commons http client:-

private static void exportBatchClass() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/exportBatchClass";
		PostMethod mPost = new PostMethod(url);
		String batchClassIdentifier = "BC4";
		mPost.addParameter("identifier", batchClassIdentifier);
		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 = 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();
					}
				}
			} 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();
			}
		}
	}

Linux 4.x Release

$
0
0

 

Server Environments
Operating System Ubuntu 14.04 LTS 64-bit
Ubuntu 14.10 64-bit
Ubuntu 16.04 LTS 64-bit (To Be Certified Q1 2018)
RHEL 6.8 64-bit
Oracle Linux 6.8 64-bit
CentOS 7 64-bit (To Be Certified Q1 2018)*
SUSE 64-bit (To Be Certified Q1 2018)
 Databases MariaDB – 10.0.19
MySql – 5.5
Oracle – 11.2.0.4 (Release 4.1 Onwards)
Oracle -12.1.0.2.0 (Release 4.1 Onwards)
Application Server Tomcat 7.0.73
Web Server Apache 2.2 (httpd)
Authentication LDAP 2.2
LDAP 2.4
Active Directory
Java Platforms Java 7 & Java 8(Release 4.1 Onwards)
Client Environments
Browser Support IE Version 10 and above
Chrome Version  43.0.2357.124 m
Firefox Version 38.0.1 and above
Scanners Fujitsu Scanners
– Fujitsu fi-6130
– Fujitsu fi-6140z
– Fujitsu fi-7160
Drivers
– Twain driver
– PaperStream driver
Web Scanner Support 32-bit Browser
32-bit Java Plugin
Screen Resolution 1366*768 and above

 

* – All versions of CentOS 6.x or lower will not be supported due to Compliance issues with the Nuance OCR engine.

Copy Batch Class

$
0
0

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 Values Descriptions
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:


<WebServiceParams>

 

<Params>

 

<Param>

 

<Name>batchClassName</Name>

 

<Value>AsiDocTypeClasTem_ticket_copy222</Value>

 

</Param>

 

<Param>

 

<Name>batchClassDescription</Name>

 

<Value>AsiDocTypeClasTem_ticket</Value>

 

</Param>

 

<Param>

 

<Name>batchClassPriority</Name>

 

<Value>1</Value>

 

</Param>

 

<Param>

 

<Name>batchUNCFolder</Name>

 

<Value>/opt/Ephesoft/SharedFolders/Copy_BC12</Value>

 

</Param>

 

<Param>

 

<Name>copyBatchClassIdentifier</Name>

 

<Value>BC4</Value>

 

</Param>

 

<Param>

 

<Name>gridWorkflow</Name>

 

<Value>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:-

private static void copyBatchClass() {
		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\\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();
			}
		}
	}

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();
			}
		}
	}

Document Type Creator

$
0
0

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 Parameters:

Input Parameter Values Descriptions
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 file for recostar extraction This file would be used for KV extraction by Recostar 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/ZON 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>MyDocument</Value>

 

</Param>

 

<Param>

 

<Name>documentTypeDescription</Name>

 

<Value>Abcd</Value>

 

</Param>

 

<Param>

 

<Name>minConfidenceThreshold</Name>

 

<Value>100</Value>

 

</Param>

 

<Param>

 

<Name>firstPageProjectFile</Name>

 

<Value>FPR.rsp</Value>

 

</Param>

 

<Param>

 

<Name>batchClassIdentifier</Name>

 

<Value>BC4</Value>

 

</Param>

 

<Param>

 

<Name>hidden</Name>

 

<Value>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:-

private static void 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\\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();
			}
		}
	}

Upload files for learning files

$
0
0

This API will upload files for learning for a particular document type in a batch class to

  • Shared Folder\ [BatchClassID]\lucene-search-classification-sample folder

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

  • 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

  • Both (image-classifiation and lucene) depending upon input parameters supplied.

This Web Service API can upload files (tif/tiff) for multiple document type of a batch class. Only files will be uploaded to the respective folders.

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 Parameters: Input parameters are a XML file and tiff file/files

XML file Input parameters

Input Parameter Values Descriptions
batch_class_id This value should be an existing batch class Id. This Parameter specifies the Batch Class Id for which learning of files is needed
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
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 need to be upload.zip

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

Sample XML file format:


<upload_learning_files>

 

<batch_class_id>BC5</batch_class_id>

 

<doc_type>

 

<doc_type_name>US Invoice</doc_type_name>

 

<learning_type>Both</learning_type>

 

<page_type_first>

 

<files_to_be_uploaded>

 

<file_name>US-Invoice.tif</file_name>

 

</files_to_be_uploaded>

 

</page_type_first>

 

<page_type_middle>

 

<files_to_be_uploaded>

 

<file_name>US-Invoice2.tif</file_name>

 

</files_to_be_uploaded>

 

</page_type_middle>

 

<page_type_last>

 

<files_to_be_uploaded>

 

<file_name>US-Invoice3.tif</file_name>

 

</files_to_be_uploaded>

 

</page_type_last>

 

</doc_type>

 

</upload_learning_files>

 

Check List:-

Before uploading following points need to ensured first:

  • XML and other required learning files are attached with the request.
  • Name of learning files mentioned in the XML must match with the file name uploaded with the request.
  • XML format must be same as it shown in Sample XML format. Rearrangement of the xml is not allowed.
  • batch_class_id, doc_type_name, learning_type, are mandatory information and must need to be specified. User cannot omit these fields.
  • 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 ).
  • 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.
  • In a xml file there needs to be single batch_class_id, but there can be multiple <doc_type>. Inside a doc_type there can only one doc_type_name, learning_type , page_type_first, page_type_middle, page_type_last block.
  • If learning files for a particular page folder(ex. First page) are getting uploaded in a single file 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:-

private static void uploadLearningFile() {
		HttpClient client = new HttpClient();
		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\\sample.xml");
		File file1 = new File("C:\\sample\\US-Invoice.tif");
		File file2 = new File("C:\\sample\\US-Invoice2.tif");
		File file3 = new File("C:\\sample\\US-Invoice3.tif");

		Part[] parts = new Part[4];
		try {
			parts[0] = new FilePart(file.getName(), file);
			parts[1] = new FilePart(file1.getName(), file1);
			parts[2] = new FilePart(file2.getName(), file2);
			parts[3] = new FilePart(file2.getName(), file3);

			MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
			mPost.setRequestEntity(entity);
			// send post request to server
			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();
			}
		}
	}

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();
		}
		}
} 

Run Batch Instance

$
0
0

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 which 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 a valid batch instance identifier.

Note: Value highlighted in the 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:-

private static void runBatchInstance() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/runBatchInstance/BI4";
		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();
			}
		}
	}	

extractFixedForm

$
0
0

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 first, second, third and last page. For Windows a default page processing file is picked by default in case no file is mapped against the documents in the batch class. In case of Linux if no files are mapped against the pages, no extraction is performed. Backward compatibility has been enabled where the web service will allow old set of input parameters as well as the modified ones. With old set of input parameter extraction will be performed on the input image according to the RSP/ZON file depending upon the environment being Windows or Linux respectively.

Request Method POST

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

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

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.

Sample XML

<WebServiceParams>

<Params>

<Param>

<Name>batchClassIdentifier</Name>

<Value>BC8</Value>

</Param>

<Param>

<Name>docType</Name>

<Value>US Invoice</Value>

</Param>

</Params>

</WebServiceParams>

Alternate (old) Input Parameters

Alternate Input parameters to the Web Service API would be three files

  • Tiff/PNG (single page or multipage)
  • XML file, with colorSwitch and projectFile as parameters.
  • Page processing file

Sample XML

<WebServiceParams>

<Params>

<Param>

<Name>colorSwitch</Name>

<Value>OFF</Value>

</Param>

<Param>

<Name>projectFile</Name>

<Value>US_INVOICE.rsp</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 for the first set of input parameters:-

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\\US-Invoice.tif");
		File file2 = new File("C:\\sample\\fixedForm.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.");
				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();
			}
		}
	}

4.0.3.0 Known Issues

$
0
0

Applies to: v4.0.3.0

Following are the known bugs:

1. On Fuzzy DB Plugin Configuration Screen user can enter confidence threshold more than 100.00
2. On Ephesoft upgrade from 3.x to 4.x Fuzzy DB and DB Export settings are not copied.
3. When Batch Class Tree Navigation Panel is collapsed, then user is unable to open Document Type/Index field/Tables using double click or Ctrl + k shortcut or Open button.
4. Fuzzy DB Mapping Configuration: When user resets a mapping from a document type then mappings in other document type with same index field name is also deleted.
5. Minor UI issues on Internet Explorer Version 11.

 


 

 

checkWSStaus 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
Input parameters to the Web Service API would be a valid numeric token. ocrToken

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();
}
}
}



                       

8.3 file naming schema

$
0
0

Issue:

When 8.3 File naming schema is disabled on the drive which hosts the SharedFolders directory, users will have issues running learned files in Ephesoft. Although the use of 8.3 file name schema is outdated, java still requires this schema to be enabled in order to function correctly with external files.

 

Solution:

8.3 file naming schema must be enabled on the drive on which the Ephesoft and SharedFolders reside.

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();
			}
		}
	}

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();
			}
		}
	}

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();
			}
		}
	}

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 to true then this tag won’t change anything.
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();
			}
		}
	}
Viewing all 478 articles
Browse latest View live