- Change Summary:
-
+ Screenshot
- Added Files:
XML ReviewUI Extension
Review Request #3564 — Created Nov. 26, 2012 and submitted
A ReviewBoard Extension that demonstrates how to: - Register a ReviewUI for XML file attachments. - Register a Mimetype Handler to create XML thumbnails for these attachments. Currently: - Both the ReviewUI / Mimetype Handler provide syntax / keyword highlight for XML file via pygments.
Manually tested with ReviewUI integration through Extensions patch: http://reviews.reviewboard.org/r/3565/ - Successfully installed this extension, its ReviewUI, and its Mimetype Handler - Once installed, "Add Comment" button on XML attachments change to "Review" buttons. - Once installed, able to review XML file attachments via the "Review" button. - Once installed, XML file attachments now have thumbnails (if it was not enabled before) - Color markup for the XML file attachment correctly rendered through pygments.
Description | From | Last Updated |
---|---|---|
Should go alphabetical: pygments.formatters then pygments.lexers |
KA Karl-L | |
Any potential for IOError (e.g. file doesn't exist)? This might be handled elsewhere, so feel free to ignore if this … |
KA Karl-L | |
Two spaces between the imports and functions, one space between the functions. Also, not sure if there's any precedent (or … |
KA Karl-L | |
This should go right after "import logging" |
AA aam1r | |
Add a blank line between these two lines |
AA aam1r | |
Add space between these two lines |
AA aam1r | |
This looks a bit long for one line. Try moving the "% PACKAGE" To the next. |
chipx86 | |
Two blank lines. |
chipx86 | |
I don't think we need to subclass everything. What I'd prefer is to just instantiate a URLHook and pass it … |
chipx86 | |
Indentation looks off here. |
david | |
Same comment. |
chipx86 | |
I think it will read a little easier if you put "extension" on the next line. Also indent only 4 … |
david | |
Same. |
chipx86 | |
Should inherit from FileAttachmentReviewable. Those defaults are available in that parent class. The only one you introduce is 'rendered', which … |
chipx86 | |
I don't really know why we have this. I'd say unless there's an immediate reason for some dashboard, remove it. |
chipx86 | |
Add two blank lines above each function. |
david | |
This file should be called xml_review_ui.py |
david | |
Is this line too long? |
david | |
This file should be mimetypes.py |
david | |
This file should be xmlReviewableView.js |
david |
-
-
-
Any potential for IOError (e.g. file doesn't exist)? This might be handled elsewhere, so feel free to ignore if this is the case.
-
Two spaces between the imports and functions, one space between the functions. Also, not sure if there's any precedent (or desire to go this way), but Django's class-based generic views would let you add these views inline in your urls.py modules. E.g. in urls.py, the url would look like: url(r'^$', TemplateView.as_view(template_name="xml_review_ui_extension/configure.html") along with the appropriate import. See https://docs.djangoproject.com/en/1.4/topics/class-based-views/ for more on class-based views. The project mentors may not be into using them, so if you're interested, double-check before going down that road.
- Change Summary:
-
Fixed imports and added error handling as per Karl's comments Also added force_unicdoe on data_string the read XML file
- Diff:
-
Revision 2 (+192)
- Change Summary:
-
Fixed minor style issue as per aam1r's comment.
- Diff:
-
Revision 3 (+191)
- Change Summary:
-
Updated this extension to adhere to the changes made to extensions framework (See http://reviews.reviewboard.org/r/3578/)
- Diff:
-
Revision 4 (+191)
- Change Summary:
-
Removed {{MEDIA_SERIAL}} as it no longer exists
- Diff:
-
Revision 5 (+192)
-
-
-
-
I don't think we need to subclass everything. What I'd prefer is to just instantiate a URLHook and pass it the patterns. Keeps things simpler.
-
-
-
Should inherit from FileAttachmentReviewable. Those defaults are available in that parent class. The only one you introduce is 'rendered', which should be the only entry in here.
-
I don't really know why we have this. I'd say unless there's an immediate reason for some dashboard, remove it.
- Change Summary:
-
Trimmed XML Review UI Extension to retain only the minimally required content logic / files.
- Testing Done:
-
Manually tested with ReviewUI integration through Extensions patch: http://reviews.reviewboard.org/r/3565/
- Successfully installed this extension and its ReviewUI ~ - Succcesfully registered XMLReviewUI through XMLReviewUIHook ~ - Once installed, able to review XML file attachments via the "Review" button ~ - Color markup for the XML file attachment correctly rendered through pygments ~ - Once installed, "Add Comment" button on XML attachments change to "Review" buttons. ~ - Once installed, able to review XML file attachments via the "Review" button. ~ - Color markup for the XML file attachment correctly rendered through pygments. - Diff:
-
Revision 6 (+121)
- Change Summary:
-
Added XMLMimetype Handler to let this Extension also demonstrate registration of the XML Thumbnails feature through hooks.
- Description:
-
~ A ReviewBoard Extension that provides a basic ReviewUI for XML file attachments.
~ A ReviewBoard Extension that demonstrates how to:
+ - Register a ReviewUI for XML file attachments. + - Register a Mimetype Handler to create XML thumbnails for these attachments. ~ Currently, the ReviewUI provides syntax / keyword highlight for XML file via pygments.
~ Currently:
+ - Both the ReviewUI / Mimetype Handler provide syntax / keyword highlight for XML file via pygments. - Testing Done:
-
Manually tested with ReviewUI integration through Extensions patch: http://reviews.reviewboard.org/r/3565/
~ - Successfully installed this extension and its ReviewUI ~ - Successfully installed this extension, its ReviewUI, and its Mimetype Handler - Once installed, "Add Comment" button on XML attachments change to "Review" buttons. - Once installed, able to review XML file attachments via the "Review" button. + - Once installed, XML file attachments now have thumbnails (if it was not enabled before) - Color markup for the XML file attachment correctly rendered through pygments. - Diff:
-
Revision 7 (+141)
- Change Summary:
-
Fixed minor style issues
- Diff:
-
Revision 8 (+141)
- Change Summary:
-
Fixed various naming and syntax issues. Waiting on pending review-request for Text-based commenting to land to introduce it to this extension
- Diff:
-
Revision 9 (+141)