Tuesday, November 15, 2011

Document Management System Guide Part 2


Registered user can login to the application through their user name and password. The URL can be obtained from the system administrator of Document Management System.





















Customer Registration

Customers involved in the business process can be registered. This helps in generating report based on the customer identity.






















Document Transaction Steps and flow diagram

1. Document Entry.
2. Document Forward.
3. Document Review.
4. Document Authorize.
5. Document Reject






















Document Transaction Generation

This is the document transaction generation module. In the screen shot Document Type, Customer list and forwarder lists is auto populated from the initial setups. User can select appropriate values from the list to generate document transaction. A document may contain multiple files as shown below in the screen shot.

Some Useful Notes:

1. Document Type is user defined and parameterized document. It helps to differentiate the type of document generated. As per the configuration, a document number may contain document short string, document date and document serial number.eg AO060720100000000019.

2. “Forward To” user field is the default user the document to be forwarded to. It must not be empty. The block “User Forwarder List” contain list of users in the priority list to be forwarded one by one from left side simultaneously. If a default user, that is user in “Forward To” field do not respond within DOCUMENT TIME OUT (DOCUMENT_TIMEOUT) parameter default set to 30 minutes, then the document is revoked from “Forward To” user (admin) and auto forwarded to first user in User “Forwarded List” (surendras). If “surendars” do not respond within DOCUMENT TIME OUT, then the document is revoked from the user and auto forwarded to user “dhrubab”. During the document auto forward process, whenever any one of the user (admin, surendras, dhrubab or malikad) respond, the users in the forwarder chain are cancelled from the priority list. Then the document is processed as per the action (FORWARD, REVOKE, AUTHORIZE, REJECT) taken by the forwarder user.

3. Document No: It is system generated number to uniquely identify the document being generated. Document number generated depends upon the configuration of document type definition. A Document Number can contain multiples related files with the document. Screen shot show a Bank Guarantee document that contain citizen ship certificate and guarantee fill up form in portable document format.

4. + sign button indicates the addition of the file in the document to be generated. Clik on the + sign button to add new row to the document.

5. – sign button on each row indicates the deletion of the file from the document. Click on the –sign button to delete the current row from the document.

6. Remarks on the each document can be included in the remarks field that should be informative to the user receiving the document. Remarks are also show on document flow report.

7. The application supports files names in portable document format (PDF) for preview during document processing. Files in other formats are not available for preview but they can be downloaded to the local computer and opened as per user demand. It is suggested to process files in portable document format as the time to generate preview for portable document format is much lesser than file downloads. Avoid processing document files other than portable document format (PDF) to minimize bandwidth usage.

8. Extensions of filenames are mandatory in “File Name” field. The system returns error and file could not be transmitted if extension are avoided. For instance, if only name of file “citizen” is placed in “File Name” field, application would return error during file upload process. So, it is required to enter extension of the file with their file name that is “citizen.pdf” in “File Name” field.

9. Files must be stored in Application Home Directory default to “C:\docman”. The default Application Home Directory can be changed upon request to the administrator.

10. “Save” Button saves the files and generates a unique Document Number for transaction.

11. Email alert is sent to the default user (admin) upon Document Transaction Generation.

12. Refer to the screen shot shown below.


Screen shot of Document Transaction Entry:






















Document Forward/Revoke/Authorize/Reject

The Document Authorize/Forward/Reject/Review grid shows the list of document forwarded to login user for approval. Click on the record to display the details of the document. Document file in portable document format (PDF) can be previewed while other file formats need to be downloaded to the local computer.

As per the requirement, a document can be processed for:
1. REVIEW document.
2. FORWARD for next level approval.
3. AUTHORIZE document.
4. REJECT document.























User Actions:

1. REVIEW Document
Whenever modification is required in the document, it is sent for review. User performing review can be same user that forward the document or any other user in the user list.

2. FORWARD Document
Whenever approval is sought from next authority level, then the document is forwarded to the respective user.

3. AUTHORIZE Document
Permit the document to carry on the business process.

4. REJECT Documents
Disallow to process the business activity.

