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

Folder monitor service Fails when Folder Monitor TURNED OFF or COMMENTED OUT

$
0
0

Versions of Ephesoft Affected: 3.x

Issue:

Folder monitor service Fails when Folder Monitor TURNED OFF or COMMENTED OUT

Solution:

When folder monitor fail-over mechanism was designed, it was based on the assumption that folder monitor will not be commented on any of the servers. We strongly don’t recommend to comment folder monitor service in applicationContext.xml. As Folder-monitor service is light weight, it doesn’t take much resources. Its only job is to create BIs of newly added documents.
The following command should remedy those who choose to comment out the Folder Monitor Service. However, it’s not recommended.

1. Execute following query in the database:

Use <database-name>;
Delete from server_status where service_Type= 'FOLDER_MONITOR';

2. Stop the Ephesoft UI server and turn on the production server on which folder monitor needs to be executed, it will make an entry in service_status. Once the service_status entry is made we can bring the back UI server.


KB0009823 [com.ephesoft.dcma.core.service.ServerHeartBeatMonitor] – Fatal transport error

$
0
0

KB Articles

KB Article # 9823

Topic/Category: Installation

Ephesoft Version: 4x

Issue: [com.ephesoft.dcma.core.service.ServerHeartBeatMonitor] – Fatal transport error

Analysis:

Heartbeat service is responsible for checking whether the servers registered in the database are still active. This is important for service failover assignments. If this error log is reported it could mean a server is down. If you know that this is not the case and the reported server is active, the heartbeat service may be blocked or there may be issues with your network infrastructure.

Solution:

To test your server for heartbeat accessibility, two tests can be run on the server recording the error:

  1. Ping the remote server by computer name recorded in server_registry table.
    – If the server responds with an ipv4 scheme, this is appropriate.
    – If the server responds with an ipv6 scheme, disable ipv6 via Microsoft’s solution.
    – If the server does not respond, the server may be down, there is a firewall or network infrastructure issue.
  2. Open a chrome or firefox browser and go to the following url
    http://<remoteservername>:8080/dcma/HealthStatus.html

    – If the message states – “Server is up.”, accessibility is correct.
    – If the page is unreachable, the server may be down, there is a firewall or network infrastructure issue.

 

< Back|KB Main Page | Next KB Article >

Setup Sharepoint 2013 Server with Ephesoft

$
0
0

How to Page?

 

Topic #9383 : Setup Sharepoint 2013 Server with Ephesoft

Applicable Ephesoft versions: 4.0 and up

 

More Info:

 

Instructions:

  1. Log into the web interface of your site, click the gear icon in the upper-right, and click on Site settings, then in the Site Actions section click on Manage site features. In the list that appears, activate the Content Management Interoperability Services (CMIS) Producer item:
 image003

 

  1. To access the repository the given URL is used.

http://yourserver/_vti_bin/cmis/rest?getRepositories

If the content management is enabled for the given share point instance, the URL will return a file containing the repository details.

 

The repository details can be found in the given tag highlighted repository ID

<app:collection href=”http://yourserver/_vti_bin/cmis/rest?getRepositories?Query” p3:id=”id”>

 

  1. Under the Central Administration tab select Security. Within General Security tab, select Specify Authentication provider. Select the zone and Edit the Authentication. Select the Basic authentication as shown highlighted in yellow and save the changes.
 image004

 

  1. In the CMIS export plugin configure the given repository URL, SharePoint credentials and the obtained CMIS repository ID. Share Point supports only CMIS version 1.0 select from the CMIS version dropdown. After making the following changes run a batch.
  2. When the batch has finished processing, the uploaded files can be retrieved from the Administrative Report library by selecting the site contents from the gear shaped drop down  at the top right.

 

Document Level Field Mapping:

To export document level fields firstly make sure the columns (Meta data) are already created on the SharePoint server. Afterwards follow the given syntax for the export mappings in DLF-Attribute-mapping. Properties file

Content of DLF-Attribute-mapping.properties file
Document_Name.Document_Level_Field 1= SharePoint_Column_Name1
Document_Name.Document_Level_Field 2= SharePoint_Column_Name2

  1. In case the document level fields contain spaces use the escape character \ before inserting spaces
    Document_Name.Document_Level_Field_Subpart1\ Document_Level_Field_Subpart2= …
    For example a String like US-Invoice-Data.Invoice\ Date would refer to the Invoice Date field of document US-Invoice-Data.
  2. In case the column name contains space, use the escape characters _x0020_.
    Document_Name.Document_Level_Field = SharePoint_Column_Name_SubPart1_x0020_ SharePoint_Column_Name_SubPart2
    For example a String like Part_x0020_Number would denote Part Number column name on SharePoint server.

Please refer the sample given below:

US-Invoice-Data.City=City
US-Invoice-Data.State=State
US-Invoice-Data.Invoice\ Date=Invoice_x0020_Date
US-Invoice-Data.Invoice\ Total=Invoice_x0020_Total
US-Invoice-Data.Part\ Number=Part_x0020_Number

 

 

 

 

Editing Nuance OCR

$
0
0

Nuance OCR Plugin


Overview

The Nuance HOCR plugin is the part of page processing module of Ephesoft Linux application by default. This plugin uses Nuance OCR tool for generating HOCR XML files. It reads the image files listed in the batch xml of a batch instance and generates HOCR XML file for each one of them.

** Nuance Plugin does not support barcode recognition. 

Description

  1. Nuance OCR Plugin is executed in the page processing phase of the application when all the import processing on the batch has been done.
  2. This plugin extracts the contents of the image using Nuance tool. This tool performs OCR’ing on tiff files.
  3. This plugin uses ”’SETTING.STS”’ file present inside “{”’SharedFolder-intall-dir}\BC??\*” directory”’. In case if no setting file is present in the mentioned folder then the plugin uses its default settings for OCR’ing process and generates the SETTING.STS file inside “{SharedFolder-intall-dir}\BC*” directory.

Configuration

Configurable Properties

Following is the list of configurable properties for the plugin:

Untitled26

Configurable property Type of Value Value Options Description
Nuance Auto Rotate/Deskew switch List of Values *On
*Off
This property is used to auto rotate and de-skew the input images on the basis of orientation and skew angle computed by Nuance.

Nuance Switch List of values *On
*Off This switch is used to turn this plugin ON/OFF. [/table_content][/table_wrap]

Nuance Valid Extensions List of values *Tif Following are the valid image types that can be OCR’ed using Nuance. [/table_content][/table_wrap]

Dependency

This plugin requires an image as an input (with TIFF format). The thumbnails and display images are created using the TIFF processed by Nuance. Hence the plugins ‘Create Display Image Plugin’/ ‘Create Thumbnails Plugin’ must be placed after this plugin.

