Editing User:Albertcoder/GSoC2014/logs

From BRL-CAD

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 276: Line 276:
 
Stuck at the problem of making this process automated like when a user adds a new trait i.e. new table, it should automatically get linked using foreign keys.
 
Stuck at the problem of making this process automated like when a user adds a new trait i.e. new table, it should automatically get linked using foreign keys.
  
'''''4th July(Friday)
+
'''''4th June(Wednesday)
  
 
Struggled a lot to add foreign key constraint in dynamically created tables in extension in an automated way. Talking on the #mysql IRC I got this ANSWER "forget about adding those automatically." They seriously questioned the credibility of database design. Totally refreshed all my concepts with respect to real world projects, requirements and performance. (Need to head towards a wayout soon)
 
Struggled a lot to add foreign key constraint in dynamically created tables in extension in an automated way. Talking on the #mysql IRC I got this ANSWER "forget about adding those automatically." They seriously questioned the credibility of database design. Totally refreshed all my concepts with respect to real world projects, requirements and performance. (Need to head towards a wayout soon)
Line 282: Line 282:
 
Learnt to add menus through MediaWiki:Sidebar and also went through the various namespaces in MediaWiki.
 
Learnt to add menus through MediaWiki:Sidebar and also went through the various namespaces in MediaWiki.
  
'''''5th July(Saturday)
+
'''''5th June(Thursday)
  
 
Finally added foreign key constraints in dynamically created tables despite the words of #mediawiki developers, "forget about adding those automatically.". They might have said this in some other sense but finally I got what I needed. :-)
 
Finally added foreign key constraints in dynamically created tables despite the words of #mediawiki developers, "forget about adding those automatically.". They might have said this in some other sense but finally I got what I needed. :-)
  
 
Resolved the problem of data inconsistency occurring due to miss-matching ids of values across all tables.
 
Resolved the problem of data inconsistency occurring due to miss-matching ids of values across all tables.
 
'''''6th July(Sunday)
 
 
Added search facility such that user can search material and its properties by name.
 
 
'''''7th July(Monday)
 
 
Installed and learnt how to use the extension AdminLinks.
 
 
Traversed the whole code for following the coding standards.
 
 
 
=== Week 8 ===
 
 
'''''8th July(Tuesday)
 
 
Added foreign key constraints to all the tables that were pending.
 
 
Added one more table `trait_units` to specify the units of each
 
trait.
 
 
Adding this extra table kind of disturbed the work flow because now a
 
new trait cannot be added without its units. For this I have to now
 
add a separate text field/dropdown which will ask for the units of the
 
trait and also change the INSERT and SELECT queries at the backend but doing this, encountered a few problems.
 
 
'''''9th July(Wednesday)
 
 
Finally resolved all the errors that occurred due to the addition of new table `trait_units`.
 
 
Added dropdown for Units when adding a new trait. Amended all the queries in the backend for proper insertion of data.
 
 
Updated _SERVER variable wherever it was necessary.
 
 
'''''10th July(Thursday)
 
 
Added ON CASCADE DELETE. Whenever any value is deleted from master table, correspponding values in foreign keyed tables are also deleted.
 
 
Added userID to trait_table too, so that it can be tracked who added that particular trait.
 
 
'''''11th July(Friday)
 
 
Added a new Special page in the extension wherefrom a user can delete a trait.
 
