Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to Command Line Interface #333

Closed
Michael4713 opened this issue Dec 19, 2017 · 137 comments
Closed

Improvements to Command Line Interface #333

Michael4713 opened this issue Dec 19, 2017 · 137 comments

Comments

@Michael4713
Copy link

Version of Archi, Operating System

4.1.2 on Windows

Expected Behaviour

When implementing an ICommandLineProvider, it should be possible to set an EXIT status.

Actual Behaviour

Currently the Exit Status is hard coded to "EXIT_OK". The ICommandLineProvider should be extended with a default method (e.g. int getExitStatus()), that can be overriden, to allow also that System.exit(-1) can be handed back to the calling command line party.

@Phillipus
Copy link
Member

How would this work for more than one ICommandLineProvider? As it is, the CentralScrutinizer class calls each one in turn and then returns a single EXIT_OK

@Michael4713
Copy link
Author

In my opinion, an additional parameter for the CentralScrutinizer would be the solution:

continueAtFailure, indicates if processing should continue in case one command line processor fails. Normally the chain would stop if one processor cannot successfully finish his work.

Currently my problem is the following: I run Archi in batch mode to insert models into a Neo4j database via an ICommandLineProvider plugin. In case an insert fails there is currently only log file reading for me to determine what went wrong, but no upfront indication.

@Phillipus
Copy link
Member

I like the idea, I just want to think about the best way to do this.

  • The CentralScrutinizer's start() method has to exit with EXIT_OK because the other options of EXIT_RESTART, EXIT_RELAUNCH and EXIT_ASYNC_RESULT make no sense here
  • Could this be achieved by the ICommandLineProvider throwing an exception?

@Phillipus
Copy link
Member

Phillipus commented Dec 19, 2017

Could this be achieved by the ICommandLineProvider throwing an exception?

The CentralScrutinizer could catch all exceptions thrown by each ICommandLineProvider and if continueAtFailure is false then exit.

@Phillipus
Copy link
Member

Maybe no need for "continueAtFailure". If something like an "AbortCommandException" is thrown then exit.

@Phillipus
Copy link
Member

The CentralScrutinizer's start() method has to exit with EXIT_OK because the other options of EXIT_RESTART, EXIT_RELAUNCH and EXIT_ASYNC_RESULT make no sense here

Actually the documentation for start() says:

"Applications can return any object they like. If an Integer is returned it is treated as the program exit code if Eclipse is exiting."

So, yes that is possible.

@Michael4713
Copy link
Author

Michael4713 commented Dec 20, 2017

Currently I see two issues:

  • In case of an AbortCommandException the Plugin programmer needs to know or guess if the guy that executes my program wants to do in case of an Exception. This might cause a problem in cases where you want to chain plugins or execute multiple plugins on one model.
  • Currently there are no means to force an order in the plugin execution (to my knowledge). Maybe an additional (optional) priority function like int getPriority() in ICommandLineProvider that returns a "developer" given priority number could solve that one, so at least you have some sort of fixed order in which the plugins get executed (but this is maybe a different issue)

For now I think the exception is a good thing, which will fix my issue without making a breaking code change for existing plugins (as long as AbortCommandException is a runtime exception).

@Phillipus
Copy link
Member

Phillipus commented Dec 20, 2017

as long as AbortCommandException is a runtime exception

Why? I was thinking of:

       for(ICommandLineProvider provider : providers) {
            try {
                provider.run(args);
            }
            catch(AbortCommandException ex) {
                if(abortFlag) {
                    return -1;
                }
            }
        }

@Phillipus
Copy link
Member

Currently there are no means to force an order in the plugin execution

I agree. I had thought about this and wondered about some kind of chaining mechanism rather than a priority-based approach.

@Michael4713
Copy link
Author

Jep you are totally right, I missed the throws Exception stuff on in the run method.
But I thought you don't want extra command line switches for the CentralScrutinizer class. In this case I would simply catch all Exceptions, because wouldn't Eclipse abort in case of an uncatched exception anyway?

@Phillipus
Copy link
Member

Yes, that's true. I put the "abortFlag" there as an example of usage if there was one.

I think an Exception is a good idea, but not sure whether all outstanding command providers should be aborted if it is thrown. Why should a plug-in make that decision. The user should make that decision, so maybe the "abortFlag" is necessary.

