»
S
I
D
E
B
A
R
«
Issue Tracking system
Jul 1st, 2009 by rakesh

ISSUE TRACK PROJECT

Issue track is one of the most useful component of your application. This is very needful for you and your users. Using this application you and your users are able to communicate the problems related to the application and you are able to provide the solution according to the queries of the users.

This is my very first project which I have done . When I was developing this project , I face much more problem. Because first time I was using the latest technology to develop this project. And also first time I was using Spring,Hibernate and Stripes. I was not much more comfortable in this technology. But after completing this project I feel that’s easy.

So in the development period of this project I learn much more thing about how to use Spring , Hibernate and stripes. So here I am sharing the details of this project .

Issue Tracking System is a system by which you are able to get the queries of the users and according to the queries your concerning person are able to send the solution to the users. Here I will tell you in details that how to develop Issue Track management System and I will also share with the great moment that I face when I was developing this project.

So first of all create a New Database in your MySql Database. Because in this project I have used Mysql for database. So firstly create a new database name ISSUETRACKSYSTEM.

Now I am writing the steps here which will be more understandable for you .

  1. Create a New Database in your MySql Databse named IssueTrackSystem
  2. Create a New Table in your database named IssueTrackInfo.
  3. Insert some columns in your table Like(IssueID,ClientId,ClientName,IssueQuery,IssueDetails,IssueRaiseDate,IssueStatus, IssueRaiseDate,IssueSolvedDate etc)

Now also make one more table in your database to store the result that what has been change by the users or admin.So to store the all chages information make another table .

  1. Create a new table in your database names ChangedIssueTrackInfo.
  2. Insert some cloumns in your new table

Like(ChangedIssueId,ChangedIssueId,IssueDetails,IssueRaiseDate,IssueStatus etc)

Now you completed the database part. Now you are able to store the Issue Related Information in your database . Because the information is very important to store. If you have the information then any time you are able to search and get the details of the issue related to the concerning users. When any issue will be raised by the users , an issue id will be create and we will be the the issue id to the user and for further changes only issue id is needed for me. According to issue id we will be able to get all the details about the issue.

This is very easy steps. Because to make a database and create a table is very easy. So don’t worry Hibernate , spring and stripes are also very easy. So have fun with these technology . Now I will tell you how to configure and integrate these things in your project

Steps are as follows

  1. Open Your Net Beans Editor. Go to File—->NewProject——-> New Web Application
  2. Write Your Project Name IssueTrackInfoSytem
  3. Click Next
  4. Select Your Server (Apache Tomcat 6.0.18)
  5. Click Next
  6. Select the framework to develop this application
  7. click on Stripes.1.4.3,Spring Web MVC 2.5,Hibernate 3.2.5
  8. Click Finish

If you don’t have this framework in your netbeans ide you can download the plugin from web and attach the plugin in the netbeans.

Now You have make a new project named IssueTrackinfoSystem. Now first of all configure your WEB.XML. Because for presentation layer we are using Stripes here. So here stripe will control all the Jsp pages . So the configuration of web.xml is compulsory. It is very simple. And using stripes you are free to handle the jsp page. Stripes will handle all the request . So I think this is a big advantage for us.

The one more best advantage of using stripes framework is that stripes automatically generate the web.xml. Only you have to little bit changes in the stripes web.xml. Only in the Filter mapping of the stripes You have to give action resolver class path of your project. I am writing here the sample snippet for this.

—————————————————————————————————————————-

<init-param>

<param-name>ActionResolver.PackageFilters</param-name>

<param-value>com.pkg.action</param-value>

</init-param>

That’s all , now nothing you have to change in the web.xml. Now you are free to write the nay number of Jsp page . Stripes will handle the all action. You need not worry. That is interesting.