Untitled25

Dependency on Shared Folders

The batch class folder inside the main shared folder contains a file by the name SETTING.STS. This file is used by the Nuance OCR engine for configuring some of its properties. If the file does not exist in the folder then Nuance uses its default settings for recognizing the image’s data and creates the setting file inside the Batch Class folder with default settings.




Permission issue with creating Samba Share

$
0
0

Issue:

This assumes that you have followed the instructions for creating a samba share from the instructions either on the knowledgebase article or the instructions included with the Ephesoft installer. If you are able to see the shared folder from another workstation, but are unable to access the share with a permissions error, please follow the steps below to help diagnose the issue.

 

Steps to take:

1. Check the Samba log on the server hosting the Samba share at /var/log/samba

2. It will list a separate log for each workstation that has attempted to connect to the Samba share. Look for the file with the IP address for the workstation from which you tried to connect and received the permissions error.

3. If you see an error message that says ‘..libcli/auth/ntlm_check.c:54(smb_pwd_check_ntlmv1) smb_pwd_check_ntlmv1: incorrect password length (74) follow the next step.

4. Check the SELinux status with the following command:

sudo getenforce

5. If the return is ‘Enforcing’, run the following command to set SELinux to permissive

sudo setenforce 0

6. Restart the samba service with the respecive commands from either the Ubuntu or RHEL instructions on the wiki.

7. Test accessing the share from the other workstation. If the issue is resolved, contact your system administrator and ask advise them of the changes you have made and ask them to review the SELinux settings on the Server hosting the Samba share.




Create Samba Share on RHEL 6.5 or Higher

$
0
0

 

  1. Make sure internet is available on the system.
  2. Make sure that user has proper permission to install software on the system.

To install software on REDHAT a user needs to have Super user permission thus in order to install Samba user must use root to install it.

yum update

yum install samba

Untitled1

Figure: Samba installation on REDHAT

 

  1. Add a user to samba and assign password to that user. Next step demonstrates method to add user to samba and assign samba password for that user. This process needs root permissions.

 

smbpasswd -a root

(-a is for adding user to samba and root is username to be added to samba)

Untitled2

Figure: Adding user to samba and assigning samba password for the user.

smbpasswd adds a user to samba and assigns samba password for the user. User will see error message if user does not exists on the Linux system.

Untitled3

Figure: Error adding user to samba as user does not exists on Linux machine.

  1. Testing samba demons smb and nmb. This requires root permission.

service smb restart

service nmb restart

Untitled4

Figure: Restarting smb and nmb

Samba Configuration

Adding a folder to network share

Samba shares can be configured through /etc/samba/smb.conf file which holds configuration details for samba server.

  1. Open smb.conf present inside /etc/samba/smb.conf using VI editor. Open file with root permissions as user may need to edit file.

vi /etc/samba/smb.conf

 

  1. E.g. User wants to make SharedFolders present at /opt/Ephesoft/SharedFolders as shareable on samba share. User can do this by adding/appending following line to the end of smb.conf file. But before this user will need to give read, write, execute permission to everyone on the sharedfolders by executing following command (by default Ephesoft installer assigns rwx permission to everyone on SharedFolders):

chmod –R 777 /opt/Ephesoft/SharedFolders

Append following lines to end of smb.conf.

 

[ephesoft]
comment=ephesoft
path=/opt/Ephesoft/SharedFolders
browseable=yes
writable=yes
create mode=0777
directory mode=0777
share mode=yes
guest ok=yes
valid users=root

 

Untitled5

Figure: Share created with name ephesoft which point to /opt/Ephesoft/SharedFolders on machine

 

Details of parameters added to smb.conf

 

  1. Comment: comment for the shared folder.
  2. path : specifies the path of shared folder.
  3. browseable : allows to browse the files from file system.
  4. writeable : makes the shared folder writeable
  5. create mode : create files with group=rw permissions.
  6. directory mode : create dirs. with group=rw permissions.
  7. guest ok:allows guest access
  8. valid users : specifies list of valid users who can access the shared folder (users must be part of user-group assigned to the shared folder).
  9. Assign multiple users to list of valid users as one credential can be used by single machine at a time.

 

User will need to create the share with write, creation, readable and browseable permissions etc. The statements mentioned above make sure of the same.

 

  1. Save smb.conf file and restart smb and nmb demons by executing following commands.

service smb restart

service nmb restart

Untitled6

Figure: restarting samba smb/nmb demons

 

Now user can access this shared folder.

Untitled7

Figure: sharedfolders accessible on network

 

Accessing SharedFolders on different Ephesoft nodes in multi-cluster setup

 

In order to setup SharedFolders on different Ephesoft nodes in multi-cluster setup user will need to mount the network share on a folder on every Ephesoft  Linux node as Linux doesn’t unserstand network paths as windows does i.e. on windows network share can be directly access using \\ip –addr but on Linux it can be done using samba protocol which works in different manner.

 

Note: Installer will create a empty folder on same location on every Ephesoft node other than the node on which actual shared folder lies i.e. path of empty folder will be same as path of actual shared folder on machine where actual shared folders lies e.g. In above configuration where SharedFolder has been added to samba share the actual folder lies at /opt/Ephesoft/SharedFolders so empty folder will be created at same path on each machine using Ephesoft installer.

 

Now user will have to mount the network sharedfolders on each empty folders created by installer on each Ephesoft node.

 

Mounting network share on empty folders created by installer

User can mount the samba share over an empty folder by executing following command.

mount -t cifs -o user=root,password=root //<ip-addres>/ephesoft /opt/Ephesoft/SharedFolders

Here password is the password of smbuser for which smbpasswd was set.

Untitled8

Figure: mounting share on empty folder /opt/Ephesoft/SharedFolders

Untitled9

Figure: network shared folder mounted on empty folder on another Ephesoft node.

User will be able to access the mounted shared folder locally by accessing /opt/Ephesoft/SharedFolders as this folder is acting as mount point for network share. User will be able to create/modify files/folders locally on this path and changes will be reflected on the network share and on all the machines where this network share has been mounted.

Untitled10

Figure: User able to access the SharedFolder locally on mounted folder.

Untitled11

Figure: User creating folder on the mounted folder and these changes will be reflected on all the mount points and network share.

Untitled12

Figure: Changes of folder creation reflected on the network share.

Note*: Ephesoft META-INF properties file will contain the path of locally mounted folders and not the network path as Linux doesn’t understand the network share like windows do. Linux makes use of smb protocol to access the share folder. Hence user will have to mount network shared folders locally on their system such that Ephesoft is able to see data on same path on every system.  



