---
tags : Exist, Insee, Worshop
robots : noindex, nofollow
---
# Insee Workshop - ExistDb Training - 23-24/03/2021
[TOC]
:::info
**Day 1 : 23rd March**
**Morning : 10:00 to 12:00**
**Afternoon : 13:00 to 15:00**
:video_camera: Video
https://zoom.us/rec/share/CzZ-4lyJStE3hT8mp8Tpz07spDOqGcTnGyBUsqxeg_4KfNQttb9EKBdV2AOT4n5o.bp844Eu0ay1GROFm
Secret code : Bb5D%qV4
---
**Day 2 : 24th March**
Morning : 10:00 to 12:00
Afternoon : 13:00 to 15:00
:video_camera: Video
https://zoom.us/rec/share/SNtz-xUGl288_z6457e3uyYV-MMRZ0TAuswpTDDsMxBpy1TSeq_014Jr7vwJWkon.xzWcw1G5vqrKgjJA
Secret code : 6x00j$HL
:::
---
## Questions
* local installation / manipulations
* difference between launcher.bat and startup.bat ? on Windows (used by developers)
* launcher.bat recommended , proposes to install existDB as a service (Good pratice!)
* how to restore a dump of an exist db to explore it on a local instance of existDb ?
* procedure of installation of an eXist database
* configuration files, important and default settings
* recommendations/best practices for settings
* how to query an eXist database
* working with Visual Studio Code
* add existdb plugin
* XML (redhat) plugin
## Workshop
### My first xquery
```
xquery version '3.1';
declare namespace tei='http://www.tei-c.org/ns/1.0';
/tei:TEI/tei:text/tei:body/tei:div/tei:head,
count(/tei:TEI),
//tei:div/tei:sp[tei:speaker ='Hamlet'],
count(//tei:sp[tei:speaker ='Hamlet'])
doc('/db/apps/shakespeare/data/ham.xml')
collection('/db/apps/shakespeare/data')/tei:TEI
```
### XQuery Exercices 1
xquery version "3.1";
declare namespace tei="http://www.tei-c.org/ns/1.0";
collection("/db/apps/shakespeare/data")
* Dashboard: http://localhost:8080/exist/apps/dashboard
* PackageManager: http://localhost:8080/exist/apps/dashboard/admin#/packagemanager
### eXist-db vscode
Configuration file `.existdb.json`:
```
{
"servers": {
"localhost": {
"server": "http://localhost:8080/exist",
"user": "admin",
"password": ""
}
},
"sync": {
"server": "localhost",
"root": "/db/apps/insee-workshop",
"active": true,
"ignore": [
".existdb.json",
".git/**",
"build/**",
".idea",
".vscode"
]
}
}
```
### XAR Files
* Demo: https://exist-db.org/exist/apps/public-repo/public/demo-0.4.3.xar
* Shakespeare's Works in TEI: https://exist-db.org/exist/apps/public-repo/public/shakes-0.3.2.xar
## Documentation Links
### eXistdb Configuration
* eXistdb documentation: https://exist-db.org/exist/apps/doc/
* eXistdb demo documentation: https://exist-db.org/exist/apps/demo/index.html
* xQuery function documentation: http://exist-db.org/exist/apps/fundocs/index.html
* Advanced eXistdb installation: https://exist-db.org/exist/apps/doc/advanced-installation
* Configuration: https://exist-db.org/exist/apps/doc/configuration.xml
* Backup and restore eXistdb: https://exist-db.org/exist/apps/doc/backup.xml
* Performance: https://exist-db.org/exist/apps/doc/tuning.xml
* Ansible repo: https://github.com/eXist-db/existdb-ansible-role
### Monitoring
* Built-in monitoring in eXistdb: https://github.com/eXist-db/monex
* Other monitoring services:
* https://icinga.com/
* http://www.shinken-monitoring.org/
* http://munin-monitoring.org/
### Testing
* Test automation service: https://www.jenkins.io/
### Visual Studio Code Editor
* VS Code Editor: https://code.visualstudio.com/
* existdb-vscode:
* https://marketplace.visualstudio.com/items?itemName=eXist-db.existdb-vscode
* https://github.com/wolfgangmm/existdb-langserver
* Example configuration for `existdb.json`: https://github.com/eeditiones/tei-publisher-app/blob/master/.existdb.json
### Implementation Example
* History at State Repo: https://github.com/HistoryAtState/hsg-project