com.atlassian.crucible.plugin.export
Class ReviewExporter

java.lang.Object
  extended by com.lowagie.text.pdf.PdfPageEventHelper
      extended by com.atlassian.crucible.plugin.export.ReviewExporter
All Implemented Interfaces:
com.lowagie.text.pdf.PdfPageEvent

public class ReviewExporter
extends com.lowagie.text.pdf.PdfPageEventHelper

Handles exporting a Crucible review to PDF, using the iText(http://itextdocs.lowagie.com/) library.

Author:
Ross Rowe

Nested Class Summary
 class ReviewExporter.ReviewMap
          Mapping of VersionedLineCommentData and FisheyeReviewItemData instances.
 
Constructor Summary
ReviewExporter(CrucibleClient client, java.util.Locale locale)
          Constructs a ReviewExporter instance.
 
Method Summary
 java.io.ByteArrayOutputStream createPdfExport(java.lang.String userName, java.lang.String password, java.lang.String reviewId)
          Performs input validation checks, retrieves the ReviewData, GeneralCommentData and VersionedLineCommentData for the specific reviewId, and invokes the PDF processing.
 CrucibleClient getClient()
          Returns the CrucibleClient instance.
 void onCloseDocument(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document)
          Finishes the calculation of the page numbering.
 void onEndPage(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document)
          Displays the page number and page generation information.
 void onOpenDocument(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document)
          Adds the Crucible image to the top of the page
 void setBaseUrl(java.lang.String baseUrl)
          Sets the baseUrl variable.
 
Methods inherited from class com.lowagie.text.pdf.PdfPageEventHelper
onChapter, onChapterEnd, onGenericTag, onParagraph, onParagraphEnd, onSection, onSectionEnd, onStartPage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReviewExporter

public ReviewExporter(CrucibleClient client,
                      java.util.Locale locale)
Constructs a ReviewExporter instance.

Parameters:
client -
Method Detail

getClient

public CrucibleClient getClient()
Returns the CrucibleClient instance.

Returns:

createPdfExport

public java.io.ByteArrayOutputStream createPdfExport(java.lang.String userName,
                                                     java.lang.String password,
                                                     java.lang.String reviewId)
                                              throws ExportException
Performs input validation checks, retrieves the ReviewData, GeneralCommentData and VersionedLineCommentData for the specific reviewId, and invokes the PDF processing.

Parameters:
userName -
password -
reviewId -
Returns:
Throws:
ExportException

onOpenDocument

public void onOpenDocument(com.lowagie.text.pdf.PdfWriter writer,
                           com.lowagie.text.Document document)
Adds the Crucible image to the top of the page

Specified by:
onOpenDocument in interface com.lowagie.text.pdf.PdfPageEvent
Overrides:
onOpenDocument in class com.lowagie.text.pdf.PdfPageEventHelper

onEndPage

public void onEndPage(com.lowagie.text.pdf.PdfWriter writer,
                      com.lowagie.text.Document document)
Displays the page number and page generation information.

Specified by:
onEndPage in interface com.lowagie.text.pdf.PdfPageEvent
Overrides:
onEndPage in class com.lowagie.text.pdf.PdfPageEventHelper

onCloseDocument

public void onCloseDocument(com.lowagie.text.pdf.PdfWriter writer,
                            com.lowagie.text.Document document)
Finishes the calculation of the page numbering.

Specified by:
onCloseDocument in interface com.lowagie.text.pdf.PdfPageEvent
Overrides:
onCloseDocument in class com.lowagie.text.pdf.PdfPageEventHelper

setBaseUrl

public void setBaseUrl(java.lang.String baseUrl)
Sets the baseUrl variable.

Parameters:
baseUrl -


Copyright © 2008. All Rights Reserved.