Now come to the next step.

  1. Create a new java package in your source packages of your project
  2. Give the name com.pkg.entity.
  3. Now right click on com.pkg.entity and select Entity class from Database(here note that Hibernate will automatically generate the entity class for you)
  4. Click on Database connection.
  5. Select New Database Connection.
  6. Fill all the details like HostName, Port No, Your DataBase Name,UserName,Password, and give the URL .
  7. Then click Ok.
  8. Now you have connected to your database. Your Table name will come then select the table name and add the table. Then Click Next ——> Click finish.

When You will finish this step you will see that a new class has been generated in your com.pkg.entity package.

This is the benefit of Hibernate. As we know that Hibernate is based on Object Relational Mapping.

Here Hibernate automatically generate the getter and setter method for all the entities. This is beneficial for us.

Now make a Data Access Object in your project. We make a DAO package to handle the transaction of our project. For Safe transaction we will create a DAO layer in our project.

Steps are like this:

  1. Create a new java package named com.pkg.dao.
  2. Create a new interface called IssueTrackInfoDAO.
  3. Write some method to handle the transaction likefor persist the date for your further use or remove data etc.

When I was developing my project I have declare this method. My method name is like this.

Public IssuetrackInfo getIssueTrackInfo(int id)

public List<IssueTrackInfo> getIssueTrackInfoList()

public void persistIssueTrackInfo(IssueTrackInfo issueTrackInfo)

public void removeIssueTrackInfo(IssueTrackInfo issueTrackInfo)

Now make another class called IssueTrackInfoDAOImpl in your com.pkg.dao to implement this interface.But here you will have to extend the HibernateDaoSupport and implement IssueTrackInfoDAO. Inside the spring framework of ORM ,there is a class called Hibenatetemplate,which has called getHibernateTemplate .Through this method we are able to handle the database transaction.

Now Make a service layer in this project. This layer is also called the business delegate of our project.

This layer handle all the business logic. This is the controller of our project. Whatever the transaction we will do using Dao will be handled by this layer. So this is the business controller of our project.

So steps are as follows:

  1. Create a new java package in your source package.
  2. Give the package name called com.pkg.service.
  3. Create an interface called IssueTrackService.
  4. Declare some method to handle the DAO.

In my project I have declare this method. You can make your own method also . Its totally depends upon you.

Public IssueTrackinfo getissueTrackInfo(int id)

public List<IssueTrackInfo> getIssueTrackInfoList()

public void persistIssueTrackInfo(IssueTrackInfo issuetrackinfo)

public void removeIssueTrackInfo(IssueTrackInfo issueTrackInfo)

Now implement this all method in you class. In your implementing class make an object of your DAO class . Because your are going to control of your DAO. So make an object of DAO class and use in your service implementing class.

Now you competed the part of hibernate and spring . You have injected your hibernate in spring. But You have have to inject all the things in the spring config also. Because as we know that Spring follow the properties of IOC(Inversion of Control). This is also called DI(Dependency Injection) . In spring every thing is bean. Spring understand that each and every thing is a bean. Spring inject one or more bean inside a bean. So that we will have to make a spring bean and inject all beans inside the spring beans.

So you must have to inject all the classes and intefaces in the spring config.xml inside beans. The format of spring configuration is like this.

<beans

/* Now insert all the beans inside this tag*/

</beans>

First inject your datasource in the spring beans. Here I am providing the format so that you can understand well.

——————————————————————————————————————-

<bean id=”dataSource”class=”org.springframework.jdbc.datasource.DriverManagerDataSource”>

<property name=”driverClassName”>

<value>com.mysql.jdbc.Driver</value>

</property>

<property name=”url”>

<value>jdbc:mysql://localhost:3306/—–</value>

</property>

<property name=”username”>

<value>Give the value of your database username</value>

</property>

<property name=”password”>

<value>Give the value of your database password</value>

</property>

</bean>

Now Inject your Hibernate Session factory and give the description of your Entity bean annotated class .In this bean inject your all entity class inside the annotated class. Here I am giving you the format which will be much understandable for you. Just think easy. This all configuration is very simple.Only think every thing just like spring, means think every thing is a bean.