Create Samba Share on Ubuntu 13.10

$
0
0

  1. Make sure internet is available on the system.
  2. Make sure that user has proper permission to install software on the system.

To install software on Ubuntu a user needs to have Super user permission thus in order to install Samba user must use sudo to install it.

sudo apt-get update
sudo apt-get install samba

Untitled13

Figure: Samba installation on ubuntu

 

  1. Add a user to samba and assign password to that user. Next step demonstrates method to add user to samba and assign samba password for that user. This process needs sudo permissions.

 

sudo smbpasswd -a turbo

(-a is for adding user to samba and turbo is username to be added to samba)

Untitled14

Figure: Adding user to samba and assigning samba password for the user.

smbpasswd adds a user to samba and assigns samba password for the user. User will see error message if user does not exists on the Linux system.

Untitled15

Figure: Error adding user to samba as user does not exists on Linux machine.

  1. Testing samba demons smbd and nmbd. This requires sudo permission.

sudo service smbd restart
sudo service nmbd restart

Untitled16

Figure: Restarting smbd and nmbd

Samba Configuration

Adding a folder to network share

Samba shares can be configured through /etc/samba/smb.conf file which holds configuration details for samba server.

  1. Open smb.conf present inside /etc/samba/smb.conf using VI editor. Open file with sudo permissions as user may need to edit file.

sudo vi /etc/samba/smb.conf

 

  1. E.g. User wants to make SharedFolders present at /home/turbo/Ephesoft/SharedFolders as shareable on samba share. User can do this by adding/appending following line to the end of smb.conf file. But before this user will need to give read, write, execute permission to everyone on the sharedfolders by executing following command (by default Ephesoft installer assigns rwx permission to everyone on SharedFolders):

sudo chmod –R 777 /home/turbo/Ephesoft/SharedFolders

Append following lines to end of smb.conf.

 

[ephesoft]

comment=ephesoft
path=/home/turbo/Ephesoft/SharedFolders
browseable=yes
writable=yes
create mode=0777
directory mode=0777
share mode=yes
guest ok=yes
valid users=turbo

 

Untitled17

Figure: Share created with name ephesoft which point to /home/turbo/Ephesoft/SharedFolders on machine.

 

Details of parameters added to smb.conf

 

  1. Comment: comment for the shared folder.
  2. path : specifies the path of shared folder.
  3. browseable : allows to browse the files from file system.
  4. writeable : makes the shared folder writeable
  5. create mode : create files with group=rw permissions.
  6. directory mode : create dirs. with group=rw permissions.
  7. guest ok:allows guest access
  8. valid users : specifies list of valid users who can access the shared folder (users must be part of user-group assigned to the shared folder).
  9. Assign multiple users to list of valid users as one credential can be used by single machine at a time.

 

User will need to create the share with write, creation, readable and browseable permissions etc. The statements mentioned above make sure of the same.

 

  1. Save smb.conf file and restart smbd and nmbd demons by executing following commands.

sudo service smbd restart
sudo service nmbd restart

Untitled18

Figure: restarting samba smbd/nmbd demons

 

Now user can access this shared folder.

Untitled19

Figure: sharedfolders accessible on network

 

Accessing SharedFolders on different Ephesoft nodes in multi-cluster setup

 

In order to setup SharedFolders on different Ephesoft nodes in multi-cluster setup user will need to mount the network share on a folder on every Ephesoft  Linux node as Linux doesn’t unserstand network paths as windows does i.e. on windows network share can be directly access using \\ip –addr but on Linux it can be done using samba protocol which works in different manner.

 

Note: Installer will create a empty folder on same location on every Ephesoft node other than the node on which actual shared folder lies i.e. path of empty folder will be same as path of actual shared folder on machine where actual shared folders lies e.g. In above configuration where SharedFolder has been added to samba share the actual folder lies at /home/turbo/Ephesoft/SharedFolders so empty folder will be created at same path on each machine using Ephesoft installer.

 

Now user will have to mount the network sharedfolders on each empty folders created by installer on each Ephesoft node.

 

Mounting network share on empty folders created by installer

User can mount the samba share over an empty folder by executing following command.

sudo mount -t cifs -o user=turbo,password=Passw0rd //192.168.108.21/ephesoft /home/turbo/Ephesoft/SharedFolders

Here password is the password of smbuser for which smbpasswd was set.

Untitled20

Figure: mounting share on empty folder /home/turbo/Ephesoft/SharedFolders

Untitled21

Figure: network shared folder mounted on empty folder on another Ephesoft node.

User will be able to access the mounted shared folder locally by accessing /home/turbo/Ephesoft/SharedFolders as this folder is acting as mount point for network share. User will be able to create/modify files/folders locally on this path and changes will be reflected on the network share and on all the machines where this network share has been mounted.

Untitled22

Figure: User able to access the SharedFolder locally on mounted folder.

Untitled23

Figure: User creating folder on the mounted folder and these changes will be reflected on all the mount points and network share.

Untitled24

Figure: Changes of folder creation reflected on the network share.

Note*: Ephesoft META-INF properties file will contain the path of locally mounted folders and not the network path as Linux doesn’t understand the network share like windows do. Linux makes use of smb protocol to access the share folder. Hence user will have to mount network shared folders locally on their system such that Ephesoft is able to see data on same path on every system.  




Create Samba Share

$
0
0

Introduction

Samba is a file sharing service which is based on SMB/CIFS network file sharing protocols. SMB, stands for Server Message Block, is a protocol for sharing files, printers, serial ports, and communications abstractions such as named pipes and mail slots between computers.

Samba primarily consists of two key programs plus few utilities. The two key programs are SMBD (Server Message Block Demon) and NMBD (NetBIOS Message Block Daemon). Main purpose of these two services is as follows:

  1. File & print services
  2. Authentication and Authorization
  3. Name resolution
  4. Service announcement (browsing)

Ephesoft’s SharedFolders are network shared folders which can be accessed from different Ephesoft nodes in Multi-Cluster. Hence on Linux Ephesoft uses Samba Share to make SharedFolders accessible over network as a file share.

This document describes steps to install and configure Samba Share such that Ephesoft’s SharedFolders can be accessible from different nodes in multi-server cluster.

Samba Installation

Most of Linux systems already have a samba service installed on the system. But just in case if Samba service is not installed on the system it can be installed by following simple steps:

 

Create Samba Share on RHEL/CentOS 6.5

Create Samba Share on Ubuntu 13.10





Batch Instance Group

$
0
0

Overview

Users can assign a group to every batch instance using scripts by making entry in the “batch_instance_groups” table in database. The assigned group will only have access to that batch instance.

