Task #2045

Mutualize and clarify TXMResult, Function, TXMObject, HasResults

Added by Sebastien Jacquot over 2 years ago. Updated 6 months ago.

Status:In Progress Start date:02/16/2017
Priority:Normal Due date:
Assignee:- % Done:

80%

Category:Development Spent time: -
Target version:TXM 0.8.1

Description

Mutualize and clarify TXMResult, Function, TXMObject, HasResults. It will also permit to avoid cyclic dependencies in plug-ins.

Locations:
http://svn.code.sf.net/p/txm/code/trunk/Toolbox/trunk/org.textometrie.toolbox/src/java/org/txm/functions/TXMResult.java
MD: permet d'identifier un résulat parmis d'autres objets. Pas bcp exploité
http://svn.code.sf.net/p/txm/code/trunk/Toolbox/trunk/org.textometrie.toolbox/src/java/org/txm/functions/Function.java
MD: permet de gérer un ProgressDialog depuis la Toolbox.
MD: mais il y a aussi une embrouille entre une Function qui produit un résultat mais qui est aussi le résultat
http://svn.code.sf.net/p/txm/code/trunk/Toolbox/trunk/org.textometrie.toolbox/src/java/org/txm/objects/TxmObject.java
MD: m'a servi à implémenter la logique de Workspace qui contient des Projets, qui contiennent des Bases qui contiennent des Corpus qui contiennent des Text qui contiennent des Edition qui contiennent des Page. Et de généraliser la sauvegarde et le chargement de tous objets depuis le fichier default.xml qui se trouve dans le dossier "workspaces" du répertoire de travail de TXM (~/TXM)
http://svn.code.sf.net/p/txm/code/trunk/Toolbox/trunk/org.textometrie.toolbox/src/java/org/txm/objects/Result.java
MD: tentative de généralisation d'un résultat TXM qui :

MD: pour conclure, 2 choses à faire
MD: 1) repenser les objets Project, Base, Corpus, Text, Edition et Page et leur sauvegarde
MD: 2) choisir si une Function créé un Result ou si la Function contient un résult ou si la Function est aussi le Result

WIP (Framapad):

Define what is a result, what is an object ans what is a function. Remove and merge useless code.

Define:

  • getName()
  • getSimpleName()
  • getAdvancedName()?
  • getDetails()?
  • toString()
Uses these and which methods to display in these possible locations:
  • Corpora view
    • tree node label (AdapterFactory) (I think this node should be updated when some parameters of the command change, eg. for Wordcloud I did that and display the fmin/vmax in the node : Worcloud (20/200))
    • status bar (when clicking on a node result)
  • Editor
    • tab title
    • tab tool tip
    • chart title
    • chart subtitle
    • add some extra legend in chart with more details?
  • Log
    • console
  • Export
    • prefilled file name when exporting a result (could be the editor tab title, it is not uniformed at this moment)

getAdvancedName() could return a string dedicated to "advanced users" following XML pattern with @ showing what is SU and what is SUP, eg.:

  • partition name: DISCOURS_text@loc

Solution

  • define abstract methods in TXMResult
  • checks that all results extend TXMResult
  • create a class TXMEditorInput that stores the TXMResult object as in the ChartEditorInput (checks and reuse the source code of CustomizableEditor)
  • use one of these methods in TXMEditorPart.init() to set part name with: setPartName(editorInput.getResult().getName())
    • see here if we can use public Object getAdapter(Class adapter) of the editor input to set the title and the icon of the EditorPArt, I tried but didn't manage to do it
  • use one of these methods in the CorporaView click listener to update the status bar (location: org/txm/rcpapplication/views/CorporaView.java)
  • use one of these methods in the export dialog to fill the file name
  • define methods Log.info(TXMResult), severe(TXMResult), etc. that call TXMResult.toString() and use them for logging. This methods should also call the stack to display the method name in log.

History

#1 Updated by Sebastien Jacquot over 2 years ago

  • Description updated (diff)

#2 Updated by Sebastien Jacquot over 2 years ago

  • Description updated (diff)

#3 Updated by Sebastien Jacquot over 2 years ago

  • Description updated (diff)

#4 Updated by Sebastien Jacquot over 2 years ago

  • Description updated (diff)

#5 Updated by Sebastien Jacquot over 2 years ago

  • Description updated (diff)

#6 Updated by Matthieu Decorde over 2 years ago

  • Description updated (diff)

#7 Updated by Sebastien Jacquot over 2 years ago

  • Description updated (diff)

#8 Updated by Matthieu Decorde over 2 years ago

  • Description updated (diff)

#9 Updated by Sebastien Jacquot 11 months ago

  • Status changed from New to In Progress
  • Target version changed from TXM 0.8.0a (split/restructuration) to TXM 0.8.0
  • % Done changed from 0 to 80

A lot of work and modifications has been done about this issue. Need to formalize the new behaviors and hierarchy in the Specs/Wiki.

#10 Updated by Sebastien Jacquot 6 months ago

  • Target version changed from TXM 0.8.0 to TXM 0.8.1

Also available in: Atom PDF