Changes between Version 24 and Version 25 of APP_BUG_REPORT_FORM_R0


Ignore:
Timestamp:
05/28/09 18:53:16 (16 years ago)
Author:
mitex
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • APP_BUG_REPORT_FORM_R0

    v24 v25  
    7474 * Create a menu item "Send an &Error Report..." in {{{org.sophie2.main.func.help.menuitems}}} and attach it to the Help menu. 
    7575 
    76  * Create a class {{{org.sophie2.main.func.help.bugreport.BugReportDialogInput}}} that extends {{{DialogInput<Void>}}} and represents the bug report data: 
    77   * {{{Throwable throwable}}} - can be null 
    78   * {{{String log}}} - the contents of the Sophie log file 
    79   * {{{Properties systemProperties}}} - java system properties ([http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#getProperties()]) 
    80   * {{{String email}}} 
    81   * {{{String explanation}}} - can be empty 
    82   * {{{File attachment}}} - can be null 
     76 * Create a class {{{org.sophie2.main.func.help.bugreport.BugReport}}} that represents the bug report data and has the following properties: 
     77  * String property {{{stackTrace}}} - can be empty 
     78  * String property {{{log}}} - the contents of Sophie log files 
     79  * String property {{{systemProperties}}} - java system properties, serialized ([http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#getProperties()]) 
     80  * String property {{{email}}} 
     81  * String property {{{userExplanation}}} - can be empty 
     82  * File property {{{attachment}}} - can be null 
     83  * String property {{{technicalInformation}}} - auto property which contains all technical data in this report, serialized to String. Includes everything that is automatically collected - stack trace, log files, system properties. 
     84  * String method {{{getContent()}}} - gets all data in this report, serialized to String. 
     85 
     86 * Create a class {{{org.sophie2.main.func.help.bugreport.BugReportDialogInput}}} that extends {{{DialogInput<Void>}}}: 
     87  * {{{private final BugReport bugReport;}}} 
     88  * {{{private final String windowTitle;}}} 
    8389 
    8490 * Create a class {{{org.sophie2.main.func.help.bugreport.BugReportDialog}}} that extends {{{org.sophie2.base.dialogs.Dialog<BugReportDialogInput, Void>}}}. 
    8591  * Use {{{BoundTextField}}}s. 
    8692   * The e-mail text field should perform validation using regular expression. 
    87   * String property {{{reportData}}} - serialized report data, without the user explanation and e-mail address. 
    88   * String property {{{userExplanation}}} 
    89   * String property {{{userEmail}}} 
     93  * BugReport property 
     94  * String property {{{title}}} 
     95  * JDialog property {{{swingComponent}}}. 
     96  * enum EventIds: CLOSE, SAVE_TO_FILE, ATTACH_FILE, EMAIL_CHANGED 
    9097  * Register the dialog in the help module. 
    9198 
     
    94101  * Use {{{FileEntryManager}}}'s methods {{{getReadableFileEntry}}} and {{{getWritableFileEntry}}}. 
    95102 
     103 * Move Sophie log files to distrib directory: 
     104  * Edit {{{log4j.properties}}} for author and reader, set log path to be in distrib/log. 
     105  * Now log files can be read using FileEntryManager. 
     106 
    96107 * Create a controller {{{enum org.sophie2.main.func.help.bugreport.BugReportLogic}}} 
    97   * method {{{BugReportDialogInput collectReportData(Throwable t)}}} that collects all required report data: 
    98    * the exception is taken as a parameter 
     108  * SHOW_BUG_REPORT_FORM: this should be called when the menu item is selected. Calls BugReportLogic.showBugReportForm(null); (null, because no exception is thrown) 
     109  * SAVE_REPORT_TO_FILE: opens a file dialog, saves the result of BugReport.getContent() and closes the form. 
     110   * Use UTF-8 encoding. 
     111  * ATTACH_FILE: opens a file dialog, sets the attachment field in the bugReport property of the event source (BugReportDialog). 
     112  * CLOSE: closes the form. 
     113  * SAVE_EMAIL: invoked when the user enters a valid e-mail in the form. Saves the address as described earlier. 
     114  * {{{static void showBugReportForm(Throwable throwable)}}}: calls {{{collectReportData(throwable)}}} and opens the form using DialogManager. 
     115  * {{{static BugReport collectReportData(Throwable t)}}}: collects all required report data: 
     116   * serializes the throwable's stack trace to string. 
    99117   * gets current date and time. 
    100    * reads the log file 
     118   * reads all log files (using {{{listFileEntries}}} in {{{FileEntryManager}}}). 
    101119   * gets all system properties 
    102120   * reads the e-mail address from a file 
    103121   * the explanation is an empty string 
    104122   * the attached file is null 
    105   * SHOW_BUG_REPORT_FORM: invokes the dialog using {{{DialogManager.get().showDialog}}} with argument - report generated by {{{generateReport}}}. 
    106   * method {{{String generateReport(BugReportDialogInput)}}} that serializes all the data to string. 
    107    * The exception is serialized using printStackTrace. 
    108    * Use ISO format for the date. 
    109    * Use UTF-8 encoding. 
    110   * SAVE_TO_FILE: opens a file dialog, saves the result of {{{generateReport}}} (without the attached file) and closes the form. 
    111   * LOAD_FROM_FILE: opens a file dialog, replaces the generated report. 
    112   * ATTACH_FILE: opens a file dialog, sets the attachment field in BugReportDialogInput. 
    113   * CLOSE: closes the form. 
    114123 
    115124 * Create a class {{{org.sophie2.main.func.help.bugreport.SophieExceptionHandler}}} that implements {{{Thread.UncaughtExceptionHandler}}}. 
    116   * In {{{uncaughtException(Thread t, Throwable e)}}} fire the same R3 event as the menuitem, but with parameter {{{e}}}. 
     125  * In {{{uncaughtException(Thread t, Throwable e)}}} call {{{BugReportLogic.showBugReportForm(e);}}} 
    117126 * Register that handler by invoking {{{Thread.setDefaultUncaughtExceptionHandler(new SophieExceptionHandler());}}} in {{{HelpModule.doStart}}}. 
    118127