In case there is no group assigned to the batch instance in the “batch_instance_groups” table, users belonging to the groups in the corresponding batch class will have access to that batch instance.

Users belonging to the group mapped in “batch_instance_groups” will be given preference over the users belong to the group specified in batch class. For example, if a particular batch instance, say BI1, is mapped to group A in “batch_instance_groups” table and corresponding batch class, say BC1 is mapped to group B, in that case group A will be given preference and only users belonging to that group will be able to access the batch instance.

Please note: The only way to utilize this functionality is via script.

 

 

 

 

Ephesoft Fixed Form Tutorial

$
0
0

How to configure Ephesoft to capture zonal OCR, ICR and OMR.

Application Level Script

$
0
0

Overview

This feature provides user with an option to execute a script repeatedly at some configurable interval of time to get some application level work done. Earlier with scripting plugin we can execute scripts with batch class only, that forces user to initiate a batch class instance to get script executed in the workflow. Now with this implementation we can get a script executed at Application level without any need to initiate a batch.

Folder name where application level script resides, script file name and execution interval all these properties are fully configurable and can be configured in dcma-scripting-plugin.properties file under META-INF/dcma-scripting-plugin. Folder having script must be present under Ephesoft Share Folder. Script java class file must has to implement an ApplicationScripts interface. This feature also works in multi-server environment, it means at a time application script execution will take place in a single server in a cluster of servers. It also have restore mechanism which helps in restoring a service on another server in the cluster in case the present server executing service went down.

Configuration

Configurable properties

Following are the configurable properties available for application level script in the dcma-scripting-plugin properties file in META_INF\dcma-scripting-plugin:

Configurable property Type Value options Description
Script Class Name (script.application.scriptClassName) String A valid java class name.(without .java or .class extension) This values tell the name of java script file present under a folder in Ephesoft Share folder. Default value is: MyApplicationLevelScript

Script Folder Name (script.application.scriptFolderName)

String An valid folder name inside Ephesoft Share folder This values specify the folder name that contains application level script file.Default value is: MyApplicationLevelScript
Execution interval cron job (dcma.applicationLevelScript.cronExpression) String Valid Cron expression This cron expression specify the interval at which the script need to be executed.

Above configuration properties are shown in screen shot given below:

400px-3.1_ApplicationLevelScript_1001

 

Steps for creating script file

The script file is a simple java class implementing an interface named ApplicationScripts. This interface declare following method that every application level script has to implement.

public Object execute(String shareFolderPath);

Input to execute method will be share folder path that a script can use to do some action on share folder content.

Following is a sample structure of script file:

import com.ephesoft.dcma.script.ApplicationScripts;

public class MyApplicationLevelScript implements ApplicationScripts {

public Object execute(String shareFolderPath) {

/**************task to done **************/

}

}

The file needs to be saved with .java extension.

A default script file will be available under application-script folder in Ephesoft Share folder for reference.

Steps for configuring the feature

  • Specify the script file name, folder name and cron expression in META-INF/dcma-scripting-plugin/dcma-scripting-plugin.properties. Save and close the file.

Note: The script on/off switch (script.scriptSwitch) available in properties file does not control execution of application level script. The switch is just to enable/disable execution of batch class level scripts. Application level scripts are enables by default.

Steps of execution

  • After configuring file name, folder name, cron expression in properties file, go to Ephesoft Shared folder and create a folder with name same as configured in property file.
  • Create a script file with the same name as specified in property file above. Save the file with .java extension.
  • Create a directory/folder in Ephesoft Share folder with the same name as specified in property file above and copy the script file inside that.
  • After completing above steps start the Ephesoft server and script will start getting executed repeatedly.

Dependency

To get this feature work on multi-server environment with restore mechanism, heart beat module should be running on all the servers.

Troubleshooting

Following are few common error messages seen in log file due to improper configuration and execution:

S. No. Error message Possible root cause
1 Script not -found Either script file or folder doesn’t exist as specified in property file. Verify script folder and folder name present in Ephesoft Share folder.
2 Script errored out. Script file was not correct. Verify the script file syntax. It needs to implement an interface ApplicationScripts.
3 Failed to compile Some java compilation error in Script file. Verify java code in java code editor.

 

Product Perspective

$
0
0

Ephesoft develops Intelligent Document Capture system using open source technologies. Ephesoft document capture and mailroom automation (aka dcma in Engineering) offers an easy way to process incoming documents such as paper, fax, email attachments a like.

Without using Ephesoft, manual workflow for mailroom document processing is very inefficient. Operators receive documents via mail, email, or fax. They organize documents based on the destination/business unit and scan them using high-speed scanners. The scanned documents are processed for validation, verification, and data entry. Ephesoft document capture and mailroom automation intends to automate the whole document processing workflow and requires operator interference only to handle exceptions.

The product is (1) web based but On-Premise[1], (2) built using open source technologies and (3) has no up-front license fee. The product is available in two editions. The community edition is available for free and has community-driven support. The enterprise edition has paid maintenance and has additional features via commercial plug-ins.

The product is designed for three different profiles of users:

  1. Data entry operators review and validate the scanned/imported documents. These users mainly use keyboard, mouse or keyboard shortcuts to have high efficiency.
  2. Supervisors do system level operations like reporting, setup, configuration, etc.
  3. Administrators configure the batch class and How Ephesoft interacts with Document Management Systems, Business Process Management Systems or Databases.

Functional Requirements

Ephesoft is built on top of a workflow engine. Each step in the workflow is called Plugin and independently responsible for one specific operation. A Plugin might be responsible of OCRing the page and another plugin might be responsible for exporting documents to a repository. Plugins are grouped into sub workflow containers which are called Modules. For example all plugin that are used to extract meta data from documents such as Free Form extraction or Zonal OCR/ICR, or table/Line item extraction plugins can be found in a module called Extraction.

Overall System Architecture

Below diagram shows the Overall Workflow and how Plugins and Modules are implemented. Workflow can be followed from left to right. Documents are imported by the plugins in the Import Module, each page is analysed by various pluings in Page Processing Module, Document boundries are identified by the plugins in the Document Assmebler Module, Operators review the documents classification results (if necessary) in Document Review, Meta Data in extracted from Documents based on document type using the plugins in Extraction Module, Operators validate the extracted values in Document Validation and finally Documents are exported to their destinations.

Ephesoft_System_Diagram

Ephesoft Document Capture and Mailroom Automation workflow consists of an automatic modules and a manual modules.

Automatic Workflow

The automatic modules, shown in green, does not require any user interaction to execute plugins. Ephesoft Server automatically processes the documents as soon as they are available.

Manual Workflow

