Archi Forum

Archi => General Archi Discussion => Topic started by: jsimoncello on July 27, 2022, 13:41:40 PM

Title: Html reports : excluding views
Post by: jsimoncello on July 27, 2022, 13:41:40 PM
Hi everyone

I have automated the daily generation of an html site with Archi command line BUT I need to filter some views that depict more sensitive or obsolete data
The only solution I have found so far is a (dirty) script which remove all references to these views and objets in the generated html source. I wonder if there is any cleaner solution ?


Regards
Title: Re: Html reports : excluding views
Post by: Phil Beauvoir on July 27, 2022, 13:52:44 PM
Yes, add a property _hide_from_export_ and set its value to true for the view. However, this will only hide it. The html file of the view will still be present in the output folder, but you could delete it manually.
Title: Re: Html reports : excluding views
Post by: jsimoncello on July 27, 2022, 14:18:27 PM
waaaahh nice ! I was hoping there was a hidden property somewhere, thanks !
Title: Re: Html reports : excluding views
Post by: jsimoncello on July 28, 2022, 07:26:58 AM
In case someone has similar needs I share the script which is ran by cron  (Oracle Linux 8.6)



#!/bin/bash
xvfb-run /applis/archi/Archi/Archi -application com.archimatetool.commandline.app -consoleLog -nosplash  --modelrepository.cloneModel https://GIT_URL/PROJECT_NAME/archimate_coop --modelrepository.loadModel /var/tmp/archi/  --modelrepository.userName  USER_LOGIN  --modelrepository.identityFile /applis/archi/archimate_coop/primary_key --modelrepository.passFile /applis/archi/archimate_coop/password.txt   --xmlexchange.export /applis/archi/archimate_coop/export.xml --html.createReport /var/www/html/archi
grep hide-true /var/www/html/archi/*.html | grep -oP 'id-.*html' | xargs rm
sed -i '/hide-true/d' /var/www/html/archi/*.html
sed -r -i -e "s|mode coop</span>|mode coop (generated on $(date))</span>|g" /var/www/html/archi/index.html

Title: Re: Html reports : excluding views
Post by: jsimoncello on July 29, 2022, 10:02:04 AM
same script + remove references to hidden views in Alasql
#!/bin/bash
xvfb-run /applis/archi/Archi/Archi -application com.archimatetool.commandline.app -consoleLog -nosplash  --modelrepository.cloneModel https://GIT_URL/PROJECT_NAME/archimate_coop --modelrepository.loadModel /var/tmp/archi/  --modelrepository.userName  USER_LOGIN  --modelrepository.identityFile /applis/archi/archimate_coop/primary_key --modelrepository.passFile /applis/archi/archimate_coop/password.txt   --xmlexchange.export /applis/archi/archimate_coop/export.xml --html.createReport /var/www/html/archi
grep hide-true /var/www/html/archi/*.html | grep -oP 'id-.*html' | xargs rm

cd /var/www/html/archi
echo "deleting reference to hidden views"
grep hide-true /var/www/html/archi/*.html | grep -oP 'id-.*html' | xargs rm
grep hide-true /var/www/html/archi/*.html | grep -oP 'id-.*html' | awk -F'[/.]' '{print $3}' > tmp.txt
sed -i '/hide-true/d' /var/www/html/archi/*.html
sed -r -i -e "s|mode coop</span>|mode coop (generated on $(date))</span>|g" /var/www/html/archi/index.html
cat tmp.txt | while read line
do
   echo "$line"
   sed -i "/$line/d"  /var/www/html/archi/id-*/elements/model.html
done
rm tmp.txt