A remark is mandatory while processing the document. The document recipient can track the state of the document and business process from the remarks as well. So, remarks must be precise and clear that can be taken as reference to authenticate the document. Remarks are also shown on document flow report.

Screen shot of File preview






















Invalid Documents:

During document transaction processing, if file name specified in file name field does not exist in Application Home Directory, the resulting document number is marked as Invalid Document. Invalid Documents can be processed from Invalid Document menu from “Invalid Document” Grid as show in the screen shot below. Respective files can be placed in Application Home Directory and process “Upload File” button to validate the resulting document.
























Email Notification and Alerts

Email Notification in the form of alerts is sent to the user that have been forwarded a document or sent for review. During AUTHORIZE and REJECT of document, email is sent to all the users involved for the document processing. This will help user to know the state of the document as well.

Background process for Auto Email Notification can be started and stopped from Email Notify menu.























User Reports

Reports are embedded in the application and rendered in Portable Document Format (pdf).

Screen shot of List of Documents























Screen shot of Document Flow Report


Sunday, November 13, 2011

Document Management System Guide Part 1

Registered user can login to the application through their user name and password.















Context Menu is loaded at the left hand side panel and log in information is shown at the right side panel. Middle panel is the working area where forms are loaded.

Usage of Refresh Button:

  1. Clear And Reload Form:

Refresh button has been placed at the top of each form. It helps to clear and reload form without visiting context menu at right hand side panel.

  1. Retrieval of Online Data:

The data grid (Manage User) is not auto loaded after modification in the existing record and after creation of new record (user) as well. For example, if new user is registered, need to press refresh button to load the new user registered (changes) in the “Manage User” grid.






















Data is loaded on the grid for further processing. When user clicks on the specific record, the details are loaded on the processing block (User Register), so that it can be modified as required. The user form controls such as “Add”, “Update”, and “Delete” buttons are loaded as per role granted to the user and their access on the each working forms.

Search in Drop down List:

The drop down list can be used for searching your required data as shown in the screen below. The list searches your data on each “Enter Key”. Type your text, to search in the list and enter the “Enter Key”. The list then returns filtered or matched data to the user that can be selected.
























Role Based Access Control Mechanism

Role can be created from Manage Role menu. Required forms can be selected from the list and privilege on specific controls can be permitted and revoked. Mark required controls (“Insert”, ”Update”, ”Delete”, ”Cancel”, ”Verify”) to provide access on forms and unmark those controls that are not permitted to the role. There is no need to grant access permission on each form to the users. The user belonging to the role directly has access control to the role forms.
























Steps for Role Creation:
Add
1. Enter Role Name, Description and select Authority level from list.
2. Select Add Group Authority and check mark the record to give access in the forms. Specific operation can be allowed and disallowed by marking and unmarking the operation.
3. The press “Add” button to save the Role information.

Screen shot of Role creation (First Tab View)























Screen shot of Role creation (Second Tab View)























Modify
1. Select record from the “Role Setup” data grid.
2. Make necessary changes.
3. Press “Update” button.

Delete
1. Select record from the “Role Setup” data grid.
2. Press “Delete” button.

User Creation and password management

User can be created with ease with necessary information on “User Register” block. The user belonging to the role can be selected from the Role list. The user receives access permission from the role assigned. Date can be selected from the date box. Valid email address is required. This email address is used during document Forward process.





















Steps for User Creation:

Add
1. Enter username and password.
2. Select Role, Authority from list.
3. Enter valid email address, date and employee id for the user.
4. The press “Add” button to save the user information.

Modify
1. Select record from the “Manage User” data grid.
2. Make necessary changes.
3. Press “Update” button.

Delete
1. Select record from the “Manage User” data grid.
2. Press “Delete” button.

Screen shot user creation




















Define your own Document Type

DMS allows define your own document involved in the business process. New document type can be added as a part of the business process. Document number is generated based on the document type definition. The document number is parameterized and can include two digit message string, document message date and ten digit message serial numbers. Document number AO060720100000000019 represents Account Open document on 6th July 2010 with serial number 19. This document category has starting serial number set to zero.