The manual modules, shown in blue, is used only when needed. If the document classification is not needed Ephesoft automatically skips this step in the workflow. Same is also valid for Document Validation. Both Document Review and Validation are designed for a very specific purposes and they provide unique features to help their functions. Review is designed for reviewing the classification results/exceptions. If Ephesoft is not sure about a document, it will ask users to correct or verify the document type in this User Interface. Validation is designed for reviewing extracted meta data fields. If the fields/data is not confidently captured or has a missing information, it will ask users to complete or verify the captured data.

Both Review and Validation also supports automatic and manual batch selection. In automatic batch selection, the system automatically selects the next available batch for processing. The user, based on his rights, can either review the batch or can both review and validate it. In manual batch selection, the user is shown a list of all the batches available for review and validation in the grid and he/she can select the batch (to work).

 

 

Developers Guide

$
0
0

Ephesoft Script Guide

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

Ephesoft Plugin Dev

Creating Sample Plugin

In order to create a new plugin, following steps need to be implemented:

Download the plugin code sample Download Now

1. Click on “File -> New -> Other…” option.
Plugin_1
2. Type “maven” and select “Maven project” from the list shown below.
Plugin_2
3. Check the “Create a simple project” option and click “Next”.
Plugin_3
4. Fill in the particulars for “Artifact” i.e. details about new project. These details include
1. “Group Id”: group id for the project as per maven artifacts standards
2. “Artifact Id”: artifact id, i.e. representation name for the plugin for use in various other projects.
3. “Version”: version of the plugin.
4. “Packaging”: type of packaging to be used for the project. In our application we use “jar” packaging.
After entering the above details for the new plugin, click on “Finish”.
Plugin_4
5. The structure shown below will be generated for the current project which includes the following:
1. “src” package: used for the storing the source code and resources used by the plugin.
2. “target” package: used for storing the target files i.e. the <b.“.class”</b> files, “.jar” files of the plugin.
3. “pom.xml” file: contains the information about the plugin.
Now start creating desired package structure for the project by right clicking on the “java” package and selecting the “new→others” option and selecting the “package”.
Plugin_5
6. Type the hierarchical structure of the project and click on “Finish”.
Plugin_6
7. Above operation will create a package structure shown below.
Plugin_7
8. Create the desired files and corresponding folders for the plugin. Sample files can be found in the sample source code as well.
Plugin_8
9. Now that the plugin is ready with all the content, right click on the project name, go to “Run As” option and from the list shown choose “Maven Build”.
Plugin_9
10. A pop up window for editing the “Run/Debug” configuration will open up. In the “Goals” field, type “clean install”, check the “offline” and “Skip Tests” options and then click “Apply”.
Plugin_10
11. For creating the jar file for the plugin following settings need to be taken care of:
1. Goto maven repository. Default path for the same is C:\Documents and Settings\{user-name}\.m2\repository folder.
2. Create the folder structure com\ephesoft\dcma\ephesoft\<VERSION_NUMBER> inside the repository folder.
3. Copy and paste the Ephesoft.jar inside the folder.
4. Rename Ephesoft.jar to Ephesoft-<Version_Number>.jar.
5. In the “pom.xml” file for the plugin make the following entry
<dependencies>
<dependency>
<groupId>com.ephesoft.dcma</groupId>
<artifactId>ephesoft</artifactId>
<version><VERSION_NUMBER></version>
</dependency>
</dependencies>

 

6. Now that we have defined the dependencies for the plugin, we can use the existing code contained within the “ephesoft-<VERSION_NUMBER>.jar” for the desired purpose.
12. Click on “Run”, this will run the maven project and make its “jar”. A .jar file corresponding to the plugin will be created in the target folder for the same.
Plugin_11

Advanced Implementation Steps

1. “Pre Processing” settings: In order to perform some desired work before running a plugin we can create a method in the plugin code file having “@PreProcess” annotation.
2. “Post Processing” settings: In order to perform some desired work after running a plugin we can create a method in the plugin code file having “@PostProcess” annotation.
3. We use the above settings in our application for creating a back up file for batch.xml before and after the plugin has processed which helps us defining the change a plugin has made to the “batch.xml” files for the batch being processed.
4. Sample function for the above scenario:
@PreProcess
public void preProcess(final BatchInstanceID batchInstanceID, String ::pluginWorkflow) }
Assert.notNull(batchInstanceID);
BackUpFileService.backUpBatch(batchInstanceID.getID());
}
@PostProcess
public void postProcess(final BatchInstanceID batchInstanceID, String pluginWorkflow) {
Assert.notNull(batchInstanceID);
BackUpFileService.backUpBatch(batchInstanceID.getID());
}
Use these settings in the new plugin in order to maintain consistency with the current conventions and workflow of the application.
5. BackUpFileService can be used to create backup xml files for the respective plugin.

Workflow Management

Introduction

Establishments:
• A batch class is made of modules, which in turn consist of plugins.
• Dependencies between modules are only a result of the dependencies that exist between plugins.
Inference: By handling the dependencies that exist between plugins, we can create the Validation framework.

• Addition of a new tab in the admin view for workflow management by the name of “Workflow Management” containing the following:

“Plugins List”: List of plugins already present.
“Add New Plugin” button: For adding a new plugin.
“Dependencies” button: On being clicked it will take user to a screen where it can manage the dependencies among the plugins.
“Help” button: On being clicked the user will be shown a pop-up message containing the information about the new plugin upload.
Workflow_1
“Add New plugin”: a plugin upload widget will open up. See the screenshot below
“Browse”: a file selection window will open up.
“Save”: this will save the plugin to the DB after validating the files.
“Cancel”: this will cancel the operation.
This widget will accept a .zip file for uploading.
Contents of the zip file:
.Jar file: The Jar for the plugin to be added.
.Xml file: containing the plugin information.
.Zip file must only contain these two files.
.Zip file and .Jar file must have the same name.
.Jar file content cannot be verified, so please make sure that they are as required.
• In order for this plugin to take effect, user needs to restart the tomcat server.
Note:
• This Zip file after successful validation of its contents will be stored in the location specified in “<DCMA_HOME>\WEB-INF\classes\META-INF\application.properties” file under the property named “plugin_upload_folder_path”.
• The JPDL file for the uploaded plugin will be stored at <Ephesoft-Shared-Folders\workflows\plugins\<PLUGIN_NAME> . This path is configurable in the dcma-batch.properties file.
Workflow_2

XML Structure