Only the traits added by a particular user can be deleted by him/her.
 
 
'''''12th July(Saturday)
 
 
Added a new Special Page in the extension wherefrom a user can delete a material from his added list of materials.
 
 
Added another Special page which has links to all the call to action buttons like add material, delete trait etc.
 
 
'''''14th July(Monday)
 
 
Added Special Page for view all materials.
 
 
Tried to implement search by trait, almost done.
 
 
Tested the extension by installing on various other systems locally and remotely.
 
 
=== Week 9 ===
 
 
'''''15th July(Tuesday)
 
 
Studied about the import/export libraries to be used for the extension.
 
 
Search by trait implemented. Now a user can either search for values of traits either by material name or by trait name.
 
 
'''''16th July(Wednesday)
 
 
Explored MediaWiki '''Editing rules, editing conventions, and formatting'''. Were very extensive topics, took more time than expected.
 
 
Tried to manipulate MediaWiki as a normal user rather than an administrator with the help of the following and many more links:
 
 
http://www.mediawiki.org/wiki/Help:Formatting
 
 
http://www.mediawiki.org/wiki/Help:Links .
 
 
Also studied how to format '''lists, images, tables etc.''' on wiki pages.
 
 
'''''17th July(Thursday)
 
 
Made a separate '''Special Pages''' for search TRAIT by name and search MATERIAL by name.
 
 
Used functions like '''ucwords(), header() and str_ireplace()''' to make improvements like automating Initials of words in capital letters, page refreshing, replacing '_' in names with space for displaying(like boiling_point).
 
 
Stuck at '''passing an array''' of table-names in MW-Joins query in place of a single table name to do selective search.
 
 
'''''18th July(Friday)
 
 
Added '''menu bars''' on the top to '''navigate''' through the extension. Replaced old ugly links' Special Page with the new menu bar.
 
 
Added almost all the '''units''' of main traits(30 at present, will be more) in the '''drop-down''' menu to prevent users from inputting wrong values of traits.
 
 
'''''19th July(Saturday)
 
 
 
Whole day struggled with user rights management in MW. There was a good user-manual to explain how permissions can be given to various groups but it did not have anything to say about reverse i.e. having to give permissions to multiple groups for accessing a single Special Page.
 
 
Asked on IRC about the solution they suggested two ways either to create a new right which can be granted to multiple groups or give the right as a second argument while calling the parent constructor in Special Page class.
 
 
Improved the menu bar on the top of each Special Page. Thinking to add images/icons in sometime after achieving all the basic functionality.
 
 
 
'''''21st July(Monday)
 
 
Applied '''validations''' across all the text-fields mainly of traits, like only '''decimal/integer''' values can be added for traits like boiling point etc.
 
 
'''Cleaned''' the code edited a few things like repositioning the forms at proper place in the code to make it more readable.
 
 
=== Week 10 ===
 
 
 
'''''22nd July(Tuesday)
 
 
Data '''updations''' done. Values of traits can be updated by specifying the trait name, material name and its value.
 
 
Set the '''order''' of traits(alphabetically) in which they are displayed on add material page.
 
 
Added a new field '''status''' in all the tables for specifying whether or not a particular value is approved by the '''admin''' or not.
 
 
'''''23rd July(Wednesday)
 
 
Made a few changes in the database data types to retain the '''precision''' of values.
 
 
'''''24th July(Thursday)
 
 
'''Searching improved''' further by adding dropdown for search both material and trait lest a user commits mistake in spellings while searching.
 
 
Encountered some problem in implementing the '''status flag''' to be administered by the admin.
 
 
 
'''''25th July(Friday)
 
 
Worked on '''export feature''', almost done. Used '''json_encode()''' to export the data by storing it in an array. Now working on passing multiple attributes in '''multidimensional array'''.
 
 
'''Status flag''' still in pipeline.
 
 
'''''26th July(Saturday)
 
 
Could not do much '''GSoC''' oriented today, as I was engaged in attending inevitable '''seminars''' in my college related to other technologies.
 
 
 
'''''28th July(Monday)
 
 
'''Progress''': Been able to write the data from the backend(tables) in '''.json''' file. I passed an array to json_encode(), whose result I wrote in a file. The contents written in the file are absolutely what they should be.
 
 
'''Problem''': When I try to prompt the user to download the same file, some futile/useless data seems to get appended at the end of the file.
 
 
Did some manipulations with the '''LocalSettings.php''' like changing the logo, skin, enabling the image uploads and so on.
 
 
===Week 11===
 
 
'''''29th July(Tuesday)
 
 
For exporting the data in json, found and implemented another '''solution''' to store the material names and the values of different traits in two '''separate arrays.'''
 
 
Used '''array_combine()''' to make an '''associative array''' of material name and value as '''key : value''' pair.
 
 
'''''30th July(Wednesday)
 
 
Made json export work but there are some glitches like the file in which the json material is written is perfect but the exported file from web interface contains some needless data appended at the end.
 
 
'''''31th July(Thursday)
 
 
Removed the problem of '''futile data''' getting appended in '''.json file'''.
 
 
Added a '''new file''' which has the code to '''export''' the data in JSON format.
 
 
Added '''option''' to select any trait which is to be exported by storing it in '''variables.'''
 
 
'''''1st August(Friday)
 
 
'''Status flag''' nearly accomplished which was in pipeline. '''Updations''' that can be only done by '''Sysop and bureaucrat''' are just left.
 
 
'''Status visible''' in view all materials page.
 
 
'''Export'''(call to action button) added in the menu bar.
 
 
'''Search bar''' hidden from the '''main login page''' where is wasn't required.
 
 
'''''2nd August(Saturday)
 
 
Couldn't work today because of engagements like depositing college fees and shifting to new hostel. Also there was power supply's problem so I could not keep my laptop charged.
 
 
'''''4th August(Monday)
 
 
Learned how to embed '''JavaScript''' in MediaWiki. Used in the '''navigation bar''' on the top of each page.
 
 
 