System Parameters

System parameters define the behavior of the application.

1. EMAIL_NOTIFICATION :
Enable or disable email notification service in the application. The value of “Y” enables the email notification service else not.

2. DOCUMENT_TIMEOUT:
Timeout in minutes for processing forwarded documents. If recipient do not respond to the document for DOCUMENT_TIMEOUT period, then document is marked as timeout and forwarded to next user in the priority list.

3. AUTO_FORWARD_TIME:
Time specified in minutes, application waits to process document in priority list.

4. DOC_REPOSITORY:
It is the central repository for storing the processed documents.

5. WORKING_DIRECTORY:
It is used temporarily during file download process.

6. MAX_FILE_TRF_SIZE:
Maximum File Transfer Size in Bytes application can handle. The application will not entertain file size greater than MAX_FILE_TRF_SIZE parameter.

Screen shot of the system parameter is shown below:



Wednesday, November 9, 2011

Code to Pass ArrayList From java to Oracle Database

package com.test;

import java.sql.*;
import java.sql.Connection;

public class Conn {
static String url = "jdbc:oracle:thin:@localhost:1521:oradb";

static String user = "username";

static String pass = "password";

public static Connection getConnection() {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection(Conn.url, Conn.user,
Conn.pass);
return conn;

} catch (Exception ms) {
ms.printStackTrace();
return null;
}
}

public static void main(String ss[]) {
Connection conn = Conn.getConnection();
}

}

public class TableTest {
int id;
String name;
String attribute1;
String attribute2;

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getAttribute1() {
return attribute1;
}

public void setAttribute1(String attribute1) {
this.attribute1 = attribute1;
}

public String getAttribute2() {
return attribute2;
}

public void setAttribute2(String attribute2) {
this.attribute2 = attribute2;
}

}


import java.sql.Array;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import oracle.jdbc.OraclePreparedStatement;
import oracle.sql.ARRAY;
import oracle.sql.ArrayDescriptor;
import oracle.sql.STRUCT;
import oracle.sql.StructDescriptor;

public class OracleStoredProcedure {

private final String ORACLE_STRUCT = "T_TYPE";
private final String ORACLE_ARRAY = "TB_T_TYPE";

public void insertAll(List records) {
Connection conn = null;
StructDescriptor structDescriptor = null;
ArrayDescriptor arrayDescriptor = null;
int iSize = records.size();
Object[] arrObj = null;
Object[][] recObj = null;
try {

conn = Conn.getConnection();

structDescriptor = StructDescriptor.createDescriptor(ORACLE_STRUCT,
conn);
arrayDescriptor = ArrayDescriptor.createDescriptor(ORACLE_ARRAY,
conn);

arrObj = new Object[3];
recObj = new Object[iSize][3];
// Structuring obj and arrays
for (int j = 0; j < iSize; j++) {
TableTest ob = (TableTest) records.get(j);
recObj[j][0] = ob.name;
recObj[j][1] = ob.attribute1;
recObj[j][2] = ob.attribute2;

// arrObj[j] = new STRUCT(structDescriptor, conn, recObj[j]);
}
ARRAY arr = new ARRAY(arrayDescriptor, conn, recObj);
oracle.jdbc.OraclePreparedStatement preparedStatement = (OraclePreparedStatement) conn
.prepareStatement("{call POPULATE_TABLE_TEST (?)}");
preparedStatement.setArray(1, arr);
preparedStatement.execute();

} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (conn != null) {
conn.close();

}
} catch (SQLException e2) {
e2.printStackTrace();
}
}
}

public static void main(String a[]) {
List list = new ArrayList();
TableTest ab = new TableTest();
ab.setId(1);
ab.setName("user1");
ab.setAttribute1("m1");
ab.setAttribute1("m2");
list.add(ab);

TableTest abc = new TableTest();
abc.setId(2);
abc.setName("user2");
abc.setAttribute1("a1");
abc.setAttribute1("a2");
list.add(abc);
new OracleStoredProcedure().insertAll(list);

}
}