<?xml version=”1.0″ encoding=”UTF-8″?><plugin>
<jar-name></jar-name>
<plugin-name></plugin-name>
<plugin-desc></plugin-desc>
<plugin-workflow-name></plugin-workflow-name>
<plugin-service-instance></plugin-service-instance>
<method-name></method-name>
<is-scripting></is-scripting>
<back-up-file-name></back-up-file-name>
<script-name></script-name>
<application-context-path></application-context-path>
<plugin-properties>
<plugin-property>
<name></name>
<type></type>
<description></description>
<is-mandatory></is-mandatory>
<is-multivalue></is-multivalue>
<sample-values>
<sample-value></sample-value>
</sample-values>
</plugin-property>
</plugin-properties>
<dependencies>
<dependency>
<type-of-dependency></type-of-dependency>
<dependency-name></dependency-name>
</dependency>
</dependencies>

</plugin>

Validation on above XML

• All tags are compulsory and will have any string value, except for “is-scripting”,” is-mandatory” and “is-multivalue” tags which will have Boolean values (TRUE, FALSE).
jar-name tag value must match the name of the jar file present in the zip file.
• If “is-scripting” tag has a value “TRUE”, only then the values of “back-up-file-name” and “script-name” tag will be taken into account.
“plugin-property” and “dependency” tag can have multiple instances and have the values for plugin configs and dependencies respectively.

Assumptions

“plugin-service-instance” and “method-name” tags must be correct as they cannot be validated. • “application-context-path” refers to the application context file name for the plugin. • For the dependencies tag:

• For a new plugin, with dependencies as
o ORDER_BEFORE : P2,P3/P4,P5,P6/P7/P8
o UNIQUE : TRUE
o OR (/) operator and AND (,) operator are also supported for specifying complex dependencies.
<dependencies>
<dependency>
<type-of-dependency>ORDER_BEFORE </type-of-dependency>
<dependency-name>IMPORT_BATCH_FOLDER</dependency-name>
</dependency>
<dependency>
<type-of-dependency>ORDER_BEFORE </type-of-dependency>
<dependency-name>IMPORT_MULTIPAGE_FILES/CMIS_PLUGIN</dependency-name>
</dependency>
<dependency>
<type-of-dependency>ORDER_BEFORE </type-of-dependency>
<dependency-name>DOCUMENT_ASSEMBLER_PLUGIN,CLEAN_UP</dependency-name>
</dependency>

</dependencies>

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. We have eliminated the Application URL from the title of External App Window. Title is now configurable through the Admin UI.

Netbeans IDE Setup

Ide-setup-1

  • Create a new Java Application Project:

Ide-setup-2

  • To implement and build the Ephesoft scripting classes the Ephesoft.jar file must be added under the project dependencies.

Ide-setup-3

  • Browse to the location of your Ephesoft installation’s library folder and locate Ephesoft.jar. The default path on the server machine is: C:\Ephesoft\Application\WEB-INF\lib

Ide-setup-4

  • As a point of reference for Ephesoft script development you can examine the script files that are packaged with the default batch classes Ephesoft ships with.
    C:\Ephesoft\SharedFolders\BC1\scripts
  • This screenshot depicts and implementation of the ScriptExtraction.java class file. However in this case a main() method has been added to allow for testing & debugging by execution within the class.

Ide-setup-5

  • At this stage the main() method has been implemented to allow for the reading in of an Ephesoft batch .xml file, and passing that Document object to the ScriptExtraction execute() method.
	public static void main(String[] args)
	{
		try {
			SAXBuilder sb = new SAXBuilder();
			Document doc = sb.build("BI10A_batch.xml");
			ScriptExtraction extractor = new ScriptExtraction();
			extractor.execute(doc, null, null);
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
  • With the main() method in place it is now possible to execute the ScriptExtraction class. Successful execution is confirmed by the print statements in the NetBeans output section.

Ide-setup-7

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 url: http://{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 URL: http://{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 URL: http://{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 URL: http://{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 URL: http://{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: 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
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 URL: http://{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_EXTARCTION, RECOSTAR_EXTARCTION, REGULAR_REGEX_EXTRACTION, KV_EXTRACTION, FUZZY_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] = 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); } 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] = 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); } 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] = 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); } 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_type there 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 = 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\\Input.xml”); File file1 = new File(“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 = 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(); } } }

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

}

}

}

E-mail Import

$
0
0

Overview

This plug-in is responsible for importing the documents present in a defined form from the user’s mail account. User is allowed to configure any mail account as well as the type of documents which the plug-in will support. This configuration is done per batch class. Multiple email accounts can be setup for each batch class.

File Name Length Restriction

Use the following formula to determine the maximum file name length that Ephesoft Transact supports for email import:

Length[UNC_FOLDER_File_Name_Path] < PERMISSIBLE_LIMIT_PATH_LENGTH_WINDOWS – PDF_PROCESSING_FOLDER.length() – 10

where:
PERMISSIBLE_LIMIT_PATH_LENGTH_WINDOWS = 259
PDF_PROCESSING_FOLDER.length()= 22

The following case study provides an example of this formula in application:

  • During the import process, the file !!!mail.pdf is located in the following directory:
    • D:\Ephesoft\SharedFolders\TestBatch\39455638711700,
  • In this case, the maximum file name length is calculated to be as follows:
    • length[D:\Ephesoft\SharedFolders\TestBatch\39455638711700!!!mail.pdf] < 227

Configuration

Mail configuration

400px-3.1_EmailImport_1001

 

Following are the configurable mail account properties:

 

Configurable property Type of value Value options Description
Username String A valid email account username. The user account name to be configured with Ephesoft on which the Email Import service will keep a watch.
Password String Corresponding password for the configured username Password for the configured user account.
Incoming name String A valid mail server name The name of the mail server to which the configured user account belongs.
Type Drop down POP3/IMAP The type of the mail server to which the configured user account belongs.
Folder String A valid and existing mail folder name The name of the mail folder on which the Ephesoft Email import will be checking. Generally it is INBOX only.
SSL Check Box Checked
Unchecked
The property that defines whether we'll be connecting to mail server using the SSL settings or Non-SSL.
Port Integer A valid port number The port number on which the configured mail server type will work. If port number is not specified Ephesoft will use connect to default ports i.e. 995 for POP3 and 993 for IMAP.

 

Configurable Properties file

  • <Ephesoft installation directory>\ Application\WEB-INF\classes\META-INF\dcma-mail-import\mail-import. properties:
