Feature #1112

Updated by Sebastien Jacquot almost 5 years ago

h2. Current state

NOTE: As a reminder, an "editor" and a "tab" means the same SWT component (real name is "editor part").

h3. TBX result object names

* TBD

h3. Editor/tab titles

* CAH => title computed from CAH.getName() + type of result "Classification:" added before
* TBD
* TODO: at least use the same pattern? For some results the type of result is displayed in the title, for some others it is not.
(e.g. actually for dimension partition there is not the corpus name in the title, only the type of result and partition name or for CAH)

h3. Data result export

* no automatic file name is computed
* this export is at TBX level therefore the name can not be computed from the editor title. It should be computed from the TBX result object name

h3. Raw chart result export (from Corpus view nodes)

* no automatic file name is computed
* this export is at TBX level therefor the name can not be computed from the editor title. It should be computed from the TBX result object name

h3. Chart editor view export (from chart editor tool bar)

* the file name is computed from the chart editor title
* a custom method is applied to replace all invalid characters by the character '_'
* see: org.txm.tbx.chartsengine.base.ChartsEngine.cleanFileName(String):

<pre>
public static String cleanFileName(String fileName) {
return fileName.replaceAll("[^a-zA-Z0-9\\._-]+", "_");
}

</pre>

This method is not optimal, e.g. it removes accented characters. We should aim to use platform native Java filename validation if exists.
Furthermore this method should be moved from the chart rendering layer and shared by all export mechanism.
MD: something like
<pre>
File f = new File(path, name)
f.createEmptyFile();
if (f.exists()) { ... }
</pre>
SJ: it would be nice for invalidating file names. After that we need to create a valid name from the invalid name.


h3. First proposals

* when exporting from an editor, compute the output file name from the editor title, but before we need to define if we put the type of result in the title of the editor. If not we may add it to the computed file name (at this moment this case is only for the chart editor)
* when exporting from a node (TBX level), compute the file name from the TXM result object name. The type of result seems to not be stored in TXM object result and I guess it shouldn't so we may need to add it to the computed file name
* for editor titles:

* user can see the type of result with the title icon image, it may be sufficient?
* for all results, start the title by the corpus name
* for partition dimensions, change icon and add corpus name?

Back