Custom Preferences when Generating HTML Report through CLI

Started by Eric Vendeville, April 08, 2025, 12:18:40 PM

Previous topic - Next topic

Eric Vendeville

Hello everyone !

It's been a while since I last posted on this forum !  :)

Today, I need your help because I'm facing a small (but tricky) problem that I don't manage to solve on my own: I don't know if it's a mistake / misuse on my part, or if it's a small "bug" in Archi (or simply something that is not supported yet, and is not intented to be in the future)...

I'll try to explain my use-case:

  • I recently decided to automate the generation of the HTML report from the architecture repository ;
  • To do this, an instance of Archi is installed on a dedicated (remote) server ;
  • On this server, an Azure agent is running Archi.exe through its command line interface (CLI) ;

The command line looks like this:

Archi.exe -consoleLog -console -nosplash -application com.archimatetool.commandline.app --modelrepository.loadModel "path_to_my_model_directory_synced_from_azure_git_repo" -html.createReport "path_to_my_target_html_report_directory"
The problem I'm facing with is the following: the views generated by the "HTML REPORT" plugin when running via the Command Line Interface (CLI) use the default object colors that are provided with the initial Archi installation. However, in the meantime, I've changed the default object colors (via the Edit > Preferences > Appearance > Colors menu), and unfortunately these custom color preferences are currently being ignored.

I don't encounter this problem when I generate the HTML REPORT directly from the application GUI (via the File -> Report -> HTML Menu): my custom default colors are correctly applied to the objects on generated views.

I'm not really sure of what happens, but my understanding of the situation is as follows: when generating the HTML site from the user interface (GUI), the "HTML REPORT" plugin correctly uses the custom default colors as defined in the preferences (maybe these preferences are stored in the my_model.archimate file, and this my_model.archimate file is read and used by the plugin when existing ?). However, when generating the HTML REPORT from the command-line interface (CLI), for a model repository that does not contain any .archimate file on its root directory (only xml files are synced from the Azure git repo, there's no .archimate file on the root directory), the "HTML REPORT" plugin ignores the application's custom preferences (the default objects colors are indeed (logically) not stored in the XML files describing the views, but at the same time, the plugin does not seem to read any custom preferences file that are probably stored somewhere (.prefs, .archimate, or other...).