Configurable property Type of value Value options Description
dcma.importMail.cronExpression String A valid cron expressions The CRON expression defining the look up time for the plug-in, i.e. at what time the plug-in looks for any updates in the configured mail account.
dcma.supported.attachment.extension String List of valid file extensions Defines the supported documents by the plug-in. Multiple entries are separated by a ( ; ) character"
dcma.mail.import.core.size Integer Valid number of thread pool size. This property defince the thread pool size which will process mails downloaded from configured mail server.
dcma.mail.import.mail_body_extension_type Integer 0 = HTML
1 = TEXT
Default value: 0 (HTML)
This property defines the extension type for file created for downloaded mail body.
dcma.mail.import.max_mail_retry_count Integer Valid number retry count.
Default value: 3
This property defines number of times a mail need to be tried before it is marked as read and stops its further processing.
dcma.mail.import.mail_retry_interval Integer Valid time lag in milli second
Default value:
The property specifies the time lag between consecutive mails retries.
dcma.mail.import.mail_body_download_flag Integer 1= don't download body
download only attachments
0= download body with
attachments(default value)
This property tells whether to download mail body or not.
dcma.importMail.mailProcessCronExpression String A valid cron expression
Default value is 5min
This expression decide after how much time interval a batch needs to picked from imported mails.
dcma.mail.import.max_mail_processing_capacity Interger A valid number of mails those need to be clubbed in one batch
Default value is 5 mails
This Integer values tell the maximum number of mail those needs to be clubbed in one batch.
dcma.mail.import.mail_pickup_procedure Integer 0= Simple pickup(Default)
1= Clubbing of mail in 1 batch.
This property decides when mail need to clubbed in on batch and when simple 1 batch/mail need to be created

 

  • <Ephesoft installation directory>\ Application\WEB-INF\classes\META-INF\dcma-open-office \open-office.properties:
Configurable property Type of value Value options Description
openoffice.serverUrl String ServerName where open office will run. This property provide server name for open office service. Generally it is server name where Ephesoft is running, so that we can start open office on same server.
openoffice.serverPort Integer A valid and available port number. Port number used for connecting to the open office server instance. Default port is 8100
openoffice.autoStart Boolean True
False
If the open office server should be started / connected upon XE starts. Default value is false.
openoffice.homePath String N-A Path to open office installation. "If no path is provided a default value will be calculated based on the operating environment."

 

Characteristics

  • The functionality/service allows the user to set up any number of mail accounts for gathering data.
  • The user is allowed to configure the account via UI.
  • The functionality/service can support multiple document formats (zip, doc, xls, tif).
  • The functionality/service makes use of the open-office to convert the received attachments files into application usable formats i.e. pdf.
  • The functionality/service is capable of downloading and saving the attachments of a mail.
  • The functionality allows user to choose whether to download mail body or just need to process the mail attachments.
  • This functionality provides an option to club multiple emails into one batch.
  • When a batch need to be created in Mail clubbing feature depends on two properties.
    • dcma.mail.import.max_mail_processing_capacity
    • dcma.importMail.mailProcessCronExpression

A batch creation can be triggered by either cron job or when number of mails downloaded equals the number specified by dcma.mail.import.max_mail_processing_capacity property.

 

Steps of execution/working

  • When the plug-in properties have been set up properly, Ephesoft moves ahead with mail downloading by accessing the mail account.
  • Email import service reads the user’s mail configuration from the database, and tries to access the user’s mail account using the configured settings.
  • If the service is able to connect to the user account, it reads all the unread mails contained in the configured folder.
  • After the service has read the mails, it starts processing multiple mails at a time.
  • Each read mail goes through a three step procedure of processing, downloading, converting and creating a batch for the mail.
  • If any error occurs while processing a mail, the mail is given configured number of tries, if even after multiple tries the mail was not able to get processed the mail is marked and read and the service sends notification mail to mail accounts configured for notification.
  • After a mail body and its attachments are download and converted into pdfs, they are further copied to UNC folder of corresponding batch classes. Copying to UNC folder is controlled by mail clubbing feature. In case mail clubbing is disabled one batch per mail will be created and copied to UNC and when mail clubbing is enabled a singled batch is created for multiple number of mails.

Troubleshooting

Following are few common error messages received due to mal-functioning of the plugin:

S. No. Error message Possible root cause
1 Unable to convert Email into PDF file. Open office service is either not running or have not been configured correctly
2 Not able to establish connection. Connection could not be established for the current user's account configuration.
3 Could not find port number. Trying with default value of 995. Port number specified in the user's configuration is invalid, hence plug-in tries to connect on the default pop3 port.
4 Could not find port number. "Trying with default value of 993. Port number specified in the user's configuration is invalid hence plug-in tries to connect on the default imap port."
5 Error while reading mail contents Either email body or other attachments could not be read and converted
6 Not able to process the mail reading. Some error in reading the contents of mail. Open-office could not convert the source file into desired.

KB00023071: Web Scanner Certificate Expiration in Ephesoft 4.5 and 4.1.3.0

$
0
0

Component:

Ephesoft Transact 4.1.3.0 and 4.5.0.0

 

Issue Description:

On accessing the web-scanner URL we are prompted with below certificate expiration message:
and on clicking View Certificate we are prompted with Expired Certificate Information as below:
Root Cause:
Ephesoft Scanner Service self signed certificate for ssl configuration got expired. This is certificate internally required by Ephesoft Scanner Service for ssl configuration.
Solution:
Short Term Solution:
Click on Yes option to proceed, however this will need to be done every time the user clicks on Web Scanner URL.
Hot-Fix for Version 4.1.3.0

Please find the new installer which has corrected cert expiration date here with steps to be performed as below:

1. Stop and uninstall previous version of Ephesoft Scanner Service (if any).
2. Download and extract the hot-fix folder from the shared location of the required version.
3. Install EphesoftScannerService.msi or EphesoftScannerService.zip present inside the extracted hot-fix folder.
4. Start Ephesoft Scanner Service.
5. Clear browser’s cache and hit Ephesoft Scanner Service URL.

Please note that you will need to reconfigure Web Scanner over HTTPS again.

Hot-Fix for Version 4.5.0.0
1. Stop and uninstall previous version of Ephesoft Scanner Service (if any).
2. Download hot-fix from here and extract the hot-fix folder from the shared location of the required version.
3. Install EphesoftScannerService.msi or EphesoftScannerService.zip present inside the extracted hot-fix folder.
4. Start Ephesoft Scanner Service.
5. Clear browser’s cache and hit Ephesoft Scanner Service URL.Please note that this will require to configure HTTPS again on the client machine.

The post KB00023071: Web Scanner Certificate Expiration in Ephesoft 4.5 and 4.1.3.0 appeared first on Ephesoft Docs.


KB00023267: How to Enable CORS in Ephesoft Transact

$
0
0

Issue:

This article focuses on how to enable CORS in Ephesoft Transact and resolve Access Control Allow Origin Exception with customer web application.

What is CORS?

