Archi Forum

Archi Plug-ins => Other Plug-ins => Topic started by: vladeki on April 03, 2019, 15:21:49 PM

Title: Driving the Database plugin from console?
Post by: vladeki on April 03, 2019, 15:21:49 PM
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?
Title: Re: Driving the Database plugin from console?
Post by: Hervé on April 03, 2019, 21:44:06 PM
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 (https://github.com/archi-contribs/script-plugin)

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

Best regards
Hervé
Title: Re: Driving the Database plugin from console?
Post by: 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é
Title: Re: Driving the Database plugin from console?
Post by: Phil Beauvoir on April 03, 2019, 21:56:42 PM
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.
Title: Re: Driving the Database plugin from console?
Post by: vladeki on April 03, 2019, 23:22:07 PM
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é.
Title: Re: Driving the Database plugin from console?
Post by: Martine on June 21, 2023, 17:02:11 PM
Hello!
I'm digging up this very old topic but has anyone found a solution to automate the export to a database?
Martine
Title: Re: Driving the Database plugin from console?
Post by: Hervé on July 07, 2023, 11:27:08 AM
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é
Title: Re: Driving the Database plugin from console?
Post by: Martine on July 20, 2023, 13:49:40 PM
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
Title: Re: Driving the Database plugin from console?
Post by: Martine on July 20, 2023, 16:54:38 PM
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


Title: Re: Driving the Database plugin from console?
Post by: Martine on July 21, 2023, 09:47:19 AM
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
Title: Re: Driving the Database plugin from console?
Post by: Phil Beauvoir on July 21, 2023, 10:45:03 AM
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
Title: Re: Driving the Database plugin from console?
Post by: Martine on July 21, 2023, 13:05:18 PM
Hi Phil,
Sure, I'll do that, thanks!
Regards
Martine