<bean id=”sessionFactory” class=”org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean”>

<property name=”dataSource”>

<ref local=”dataSource”/>

</property>

<property name=”annotatedClasses”>

<list>

<value>Your class name full path</value>

</list>

</property>

<property name=”hibernateProperties”>

<props>

<prop key=”hibernate.dialect”>org.hibernate.dialect.MySQLDialect</prop>

<prop key=”hibernate.hbm2ddl.auto”>update</prop>

</props>

</property>

</bean>

—————————————————————————————————————————-

Now your entity bean has been mapped in the spring configuration in the session factory. Now inject the transaction manager for a single hibernate session factory. The format is as follows.

<bean id=”transactionManager” class=”org.springframework.orm.hibernate3.HibernateTransactionManager”>

<property name=”sessionFactory”>

<ref local=”sessionFactory”/>

</property>

</bean>

Now inject the hibernate interceptor. Hibernate interceptor is very necessary in the any project . Because this is used to inspect the code. When you some changes in your code this automatically change or update all the thing in your application

—————————————————————————————————————————-

<bean id=”hibernateInterceptor”

class=”org.springframework.orm.hibernate3.HibernateInterceptor” autowire=”byName”>

</bean>

Now inject your DAO in the spring bean. Because spring understand only bean . So it is compulsory to inject all the thing in this configuration. So here you will have to inject the DAO also.

Here I am writing the format also so that you will be able to understand.

<bean id=”Your Dao name Target” class=”Full path of your DAO class” autowire=”byName”>

</bean>

Now set the property of your Dao in the object and initialise the value of your dao using Spring configuration. The format are as follows.

<bean id=”DAo Object name” class=”org.springframework.aop.framework.ProxyFactoryBean”>

<property name=”proxyInterfaces”>

<value>Path of the Dao object</value>

</property>

<property name=”interceptorNames”>

<list>

<value>hibernateInterceptor</value>

<value>name of the DAO Target</value>

</list>

</property>

</bean>

Now you have injected the Dao but you have to inject your business delegate means your business controller also in the spring configuration. So Inject the service package also in the spring config also.

I am writing the format here also for your ease use.

<bean id=”Object of your service ” class=”full class path of your service Implementation”>

<property name=”Your Dao class Object”>

<ref local=”Your Dao class Object”/>

</property>

</bean>

Now mapped your stripes action bean also in the spring configuration. It is very easy. The stripes action bean handle your front end. This handles your all the action means this handles all the request and dispatch the response according to the request. The format of Stripes action bean are as follows.

————————————————————————————————————————–

<bean id=”object of your action bean” class=”full path of your action bean” scope=”prototype”>

<constructor-arg index=”0″ ref=”object of your business controller”/>

</bean>

Now you have done all the configuration all the spring. Now you are free to handle all the transaction , action or request . Spring will handle all the thing. This is the magic of spring. Using Spring your code will be much easier to handle and also much easier to maintain. The main benefit of spring is that it is easy to maintain. Spring MVC separates the Model ,View and controller in a very clean way. Validation is also very easy in spring.

Now come to the benefits of stripes framework. Stripes framework are used as a view controller of your project. Stripes are only used for presentation layer. The best part of stripes is that it needs little bit of configuration. Programmers are not worry to handle the all jsp pages, stripes will automatically all the jsp page. You need not to configure every time of your jsp and servlet page. Feel free if you are using stripes about the jsp and servlet pages.

Validation is also easy in stripes. Stripes also provide annotation for the validation which is very useful and very easy to use.

So for this project write the all jsp page using stripes. The tags of stripes are very similar to html. It is very easy to use. Only you have to add tag library in your jsp page.

<%@ taglib prefix=”stripes” uri=”http://stripes.sourceforge.net/stripes.tld” %>

