User Tools

Site Tools


project:mt:startup:tecdesc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
project:mt:startup:tecdesc [2023/04/05 13:21] – ↷ Page moved from project:mtstartup:tecdesc to project:mt:startup:tecdesc snarfburproject:mt:startup:tecdesc [2023/05/23 14:30] (current) snarfbur
Line 5: Line 5:
 ==== Clear separation between MapTool system and usage data ==== ==== Clear separation between MapTool system and usage data ====
  
-=== Add argument (option) parameters === +See User Guide [[:project:mt:ug:stratupprops|]].
- +
-  * D, data-dir +
-  * S, server +
-  * ?, help +
- +
-Implement help output (only English). +
- +
-=== User startup.properties file === +
- +
-Create & Read Preference file under MAPTOOL_DATADIR/config named startup.properties. \\ **Note**If this is not update-save maybe an own DIR under the data folder or an own folder in parallel +
- +
-Parameter-List: +
- +
-  * language +
-  * country +
-  * startup-server +
-  * startup-campaign +
-  * no-auto-update +
-  * … +
- +
-Do not overwrite cmdOptions values. +
- +
-Implement language and country switch. +
- +
-Get sure that data-dir is used.+
  
 ==== Option on startup to start a server ==== ==== Option on startup to start a server ====
  
-  * Check, if we can use already the original startup sequence, where the private server is created. +  * Add startup property to start the last server on startup 
-  * Checkwhat additional parameters are needed (first only for one Server initialization variant)+  * Add startup property to define how the startup sequence should handle a auto backup file 
 +  * Find the correct place to start the server in the startup sequence (trickybecause there are already threats running)
  
 ==== Refactor: UI startup frame ==== ==== Refactor: UI startup frame ====
 +
 +=== Best Solution ===
  
   * Separate user from system settings, users first   * Separate user from system settings, users first
Line 48: Line 26:
   * Describe keys for advanced options   * Describe keys for advanced options
  
-**Note:**  Who does the translations?+=== Minimum Solution === 
 + 
 +  Add description for the startup.properties file and the minimum how to use it.
  
 ===== Implementation Decisions ===== ===== Implementation Decisions =====
Line 62: Line 42:
   * Let return values in the AppUtil class.   * Let return values in the AppUtil class.
   * Create App Properties to manage the properties for boolean and String, with (deprecated) references in the AppUtil. (Later easy to refactor in the rest of MapTool)   * Create App Properties to manage the properties for boolean and String, with (deprecated) references in the AppUtil. (Later easy to refactor in the rest of MapTool)
-  * Create CmdOptionProperties and StartUpProperties class to manage there values+  * Create CmdOptionProperties and StartUpProperties classes to manage there values
   * Rearrange the startup methods (& logs), so that the properties are initialized first, second the main directories (data & logs), then the logging and at last call MapTool.main().   * Rearrange the startup methods (& logs), so that the properties are initialized first, second the main directories (data & logs), then the logging and at last call MapTool.main().
  
Line 76: Line 56:
 The current UserJvmOptions is therefore a mix of JVM, library and application options and should be refactored. Since it has also a lot of methods to handle the cfg file values, I would at least recommend an renaming. \\ A first closer check shows that this class is mainly used in the PreferenceDialog, so it should be refactored, when the last part (Refactor UI startup frame) will be done. The current UserJvmOptions is therefore a mix of JVM, library and application options and should be refactored. Since it has also a lot of methods to handle the cfg file values, I would at least recommend an renaming. \\ A first closer check shows that this class is mainly used in the PreferenceDialog, so it should be refactored, when the last part (Refactor UI startup frame) will be done.
  
-**Note:**  The definition of the DEFAULT_DATA_DIR is wrong, if the MAPTOOL_DATADIR is overwriten (in MapTool.cfg file or by cmdLineOptions)+==== RefactorUI startup frame ====
  
-===== Implementation Questions =====+Analysis of the Option Dialog shows:
  
-==== Log vs. MapTool.show...() ====+  * All in one Class: 
 +  * Swing 
 +  * Generated Code: Tool xxx used
  
-When do you want just a log and when should there be a show popup?+Since Swing is deprecated and I have no experience with the Tool or with JavaFX I will go for the minimum + bug fixing (show the correct values) and maybe add the new values (without the tool).
  
