Skip to main content

Posts

Showing posts from 2013

Create clone of git project from existing code without do new clone

In this article, I will guide you how to create a clone of a existing project by using the already cloned code set which available in another computer. When you going to clone the project from remote repository, it's need to download the project form the remote. Trouble start if the project got more capacity and slow internet connections or temporary disconnection to clone new one. Step 01.  Go to the project location of code existing place by console. (I'm using linux terminal) Step 02. Execute following command at the project place. git archive --format zip --output /full/path/to/myproject.zip master Project code has exported to the myproject.zip, but not included the .git folder. Take both myproject.zip file and .git folder to another computer or another place of your computer Step 3. Extract the zip and copy the .git folder into it. Step 4. Go inside to the project and take git pull (If internet connection available). Now it's working as a newly clone...

Simple jQuery multiple file uploading manager

In following segment refers how to create dynamically add multiple files uploading fields in forms.  Copy and paste following code segment into html file. Then open it in a browser and try out the demo. (I have used the on-line reference for the jquery-1.10.1.min.js , else download it from http://jquery.com/download/ ) <html> <script src="http://code.jquery.com/jquery-1.10.1.min.js">     /**      * Above is for on-line reference for jQuery.      * If above is not worked, please download the jquery-1.10.1.min.js from here. http://jquery.com/download/      *      */ </script> <script type="text/javascript" xmlns="http://www.w3.org/1999/html">     $(document).ready(function () {         var counter = 2;         $("#addButton").click(function () {      ...

Struts2 Data Grid with Maven

In this document refers how to use Struts2 jQuery grid for view data set.  This is the project structure using maven of my example. (IDE Intellj Idea 12 ) Step 01. Start Struts2 project with maven builder. pom.xml : Need to add struts2 jquery plugin, grid plugin and json pluing as dependencies. <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">     <modelVersion>4.0.0</modelVersion>     <groupId>com.struts2.gridExample</groupId>     <artifactId>Struts2GridExample</artifactId>     <packaging>war</packaging>     <version>1.0</version>     <name>...

Birt Dynamic Table Creation from JDBC Mysql Connection with Maven

In this post refers how to create dynamic Birt reports using given customizing fields list using Birt Runtime 4.2.2 Step 01 : First need to download birt runtime. Download from here For view/Edit the rptdesign files, it's better to use Eclipes 4.2.2 Birt integration. Download eclipes here Step 02 : Extract the birt-runtime-4_2_2. and set the birt runtime home environment variable. e.g. in my case i'm set the environment variable in .bash_profile since i'm using Fedora. (we can specify the Birt home in java code as wel) export BIRT_HOME=/home/malith/usr/eclips/birt-runtime-4_2_2 Step 03 : Create Maven project and insert the dependency for Birt Runtime         <dependency>             <groupId>org.eclipse.birt.runtime</groupId>             <artifactId>org.eclipse.birt.runtime</artifactId>  ...

Localization unicode issues in MySql

Problem : When you trying to use localizations in to you web system with MySql, You may face following problem.    "Incorrect string value: '\xE0\xB6\xB8\xE0\xB6\xBD...' for column 'gen_local_value_si' at row 1"    where gen_local_value_si is the column name which occurring the error. So the issue is the character encoding is not done well for Unicode. We need to specify the charterer encoding to "UTF-8" and Collate to "utf8_general_ci". Solution :  Simply set the character set and collate by executing of following command ALTER TABLE my_database.my_table MODIFY COLUMN gen_local_value_si VARCHAR(255)  CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;   Try on inserting localization values. If it's not work, then do the following configurations To check the variables, execute  following command mysql > show variables like 'char%' ; + --------------------------+----------------------------+ | Variable...

Maven project with Spring data JPA and Hibernate

Following example shows how to create simple system using Maven, Spring Data JPA with Hibernate.   01. Create Project structure as above. (I have used IntelliJ Idea 12 as IDE) 02. Create application-context.xml for spring configurations as follows <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans"        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"        xmlns:jdbc="http://www.springframework.org/schema/jdbc"        xmlns:jpa="http://www.springframework.org/schema/data/jpa"        xmlns:context="http://www.springframework.org/schema/context"        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring...