Tuesday, 27 September 2011

Setting Up Your First Ext GWT Project in Eclipse


Setting Up Your First Ext GWT Project in Eclipse by Brendan CoughranFor those of you just entering the Ext GWT world, this is a quick guide for setting up your first project in Eclipse.

Prerequisites

It is assumed you already have a working Eclipse install with a recent JDK on your computer. This guide was made using Eclipse 3.6 and JDK 6.

GWT

Follow the GWT setup: http://code.google.com/eclipse/docs/getting_started.html

Ext GWT

Download the latest Ext GWT release (currently 2.2.0).http://www.sencha.com/products/gwt/download.php

Create User Defined Library

Select Windows > Preferences and select Java > Build Path > User Libraries in the preference tree. Click New and type "GXT" into the User library name field. Make sure your new library is selected and click Add JARs. Navigate to the root folder of the Ext GWT download and add the "gxt.jar" file. Click OK.

Create Project

20100920-gxt0Click the New Web Application Project button in Google toolbar to create a new GWT project. Alternatively, if you don't see the button in the toolbar, you can click File > New > Other and select Web Application Project under the Google folder and click Next. In the Project name field, write "HelloGXT". In the Package field, write "com.hello.gxt". Make sure under Google SDKs the "Use Google Web Toolkit" box is checked. Click Finish.

Build Path

In the Project Explorer, you will see a new folder with your project's name. Right click that folder and click Build Path > Configure Build Path. This takes you to the Properties of your project under the Java Build Path settings. Click Add Library and then select User Library and click Next. Make sure the check box for your Ext GWT library is checked and click Finish. Your Ext GWT library should now appear in your build path.
20100920-gxt1

Resources

Copy the resources folder from the Ext GWT download into your war folder.20100920-gxt2

HTML

Open HelloGXT.html in Eclipse and delete the table and h1 data in the body tag. Add the following lines to the head tag.
<link rel="stylesheet" type="text/css" href="resources/css/gxt-all.css" />
<script language='javascript' src='resources/flash/swfobject.js'></script>

XML

Open HelloGXt.gwt.xml in Eclipse. Add the following line under the Other module inherits line.
<inherits name="com.extjs.gxt.ui.GXT" />

Hello World