You will have to add this tag library in every jsp page. Now use the tag of stripes. And have a fun with stripes world also.

So now lets start to develop your Issue tracking Management System using the latest technology. And have fun with Spring ,Hibernate and spring .

For any further enquiries about this project , just send me a mail on

rakeshraushan01@gmail.com

Thanks,

25X7
Jun 21st, 2009 by Umesh

I think Ratnesh is one of the greatest assets to mankind (and Demazi:).

He works like 25 by 7!!

An acquaintance with AppFuse
May 14th, 2009 by rkd

For past few days I was browsing through various articles on spring, hibernate and stripes integration. I have already used these technologies in my projects earlier but this time I wanted a truly modular architecture, an architecture where each of the three presentation, business and persistence layers are decoupled completely also I wanted a heavy use of annotation (personal choice as it requires lesser and better managed code) instead of XML files.
As I love to learn by examples I stumbled upon a few good pages or projects.
Wiring Your Web Application with Open Source JavaAppfuse.org and learntechnology.net.

Stripes
Apr 29th, 2009 by rakesh

Now have a fun with Stripes , A presentation framework for the development of  java web application within few minutes.

Stripes is a presentation framework for building web application in java. It enhances the look and and feel of  the web page. stripes is an framework so it has its own functionality and usage. It supports all the latest java technologies. To develop a web application  in java need too much work. It need lots of configuration. If you are using some other framework like Struts, WebWork2, Spring -MVC needs lots of configuration. If you are using this framework like Struts , Spring,etc.,then  first of all you will  need to learn as a whole to get started.  But nothing like that if you are using Stripes. Stripes does not needs lots of configuration. It is very easy to learn and use.

If you have been tired to use of complicated Java web frameworks . Just go ahead and use Stripes. Stripes is a lightweight, practical framework that lets you write lean and mean code without a bunch of XML configuration files. Stripes is designed to do a lot of the common work for you, while being flexible enough to adapt to your requirements.

Key Features of stripes

Zero external configuration per page/action (ActionBeans are auto-discovered, and configured using   annotations)
Powerful binding engine that will build complex object webs out of the request parameters
Easy to use (and localized) validation and type conversion system
Localization system that works even when you use direct JSP->JSP links
Ability to re-use ActionBeans as view helpers
Ridiculously easy to use indexed property support
Built in support for multiple events per form
Transparent file upload capabilities
Support for incremental development (e.g. you can build and test your JSP before even thinking about your ActionBean)
And a lot of built in flexibility that you only have to be aware of when you need to use it

So these  are the key features of Stripes. Using this you can develop a complex web application with a very easy steps. It is also very easy to maintain the whole application.  It also reduce the code for our application and also feel free , because for every Jsp Or Servlet page we don’t need to configure our configuration files. Stripes has its own standard configuration for all pages. The ActionBean class maintain this all things.It also maintain the request and response of the application. So , Stripes is very useful for developing a web applicatin in java.

Quick Start Guide to Develop an application using Stripes
Apr 29th, 2009 by rakesh

Introduction:

Now start to work on Stripes. This paragraph will guide you to develop an web application using Stripes. It also contains a section called Requirement , How to configure Stripes and a simple code and some other things.

Requirements:

Stripes makes significant use of several features in Java 1.5 such as Annotations and Generics. It also relies heavily on several Servlet 2.4/JSP 2.0 features. As a result you will need a 1.5 JDK (now available for most major platforms), and a Servlet Container that supports Servlet 2.4. Such containers include Tomcat 5.x, which is free (Apache license).

It is also expected that the reader has some experience with JSP development, and understands that there exists an Expression Language, though not necessarily too much about it.

Configuring Stripes:

Stripes is designed to require as little configuration as possible. To get it up and running you simply need to configure the Stripes Filter with a parameter and the Stripes Dispatcher Servlet in your web application’s web.xml. A pretty standard configuration would look like this:

—————————————————————————————————————————————————

web.xml

