Introducing Thumbnail Integration through Extensions.
Introducing Thumbnail Integration through Extensions.

ReviewBoard Extensions can now define how to create thumbnails
for specified file attachment mimetypes.

Added FileAttachmentThumbnailHook to generalize a hook point for all files of
all mimetypes. Mimetype Handlers for text-based mimetypes can leverage
`reviewboard.attachments.mimetypes.TextMimetype` by simply overriding
`_generate_preview_html` to define how to generate the HTML used in the
thumbnail, instead of having to redefine `get_thumbnail`.

Testing done:
- Disabled the registration of XMLMimetype in reviewboard.attachments.__init__
- Verified that XML thumbnails now fall back to raw uncolored text
- Copied over the XMLReviewUIExtension from the sample extension branch, and:
- Added XMLThumbnail.py to define the XMLMimetype class for generating XML
  thumbnails
- Modified extensions.py to use the FileAttachmentThumbnailHook to hook
  XMLMimetype into ReviewBoard to handle XML thumbnails.
- Verified that the Extension installs without error
- Verified that Extension-installed XML thumbnails feature work exactly as
  did before.

Reviewed at http://reviews.reviewboard.org/r/3614/

sgallagher/reviewboard,brennie/reviewboard,beol/reviewboard,reviewboard/reviewboard,custode/reviewboard,KnowNo/reviewboard,reviewboard/reviewboard,KnowNo/reviewboard,custode/reviewboard,chipx86/reviewboard,KnowNo/reviewboard,chipx86/reviewboard,KnowNo/reviewboard,davidt/reviewboard,1tush/reviewboard,1tush/reviewboard,1tush/reviewboard,brennie/reviewboard,1tush/reviewboard,1tush/reviewboard,1tush/reviewboard,reviewboard/reviewboard,beol/reviewboard,davidt/reviewboard,reviewboard/reviewboard,custode/reviewboard,davidt/reviewboard,brennie/reviewboard,chipx86/reviewboard,beol/reviewboard,sgallagher/reviewboard,1tush/reviewboard,1tush/reviewboard,bkochendorfer/reviewboard,1tush/reviewboard,bkochendorfer/reviewboard,sgallagher/reviewboard,brennie/reviewboard,bkochendorfer/reviewboard,bkochendorfer/reviewboard,davidt/reviewboard,custode/reviewboard,sgallagher/reviewboard,chipx86/reviewboard,beol/reviewboard