Changes between Version 8 and Version 9 of PLUGIN_SUPPORT_LIB_CONFIGURING_R1


Ignore:
Timestamp:
06/12/09 17:20:51 (16 years ago)
Author:
mitex
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PLUGIN_SUPPORT_LIB_CONFIGURING_R1

    v8 v9  
    5555== How to demo == 
    5656 * Open Sophie. 
    57  * Maximize the main window. 
    5857 * Open the bug report form (in Help menu) and enter a valid e-mail address. 
    5958 * Close the form. 
    6059 * Restart Sophie. 
    61  * Show that the main window is maximized. 
    6260 * Open the bug report and show the saved e-mail address. 
    6361 
    6462= Design = 
    65  * Package {{{org.sophie2.base.config}}}. 
     63 * New module {{{org.sophie2.base.config}}}. 
    6664 
    6765 * Immutable generic class {{{ConfigKey<T>}}} that encapsulates all of the information about a key: 
    6866  * name (of the key) - String 
    69   * configuration file - File 
     67  * configuration file - String - relative path. For example, if the file is "distrib/conf/a/b.conf", this should be "a/b.conf". 
    7068  * default value (if the key is not present in the file) - T 
    7169  * schema (for the persistence) - String, for example "imm:int|storage|decimal" 
     70 
     71 * Class {{{BaseConfigModule}}}. 
     72  * Extension point of type {{{ConfigKey<?>}}}. 
    7273 
    7374 * Class {{{ConfigEntry}}} that extends {{{ListEntry}}} 
     
    7980  * list property of {{{ConfigEntry}}}s that stores all key-value pairs in that file. 
    8081  * {{{T getValue(ConfigKey<T> key)}}} - searches the list for a given entry and returns the corresponding value or the default value for the key. 
    81   * {{{void setValue(ConfigKey<T> key, T value)}}} - sets the value in the list and saves the configuration using the persister (see below). 
    82   * When a Configuration for a given file is constructed, all entries are read from that file and stored in the list. 
     82  * {{{void setValue(ConfigKey<T> key, T value)}}} - sets the value in the list. 
    8383 
    84  * Class {{{ConfigurationPersister}}} that loads/saves configuration files from/to Storage. 
     84 * Package {{{org.sophie2.base.config.persistence 
     85  *  
     86 
     87 * Class {{{ConfigurationStoragePersister}}} that loads/saves configuration files from/to Storage. 
    8588  * Use the following structure for the storage, where "value" is the storage for the value of the configuration key, created with the according persister: 
    86    * configuration 
    87     * entry 
    88      * key 
    89      * value 
    90     * entry 
    91      * key 
    92      * value 
     89   * entry 
     90    * key - attribute 
     91    * value - text content of entry 
     92   * entry 
     93    * key - attribute 
     94    * value - text content of entry 
    9395  * Schema: "configuration|storage|conf" 
     96  * When reading, iterate over all registered extensions - config keys - for the given configuration file. 
    9497 * Class {{{ConfigurationFilePersister}}} that loads/saves Storage from/to *.conf files. 
    95   * Create an XML tag for each of the above storage nodes (configuration, entry, etc.) 
     98  * Use the same structure as the storage for the XML file. 
     99   * Name the root tag "configuration". 
    96100  * Schema: "storage|xml|conf" 
    97101 * Register the persisters as extensions. 
     
    102106   * Given the file name in the key, finds the corresponding Configuration and then returns the result of Configuration.getValue. 
    103107  * {{{setValue(ConfigKey<T> key, T value)}}} 
    104    * Given the file name in the key, finds the corresponding Configuration and sets the new value for that key. 
     108   * Given the file name in the key, finds the corresponding Configuration and sets the new value for that key. Saves the configuration using the persister (see below). 
     109  * When a Configuration for a given file is constructed, all entries are read from that file and stored in the list. 
    105110 
    106  * Implement at least one of the following: 
    107   * In {{{BugReportLogic}}} 
    108    * Remove the file "distrib/email" and create a new one "distrib/conf/org.sophie2.main.func.help.conf". 
    109    * Create a ConfigKey {{{userEmail}}}. 
    110    * Remove the method {{{readEmail}}} and use {{{getValue}}} in ConfigurationManager. 
    111    * In {{{SAVE_EMAIL}}} use {{{setValue}}} in ConfigurationManager. 
    112   * In {{{MDMainWindow}}} 
    113    * Create a ConfigKey {{{windowSize}}} of type {{{ImmSize}}} and set its default value to (1200, 900). 
    114    * Remove the constants WINDOW_WIDTH, WINDOW_HEIGHT. 
    115    * In {{{globalContainer}}} set the JFrame's size according to the value of the configuration key. 
     111 * In {{{BugReportLogic}}} 
     112  * Remove the file "distrib/email" and create a new one "distrib/conf/org.sophie2.main.func.help.conf". 
     113  * Create a ConfigKey {{{userEmail}}} and add it as an extension for the help module. 
     114  * Remove the method {{{readEmail}}} and use {{{getValue}}} in ConfigurationManager. 
     115  * In {{{SAVE_EMAIL}}} use {{{setValue}}} in ConfigurationManager. 
    116116 
    117117 * [3228], [3238], [3284] 
    118118 
    119119= Implementation = 
    120 ^(Describe and link the implementation results here (from the wiki or the repository).)^ 
     120 * [3228], [3238], [3284],  
    121121 
    122122= Testing =