@Michael4713
Copy link
Author

That was my thought as well.

@Phillipus
Copy link
Member

Actually a plugin might throw any exception depending on what it does. At the moment this is thrown onward to the start() method. Should it be the responsibility of the plugin designer to wrap their exceptions in an AbortCommandException or even care about that? Maybe we don't need a special excpetion?

@Michael4713
Copy link
Author

Regarding the sorting/priority issue: Maybe it is a good idea to let the developer give the plugin an initial priority (so you have some kind of order), that can be overridden by an optional property file in the Archi directory.

So if you want one plugin to go first, but do not care about the rest, you could just put in that plugin's Id in the file.

  • Lets say you have a default function in ICommandLineProvider, that outputs 0 and by which you sort the providers.
  • I (the plugin developer) override it, because I feel my plugin is super important with 1000.
  • The user thinks my choice is crap and creates a property file (e.g. plugin_priorities.properties) and enters com.someone.someplugin = 1.

@Michael4713
Copy link
Author

One other request. Could you take the "helper functions" from HTMLReportCommandLine.java into the CommandLineUtils along the way? They are probably needed by any plugin developer.

- private Map<String, String> parseArgs(String[] args)
- private void logMessage(String message)
- private void logError(String message)

:-)

@Phillipus
Copy link
Member

The least intrusive solution would be an optional -abortOnException flag:

        for(ICommandLineProvider provider : providers) {
            try {
                provider.run(args);
            }
            catch(Exception ex) {
                if(abortOnException) {
                    return -1;
                }
                else {
                    System.err.println(ex);
                }
            }
        }

@Michael4713
Copy link
Author

Sounds good (don't have a "thumbs up" here it seems)

@Michael4713
Copy link
Author

Ahhh. I think I have just been outed as a Github Forum Neeby :-)

@Phillipus
Copy link
Member

Phillipus commented Dec 20, 2017

  • private Map<String, String> parseArgs(String[] args)

Not sure how to make that generic. It requires that args come in pairs. Some args might be single.

@Michael4713
Copy link
Author

I would propose:
Map<String, String> parseArgs(String[] args, List<String> commandLineNames)
I would only try to find those names in the list and if one is without a value, I would return null as the value string.

@Phillipus
Copy link
Member

Phillipus commented Dec 20, 2017

Some ideas:

  • An AbstractCommandLineProvider might be useful for things like the log() methods
  • A -help switch to return help text, each provider can supply that
  • The parsing of args could be done by the CentralScrutinizer once and the appropriate args passed to each provider.
  • Should a provider be interested in all args? If so they can call Platform.getApplicationArgs();
  • Some options and information for the provider could be added to the plugin.xml declaration - help text, priority, prefix for output log, args that it is interested in (your idea is better)

@Phillipus
Copy link
Member

Apache Commons CLI might be useful:

https://commons.apache.org/proper/commons-cli/index.html

@Phillipus Phillipus changed the title Return Code for Command Line Interface Improvements to Command Line Interface Dec 20, 2017
@Phillipus
Copy link
Member

Changed title of this issue so we can cover many things.

I think we have to accept that we will break the current API. But it will be worth it,

@Michael4713
Copy link
Author

I also had Apache CLI is a good idea.

@Michael4713
Copy link
Author

I would propose to keep the exsting API functioning if possible and to extend it. I would rather deprecate methods than make a hard break. You could create the AbstractCommandLineProvider implements ICommandLineProvider to have backward compatibility.

@Michael4713
Copy link
Author

  • An AbstractCommandLineProvider might be useful for things like the log() methods
    can be made as a compatible change

  • A -help switch to return help text, each provider can supply that
    can be made as a compatible change. I would split it in two commands:
    -help provides a list of available command line plugins with some basic info
    help <plugin_name> provides detailed information about the plugin including usage

  • The parsing of args could be done by the CentralScrutinizer once and the appropriate args passed to each provider.
    that is a hard one. I would still opt for the "helper" method to convert the arguments into a map.

  • Should a provider be interested in all args? If so they can call Platform.getApplicationArgs();
    I would think this is a very special case and would not invest extra time in this one

  • Some options and information for the provider could be added to the plugin.xml declaration - help text, priority, prefix for output log, args that it is interested in
    Yep, totally agree. It would be good to have the following informations:
    Plugin (unique) name and version as part of the help text
    Short description (for the help text)
    Usage information with parameter description