Javascript : Apply method

Javascript functions are objects with spcified property named apply. The apply method is used as the constructor of the object. The object is passed as the first parameter to the apply method. The second parameter is always an array used to initialize the object being passed with the array object.
A function named Person has three parameters and initialize the object property with the passed arguments. Here "this" refer to the object that invoke the apply method ie Aperson object. Aperson function applies Person attributes with itself as first argument and array as its parameters.


function Person(firstname,middlename,lastname)
{
this.firstname = firstname;
this.middlename= middlename;
this.lastname = lastname;
}

function Aperson(age, firstname, middlename, lastname)
{
this.age = age;
Person.apply(this, new Array(firstname, middlename, lastname))
}

aperson = new Aperson(31,"Bill","Jill","King")
console.log(aperson.firstname + " " + aperson.middlename + " " + aperson.lastname + " is " + aperson.age +" years old.") ;


Output
Bill Jill King is 31 years old.

Tuesday, November 8, 2011

Javascript: Array functions Push, Unshift, Pop, Shift

Push : The push method adds an element to the end of the array. If the method takes more than one elements, they are appended from left to right order.

var arraydata = ['a','b'] ;
arraydata.push('c');
arraydata.push('d','e');
console.log(arraydata);

Output
['a','b','c','d','e']


Unshift :The unshift method adds an element to the start of the array. If the method takes more than one elements, they are appended from right to left order.

var arraydata = ['b','a'] ;
arraydata.unshift('c');
arraydata.unshift('e','d');
console.log(arraydata);

Output
["e", "d", "c", "b", "a"]

Pop: The pop method removes an element from the end of the array and returns it.

var arraydata= ['a','b','c','d','e'];
console.log(arraydata.pop());
console.log(arraydata);

Output:
e
["a", "b", "c", "d"]

Shift : The shift method removes an element from the start of the array and returns it.

var arraydata= ['a','b','c','d','e'];
console.log(arraydata.shift());
console.log(arraydata);

Output:
a
["b", "c", "d", "e"]

arguments property of Javascript function

Javascript arguments property inside any function is array of function parameters passed. An arguments property is available only inside the function. Any function parameter can be accessed from the arguments property as usual array indexed by number starting from 0. Lets take an example.

argumentExample=function()
alert(arguments.length);
for loop counter between 0 and arguments.length
alert(arguments[counter]);

argumentExample("firstItem","secondItem",232,"fourthItem");

Callback in javascript

We create function normally to get arguments and return specific type of value in most of the programming languages. But functions in javascript behaves different. Function in javascript are objects that has predefined properties.

In javascript we can pass function as an argument and execute that passed function from the called function. We can execute passed function from the called function using the predefiend function property "call". The first parameter to the call back function acts as scope of the function and other parameters can be accessed normal way.

Lets take an example. Here function named "func" is the main function that takes an argument. Inside the function object "p" is created that has two property named "name" and "lastname". Similarly "company" object is created with property named "name" and "address". Also variable named "fullname" is created.

Another function test is created with two parameters "param1" and "param2". Here alert is given for the passed parameters and scope provided to the test from the called function.

Now we call the function "func" with the function "test" as parameter.
The line
a.call(p,fullname,company);
calls back the passed function "test". The first parameter "p" here acts as scope of the function during callback and can be accessed using keyword "this" as done on lline
alert(this.name+' ' +this.lastname);



func=function(a){
p={};
p.name='myname';
p.lastname='mylastname';
var fullname= 'abc xyz ';
company = new Object();
company.name='My Tech P. Ltd';
company.address='Nepal';
a.call(p,fullname,company);
}

test=function(param1,param2){
alert(param1);
alert(param2.name+param2.address);
alert(this.name+' ' +this.lastname);
}

func(test);

Program to send Email in Php with Authentication

PEAR Installation

PEAR is an extension for PHP. These days PEAR is included with PHP, but you need to install it yourself. I use PEAR on all my PHP developments.

Installing PEAR:

Open a command line window (i.e. Start->Run->cmd)
Go to the PHP directory, in my case C:\php. Type go-pear.bat. Follow the instructions.
The PEAR extension get installed in C:\php\PEAR directory.
Once PEAR is installed, go to the php.ini file in your Apache2 directory. Find the

Code:
;include_path = ".;c:\php\includes"

Remove the semi-colon (to un-comment it), and then add C:\php\PEAR to it

Code:
include_path = ".;c:\php\includes;C:\php\PEAR"
;include_path = ".;C:\wamp\php\includes;C:\wamp\php\PEAR"

---------------------------------------------------------------------------------------------
** The 'pear' command is not currently in your PATH, so you need to
** use 'c:\wamp\php\pear.bat' until you have added
** 'C:\wamp\php' to your PATH environment variable.

* WINDOWS ENVIRONMENT VARIABLES *
For convenience, a REG file is available under C:\wamp\php\PEAR_ENV.reg .
This file creates ENV variables for the current user.

Double-click this file to add it to the current user registry.

-----------------------------------------------------------------------------------------------
#########Pear mail package Installation################

go to http://pear.php.net/package/Mail/download/ for supported Mail packages

pear install Mail-1.1.14
pear install --alldeps Mail-1.1.14

########Email with authentication#############

";
$to = "XYZ ";
$subject = "Hi!";
$body = "Hi,\n\nHow are you? This is test php mail.";

$host = "mail.domain.com";
$username = "user@myserver.com";
$password = "sdfdsf";

$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
echo("

" . $mail->getMessage() . "

");
} else {
echo("

Message successfully sent!

");
}
?>

Sunday, November 6, 2011

Document Management System

Content

  1. About Document Management System.
  2. How to use Document Management System.
  3. Customer Registration.
  4. Document Transaction steps and flow diagram.
  5. Document Transaction Generation.
  6. Document Forward/Revoke/Authorize/Reject.
  7. Invalid Document.
  8. Email Notification and Alerts.
  9. User Reports.

Document Management System

A document management system (DMS) is a computer system (or set of computer programs) used to track and store electronic documents and/or images of paper documents. Document management systems are becoming more important as it becomes increasingly obvious that the paperless office is an ideal that may never be achieved. Instead, document management systems strive to create systems that can handle paper and electronic documents together.

Document management system handles documents in such a way that information can be created, shared, organized and stored efficiently and appropriately. The focus of document management system is on the organization and storage of documents. Documents are stored in an organized and secure way and allow documents to be found easily. There is a move within large organizations to use document management software to help them do this. This system is designed to make handling electronic files more efficient and effective way.

Document Management system enables the automatic routing of documents to the user responsible for working on them. Enterprises can rely on documents to be processed efficiently through a step-by-step process and there is no risk that they can be lost or overlooked. Workflow can be defined for the document processing and ensures that documents are forwarded to the appropriate user automatically at specified times, alerting the user of the necessity to process them through emails. This system ensures the smooth flow of documents through the enterprise.

In any enterprise it is vital that the security of electronic documents is appropriately managed. Document Management system ensure that access to the system is restricted only to those with the correct access permissions, both to ensure the integrity of data and to reduce the number of documents presented to the user only to those documents that are relevant to his or her role.

Document Transaction Steps and flow diagram

  1. Document Entry.
  2. Document Forward.
  3. Document Review.
  4. Document Authorize.
  5. Document Reject













Technical Details

  1. Full Open Source Implementation
  2. ZK
  3. JDK 1.6
  4. Spring Web Application Development Framework
  5. Apache Tomcat v6/ Jetty
  6. MySql
  7. Rsync
  8. Jasper Reports
  9. Linux/Fedora
  10. Enterprise Eclipse Platform for Software Development

Core Features

  1. Web Based Application
  2. Role Based Menu Access Control
  3. User Access Control
  4. User File Management
  5. Auto Email Notification
  6. Reports on Portable Document Format(PDF)
  7. Version Control
  8. Security/Access Control
  9. Support Multiple File Types
  10. Reports/Metrics
  11. Backup/Recovery