User:Himeshi/GSoC 2013/Project


Section Handling in Semantic Forms[edit]

This is the project page for my Google Summer of Code 2013 project to implement Section Handling in the Semantic Forms extension.

Project Description[edit]

The Semantic Forms Extension in Mediawiki is a useful and widely used feature of MediaWiki to make semantically structured data, contained within template calls which are easy to create and edit. However at present Semantic Forms does not support structuring of wiki pages by page sections. Accomplishing this project would mean enabling administrators to define page sections in the form definition for the structure of their wiki pages. It would also allow users to add data to those defined page sections using forms in the Semantic Forms extension.

The project would also extend the Page schemas extension to allow defining of page sections.

This is the application submitted by me for this project.


I will be posting weekly progress updates for the period 17th June 2013 - 27th September 2013 here.

Community Bonding Period[edit]

During this period I have gone through the necessary documentation to understand the working of Semantic Forms extension and also a bit about Semantic MediaWiki and MediaWiki in general. I have also written a small code sample to add a {{{section}}} tag to understand the project better.

I have discussed with my mentor on the work I'm going to do next and have agreed upon the methods and frequency of communication as well as details pertaining to coding and updates.


17th June - 28th June[edit]

During this period most of the time was spent on going through the code of the formHTML() method in the Semantic Forms extension which is really the most important part of the extension and where my work will mostly be. So far I have done (or at least tried to do!) the following;

  • Introducing a {{{section}}} tag and displaying HTML headers and textarea on the form given to the users
  • Display section headers in wikitext on the page created
  • If the user has selected the edit with form option display the existing page content on the form for editing

Currently I'm working to finish the implementing of this tag and I'm hoping to start work on allowing users to create page sections via the Special:CreateForm page.


1st July - 12th July[edit]

In the period of the first week (with the help of Yaron) I was able to figure out the workings of the query string and implement the saving of form section data onto the page created to complete adding the {{{section}}} tag to the form definition syntax and submitted the code for review. Later I submitted several patch sets to this with the comments provided with notably the change to enable templates to be added anywhere on the page.

I also implemented enabling page sections to be added to the form via Special:CreateForm page and translating those page sections into the form, which at the moment requires a slight modification (from the comments given) that I'm working on now. I also set up phpunit and started looking into writing unit tests for the formHTML() method in SF_FormPrinter.php.

15th July - 31st July[edit]

During the last two weeks of this month I worked on adding modifications and perfecting the following commits to get them merged into Semantic Forms(SF) master. The second commit also required code for handling the PageSchemas(PS) extension by SF so that the latest code of SF having the new changes for page sections would still work with PS. In doing this I was also able to fix some existing bugs in the SF code related to PS as well.

I put aside writing unit tests for a while and started looking at the PageSchemas code to modify it for page sections. I installed it, tried it out and went through the documentation given for the extension (which led to the discovery of the bugs). Currently I have kept that aside too and upon the suggestion of Yaron, am working on adding additional parameters to the section handling of SF.


1st August - 16th August[edit]

In the first half of August I completed on adding some other parameters for creating page sections to the Special:CreateForm page apart from hidden, mandatory and restricted which were already there. See,

I also started going through the PageSchemas code extensively to understand what was going on and then started to work on introducing a new ‹Section› tag to the PageSchemas xml tree for adding page sections to forms. To do this I had to modify the code related to the Special:CreateSchema page of PageSchemas as well as the PageSchemas handling code in Semantic Forms. I was also able to fix some minor bugs in the process of my work.

19th August - 30th August[edit]

In the latter part of August I was able to complete the work on the adding page sections to forms via the PageSchemas extension. I completed implementing creating and editing an xml schema with page sections and then generating the form via Special:GenerateForm containing the page sections defined in the xml. See gerrit submissions,


2nd September - 16th September[edit]

During this period I worked on writing PHPUnit tests for the {{{section}}} tag processing in Semantic Forms. This was the first attempt at creating any unit tests for the extension and therefore it was a bit challenging.

Some minor improvements and bug fixes to the previously done work was also made.

The documentation that needed to be updated was also created. It will be made available with the next releases of SF and PS which will contain section handling. During the latter part of this period I had end of semester examinations and thus took a break from project work.

Current Status[edit]

This project has been successfully completed and has passed the final evaluation for GSoC 2013. Section handling has been incorporated into the Semantic Forms version 2.6 release. See here for the announcement.

My e-mail to Wikitech-1 and semediawiki-user lists summarizing my work and explianing about the newly added features to Semantic Forms and Page Schemas extensions can be found here.