—————————————————————————————————————————————————

<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
         http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">
<filter>
		<display-name>Stripes Filter</display-name>
		<filter-name>StripesFilter</filter-name>
		<filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
		<init-param>
			<param-name>ActionResolver.Packages</param-name>
			<param-value>net.sourceforge.stripes.examples</param-value>
		</init-param>
 	</filter>

	<filter-mapping>
		<filter-name>StripesFilter</filter-name>
		<url-pattern>*.jsp</url-pattern>
		<dispatcher>REQUEST</dispatcher>
	</filter-mapping>

	<filter-mapping>
		<filter-name>StripesFilter</filter-name>
		<servlet-name>StripesDispatcher</servlet-name>
		<dispatcher>REQUEST</dispatcher>
	</filter-mapping>

	<servlet>
		<servlet-name>StripesDispatcher</servlet-name>
		<servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet-mapping>
		<servlet-name>StripesDispatcher</servlet-name>
		<url-pattern>*.action</url-pattern>
	</servlet-mapping>
</web-app>
---------------------------------------------------------------------------------------------------------


The ActionResolver.Packages parameter                             

Stripes auto-discovers your ActionBeans at deployment time by scanning your web application’s classpath. This saves you from having to enumerate all your ActionBeans somewhere, but you do have to give Stripes some starting points. To do so, use the ActionResolver.Packages init-param of the Stripes Filter to indicate one or more package roots. Do not use .* at the end of a package, subpackages are automatically included. Use commas to separate multiple package roots.The ActionResolver.Packages is the only required init-param for the Stripes Filter.

*.jsp Parameter:

Stripes automatically discovers the url-pattern of your web application . Every time you do not need to set the url of your page. Simply set *.jsp in your web.xml filter mapping.

*.action Parameter :

Stripes automatically discovers the Url-pattern of the action bean of your web application. You do not need to configure explicitly of your action bean in servlet mapping.

Next you’ll need to drop stripes.jar into your classpath, usually in your /WEB-INF/lib directory. This is the only compile-time dependency for developing with Stripes. For deploying and running Stripes you will also need to copy the following library files supplied with Stripes into your classpath:

1. commons-logging.jar

2. cos.jar

3. stripes.jar

My First Stripe:

As a first application we’ll develop a simple, one page calculator that can take two numbers and perform additions, and maybe some other operations later. First off, lets get the JSP into shape. The following is a first cut at a JSP. You’ll want to put it in a directory called ‘quickstart’ off your web application root.

———————————————————————————————————————————————————————————————————————————————————–

index.jsp

———————————————————————————————————————————————————————————————————————————————————–

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head><title>My First Stripe</title></head>
  <body>
    <h1>Stripes Calculator</h1>

    Hi, I'm the Stripes Calculator. I can only do addition. Maybe, some day, a nice programmer
    will come along and teach me how to do other things?
<stripes:form beanclass="net.sourceforge.stripes.examples.quickstart.CalculatorActionBean" focus="">
        <table>
            <tr>
                <td>Number 1:</td>
                <td><stripes:text name="numberOne"/></td>
            </tr>
            <tr>
                <td>Number 2:</td>
                <td><stripes:text name="numberTwo"/></td>
            </tr>
            <tr>
                <td colspan="2">
                    <stripes:submit name="addition" value="Add"/>
                </td>
            </tr>
            <tr>
                <td>Result:</td>
                <td>${actionBean.result}</td>
            </tr>
        </table>
    </stripes:form>
  </body>
</html>
----------------------------------------------------------------------------------------------------