To test that you have properly setup Ext GWT, try running this sample program. Replace the EntryPoint class in HelloGXT.java with the sample below.
public class HelloGXT implements EntryPoint{
	@Override
	public void onModuleLoad() {
		MessageBox.info("Message", "Hello World!!", null);
	}
}
Run your program like any GWT project (seehttp://code.google.com/eclipse/docs/getting_started.html). If you setup Ext GWT correctly, you should see a message box with the words Hello World!! Congratulations! You have created your first Ext GWT project.20100920-gxt3


Saturday, 24 September 2011

Loading data from external files (like .xls) to your Staging table.

Loading data from external files (like .xls) into Staging table.

In the following example we will use Excel file as our data source and insert it's data into
Staging table using Oracle Apps environment.



















Lets start the process step by step,

1.You need a Excel file containing your source data.
    For example we have two excel files
    a. INVOICE_HEADERS.xls

 b. INVOICE_LINES.xls 

2. What we need is .csv file (comma separated value file) from this .xls file
     So "Save As" the Excel file by selecting Other Formats option and choose the
     Save As type : CSV (Comma delimited).
       Now you are having two .csv files one each for .xls(excel files)
       For example  a: MAD_INVOICE_HEADERS.csv
                            b: MAD_INVOICE_LINES.csv

3. We need two tables (Staging tables) to store and hold the data in database
    Following Query will create the table



So now we have two Staging tables ready in database to get filled with data.

 For example  a: XXMAD_AP_INVOICES_INTERFACE
                      b: XXMAD_AP_INVOICE_LINES_INTF


4. Create a (.ctl) control file which plays an important role to insert / append or do any
    operation on the staging table by using the data which was in .xls file and now which is
    converted  in .csv files.

    Steps to create control file (.ctl)
    a. Open a notepad and write the ctl code in it,
       For eg.   

After writing the code in notepad Save it with   .ctl  extension
 For example  a: MAD_INVOICE_HEADERS.ctl
                      b: MAD_INVOICE_LINES.ctl

5. Now we need to move our .csv and .ctl files to middle tier (Application tire)
    use WinSCP to move files.
    In our case we have 4 files needs to be moved under the the
    CUSTOM_TOP -> Bin folder


6. Concurrent Program needs to be created in Oracle Apps
     Steps,
     a: Create an Executable (System Administrator-> Concurrent-> Program->Executable)
        Note: Execution Method should be SQL*Loader and  Execution File Name must
        be the name of control file (.ctl) don't give any extension to it.


    b: Define a Concurrent program
    Note: Keep the Short Name of Executable (in above step) and Short Name of this
    Concurrent Program same

  c: Now add this Concurrent Program to Request Group of your Responsibility.
 
   d: Now Submit Request through your Responsibility
       (View->Requests->Submit a New Request)
       Write your Concurrent Program name and click submit button


7. Check your Staging tables data is inserted in those tables.


Thus by following these easy steps one can transfer data from external files into Staging tables.





Thanks,
Sudhir Bhilar 

Friday, 23 September 2011

Normalization

Normalization : In simple terms Normalization is the Best data formation of  the DataBase.

Normally we can achieve this Best Data Formation by
1NF (First Normal Form)           : Where we remove Duplication/Repetition of data
2NF (Second Normal Form)      : 1NF should be satisfied and along with it there should be
                                                    no "Partial Dependency" in data.
3NF (Third Normal Form)          : 2NF should be satisfied and along with it there should be
                                                    no "Transitive Dependency" in data.


         Partial Dependency – when an non-key attribute is determined by a part, but not the whole, of a    COMPOSITE primary key.

Transitive Dependency – when a non-key attribute determines another non-key attribute.



Lets Take some examples:
Example 1 : Determine NF



Here there is no partial dependency. So not in 2NF


As it is not in 2NF so can't achieve 3NF


Thus we can say that the relation is in 1NF only.




Bringing to Normalized Form.
Example 2:

 Bringing a relation to 1NF




 Bringing a relation to 2NF




 Bringing a relation to 3NF




 This is how we can format data using Normalized Form. 

Thanks,
Sudhir Bhilar





Powerful Excel : Vlookup

When you have bulky data in Excel sheets for example we will take columns in excel sheet as
1 Employee Names
2 Contact Number
3 Address
4 Qualification
5 Email-ID
and you need to search a Email-ID of the Employee. Now with small data you can just move your eyes over the Employee Names and you can get the result.
But what if data is large eg. some Lakhs and more date in Excel sheet.

So Solution to search down the required value in less span of time is to use Vlookup in Excel sheet.










Following are the steps,


1.You Need a Data to perform this operation.




2. You Need to made two (or as required ) columns, in our example Employee Name is
    Input and we want to  find out his Email ID. So the column where we want the Result
    we need to write Vlookup Formula in that column in our case it's  C23
    start typing =VLOOKUP(.....


3. Vlookup takes 4 parameters
    a: The input data to formula in our case it's B23


    b: The Entire Table where we want to search the data in our case the range of table is
        B9:F12

   c: The column number where we want to search in our case we want to search Email ID
       and it's column number is 5.

   d: Simply enter the fourth parameter as FALSE.


5: Add the $ sign between the table range i.e. we have B9:F12 make it as $B$9:$F$12


6: There you have your required result i.e. Email ID of the Employee you want


Further you can drag the formula and it gets applicable there too.


It will look some what like this.



Just Enter any Employee Name you want and the formula of VLOOKUP will find the answer i.e. Email Id for you.


Thus easy but very Powerful formula Vlookup in MS Excel can help you to search a particular record from Bulky/Heavy data.

Save Time and give Accuracy your your search.


Thanks,
Sudhir Bhilar