-Examples: +===== Implementation Questions =====
- +
-  * +
-<code>log.info("Start up properties file definition {} was set relative to the DataDir, so redefinition of the DataDir will be ignored!", AppProperties.getStartUpPropsFileNameOriginal()); +
- +
-</file> +
-  * +
-<code>log.info("{} not found. This can be ok, if it really does not exists.", AppProperties.getStartUpPropsFileName()) +
- +
-</code>+
  
 ==== Naming Conventions ==== ==== Naming Conventions ====
  
-  * start-up -> startUp or to startup? 
   * Abbreviations: Where are they ok, where not e.g. usage of properties and props   * Abbreviations: Where are they ok, where not e.g. usage of properties and props
  
Line 114: Line 86:
 ==== cmdOption -r -> Exception ==== ==== cmdOption -r -> Exception ====
  
-To the time the reset method is called, the 'jvmNodeConfiguration' is null. - Version 1.12.2+To the time the reset method is called, the 'jvmNodeConfiguration' is null. - Found in productive Version 1.12.2
  
 ==== cmdOption -w is double defined ==== ==== cmdOption -w is double defined ====
- 
 <code> <code>
 +
 cmdOptions.addOption("m", "monitor", true, "sets which monitor to use"); cmdOptions.addOption("m", "monitor", true, "sets which monitor to use");
 ... ...
Line 135: Line 107:
  
 </code> </code>
 +
 +==== Start-Properties / JvmOptions not Shown under Windows ====
 +
 +At least since 1.12.2 the start properties are not shown in the OptionDialog under Windows.
 +
 +They are also not editable under Windows, even if the file is in a editable directory.
 +
 +Under Development the hole tab is not shown. That makes development for the dialog hard.
  
 ===== Recommended Refactoring Issues ===== ===== Recommended Refactoring Issues =====
Line 152: Line 132:
 . .
  
-==== AppUtil.getDataDirAppClfFile() & UserJvmOptions.copyConfigFile() ====+==== AppUtil.getDataDirAppCfgFile() & UserJvmOptions.copyConfigFile() ====
  
 This is a helper function to copy the original maptool.cfg from the app directory into the 'DataHome/config' directory as a BACKUP. But it is not renamed and so a user does not now, that the file in the data directory is never used. This is a helper function to copy the original maptool.cfg from the app directory into the 'DataHome/config' directory as a BACKUP. But it is not renamed and so a user does not now, that the file in the data directory is never used.
  
 **Conclusion:**  Rename the file to backup_from_currentDate&Time and write it into a backup directory. **Conclusion:**  Rename the file to backup_from_currentDate&Time and write it into a backup directory.
- 
-===== MapTool-Sample.cfg ===== 
- 
-The Example seems to be out of date. 
  
 ===== Notes ===== ===== Notes =====
Line 169: Line 145:
  
 Its looks like the current cfg file is not generated during the normal build and it is not accessible from IntelliJ run/debug. Does somebody know, how a cfg file can be used during development? Its looks like the current cfg file is not generated during the normal build and it is not accessible from IntelliJ run/debug. Does somebody know, how a cfg file can be used during development?
 +
 +==== Translations Yes or No ====
 +
 +The developer team uses a pragmatic rule: If the information is useful for the user, so he can (re-)act with the information, translate it, otherwise it should be in English, so that it is useful for the developer team.
 +
 +=== Examples ===
 +
 +== CmdLineOption: Description ==
 +
 +The description is only in English. Maybe you want to use translation encoding? \\ I use the description for the help view, so this is also only in English.
 +
 +Answer: Yes
 +
 +== MapTool.showError() ==
 +
 +Should I use a translation here? \\ MapTool.showError("Unexpected IOException during load of startup properties.", catchedIOException);
 +
 +Answer: No
 +
 +==== Log vs. MapTool.show...() ====
 +
 +Use the same rule as for translations and thing about it, if the value of the information is high enough for the user to commit it. The log is just written into the file, the dialog needs interaction!
  
  
project/mt/startup/tecdesc.1680693670.txt.gz · Last modified: 2023/04/05 13:21 by snarfbur