===Week 12===
 
 
'''''5th August(Tuesday)
 
 
'''Status''' now visible in '''Search by Trait''' and '''Search by Material''' too. All the '''approved''' material properties are denoted by "1" and the '''pending''' by "0". The privilege(for bureaucrat and sysop) to approve still pending.
 
 
'''''6th August(Wednesday)
 
 
Facing a bit of challenge to set the privilege for approval. Because unlike '''Wiki''' pages, '''Special''' pages cannot be edited.
 
 
'''''7th August(Thursday)
 
 
Done with the '''approval part.''' Now the values can be approved from the '''Special Page itself'''.
 
 
'''''8th August(Friday) and 9th August(Saturday)
 
 
Visited a funeral ceremony.
 
 
Couldn't work, I also had to visit my doctor regarding respiratory problem.
 
 
'''''11th August(Monday)
 
 
Made the navigation bar more interactive using '''javascript.''' Also renamed a few variable for better '''readability'''.
 
 
=== Week 13 ===
 
 
'''''12th August(Tuesday)
 
 
Found a minor glitch in export. The '''indices''' of the '''two arrays''' don't match and making the json more readable by replacing the "value" attribute with trait name.
 
 
'''''13th August(Wednesday)
 
 
Perfectly done with the '''json export''' now grappling with '''CSV format.'''
 
 
'''''14th August(Thursday)
 
 
Export in '''CSV done''', using PHP '''header''' function and '''array''' manipulation.
 
 
'''Status''' which was approved by the admin is '''now visible''' on the '''front-end''' too.
 
 
'''''15th August(Friday)
 
 
'''Exporting''' data in '''XML''' format now possible. Now grappling with data import.
 
 
'''''16th August(Saturday)
 
 
Added '''update''' , '''import''' call to action buttons.
 
 
Done with '''import''' of data in '''JSON.'''
 
 
'''''17th August(Sunday)
 
 
Set the permissions such that only '''sysop''' and '''bureaucrat''' can delete '''materials''' and '''traits.'''
 
 
'''''18th August(Monday)
 
 
As today is the last day of GSoC, I have given my level best to add everything possible to the code before final evaluation.
 
 
I have added support for importing the data by '''selecting''' the trait name which earlier was '''static.'''
 
 
I have updated the '''update page''' which now allows to update all the values of a particular material '''in one go''', which wasn't possible earlier.
 
 
I have also added the facility to the user to '''add''' only '''selective''' traits at a time in case he does not know all the values at present.
 
 
Apart from '''normal users''', a separate '''call to action button''' is added for '''admins''' to delete materials and traits and approve the values added by users.
 
 
And finally '''removed''' the '''unnecessary''' data '''exported''' from XML like mat_id, timestamp etc.
 

Please note that all contributions to BRL-CAD may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see BRL-CAD:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)