Saturday, August 1, 2009

Work done in the last two weeks.

Work done in the last two weeks include:
  • UI changes in which the green and blue boxes for structure and data synchronization are replaced by buttons. So that, the users have no confusion as whether they are clickable or not.
  • Table showing the details when the data and structure synchroinzation buttons are pressed.
  • Structure synchroinzation in which columns are matched by thier names. Then for matching columns type, null, collation, default value, comment and key criterias are checked.
  • Columns present in source table but not in target table are added to the target table. And columns present in target table and not in source table are dropped from target tables.
  • Integration of structure syn work with the UI.
  • Adding and dropping of indexes in the target tables.

Structure synchronization was broken down in three parts. First column syn, then syn of indexes and lastly syn of foreign keys.

Column syn is complete and have been integrated in the UI.

Indexes syn will be integrated in the UI by today.

Foreign keys syn is the target for the next two days.

Today I will be commiting the code done so far in the branch.

Wednesday, July 15, 2009

Mid Term Evaluation And Tasks Ahead!!

Although the patch sent for mid evaluation gave a lot of warnings but I am happy that it was able to synchronize the source and target databases when tested by Michal and Marc.

I will be enabling the warnings for my later work and improving the data sync code by handling different cases.

Please feel free to see the demo server set up by my mentor of the work send so far and suggestions are welcomed.
Demo is at:
http://demo.phpmyadmin.net/gsoc-zahra/


KEY ACCOMPLISHMENTS LAST WEEK

I have refactored the code written so far by:
1) Applying all the applicable pear coding conventions.
2) Change the data structure of update array.
3) I have started building the logic for the cases when synchronizing table either has a composite primary key or does not have a primary key at all.

KEY TASKS THAT STALLED LAST WEEK

Apply selected changes button has not yet become functioning.

TASKS IN THE UPCOMING WEEK

1) Make 'Apply selected changes' button functioning.
2) Implement the logic for different cases of primary key encountered during data synchronization.
3) Start building logic of structure synchroniziation.
4) Create a plan for the post mid evaluation tasks.

Tuesday, July 7, 2009

Implementation Till Mid Evaluation!

This is the first screen that appears when "Synchronize" tab is pressed. Here the user has to enter host name, username , password, port, and database name of the source and target databases which are to be synchronized.



When "Go" is pressed this screen is shown. Here firstly there is information for the user that red box with 'S' on it is an indication that there is structural difference, blue box with 'T' is for type difference and green box with 'D' is for data difference between source and target databases.
Theses colored boxes are shown infront of the table names to show the three type of difference between source table and target table. These boxes infront of the table name are clickable.



When the green box in front of the table 'Course' is clicked the color of the box changes to grey and the details as what difference is there is shown with a check box below the table. Like in the screen shot it is shown that '1 row to be updated and 1 row to be inserted in "course" table.'



Tables that are present in the source and not in the target are shown with a "+" sign and tables that are present in the target and not in the source are shown with "_" sign.

Now the user can select the changes with the check box and apply the selected changes with the button "Apply Selected Changes".

Button "Synchronize databases" will synchronize the target database with the source database. Whereas "Apply Selected Changes" will only apply those changes which have been already selected by the user by pressing the colored boxes in front of the table name and then by checking the check box.

Wednesday, July 1, 2009

Fine tunings in GUI 2

'Apply Difference' button will apply difference on all the tables that are checked(check boxes are checked) and were previously selected by pressing the colored buttons against each source table names.

'Select All' link will check all the check boxes.

'Synchronize Databases' button will synchronize both the databases and apply all types of differences on all the tables of the databases.

'+' sign in the source database shows that this table is only present in source and absent from the target database.

'-' sign in the target database shows that this table is only present in target and absent from source database. Uptill now I've planned that the tables with '-' sign will later on be deleted with the user's consent.

Key accomplishments last week



KEY ACCOMPLISHMENTS LAST WEEK
==============================
1.As per the suggestion from my mentor, I have modularized the code using functions.
2.Reviewed the code of GUI 1 and I have coded it according to PMA.
3.Coded and tested the corresponding queries required to apply the data difference between the target and source databases.
4.Started coding GUI 2.


KEY TASKS THAT STALLED LAST WEEK


===============================
I still need to see the peer coding conventions although I have followed some coding & naming conventions already.
The code does not so far connect to a remote server

KEY CONCERNS


============
Code GUI 2 according to PMA and display all the contents whether functioning or hard coded dummy information.

TASKS IN THE UPCOMING WEEK


==========================
1. Code GUI 2 according to the fine tunings
Make the "Synchronize databases" button functioning i.e. by pressing this button both the databases will be synchronized completely.


Any synchronization type selected for any table of the source database will have its information displayed along with a check box as soon as it is selected.


Show buttons for applicable types of synchronization in front of each table in source database and make them functioning.

Tuesday, June 23, 2009

For data synchronization I was able do the following tasks :
  • Accessed data from source and target databases.
  • Mapped the matching and non-matching tables in the source and target databases.
  • Saved the data difference.

I yet have to apply the data difference on the target database. For all the work I have done till now source and target databases resides on the same server.

Problem that hindered my work was that data could not be retrieved by $_REQUEST and $_POST if require_once is there in the file. Therefore, the code written so far is hard coded for values of servers.

