MultiPageEdit Special Page for the MediaWiki Page Forms extension - Final Report
GSoC Proposal Link: https://phabricator.wikimedia.org/T189743
Project Page: Page Forms
About my project
My project for GSoC was creating a special page for the MediaWiki Page Forms extension that allowed users to edit multiple pages through a single spreadsheet-like interface.
Templates are an integral part of MediaWiki. They can be used to render tables, infoboxes, and other HTML elements on the pages of a wiki. This makes it much easier for users to create complex and elegant pages, without any knowledge of HTML, CSS, etc. The Page Forms extension provides forms that can be used to create, edit and query data. It also defines the powerful autoedit API action that can be used to edit, create pages using forms.
My project focused on creating a spreadsheet interface using the jsGrid library which would allow users to edit template calls of a particular template embedded in various pages of the wiki. The interface also allows users to create and rename pages. Moreover, it supports pagination for large data sets. The spreadsheet interface supports input types like text, text area, checkbox, date, combobox and tokens.
Current status of the project: The features that I mentioned in my proposal have been implemented and the MultiPageEdit special page is ready to be used.
I made the following patches during the GSoC period:
Create Special Page for Spreadsheet Interface to edit template calls
- Add a new special page for the spreadsheet inerface
- Display template calls in a Spreadsheet
- Fetch form name for each template
The patches create a special page for displaying all the templates and for displaying the spreadsheet. Forms are also fetched for each template, so that the pfautoedit API action can be used for editing the pages. All the template calls fetched, are displayed in a spreadsheet.
Get Ideal input type for parameters
The ideal input type for each field is set according to the cargo field type or the SMW property type. The fields are displayed according to predefined HTML templates.
The page contents are loaded dynamically according to the selected page of the spreadsheet. Thus reducing the loading time for the the entire spreadsheet.
Add Support for editing, creating and renaming pages
Pages are edited and created using the pfautoedit API action. The remaning of pages is implemented using the Move API action.
Add support for tokens and combobox
Tokens and combobox input types are now supported by the spreadsheet display too. I have used the select2.js prototypes to implement this.
What I learned from GSoC - Summing it all up!
While working on my GSoC project, I faced a lot of challenges and overcoming them has taught me quite a few things. This was the first time I worked on such a huge project, one with a massive userbase. The major hurdle I faced at the start of each task was to understand the existing code related to it and accordingly implement the funtions, prototypes. Many a times, I was at crossroads and had to decide upon which approach to take to complete a task or solve an issue. My mentors were really helpful and guided me throughout the project duration. They also helped me make crucial decisions and introduced to me to the various modules of the MediaWiki codebase. In terms of coding I learned how to use Ajax and callbacks efficiently and how to use the different actions provided by the MediaWiki API. In the process, I also started my own blog. I would also like to thank the org administrators of the Wikimedia Foundation for their valuable guidance and inputs.
I plan to add the page delete feature to the MultiPageEdit special page. Also, the pfautoedit API action which is the backbone of the special page needs some changes to handle multiple template calls in a single page. I plan to work on that. Moreover, I am looking forward to meeting and interacting with my mentors and other members of the Wikimedia community. Given the chance, I would love to attend conferences and get to know about other MediaWiki projects.