Sunday, August 21, 2011

AJAXify phpMyAdmin Interface - GSOC 2011 - 13th week

This is the final week of gsoc 2011. As I mentioned in last weeks report I had to continue with rewriting the querywindow.js functions using jquey this week.

I had to rewrite the following functions this week.
  1. PMA_queryAutoCommit()
  2. PMA_querywindowResize()

Initially I rewrote the logic in "PMA_queryAutoCommit()" function using jquery, but I could not find a scenario where this function is triggered within the query window. Then I asked from Marc to get an ideal of a scenario where this function triggers. Then he suggested me that "clicking on the queries in sql history tab" should trigger this function. Further he mentioned that this scenario didn't work with his testings and if I also couldn't get it check correctly it is better to skip ajaxify this function. I tried the scenario and compiled the querywondow.js file with firebug, but it didn't trigger the "PMA_queryAutoCommit()" function. So I skipped ajaxifying the "PMA_queryAutoCommit()" fucntion.

Then I started working with ajaxify "PMA_querywindowResize()" function and with Marcs help I was able to test it correctly.

With that I finished ajaxifying the functions in querywindow.js file.

Then Marc directed me to a bug which is reported at bug tracker regarding the table->structure->change. When the user clicks on change a column which is having var_cahr type, the change dialog does not load the type correctly. So I went through the code and found this that this issue is not with my ajaxified part, but on original non table structure change section. Then I went though the file and found what is the issue for this and reported it to Marc. Then Aris showed what was the bad commit which caused this issue and the remaining changes should do after discussing more with Marc.

With all these, I finished my tasks which were proposed my proposal at the beginning. Lots of people helped me a lot to achieve this success in the project, specially Marc, Ninad, Michal, Madura, Rouslan and Aris. Even after this gsoc project I'm willing to continue contributing to PMA which is a great pleasure to me.

Monday, August 15, 2011

AJAXify phpMyAdmin Interface - GSOC 2011 - 12th week

According to the schedule I had to continue with ajaxify the table maintenance options in this week. Last week I did some modifications with this task and there were some bugs with that. Marc showed me that some important information are missing with the results of ajaxified table maintenance actions. In CHECK TABLE action there was a table which contains Msg_type and Msg_text information in non ajax configuration but in ajax configuration it was not there. In order to make this information available I had to do the following changes.
  1. Added "if(isset($_REQUEST['ajax_request']) && isset($_REQUEST['table_mainrenance'])) {}" condition to sql.php file in order to handle the table maintenance action and return the results with those useful information.
  2. Change the logic in "$("#tbl_maintenance.ajax li").live('click')" action to get the results sent by sql.php file and then show it in the table operations page using ajax.
Then after Marc showed me a new bug where the documentation links are not functioned properly, I changed the "$("#tbl_maintenance.ajax li").live('click')" action to "$("#tbl_maintenance.ajax li a.maintain_action").live('click')" and changed the tbl_operations.js file according to that.
After all these changes this option seems working properly and I'm waiting for the response by Marc.

Since I skip ajaxify the "Table options" in table operations after discussing with Marc due to inefficiency of doing that, Marc asked me to find a new task instead of that. I went trough various options in PMA and could not find a suitable action which is really need ajax behavior at this moment. Then I went through the "Ajaxify Interface" section in PMA wiki and found that the ajaxification of table insert is remaining as a to do task. After discussing with Marc he mentioned that this is not necessary at this stage and he asked me to involve with more useful task which is rewrite the querywindow.js file using jquery.

The querywindow.js file contains four function which are
  1. PMA_queryAutoCommit()
  2. PMA_querywindowCommit(tab)
  3. PMA_querywindowSetFocus()
  4. PMA_querywindowResize().
I rewrote the 2nd and 3rd functions using jquery and works fine for testing.

Next week I'll continue with rewriting the querywindow.js functions.

Sunday, August 7, 2011

AJAXify phpMyAdmin Interface - GSOC 2011 - 11th week

According to the schedule I had to continue with ajaxifying table operations task this week.

Since there was a bug with "Table copy" option which was done last week, Marc asked me to fixed the issue which is currently not reloading the navigation panel after copping the table to a new database. Initially I could not understand why we need a reload on navigation panel, but after the Madhura clarify me why we need it I fixed the issue.

Then I start working with ajaxifyig the other four options in "Table operations". Those are
  • Move table to database
  • Table options
  • Table maintenance
  • Delete data or table.
After discuss with Marc we decided "Move table to database" option do not need ajax behavior, because anyhow we have to redirect to the moved table after moving the table to new database. Also we decided that only "Empty the table(Truncate)" option in the "Delete data or table" section need ajaxification because after delete action there is no need to be in the Table operations of the deleted table.

I started ajaxifing the four actions in Table maintenance section.
  • I added "$("#tbl_maintenance.ajax li").live('click')" ajax action to the fucntions.js file which handles all four ajax click actions in "Table maintenance" section, and get the results of those actions.
  • Then I changed the tbl_operations.php and sql.php files in order to handle the ajax request and response according to that.
Then Marc showed a me a bug of not showing the Msg_type and Msg_txt feature after "Check table option" and I'll fix it next week.

Then I worked with Ajaxify the "Empty the table (Truncate)" option.
  • Since there is some related code for this feature with $("#truncate_tbl_anchor.ajax").live('click')" action in functions.js file I reused that action and changed the logic to show the results using ajax.

Next week I 'll continue with ajaxify the "Table options" and fixing the bug in "Table maintenance".