CORS is a security feature that uses HTTP Headers that can be sent from the web server and interpreted by the browser to allow the browser to decide if it should proceed with a request or not. Part of the CORS mechanism involves the browser making a ‘preflight’ OPTIONS request to the web server so it can decide if it should send the actual request or not. Something that’s important to note here is that CORS checks are only made for requests that are not categorized as ‘simple requests’ and one of the triggers for requests to our APIs is the inclusion of an ‘Authorization’ header.

It’s also important to note that CORS is controlled by the client so any custom code written in Java for example or any custom requests made in PostMan will not be affected by CORS, however any custom code that is executed by a modern web browser such as JavaScript will be affected by CORS.

So in the current Transact configuration we have two issues:

  1. OPTIONS requests are not supported by the current web.xml configuration: OPTIONS requests need to be supported WITHOUT the requirement for the request to be sent with authentication (since CORS preflight requests do not include authentication). Configuration needs to be added to Ephesoft\Application\WEB-INF\web.xml enables this support
  2. CORS response headers are not configured to be returned to a client that requests them. We need to add an additional filter configuration which needs to be added to Ephesoft\JavaAppServer\conf\web.xml

Solution: 

Add the following to Ephesoft\JavaAppServer\conf\web.xml:

<filter>
  <filter-name>CorsFilter</filter-name>
  <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
  <init-param>
                  <param-name>cors.allowed.origins</param-name>
                  <param-value>*</param-value>
  </init-param>
  <init-param>
                  <param-name>cors.allowed.methods</param-name>
                  <param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
  </init-param>
  <init-param>
                  <param-name>cors.allowed.headers</param-name>
                  <param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,Content-Disposition, Authorization</param-value>
  </init-param>
  <init-param>
                  <param-name>cors.exposed.headers</param-name>
  <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
  </init-param>
  <init-param>
                  <param-name>cors.support.credentials</param-name>
                  <param-value>true</param-value>
  </init-param>
  <init-param>
                  <param-name>cors.preflight.maxage</param-name>
                  <param-value>10</param-value>
  </init-param>
  </filter>

<filter-mapping>
  <filter-name>CorsFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>

Add the following to: Ephesoft\Application\WEB-INF\web.xml:

<security-constraint>
  <web-resource-collection>
                  <web-resource-name>web service</web-resource-name>
                  <url-pattern>/rest/*</url-pattern>
                  <http-method>OPTIONS</http-method>
  </web-resource-collection>
</security-constraint>

The post KB00023267: How to Enable CORS in Ephesoft Transact appeared first on Ephesoft Docs.

KB00023717: Open Office Issue org.artofsolving.jodconverter.office.OfficeException: could not load document in Ephesoft Transact 4.1.2.1

$
0
0

Affected Version:

4.1.2.1

 

Component:

Email Import

 

Issue Description:

An issue is observed in Ephesoft Transact 4.1.2.1 with Email Import where PNG images when embedded or inserted using outlook-client fails to get converted to PDF file with below exception thrown in Ephesoft log files:

4.1.2.1.2018-08-30 11:50:07,650 [ERROR] [pool-5-thread-1] [com.ephesoft.dcma.mail.service.EmailConvertorImpl] – Unable to convert Email into PDF file.
org.artofsolving.jodconverter.office.OfficeException: could not load document: C:\Ephesoft\SharedFolders\download-emails\8508528827530180\downloaded-email-attachments\image003.png

The issue is very specific to certain email’s and when the emails are forwarded using outlook-client to lotus notes from where Ephesoft transact is configured to pickup the email’s.

 

Solution:

1. Download the LibreOffice folder from here.
2. Stop Ephesoft Service and kill any soffice.exe and soffice.sbin processes running in Task Manger -> Details Tab. Make sure no process of soffice is running 
3. Navigate to Ephesoft -> Dependencies folder and take a backup of libreoffice folder to some other location and delete the folder from this location.
4. Extract libreoffice folder from the download link above and paste this in Ephesoft->Dependencies folder.
5. Navigate to Ephesoft\Application\WEB-INF\classes\META-INF\dcma-open-office folder and open open-office.properties file.
6. Change the value of openoffice.homePath from C:\\Ephesoft\\Dependencies\\libreoffice\\App\\libreoffice to C:\\Ephesoft\\Dependencies\\libreoffice
7. Restart the ephesoft service and now try to process the email’s and let me know if these gets processed properly or not.

The post KB00023717: Open Office Issue org.artofsolving.jodconverter.office.OfficeException: could not load document in Ephesoft Transact 4.1.2.1 appeared first on Ephesoft Docs.

KB00023890: Resolving unable to load image popup warning on Table Extraction Screen

$
0
0

Component:

Table Extraction

 

Issue:

There are scenario’s when the images are deleted from the advanced-test-table folder due to which when opening the table extraction rule we are shown warning popup message as below:

 

Solution:

This issue happens because entry exists in database table and the files are not present in Shared Folder advanced-test-table folder in the batch class. As you can see in the below screenshot, highlighted file name in table_extraction_detail table is referring to file which is not present in advanced-test-table folder hence when on opening the configuration page it doesn’t find the png file and therefore throws error.

In order to resolve the issue do the following:

  1. Make sure to take database backup and batch class export and its batch class folder backup.
  2. Delete the entry from table_extraction_detail table in ephesoft database for the file name for which you are seeing the issue.
  3. Redeploy batch class from batch class management screen.

 

The post KB00023890: Resolving unable to load image popup warning on Table Extraction Screen appeared first on Ephesoft Docs.

How To Stop The Logs From Zipping

$
0
0

How To: Stop logs compression

 

Topic #24490

Applicable Ephesoft versions: 4.5

In 4.5, logs are automatically compressed into a .gz file when archived. Some customers may prefer to have the logs uncompressed for easy access.

 

Instructions:

 

  1. Open the log4j.xml file inside Ephesoft/Application
    1. Remove all mentions of .gz, instead leaving just .log

Before:

After:

 | Documentation Main Page | How To Articles | Downloads and Updates |

The post How To Stop The Logs From Zipping appeared first on Ephesoft Docs.

Issue: Transact operations slowness due to corrupted KV extraction entries in the database

$
0
0

Issue:

In some cases, KV extraction entries in the database might get corrupted, which causes the slowness of Ephesoft Transact operations, including execution of web services.

 

Solution (for MSSQL database):

1. Stop the Ephesoft server.

2. Take backup of the Ephesoft database.

3. Extract the file below and save it in a temporary location.

KVExtraction_Proc

4. Execute the procedure described in the KVExtraction_Proc.txt file in the Ephesoft database.

5. Start the Ephesoft server.

 

The post Issue: Transact operations slowness due to corrupted KV extraction entries in the database appeared first on Ephesoft Docs.

Viewing all 478 articles
Browse latest View live


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