Page MenuHomePhabricator

Curator reads a revision offline
Open, MediumPublic

Description

"As a Curator, I want to get a revision and its contents, so that I can read it whenever I want."

GET /revision/{id}/with_html

Return the revision of a page without content.

Request payload: none

Body: JSON, object with following fields:

  • id: revision ID
  • page: Object with these fields
    • id: ID of the page
    • title: current title of the page (might have been changed)
  • user: user who made the change, object with these fields
    • id: ID of the user or null for anonymous
    • name: name of the user or unique identifier for anonymous
  • comment: User comment ("edit summary") describing the change that generated this revision
  • timestamp: time the revision was made
  • size: size of the revision in "bogobytes" (as from DB, usually bytes)
  • delta: change from previous revision in "bogobytes" (as from DB, usually bytes)
  • html: reversible HTML content of the page as generated by Parsoid, including all slots, for current user

Event Timeline

eprodromou updated the task description. (Show Details)
eprodromou updated the task description. (Show Details)

User story T231345 used to have HTML embedded, but due to schedule pressures we dropped it. It's now in this user story instead.

This is kind of a bigger task than it looks like, because currently we don't have Parsoid/PHP available in MediaWiki core. We need to include it via PHP Composer (I don't think it's yet part of the PHP Composer repository, either).

We also need to cache the Parsoid/PHP HTML output; probably using the same cache that RESTBase uses.

What is "bogobytes"?

It's the (theoretically) arbitrary size system that each content model implements.

includes/content/Content.php
	/**
	 * Returns the content's nominal size in "bogo-bytes".
	 *
	 * @return int
	 */
	public function getSize();