I have mailed the first patch to my mentor and am waiting for suggestions for the work done till now.

Coding and testing the corresponding queries required to apply the data difference between the target and source databases. Start to code GUI 2.

Saturday, June 13, 2009

Key Accomplishments This Week!

I had planned 9 days to code the first GUI and put it in the pma code. But luckily I was able to put the "Synchronization" tab and the first GUI in pma code by Wednesday 10th June. This was a great accomplishment and now I have more time for data synchronization, my next milestone.

Screenshots of the GUIs with Synchronization tab are:






Now I am analyzing the source code for functions I will be needing for data synchronization. Function for making connection, for queries etc.

Thursday, June 4, 2009

Planned interface for phpmyadmion Synchronization

GUI 1

On pressing the synchroninzation tab at the top, this GUI will be shown. Here the host, username, password, port and database name for the databases to be synchronized will be given.
On the basis of the given information, connections of databases are established with their respective servers.

On pressing "Go" the next GUI will be shown.


GUI 2

In this GUI, corresponding tables of sourcedb and targetdb will be shown.
Red, blue and green color indicates structure difference, type difference and data difference respectively. In front of the table name the presence of red, blue or green button will indicate that there is a difference in structure, type or data. The colored buttons are clickable and on pressing the green button in front of table name 'Person', the data of target table will be synchronized with that of source table.
Also the corresponding query generated for the required synchronization, will be shown in the text area at the bottom. Color of the button(data sync, structure sync or type sync) will change after it has been clicked to confirm that the command has been saved for execution. This way any type of synchronization user want, will be saved.
I am also thinking to add a remove button after each query in the text area, to facilitate the user to revert any synchronization selected previously.
Once the "Execute All" button is pressed all the saved synchronizations will be executed. This way user can synchronize selective tables from the databases.
The presence of the "+", "-" signs with source and target table Organization shows that this table is present in the source and not present in the target.
The "Synchronize databases" button will synchronize the target database with the source database and this comprises of applying all the differences on the target database.






























Tuesday, June 2, 2009

Activities after my exams

I was busy with my final exams from 18 May to 28 May. I was unable to give time during that one and a half week.
As coding started from 23 May and I am behind the schedule so I have planned to cover up that time.

Firstly, I am working on the plan till the mid evaluation. The plan will include my weekly milestones and soon I will be sharing that.

I am setting the environment these days. I have downloaded SVN and have checked out phpmyadmin code. Also I have planned to use Eclipse and Xdebug or Nusphere for debugging.

Currrently I am looking at different tools available for synchronization, which could give me an idea about the UIs. I have analyzed some tools which includes Navicat, SQL Yog and Spectral Core. After analyses I have identified some UI which should be there in the synchronization process.
Also I thought about where to place the synchronization button or tab in the original phpmyadmin page. Most appropriate place I could find was with the other tabs like "Databases, SQL, Variables,..." on the phpmyadmin page.

Other than the UI, I have also started to work on the backend logic. I took two tables from the same database on the same server and found structural differences. I yet have to apply those differences on the target database.

I also went through the code of phpmyadmin. I looked at the files db_create, db_printview and index.php.

Saturday, May 16, 2009

Rough Interface!



After reading the tracker and looking at some synchronization tools I came up with a sample interface. Although it is very raw but atleast it gave me an idea of what should be there in the interface.

Thursday, May 14, 2009

Tracker

I read the tracker links and got to know that there are three types of synchronization that I have to perform.
First, structure synchronization that includes making the structure of two tables in databases same. This includes making the fields in table same.
In type synchronization data types of the tables will be matched and then synchronized.
Then comes synchronization of the data.
All these synchronizations can be on one server or on remote servers.

Also I saw the interface of the tool Navicat mentioned in the tracker. I understood that the interface should be such that tables of the two databases should be shown in two columns and the user could select the tables which are to be synchronized. Also results should be shown to the user as which queries have been executed or which tables have been synchronized.

Tracker also gave some pointers as how can synchronization can be improved like by maintaining order of fields, or by maintaining keys and indexes. I also think that if these are maintained in structure synchronization then the ultimate goal of data synchronization can be achieved easily.

Tuesday, April 28, 2009

First change in code of phpmyadmin-Yeah!

Throughout this week I tried to read and understand the source code of phpmyadmin, which ofcourse is a difficult and time consuming job. Firstly I downloaded the code from sourceForge.net and compared it with the source that I had since I had installed xampp. They were exactly the same.

Then I found a link on mibbit-freenode and #phpmyadmin. Link is:
http://wiki.phpmyadmin.net/pma/Quick_Install

I tried and added a piece of code in the config.inc.php file by taking the code and I was able to secure my phpmyadmin by enabling a login page before it actually displayed the main screen of MySql. Yeah!
So, this was my first change in the code, Cheers...

The most interesting work that I kept doing was to introduce myself on the GSoC mailing list of selected students for 2009. And by starting a thread of GsocersPakistan, I was able to find 5-6 people from my nearby. So, it is a wonderful feeling and I am motivated...

Wednesday, April 22, 2009

Got Started!

Today I have taken notes of works to be performed till coming friday i.e. April 24 2009.
These include: Blog creation and adding the first post, getting the source code of phpmyadmin, etc.