The  first interesting thing in the page above is the second line (the one beginning <%@ taglib …. That imports the Stripes Tag Library for use within the page. Then, a little lower, the line:

—————————————————————————————————————————————————

<stripes:form beanclass="net.sourceforge.stripes.examples.quickstart.CalculatorActionBean" focus="">
--------------------------------------------------------------------------------------------------------

opens up a stripes:form tag. The Stripes form tag does a bunch of things we won’t go into here, and ultimately produces a regular html form tag on when the page is rendered. The focus=”" tells Stripes to automatically set focus into the first visible field (or the first field with errors when there are errors).

Next, we see two tags, something like:

—————————————————————————————————————————————————

<stripes:text name="numberOne"/>
---------------------------------------------------------------------------------------------------------
This is the Stripes equivelant of a <input type="text"/>
tag, but provides functionality for pre-populating, re-populating, and
changing display when there are validation errors. The name numberOne corresponds to the name of a property on the ActionBean that will receive the request.

instead of a <input type=”submit”> we see:

————————————————————————————————————————————————–

<stripes:submit name="addition" value="Add"/>
--------------------------------------------------------------------------------------------------------

The Stripes submit tag has additional functionality to render localized Strings on the button, but that’s more than we need here, so the tag simply uses the value attribute. The name of the submit button, addition, is very important as this is tied to the method that will be invoked on the ActionBean receiving the request.

Lastly, a small EL expression is used to print the result property of the ActionBean if it is present.

————————————————————————————————————————————————–

<td>${actionBean.result}</td>
--------------------------------------------------------------------------------------------------------
Now run this and see the preview of your jsp page.When the page first renders there is no ActionBean present (one is not instantiated by the form tag, and we haven't posted this form).

The ActionBean

An ActionBean is the object that receives the data submitted in requests and processes the user’s input. It both defines the properties of the form, and the processing logic for the form. To compare to Struts, the ActionBean is like the ActionForm and the Action put together in one class.

It should be mentioned at this point that there is no need for any external configuration to let Stripes know about the ActionBean implementations in an application, nor to tie together the JSP page and ActionBean. All of the information necessary is in the ActionBean itself. Let’s take a look at the simple ActionBean that receives the Calculator’s request.

————————————————————————————————————————————————–

CalculatorActionBean.java

————————————————————————————————————————————————–

package net.sourceforge.stripes.examples.quickstart;
import net.sourceforge.stripes.action.DefaultHandler;
import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.action.ForwardResolution;
import net.sourceforge.stripes.action.ActionBean;
import net.sourceforge.stripes.action.ActionBeanContext;

/**
 * A very simple calculator action.
 * @author Tim Fennell
 */
public class CalculatorActionBean implements ActionBean {
private ActionBeanContext context;
private double numberOne;
private double numberTwo;
private double result;
public ActionBeanContext getContext() { return context; }
public void setContext(ActionBeanContext context) { this.context = context; }
public double getNumberOne() { return numberOne; }
public void setNumberOne(double numberOne) { this.numberOne = numberOne; }
public double getNumberTwo() { return numberTwo; }
public void setNumberTwo(double numberTwo) { this.numberTwo = numberTwo; }
public double getResult() { return result; }
public void setResult(double result) { this.result = result; }

    @DefaultHandler
public Resolution addition() {
        result = getNumberOne() + getNumberTwo();
return new ForwardResolution("/quickstart/index.jsp");
    }
--------------------------------------------------------------------------------------------------------

Notice that we used the ActionBean’s class name in the stripes:form tag. Nevertheless, it’s good to know how Stripes goes from the class name to a URL. If you look at the generated code, you’ll see action=”/examples/quickstart/Calculator.action in the HTML. By default Stripes will examine ActionBeans and determine their URL based on their class and package names. To convert class names to URLs Stripes:

  • Removes any package names up to and including packages called ‘web’, ‘www’, ’stripes’ and ‘action’
  • Removes ‘Action’ and ‘Bean’ (or ‘ActionBean’) if it is the last part of the class name
  • Converts it to a path and appends ‘.action’

So in the above case, net.sourceforge.stripes.examples.quickstart.CalculatorActionBean became:

  • examples.quickstart.CalculatorActionBean
  • examples.quickstart.Calculator
  • /examples/quickstart/Calculator.action

The URL generated from the class name matches the action generated by the stripes:form tag. In both cases this is relative to the web application root. You can read more about how this is handled (and how to change the conversion to create different URLs) in the JavaDoc for NameBasedActionResolver.

}


Demazi Office Pics :P
Apr 24th, 2009 by rkd
A one day startup
Apr 24th, 2009 by rkd

For past few days we were negotiating with ICICI guys. Some of our clients have to print thousands of cheques at a time and ICICI CMS (cash management system) has some product for bulk cheque printing. They sent their proposal with the details like how many cheques they’d provide, the charges when printed on their end and when printed on our end, charges depending on the kind of stationary, no. of cheques on a page, the volume of cheques per month, et cetera. Since we wanted beautifully (for reasons too elaborate to mention here) printed cheques, we asked them for a sample printed cheque.

sample ICICI cheque print

sample ICICI cheque print

This was certainly not the ‘beauty’ we had in mind. not even close. We even thought it would get rejected at the banks if only it was not an only-at-icici cheque. People might just refuge to accept it. So we decided to format the cheque from our software only then came this thought “Cheque printing is something which every enterprise needs at one time or the other, though their are many offline stand alone solution, another online solution wont do any harm”. And the best part of this application was it wont need lot of time to launch a pre-alpha working. Umesh concluded “Lets do it!”.

So we zeroed on a gui based tool where

  1. User will upload a scanned of cheque
  2. Will drag and adjust size of name,date,amount labels
  3. Will upload the data from excel/csv or enter the same in gui form
  4. Get a formatted pdf report of the cheque ready for printing

And two days after we asked one of our client to send a scanned copy of cheque leaf to adjust the labels to be printed on cheque soon after that they printed a cheque and complained that the date is being printed a bit out of the place…

aixs-bank-cheque-demazi-sample

Cheque printed by our application

as we now had a gui tool so we accepted to fix this as well :)

What is BytearrayOutStream?
Apr 23rd, 2009 by rakesh

Sol:  ByteArrayOutputStream is used as an output stream in which the data is written into a byte array. The buffer of byteArrayOutputStream automatically grows according to data as you insert. The data can be retrived usingtoByteArray() and toString(). ByteArrayOutputStream is an implementation of an outputstream that used a byte array.

BytearrayOutputStream has two constructors:   ByteArrayOutputStream() and ByteArrayOutputstrem(int numbytes).

The default size of  ByteArrayOutputStream is  32 bytes but you can fix the size using the constructor ByteArrayOutputStream(int numofBytes).

What is ArrayList and its usefulness?
Apr 23rd, 2009 by rakesh

Sol:        Arraylist is resizeable array implementation of list interface. It implements all list operation. It can store all elements including null also. This is in util pacakage in java. We can import through ” import java.util.ArrayList”. There is three constructor in ArrayList a)ArrayList()- It is used for construct an empty arraylist with initial capacity of ten.              b)ArrayList(Collection c)- This is used to construct an arraylist which contains the elements of the specified collection.     c) ArrayList(int initialCapacity)- This is used to construct an arraylist with the specified initial capacity.

Methods in ArrayList:- These are some methods of an ArrayList.i)void add(int index,Collectiion c),boolean add(int index,Object o),boolean addAll(Collection c), void clear(),Object Clone(), void ensureCapacity(int mincapacity),int lastindexof(),object remove(),void removerange(int indexfrom,int indexto).

Notes: (a) ArrayList  stores only object references. That is why it is impossible to use primitive data types like int,double etc.. but we can use wrapper class like(Integer,Double……) instead of int, double..

b) ArrayList are not synchronised . For synchronised we can use vector.

Listen to Albert!
Apr 22nd, 2009 by Umesh

What a start with our first guest post by our dear friend:

albert-demazi-einstein

Albert Demazi Einstein

»  Substance: WordPress   »  Style: Ahren Ahimsa