@Phillipus
Copy link
Member

Good ideas.

I will create a branch "CLI" here in GitHub and push some experiments. Apache CLI will solve a lot of problems.

@jbsarrodie
Copy link
Member

Hi guys,

I have one remark regarding the ordering. Why not just use the (JS embedded) script engine so that the command line usage is basically mono-function and one new function being to run a script in which you functions are exposed.

@Phillipus this would be in line with the basic idea of an extendable API for Archi that is usable both from CLI and scripts.

@Phillipus
Copy link
Member

@jbsarrodie Interesting idea. That could be another way to do it. For now, I'm going to improve what we have using Apache CLI. That's an easy win. ;-)

@Phillipus
Copy link
Member

[Load Empty Model] Load Empty Model
[Load Model] Load Model from File

These could be combined into one? If path is present load it, otherwise empty?

@jbsarrodie
Copy link
Member

These could be combined into one? If path is present load it, otherwise empty?

I don't think so. I think that they are mutualy exclusive. In addition I would rename loadEmptyModel to createNewModel with an optional argument for the .architemplate to use. But is it possible to have an optional argument ?

New options:

For the sake of harmonization I would make all options long ones with "--". In addition, "createHTMLReport" being included in Archi by default I don't know if it makes sens to prefix it with "reports".

@Phillipus
Copy link
Member

Phillipus commented Dec 24, 2017

In addition I would rename loadEmptyModel to createNewModel with an optional argument for the .architemplate to use. But is it possible to have an optional argument ?

Done. Yes.

New output:

usage: Archi -application com.archimatetool.commandline.app -consoleLog -nosplash [options...]

Common options:
---------------
 -a,--abortOnException          If present all further command line providers will not run when an exception is thrown
 -h,--help                      Show this help

Registered plugins:
-------------------
[Create Empty Model] Create an empty model from optional template
[Load Model] Load Model from File
[Clone/Load Model] Load and Clone model from repository
[HTML Reports] Generate a HTML Report from a model file

Options:
----------
    --createEmptyModel <"*.architemplate file">          Create an empty model <optional template>
    --loadModel <*.archimate file>          Load a model at given file path.
    --modelrepository.cloneModel <url>             Clone a model from <url>
    --modelrepository.loadModel <path>             Load a model from the repository folder <path>
    --modelrepository.password <password>          Repository password
    --modelrepository.userName <userName>          Repository user name
    --createHTMLReport <path>          Create a HTML Report from the current model to folder in <path>

@Phillipus
Copy link
Member

--saveModel <path> added

@Phillipus
Copy link
Member

Is-it clearer?

I love that diagram in #333 (comment)

We need to agree on what we have now before I add any more CLI providers.

@Phillipus
Copy link
Member

"CLI" branch commits squashed and rebased onto latest master.

Added Export and Import CSV.

Import from CSV has a lot of options, feel free to suggest different naming convention:

usage: Archi -application com.archimatetool.commandline.app -consoleLog -nosplash [options...]

Common options:
---------------
 -a,--abortOnException          If present all further command line providers will not run when an exception is thrown
 -h,--help                      Show this help

Registered plugins:
-------------------
 [Create Empty Model] Create an empty model from optional template
 [Clone/Load Model] Load and Clone model from repository
 [Load Model] Load Model from File
 [Import from CSV] Import from CSV to current model
 [HTML Reports] Generate a HTML Report from a model file
 [Export to CSV] Export to CSV file format
 [Save Model] Save Model to File

Options:
----------
   --createEmptyModel <*.architemplate file>          Create an empty model <optional template>
   --modelrepository.cloneModel <url>             Clone a model from <url>
   --modelrepository.loadModel <path>             Load a model from the repository folder <path>
   --modelrepository.password <password>          Repository password
   --modelrepository.userName <userName>          Repository user name
   --loadModel <*.archimate file>          Load a model at given file path.
   --importFromCSV <elements.csv file>          Import into the current model in CSV format from <file>
   --createHTMLReport <path>          Create a HTML Report from the current model to folder in <path>
   --csv.delimiter <delimiter>            Delimiter to use for CSV - ",", ";" or "\t"
   --csv.encoding <encoding>              CSV Encoding - "UTF-8", "UTF-8 BOM" or "ANSI"
   --csv.filenamePrefix <prefix>          Prefix for file names
   --csv.leadingZeros                     Use Excel leading zeros/spaces workaround
   --csv.stripNewLines                    Strip newline characters
   --exportToCSV <path>                   Export the current model in CSV format to <path>
   --saveModel <*.archimate file>          Save a model to given file path.

