Jump to content

Extension:Proofread Page/GSoC

From mediawiki.org

Summer of Code 2013 project of Aarti Kumari Dwivedi.


Roadmap

[edit]

Ideas

[edit]

Page

[edit]

in the includes/page folder:

ProofreadPagePage

[edit]

Same level as ProofreadIndexPage:

class ProofreadPagePage {
    public static function newFromTitle(Title $title)
    public function getContent() //Return ProofreadPageContent
    public function getTitle()
    public function getIndex() //Returns the ProofreadIndexPage of the Page: page
...
}

ProofreadPageContent

[edit]

Page's content

class ProofreadPageContent {
    public function getBody() //Return wikitext
    public function getHeader() //Return wikitext
    public function getFooter() //Return wikitext
    public function getLastProofreader() //Return User
    public function getProofreadingLevels() //Return integer

    //seters

    public static function newFromWikitext(string $content) //Create a new ProofreadPageContent
    public function unserialize(string $content) //Set values from the page content (manage both version of "pagelevel"). Should be tested carefully. If $content doesn't contain a header... keep the old value.
    public function serialize() //Return data to store (wikitext currently, after json?
}

EditProofreadPagePage

[edit]

Edition system. Same as EditProofreadIndexPage. Should handler both edition from the edit form + edition from API (the EditPage::textbox1 field already set with the wall page content).

ViewProofreadPagePage

[edit]

Answer to the ArticleViewCustom hook: output the page content with the scan view (currently done in JavaScript).

JavaScript sandox

[edit]
( function( $, mw ) {
    'use strict';

    //my code in a sandbox, only $ and mw are availlable from outside
}( jQuery, mediaWiki ) );

Reports

[edit]

1. Tested local install with a DjVu file. Works fine. (Aarti)

2. Read up on Wikimedi Labs. (Aarti)

3. Reading up on ContentHandler.(Aarti)

4. Refactoring ProofreadPage.body.php .(Aarti)

5. Began refactoring of Page pages. (Aarti)

6. Added unit tests for Page pages. (Aarti)

7. Began the separation of rendering and parsing part from ProofreadPage.body.php. (Aarti)

8. Added the code for editing of Page pages in PHP. (Aarti)

9. Shifted the display of image on Page pages to PHP. (Aarti)

10. Integrated a new zooming library. (Aarti)

11. Added zoom buttons for WikiEditor as well as old toolbar. (Aarti)

Meetings

[edit]

2013-05-29

[edit]
  • Skype meeting every week.
  • Mail to Wikisource-I before any import changes.
  • Use labs
  • Discuss with the Visual Editor team about compatibility with Page: pages (Aarti).
  • Open an RFC about Page: pages storage bugzilla:46724 (Thomas)

2013-06-07

[edit]
  • read about ContentHandler that might be used during of after the refactoring
  • make sure to test local install with a DjVu file: [1]
  • read about Wikimedia Labs and how to deploy commits there for "real-life" testing
  • put a message on the main wikisource community portals to point them to Aarti's email to the mailing list (in case the communities are not following it)

2013-06-14

[edit]
  • Function of ProofreadPage class should be to just process the input it receives. It should not be bothered about how the input is received and how the output is displayed.
  • Write unit tests.
  • Break down large functions into smaller parts so that code redundancy is reduced.

2013-06-22

[edit]
  • Write a separate class for parsing.
  • Write a separate class for conversion between page number in the file and page number in the Wiki.
  • Implement the ProofreadPagePage and ProofreadPageContent classes.
  • In EditProofreadPagePage class, use more of EditPage functions.
  • Refactor the JavaScript part to move suitable things to server-side for page pages.

2013-07-07

[edit]
  • Move the code for setting up of editing system from JavaScript to PHP.
  • Finding and using a good library for zooming.
  • Refactor the JavaScript, provide the option of showing and hiding the footer, header etc.

2013-07-22

[edit]
  • Fix the styling of edit page for a Page page.
  • Add the image on a Page page.
  • Rewrite the JavaScript.
  • Find a good zooming library.

Working method

[edit]

Here is a possible method to do quickly and (pretty) easily good code changes. It's not the ultimate method but I hope it's a good one.

  1. Write your code structure (class and method declaration) and then the code itself.
  2. When it's done read the diff in your git manager to see issues (personally I use git GUI but everything that output colored diff is good)
  3. Test changed part of the software. After this step you should have fixed 75% of the bugs
  4. Submit the change on gerrit
  5. Do something else during an hour or more
  6. Go to gerrit and review your code at if it is the code of someone else with a critical eye. Fix the problems (coding style, crazy things...)
  7. Retest parts where code logic have been changed
  8. Submit the change
  9. Ask for review!

Monthly Reports

[edit]

June

[edit]

I have been working on Refactoring the ProofreadPage Extension as a participant in Google Summer of Code 2013.

  • The first few days were dedicated to settling down upon the methods of working and, getting familiar with the codebase.
  • I also installed the extension on my local version of MediaWiki and tested it with a DjVu file.
  • The first task was to refactor the file ProofreadPage.body.php so that it can be cleansed of code that should have been in some other place. DbConnector classes were used to separate data fetching from other processes.
  • Thomas moved the code related to index pages to ProofreadIndexPage.
  • Some parts of the editing system were moved to a different class for better modularity.
  • Currently I am working on the refactoring of Page pages. I am also reading up on PHPUnit so as to add more unit tests.

Changes in gerrit:

July

[edit]
  • Added ProofreadPagePage and ProofreadPageContent classes.
  • Inherited the EditPage class to EditProofreadPage class and overwrote functions for showing the content form and saving.
  • Moved the display of all form fields from JavaScript to PHP.
  • Implemented the ProofreadPagePage and ProofreadPageContent classes.
  • Started the refactoring of JavaScript.
  • Added unit tests

Changes in gerrit:

August

[edit]