Driving the Database plugin from console?

Started by vladeki, April 03, 2019, 15:21:49 PM

Previous topic - Next topic

vladeki

Hello, Archi forum!

First of all, thank you for the tool. It works and accomplishes exactly what my organization needs.

I was able to automate remote model retrieval and the HTML dump through the terminal, but I'm stuck trying to automate export into a SQLite database. Are there any command line controls for the DB plugin, like there are for the Collaboration plugin?

Hervé

Hi,

In fact, the database plugin is not developed by the core Archi team, and therefore is not known by the core of Archi.

That's the reason why I created the script plugin that is quite very limited but allows to automate a model loading and saving from a file or a database: https://github.com/archi-contribs/script-plugin

Please do not hesitate should you need help using this plugin.

Best regards
Hervé

Hervé

Just thinking ...

I should be possible to reference org.archicontribs.database classes and methods from jArchi, and jArchi can be piloted using the command line ... I'll try to try it this way and let you know if I succeed :-)

Best regards
Hervé

Phil Beauvoir

Or you could write an Archi CLI extension plug-in. Take a look at the existing ones.

https://github.com/archimatetool/archi-modelrepository-plugin/tree/master/org.archicontribs.modelrepository.commandline

Extend AbstractCommandLineProvider class and implement:

void run(CommandLine commandLine);

Options getOptions();

int getPriority();

And then just call your code.
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

vladeki

Quote from: Hervé on April 03, 2019, 21:47:43 PM
Just thinking ...

I should be possible to reference org.archicontribs.database classes and methods from jArchi, and jArchi can be piloted using the command line ... I'll try to try it this way and let you know if I succeed :-)

Best regards
Hervé

I've been considering something like this, however, I'd really need to catch up on my Java.

For now, I've decided that xdotool would suffice as far as pushing the right buttons goes. I'll take a closer look at a proper implementation as mentioned above by Hervé.

Martine

Hello!
I'm digging up this very old topic but has anyone found a solution to automate the export to a database?
Martine

Hervé

Hi Martine,

The latest version can be console piloted. I still need to update the documentation (on Github's wiki and inside the plugin).

More help on:
Archi -application com.archimatetool.commandline.app -consolelog -nosplash -h -p

As an example, the import command is:
Archi [-consoleLog] -application com.archimatetool.commandline.app -consolelog -nosplash --import.database "database name" --import.model.name "model name" [--import.model.version "model version"]

Best regards
Hervé

Martine

Great!!
Thank you very much Hervé, for your reply and for the release :-)
I'm going to look at this with the greatest interest!
Regards,
Martine

Martine

Hello Hervé,
My environment is Windows / SQLServer
I wrote a .bat file but when I run it I get errors (see attachments please), do you see what is happening?

My command line is like :

Archi -application com.archimatetool.commandline.app -consoleLog -nosplash --modelrepository.cloneModel "https://dev.azure.com/xxxxxxxx" --modelrepository.loadModel "myRep" --modelrepository.userName "myUser" --modelrepository.passFile "MyPassFile" --export.database "Database name in the plugin" --export.model.name "MyModelName"
timeout /t 10



Martine

Hello.
What seems curious to me is that the error message speaks of import while I am doing an export...
Moreover, the export command does not seem to need the name of the model unlike the import (I do not see the option in the online help), is this normal?
Martine

Phil Beauvoir

Hi Martine,

it might be better to report the issue on the plug-in's issue tracker - https://github.com/archi-contribs/database-plugin/issues

Phil
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Martine

Hi Phil,
Sure, I'll do that, thanks!
Regards
Martine