@jbsarrodie
Copy link
Member

This seems really good !

feel free to suggest different naming convention

My sole remark would be that dot should be used only for namespace, so:

  • Either we consider that using a namespace for CSV plugin makes sens (even if included by default with Archi) and we use it for every options: --importFromCSV becomes --csv.import, and --exportToCSV becomes --csv.export
  • Or we don't use a namespace so:
    • --csv.delimiter becomes --CSVDelimiter
    • --csv.encoding becomes --CSVEncoding
    • --csv.filenamePrefix becomes --CSVPrefix
    • --csv.leadingZeros becomes --CSVLeandingZero
    • --csv.stripNewLines becomes --CSVStripNewLines

I don't know why but IMO first option (use csv namespace) seems better (less weird)

@Phillipus
Copy link
Member

I don't know why but IMO first option (use csv namespace) seems better (less weird)

I agree.

BTW - just because I'm a saddo doing this on Boxing Day doesn't meant you have to! Get back to your vacation! ;-)

@Phillipus
Copy link
Member

Phillipus commented Dec 26, 2017

I tried it and the csv.* options all got mixed up and not clear whether they belonged to import or export. So maybe to make it clearer use csv.export.*:

   --createEmptyModel <*.architemplate file>          Create an empty model <optional template>
   --modelrepository.cloneModel <url>             Clone a model from <url>
   --modelrepository.loadModel <path>             Load a model from the repository folder <path>
   --modelrepository.password <password>          Repository password
   --modelrepository.userName <userName>          Repository user name
   --loadModel <*.archimate file>          Load a model at given file path.
   --csv.import <elements.csv file>          Import into the current model in CSV format from <file>
   --createHTMLReport <path>          Create a HTML Report from the current model to folder in <path>
   --csv.export <path>                           Export the current model in CSV format to <path>
   --csv.export.delimiter <delimiter>            Delimiter to use for CSV - ",", ";" or "\t"
   --csv.export.encoding <encoding>              CSV Encoding - "UTF-8", "UTF-8 BOM" or "ANSI"
   --csv.export.filenamePrefix <prefix>          Prefix for file names
   --csv.export.leadingZeros                     Use Excel leading zeros/spaces workaround
   --csv.export.stripNewLines                    Strip newline characters
   --saveModel <*.archimate file>          Save a model to given file path.
``

@jbsarrodie
Copy link
Member

jbsarrodie commented Dec 26, 2017

So maybe to make it clearer use csv.export.*

Prefixing using export is OK but this shouldn't be another namespace. Why not just --csv.exportDelimiter, --csv.exportEncoding, --csv.exportFilenamePrefix, --csv.exportLeadingZeros and --csv.exportSTripNewLines ?

@Phillipus
Copy link
Member

Yep. Better idea.

Pushed.

@Phillipus
Copy link
Member

Phillipus commented Dec 27, 2017

Regarding export to Jasper - this one has many options:

Path to output
Template path (if not set maybe use the default customisable one?)
Locale
PDF Format
HTML Format
RDF Format
DOCX Format
PPT Format
ODT Format

Suggestions?

--createJasperReport "/path" --jasperTemplate "/path" --jasperLocale "fr_FR" --jasperPDF --jasperHTML --jasperRDF

Or for all the formats in one option, maybe something like --jasperFormat "PDF HTML RDF"?

@jbsarrodie
Copy link
Member

Or for all the formats in one option, maybe something like --jasperFormat "PDF HTML RDF"?

It seems we can set valueSeparator (the character value used to split the argument string, that is used in conjunction with multipleArgs e.g. if the separator is ',' and the argument string is 'a,b,c' then there are three argument values, 'a', 'b' and 'c'.) to any character. I would suggest "," for that so this would become --jasperFormat PDF,HTML,RDF.

