Html reports : excluding views

Started by jsimoncello, July 27, 2022, 13:41:40 PM

Previous topic - Next topic

jsimoncello

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

Phil Beauvoir

#1
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.
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

jsimoncello

waaaahh nice ! I was hoping there was a hidden property somewhere, thanks !

jsimoncello

In case someone has similar needs I share the script which is ran by cron  (Oracle Linux 8.6)
  • First I get the model from Git, generate an open exchange file (I use it as datasource to expose model data as API REST), and generate the html site.
  • Then I remove all pages that which are tagged with the "hide-true"  style
  • then delete the links in the html file.
  • Finally, I add the current date in the index.html so that web users knows if the data are up to date.



#!/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


jsimoncello

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