I don't know if my understanding of the situation is correct (maybe i'm wrong). But in order to solve my problem, I'd like to know if there's a way to make the "HTML REPORT" plugin take custom preferences into account when using it from the command line (maybe by specifying a parameter that i'm not aware of, pointing to the "custom_defaults.prefs" file in the command line, or something equivalent?)

If this isn't possible, is there any workaround that would allow me to achieve this result?

Thank you very much in advance for any answer or help you could provide!

Eric.

(I continue to use Archi as a (almost) daily tool, and I really appreciate it... simple, but yet very powerfull ! Thanks Phil for your hard work, JB for his inspiring posts and wise advices, and the entire community for its kindness) ! :D

Phil Beauvoir

Hi Eric,

I just tested this and it's working OK for me.

It might be that the instance of Archi that you use for the CLI is using a different preference location. If you take a look at the Archi.ini file you'll see this:

-Dosgi.instance.area=@user.home/AppData/Roaming/Archi
And Archi's preferences for custom colours are stored in a file in here:

@user.home/AppData/Roaming/Archi/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.archimatetool.editor.prefs
Regards,

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

Jean-Baptiste Sarrodie

Hi,

Quote from: Eric Vendeville on April 08, 2025, 12:18:40 PMI'd like to know if there's a way to make the "HTML REPORT" plugin take custom preferences into account when using it from the command line (maybe by specifying a parameter that i'm not aware of, pointing to the "custom_defaults.prefs" file in the command line, or something equivalent?)

Yes you can do that. This is explained in the wiki page dedicated to the creation of a "packaged" version of Archi: https://github.com/archimatetool/archi/wiki/How-to-create-a-packaged-version-of-Archi-(including-configuration-and-plugins)#change-default-configuration

Regards,

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

Eric Vendeville

Hi Phil,

Once again, thank you very much for your very quick answer !

I just checked the files you mentioned in my environment...

My Archi.ini file is pointing to the same folder than yours :

-Dosgi.instance.area=@user.home/AppData/Roaming/Archi
...but in this folder, unfortunately I can't find any file named :

@user.home/AppData/Roaming/Archi/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.archimatetool.editor.prefs
Instead, I only found one another file named :

@user.home/AppData/Roaming/Archi/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs
 :'(

In order to give you some additional context (that could eventuellly help you to tell me what I did wrong and/or understand why the file you mentioned is not present), the Archi instance running on the remote server has been installed this way : 

  • I built a packaged version of Archi (following the instructions on the official wiki page) ;
  • In this packaged version of Archi, I tailored a custom_defaults.prefs file and moved it in the ROOT\PKGNAME\ folder (and, of course, I followed all other instructions given in the wiki page...) ;
  • I also created an Archi.ini file and placed it in the ROOT\PKGNAME\ folder (please see its content below) ;
  • Then I shared this "packaged version" of Archi to the team, and also deployed it on the remote server used to automate the HTML REPORT generation ;
  • I also ran Archi.exe once through its GUI (launched the workbench) on the server, in order to "force" Archi to read its Archi.ini file and to "initialize" its environment at first launch (copying files to user.home directory, or stuff like that...) ... (don't know if this step is necessary, but I did it anyway in doubt...) ;
  • Then I tried to generate HTML REPORT through Archi's CLI, facing the problem I mentioned in my previous post...

It seems that the way I did things has not created the necessary com.archimatetool.editor.prefs in the directory you mentioned. I would appreciate if you could tell me what I did wrong  :-[

My Archi.ini file looks like this :

-startup
plugins/org.eclipse.equinox.launcher_1.6.800.v20240513-1750.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.1000.v20240507-1834
-cleanConfig
--launcher.defaultAction
openFile
-showSplash
my-custom-splash.png
-pluginCustomization
custom_defaults.prefs
-eclipse.keyring
@user.home/AppData/Roaming/Archi/secure_storage
-vmargs
-Dosgi.requiredJavaVersion=17
-Dfile.encoding=UTF-8
-Declipse.p2.data.area=@config.dir/p2
-Ddata.location=@user.home/Documents/Archi
--add-modules=ALL-SYSTEM
-Dosgi.instance.area=@user.home/AppData/Roaming/Archi
-Dosgi.configuration.area=@user.home/AppData/Roaming/Archi/config
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=%user.home%/AppData/Roaming/Archi/dropins



Eric Vendeville

Quote from: Jean-Baptiste Sarrodie on April 08, 2025, 13:25:53 PMHi,

Quote from: Eric Vendeville on April 08, 2025, 12:18:40 PMI'd like to know if there's a way to make the "HTML REPORT" plugin take custom preferences into account when using it from the command line (maybe by specifying a parameter that i'm not aware of, pointing to the "custom_defaults.prefs" file in the command line, or something equivalent?)

Yes you can do that. This is explained in the wiki page dedicated to the creation of a "packaged" version of Archi: https://github.com/archimatetool/archi/wiki/How-to-create-a-packaged-version-of-Archi-(including-configuration-and-plugins)#change-default-configuration

Regards,

JB

Hello Jean-Baptiste, thanks for your answer, my post (answering Phil) crossed yours... this is exactly what I did (but maybe I messed-up somewhere..  :'( ;D )

Phil Beauvoir

Hi Eric, what you're doing works my end. The only thing I can think that could go wrong is that "custom_defaults.prefs" is not located in the right place or its contents is incorrect. Can you say where it is located and post the contents of that file?
If you value and use Archi, please consider making a donation.
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Eric Vendeville

Of course I can !

Please find attached to this post, a screenshot of the packaged version of Archi (root folder), and a copy of the custom_defaults.prefs file.

Thank you very much Phil for helping me to investigate this, and sorry to waste your time...  :-[

Phil Beauvoir

It's working for me with your "custom_defaults.prefs" file, when launching Archi and when using the CLI.

Here's my Archi.ini:

-startup
plugins/org.eclipse.equinox.launcher_1.6.800.v20240513-1750.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.1000.v20240507-1834
-cleanConfig
--launcher.defaultAction
openFile
-pluginCustomization
custom_defaults.prefs
-eclipse.keyring
@user.home/AppData/Roaming/Archi/secure_storage
-vmargs
-Dosgi.requiredJavaVersion=17
-Dfile.encoding=UTF-8
-Declipse.p2.data.area=@config.dir/p2
-Ddata.location=@user.home/Documents/Archi
--add-modules=ALL-SYSTEM
-Dosgi.instance.area=@user.home/AppData/Roaming/Archi
-Dosgi.configuration.area=@user.home/AppData/Roaming/Archi/config
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=%user.home%/AppData/Roaming/Archi/dropins

Are you sure that you're seeing these custom settings when launching Archi.exe in the UI and it's the same Archi.exe that's being used in the CLI?
If you value and use Archi, please consider making a donation.
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Eric Vendeville

Quote from: Phil Beauvoir on April 08, 2025, 15:21:41 PMAre you sure that you're seeing these custom settings when launching Archi.exe in the UI and it's the same Archi.exe that's being used in the CLI?

As you made me doubt  ::) , I triple-checked all that you mentioned, and took some screenshots as kind of proofs  ;D  (this issue drives me crazy, I already investigated it for several days with a colleague of mine, before giving up and contacting you today)

Phil Beauvoir

I don't see the Archi.exe and Archi.ini files in the second screenshot? That's not Archi's home directory, but seems to be a mixture of files?
If you value and use Archi, please consider making a donation.
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Eric Vendeville

#10
;D ... you don't see them because I took a screenshot directly from Archi's UI, using the "file -> open" menu item (the modal window that shows up filters on .archimate filetype by default).

My intention doing this, was to show you that the path that shows up is the same than the path you can oberve on the commad line (and that I am working with the same Archi.exe instance on both case : GUI and CLI)...

To reassure you, please find attached to this post another screenshot taken outside of archi, from windows explorer... all needed files are where they should be !

Phil Beauvoir

I think you need to start from a simple case that works and then figure out from that what's not working.

1. Get a fresh copy of Archi 5.5 portable zip
2. Unzip it somewhere
3. Edit the Archi.ini file and add the "-pluginCustomization custom_defaults.prefs" lines
4. Copy the "custom_defaults.prefs" file alongside Archi.exe
5. Make a copy of Archi's data folder (whatever @user.home/AppData/Roaming/Archi references) or rename it so it's empty

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

Eric Vendeville

You're probably right (I already tested the "delete all / re-install all" approach, but I will try once again, going step-by-step this time, as you recommend).

I test and I tell you... thanks for the help !

 

Eric Vendeville

#13
Re Phil,

I followed your instructions, and (unfortunately) that still doesn't work  :'(

Here is exactly what I did, step-by-step :

1. deleted      :   Folder "E:\sysapp\Archi"
2. deleted      :   Folder "C:\Users\T003277\AppData\Roaming\Archi"
3. unzipped   :   Archive "Archi-Win64-5.5.0.zip" to Folder "E:\sysapp\"
4. edited         :   File "Archi.ini" to add following line : "-pluginCustomization custom_defaults.prefs"
5. copied         :   File "custom_defaults.prefs" to Folder "E:\sysapp\Archi"
6. launched   :   Executable "E:\sysapp\Archi.exe"
7. checked      :   Custom preferences visible in Archi's UI at first launch ? OK
8. checked      :   Presence of File "com.archimatetool.editor.prefs" in Folder "@user.home/AppData/Roaming/Archi/.metadata/.plugins/org.eclipse.core.runtime/.settings/" ? KO : no such file, nor directory ! (the file has not been generated at first launch of Archi)

I attached below, once again (but they didn't change since our previous discussion) my Archi.ini file, my custom_defaults.prefs, and a screenshot that shows what has been created/populated in my user.home directory after first launch of Archi...

Phil Beauvoir

#14
Please copy and paste your command line here as text. From the screenshot in your earlier post I see "-html.createReport" with one leading hyphen instead of two, it should be "--html.createReport"

Edit: ignore that, it doesn't make any difference.
If you value and use Archi, please consider making a donation.
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.