In this case I also think using namespace might be more appropriated:

  • --jasper.createReport
  • --jasper.template (optional, defaults to customizable report)
  • --jasper.locale (optional, defaults to system locale)
  • --jasper.format (I'd suggest to make it optional and default to PDF, a little bit opiniated but seems to be the most frequent use case)

@Phillipus
Copy link
Member

Jasper Reports added.

usage: Archi -application com.archimatetool.commandline.app -consoleLog -nosplash [options...]

Common options:
---------------
 -a,--abortOnException          If present all further command line providers will not run when an exception is thrown
 -h,--help                      Show this help

Registered plugins:
-------------------
 [Create Empty Model] Create an empty model from optional template
 [Clone/Load Model] Load and Clone model from repository
 [Load Model] Load Model from File
 [Import from CSV] Import from CSV to current model
 [HTML Reports] Generate a HTML Report from a model file
 [Export to CSV] Export to CSV file format
 [Jasper Reports] Generate a Jasper Report from a model file
 [Save Model] Save Model to File

Options:
----------
   --createEmptyModel <*.architemplate file>          Create an empty model <optional template>
   --createHTMLReport <path>                          Create a HTML Report from the current model to folder in <path>
   --csv.export <path>                                Export the current model in CSV format to <path>
   --csv.exportDelimiter <delimiter>                  Delimiter to use for CSV - ",", ";" or "\t" (optional, default is ",")
   --csv.exportEncoding <encoding>                    CSV Encoding - "UTF-8", "UTF-8 BOM" or "ANSI" (optional, default is "UTF-8",)
   --csv.exportFilenamePrefix <prefix>                Prefix for file names (optional)
   --csv.exportLeadingZeros                           Use Excel leading zeros/spaces workaround (optional)
   --csv.exportStripNewLines                          Strip newline characters (optional)
   --csv.import <elements.csv file>                   Import into the current model in CSV format from <file>
   --jasper.createReport <path>                       Create Jasper Reports from the current model to folder in <path>
   --jasper.filename <name>                           File name to use for reports
   --jasper.format <format>                           Comma separated output formats - PDF,HTML,RTF,PPT,ODT,DOCX (optional, default is PDF)
   --jasper.locale <locale>                           Locale in en_GB format (optional, default is system locale)
   --jasper.template <main.jrxml>                     Full path to the main.jrxml template file (optional, default is Customisable Report)
   --jasper.title <title>                             Title of report
   --loadModel <*.archimate file>                     Load a model at given file path.
   --modelrepository.cloneModel <url>                 Clone a model from <url>
   --modelrepository.loadModel <path>                 Load a model from the repository folder <path>
   --modelrepository.password <password>              Repository password
   --modelrepository.userName <userName>              Repository user name
   --saveModel <*.archimate file>                     Save a model to given file path.

@Phillipus
Copy link
Member

Open Exchange Format Import/Export done

usage: Archi -application com.archimatetool.commandline.app -consoleLog -nosplash [options...]

Common options:
---------------
 -a,--abortOnException          If present all further command line providers will not run when an exception is thrown
 -h,--help                      Show this help

Registered plugins:
-------------------
 [Create Empty Model] Create an empty model from optional template
 [Clone/Load Model] Load and Clone model from repository
 [Load Model] Load Model from File
 [Import from CSV] Import from CSV to current model
 [Import from Open XML format] Import from Open XML format
 [HTML Reports] Generate a HTML Report from a model file
 [Export to CSV] Export to CSV file format
 [Jasper Reports] Generate a Jasper Report from a model file
 [Export to Open XML format] Export to Open XML format
 [Save Model] Save Model to File

Options:
----------
   --createEmptyModel <*.architemplate file>          Create an empty model <optional template>
   --createHTMLReport <path>                          Create a HTML Report from the current model to folder in <path>
   --csv.export <path>                                Export the current model in CSV format to <path>
   --csv.exportDelimiter <delimiter>                  Delimiter to use for CSV - ",", ";" or "\t" (optional, default is ",")
   --csv.exportEncoding <encoding>                    CSV Encoding - "UTF-8", "UTF-8 BOM" or "ANSI" (optional, default is "UTF-8",)
   --csv.exportFilenamePrefix <prefix>                Prefix for file names (optional)
   --csv.exportLeadingZeros                           Use Excel leading zeros/spaces workaround (optional)
   --csv.exportStripNewLines                          Strip newline characters (optional)
   --csv.import <elements.csv file>                   Import into the current model in CSV format from <file>
   --jasper.createReport <path>                       Create Jasper Reports from the current model to folder in <path>
   --jasper.filename <name>                           File name to use for reports
   --jasper.format <format>                           Comma separated output formats - PDF,HTML,RTF,PPT,ODT,DOCX (optional, default is PDF)
   --jasper.locale <locale>                           Locale in en_GB format (optional, default is system locale)
   --jasper.template <main.jrxml>                     Full path to the main.jrxml template file (optional, default is Customisable Report)
   --jasper.title <title>                             Title of report
   --loadModel <*.archimate file>                     Load a model at given file path.
   --modelrepository.cloneModel <url>                 Clone a model from <url>
   --modelrepository.loadModel <path>                 Load a model from the repository folder <path>
   --modelrepository.password <password>              Repository password
   --modelrepository.userName <userName>              Repository user name
   --saveModel <*.archimate file>                     Save a model to given file path.
   --xmlexchange.export <path>                        Export the current model in Open Exchange XML format to <path>
   --xmlexchange.exportFolders                        Specifies that folder structure should be exported as an organization structure
   --xmlexchange.exportLang <lang>                    Two letter language code for export. Example - en, fr, de
   --xmlexchange.import <*.xml file>                  Import XML Exchange from <file> and set to current model

@jbsarrodie
Copy link
Member

Wooo ! Seems really nice... and powerful !

@Phillipus
Copy link
Member

Now let's agree on option names and descriptions and I'll create a beta build and get some feedback via the Archi forum. (String externalisation in the code will wait until this is agreed)

@Phillipus
Copy link
Member

Improved descriptions:

usage: Archi -application com.archimatetool.commandline.app -consoleLog -nosplash [options...]

Common options:
---------------
 -a,--abortOnException          If present all further command line providers will not run when an exception is thrown
 -h,--help                      Show this help

Registered providers:
---------------------
 [Create Empty Model] Create an empty model and set to the current model (from optional template)
 [Load & Clone Collaboration Model] Load and/or clone from a local or online collaboration repository and set to the current model
 [Load Model] Load a model from file and set to the current model
 [Import from CSV] Import data from CSV into the current model
 [Import from Open Exchange XML format] Import from an Open Exchange XML format file and set to the current model
 [HTML Reports] Generate a HTML report from the current model
 [Export to CSV] Export the current model to CSV file format
 [Jasper Reports] Generate Jasper Reports from the current model
 [Export to Open Exchange XML format] Export the current model to the Open Exchange XML file format
 [Save Model] Save the current model to file

Options:
--------
   --createEmptyModel <*.architemplate file>          Create an empty model and set to the current model. If <*.architemplate file> is set,
                                                      this will be used as the model's template.
   --createHTMLReport <path>                          Create a HTML Report from the current model to the folder set at <path>.
   --csv.export <path>                                Export the current model in CSV format to the given path.
   --csv.exportDelimiter <delimiter>                  Delimiter to use for CSV export. One of "," ";" or "\t" (optional, default is ",")
   --csv.exportEncoding <encoding>                    Encoding to use for CSV export. One of "UTF-8", "UTF-8 BOM" or "ANSI" (optional,
                                                      default is "UTF-8",)
   --csv.exportFilenamePrefix <prefix>                Prefix for file names to use for CSV export (optional).
   --csv.exportLeadingZeros                           Use Excel leading zeros/spaces workaround for CSV export (optional).
   --csv.exportStripNewLines                          Strip newline characters for CSV export (optional).
   --csv.import <elements.csv file>                   Import into the current model in CSV format from the supplied elements.csv file.
   --jasper.createReport <path>                       Create Jasper Reports from the current model to the folder set at <path>.
   --jasper.filename <name>                           File name to use for Jasper Reports (required).
   --jasper.format <format>                           List of comma separated output formats for Jasper Reports. Any of
                                                      PDF,HTML,RTF,PPT,ODT,DOCX (optional, default is PDF).
   --jasper.locale <locale>                           Locale for Jasper Reports in "en_GB" format (optional, default is the current system
                                                      locale).
   --jasper.template <main.jrxml>                     Full path to the main.jrxml Jasper Reports template file (optional, default is
                                                      Customisable Report).
   --jasper.title <title>                             Title of Jasper Reports (required).
   --loadModel <*.archimate file>                     Load a *.archimate model from file and set to the current model.
   --modelrepository.cloneModel <url>                 Clone a collaboration model from <url> to the <path> set in option
                                                      --modelrepository.loadModel (optional).
   --modelrepository.loadModel <path>                 Load a collaboration model from the given repository folder at <path> (required if
                                                      option --modelrepository.cloneModel) is used).
   --modelrepository.password <password>              Online repository login password (required if option --modelrepository.cloneModel) is
                                                      used).
   --modelrepository.userName <userName>              Online repository login user name (required if option --modelrepository.cloneModel) is
                                                      used).
   --saveModel <*.archimate file>                     Save the current model to a *.archimate file.
   --xmlexchange.export <path>                        Export the current model in Open Exchange XML format to <path>.
   --xmlexchange.exportFolders                        If set the model's folder structure will be exported as an <organization> structure
                                                      (optional).
   --xmlexchange.exportLang <lang>                    Two letter language code for export. Example - en, fr, de (optional).
   --xmlexchange.import <*.xml file>                  Import an XML Open Exchange file and set to the current model.

