User:Aashish.mittal/GSoC Application

Identity
Name: Aashish Mittal Email: ashishmittal [DOT] mail [AT] gmail.com Project title: Put a whole Wikisource/Wikibook "book" on your watchlist

Contact/working info
Timezone: GMT +5.5 (India) Typical working hours: 10am - 10pm (flexible work time) IRC or IM networks/handle(s): aashishmittal

Project summary
The basic gist of this project - Create a way to have “books” for wikisource/wikibooks is that users of Wikimedia projects (Wikibooks, Wikisource, etc.) should be provided with a way to organize and use multiple pages which are related together, as Books and give them the facilities to operate all these pages as a single unit. There are extensions (ex. BookManager, Collections, etc) which attempt to achieve some of these functionalities and the aim of this project is to improve/extend these extensions to add a more capabilities to them. This feature has been a wish of Wikimedia community since a long time and after discussing and interacting with developers interested in this idea, we have been able to get a good understanding of what has been achieved till now and what needs to be implemented this summer.

The corresponding ticket maintained for this project is Bug-15071 and the various features of this project are marked individually under the tickets mentioned here. This project aims to successfully implement all the mentioned features listed. I have created a space for discussing the project goals and implementation details: https://meta.wikimedia.org/wiki/Books.

In the past few weeks, I have interacted with the project mentor (Mr. Raylton) regarding this project and have taken his advice and help for getting a clear picture on how to implement this as a complete project. Under his guidance, we have assembled a list of features that we plan to implement as a part of this project which are listed under ‘deliverables’. Given an opportunity to implement this project, I am sure it would be a great addition to the existing extensions and would prove useful to lot of Wikimedians and book lovers.

Deliverables
After receiving feedbacks and discussing with the developers, I have thought upon an initial list of deliverables to be implemented in this extension. The deliverables are classified as Editing related and Reading related. The project mainly focuses on completing the editing functionalities for the books and eventually provide a good reading experience by completing the reading related deliverables.

The deliverables are as follows:

Required deliverables

 * Create a book
 * Table of contents for a book
 * Recent changes for each book
 * Create chapters
 * Arrange order of pages in a book
 * Protect/watchlist/move/delete all pages of a book

If time permits

 * Read a book (creation of a Navbar)
 * Export book metadata (export the book details containing all page links to a file which can be saved by user, similar to MetaBooks)
 * Export entire book to HTML/Pdf/etc
 * Search in a book
 * Automatic Bookshelves, where the books of a wiki could be organized according to their metadata.

Of the deliverable, some of them are explained in brief below:


 * 1) Create a book: This refers to creating a book with certain number of book pages. This can be implemented by using a suffix/prefix (ex. ‘Book/’) as implemented in BookManager.
 * 2) Read a book (include a Navbar): As described by Mr. Raylton, we need to maintain a linear order of page accesses in comparison to Random accesses (such as in Wikipedia) to allow reading of books by the users. This would also include creation of a navigation bar (similar to what is present in BookManager) to provide user with links to next/previous pages in the book, list of chapters of the book and the metadata of the book. This would enable the user to navigate and read the books created efficiently.
 * 3) Recent changes for each book: Maintain a list of recent changes to a book made by its author to allow the readers of that book be updated with any new additions/changes.
 * 4) Arrange order of pages in a book: Provide the book user with some kind of an interface (Special page) which he can use to arrange the order of chapters in a book. For this we need to maintain an entry of order in the database (possibly Categorylinks table) and update the order on change (ex. Using jQuery sortable).
 * 5) Protect/watchlist/move/delete all pages of a book: A functionality to provide an option to perform an operation on all/selected pages of the book at once. The action can be to protect/watch/move/delete etc. The user can be provided with a special page to select specific pages of the book (similar to Gmail) and perform an action on them. This can be implemented by getting names of all the pages present in a book and repeatedly performing action on each of them.
 * 6) Export entire book to HTML/PDF: Provide ability to export the book to pdf/html format as implemented in Collections and BookManager extensions.
 * 7) Search in a Book: Search for a particular content/page in a book and return all matching elements.

For the implementation of the above mentioned points in the extension, I will be maintaining a design draft (similar to this).

Project schedule
I have been in regular discussions with Mr. Raylton, the proposed mentor for this project. Based on his guidance, I came up with an analysis and a flow of the project which is described below. I have given an approach towards the project in a time-line basis.

What we currently have: The BookManager/Collections extension with basic functionalities of Book reading incorporated.

What we aim to acheive by the end of GSoC term: An extension to the current extensions to enable the user to create books from existing pages, perform operations on all pages of the book in a single click and include more features for efficient Book reading.

The proposed project flow is as follows:

Step 1 (23rd April – 20th May): Study of existing extensions in depth and understanding the enhancements that are needed to be made on top of existing base.

21st May: Official date of commencement.

Step 2 (1st week): Start with implementation of mentioned deliverables. I plan to start with implementing the basic function in this extension, i.e. to create a book (using suffix/prefix for a book representation)

Step 3 (2nd week): Next would be creating necessary database structures and PHP variables to support addition and storage of pages in a particular book. Once the pages are added to a book, the details would be maintained in the database number of chapters/pages, index page of the book, next/previous page of the current page, chapter name, etc.

Step 4 (3rd - 4th week): Adding support for creating chapters without content (similar to existing one in MediaWiki where the links are shown in red color). Allowing the chapters to be edited and creating new ones without leaving the page. Also maintaining a list of recent changes to the chapters by the author.

Step 5 (5th – 7th week): Start working on the custom ordering of pages/chapters inside a particular book. This would include creation of special pages which would display the user a list of available chapters. The user can create a sortable order using jQuery. A separate field would be needed to be maintained in the database (maybe categorylinks table) which would be manipulated by this jQuery sortable and would store the order of chapters.

Step 6 (8th – 9th week): Adding functionality to perform operations on multiple pages of the book together (such as watch/delete/move all). This can be done by getting the list of all chapters of the book from the database and then creating a PHP script to perform the action for all pages.

Step 7 (10th – 11th week): Document all work and testing.

Step 8: If time permits, I will also try completing the other deliverables related to reading of books such as export of books to other formats, implementing a Navigation bar, search in a book, etc.

August 20: Pencils down.

''Kindly note, the above flow has been built on my understanding and preliminary discussions with the mentor. It is flexible and any necessary changes can be included and acted upon. I will be taking suggestions from my mentor and the community and any new feature requested would be adjusted in the project timeline.''

I have started working with Mediawiki development and started getting familiar with the coding practices. Also filed patches for some introductory tickets such as 33997, 29135 and 33545. I am confident of giving my best and of creating all features as per the existing scope of the project.

I will be in constant touch with my mentor and other developers on mailing list informing them of my progress and ask for help when I find it essential. I will be taking suggestions from them at all stages on how to improve the implementation and how to make the most out of this project. The necessary learning part will be done well before the project coding starts along with chunks of implementation. Coding phase will be used for rest of coding implementation and solving of bugs along with the necessary documentation.

Anticipated Challenges:

Non-Technical:
 * The system should be built such that it is accepted and liked by all Wikimedia developers.
 * The final extension should be complete to the level it can be released and ready for use.

Technical:
 * Covering all the required features in the extension and adhering to Mediawiki standards.
 * Try to include the reading features in the extension to give a full-fledged experience to book readers such as provided by Google Books, iBooks, etc.