@Phillipus
Copy link
Member

I've made a new beta build with this in:

https://www.archimatetool.com/dev/beta

@Phillipus
Copy link
Member

The odd one out to me is:

--createHTMLReport

Maybe it should be:

--reports.createReport

?

@jbsarrodie
Copy link
Member

(required if option --modelrepository.cloneModel) is used).

There's an unwanted closing parenthesis after cloneModel (same for every occurence of this sentense).

In addition, when something is optional I would make the default option/value explicit everywhere (in csv and xmlexchange)

The odd one out to me is:

I see several issues:

  • the plugin name (reports) is no more really accurate. htmlexport would be better IMHO.
  • for the moment there's no need for multiple options (but will at some point when users will be able to define their own export templates and thus will have to choose the one to use)

Maybe --createHTMLreport is ok now but will have to be changed in the future (FYI I'm working on a fully redesigned HTML export template based on modern web technologies -vue.js and Quasar framework- that will include query and dataviz)

@Phillipus
Copy link
Member

Phillipus commented Dec 28, 2017

Corrections pushed.

Regarding --createHTMLreport - if you are working on a new template (cool!) then maybe we do need a nice prefix now so we don't have to change again in the future. Maybe something that aligns with --jasper.createReport? Like --html.createReport?

@Phillipus
Copy link
Member

FYI I'm working on a fully redesigned HTML export template based on modern web technologies -vue.js and Quasar framework- that will include query and dataviz

You could build a whole app with that!

@jbsarrodie
Copy link
Member

You could build a whole app with that!

Yes, that's also part of the idea. In short: html export would "dump" model (including folders and views) in an asql database and export each views to images. The "report app" (what I call Archi Web Client) would then allow to:

  • show views and concepts properties
  • navigate through the model concepts in a tabular way (select a type of object, add filters, add "property" columns...)
  • do some SQL and graph based queries (thanks to alasql)
  • do some dataviz. First using a rawgraphs instance opened in an iFrame. Then maybre create a rawgraphs clone using vuejs

The next step would be to make this app aware of GitHub/BitBucket/GitLab.... API to add enhanced features for those using the collaboration plugin:

  • add/show comments (ie. issues)
  • show old version of views (simply load old images in a carousel)
  • manage repositories...

@Phillipus
Copy link
Member

I've opened this up for public testing and feedback:

http://forum.archimatetool.com/index.php?topic=474.0

@Phillipus
Copy link
Member

@Michael4713 Did you test this version? Does it fulfil requirements?

@Michael4713
Copy link
Author

Yep, from my current status this looks very good. Currently all my wishes are fullfilled :-)

@Phillipus Phillipus moved this from In progress to Done in Archi 4.2 Release Jan 30, 2018
@Phillipus
Copy link
Member

Released in 4.2. If any changes/additions are needed please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

4 participants