expoweb/handbook/troggle/trogarch.html

98 lines
5.9 KiB
HTML
Raw Normal View History

2020-04-02 21:40:30 +01:00
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Handbook Troggle Architecture</title>
2020-04-02 21:40:30 +01:00
<link rel="stylesheet" type="text/css" href="../../css/main2.css" />
</head>
<body>
<style>body { background: #fff url(/images/style/bg-system.png) repeat-x 0 0 }</style>
2020-04-02 21:40:30 +01:00
<h2 id="tophead">CUCC Expedition Handbook</h2>
<h1>Troggle Architecture</h1>
2020-06-29 16:33:29 +01:00
<style>figure {font-weight: bold; font-size: small; font-family: sans-serif;font-variant-caps: small-caps;}</style>
2021-03-30 01:42:41 +01:00
<h2>Troggle overall architecture</h2>
<p>Troggle is made up of three large chunks:
<ul>
<li>The <strong>website pages</strong>: the handbook, instructions, indexes, reference material, walking guides,
logbook typescripts, reports to funding agencies, copies of expo reports in magazines, instruction guides for how to run an expo, accounting protocols for subsidising transport, rope maintenance standards: over 900 pages in all. What you are reading now is part of this.<br><br>
<li>The <strong>file archive</strong>: the photo galleries, the copies of PDF reports, the scans of original survey notebooks, GPS tracks, maps, aerial photos, scanned images of our handwritten expo logbooks. There are 40 GB of files.<br><br>
2022-07-25 10:05:42 +01:00
<li>The <strong>troggle-generated reports</strong>: the tables of survey trips for each cave, the lists of scanned surveys for each survey trip, who was on what trip, calendar lists of logbook entries corrleated with recorded survey trips, who surveyed what caves, what source material was used to create the final cave survey images, who went on which expeditions (and who didn't go caving).
There are over 2,000 webpages generated using over 9,000 lines of bespoke python code from over 90 different urls.
2021-03-30 01:42:41 +01:00
</ul>
<h3>Troggle data architecture</h3>
<p>
2021-03-30 01:42:41 +01:00
The core of the troggle software is the data architecture: the set of tables into which all the cave survey and expo data is poured and stored. These tables are what enables us to produce a large number of different but consistent reports and views.
2020-05-18 22:25:07 +01:00
<div style="display: flex">
<div style="flex: 50%">
<figure>
<a href="../i/troggle-tables.jpg">
2020-05-18 22:25:07 +01:00
<img src="../t/troggle-tables-small.jpg" /></a>
2023-01-30 22:27:46 +00:00
<br><figcaption>Tables (Objects) - wildly out of date</figcaption>
</figure>
2020-05-18 22:25:07 +01:00
</div>
<div style="flex: 50%">
<figure>
<a href="../i/trogpkg.jpg">
<img src="../t/trogpkg-small.jpg" /></a>
2020-05-20 22:43:56 +01:00
<br><figcaption>Packages</figcaption>
2020-05-18 22:25:07 +01:00
</figure>
</div></div>
<p>
2021-03-30 01:42:41 +01:00
Also there have been tables added to the core representation which are not included in this old diagram, e.g. Scannedimage, Survexdirectory, Survexscansfolder, Survexscansingle, Tunnelfile, TunnelfileSurvexscansfolders, Survey. See <a href="datamodel.html">Troggle data model</a> python code (15 May 2020) and click on the Class Diagram below on the right.
2023-03-11 20:52:08 +00:00
<figure class="onright">
2023-01-30 22:27:46 +00:00
<a href="../l/trogclass-1.html"><img src="../t/trogclass-2.jpg"></a>
<br><figcaption>Class Diagram<br />(Click to enlarge)</figcaption>
2020-06-29 16:33:29 +01:00
</figure>
2023-03-11 20:52:08 +00:00
<h3>Purpose</h3>
<p>The reasons why we have an online system at all are described in our <a href="../website-history.html">website history</a>.
<p>There is an introductory article "<a href="/expofiles/documents/troggle/troggle2020.pdf" download>Troggle: a revised system for cave data management</a>".
2020-06-04 02:12:54 +01:00
2023-01-30 22:27:46 +00:00
<h3>Implementation in software</h3>
2020-06-04 02:12:54 +01:00
<p>
2023-01-30 22:27:46 +00:00
Troggle is written in Python (about 11,000 lines excluding comments) and is built on the Django framework. Before starting to work on Troggle it might be a good idea to run through an initial install and exploration of <a href="https://code.djangoproject.com/wiki/Tutorials">a tutorial Django project</a> to get the Django concepts bedded down - which are not at all obvious and some exist only within Django.
2020-06-04 02:12:54 +01:00
2023-01-30 22:27:46 +00:00
<p>Django is the thing that puts the survey data in a database in a way that helps us write far less code to get it in and out again, and provides templates which make it quicker to maintain all the webpages. <a href="http://www.djangoproject.com/"><img class="onright" src="https://www.djangoproject.com/m/img/badges/djangopowered126x54.gif" border="0" alt="Powered by Django." title="Powered by Django." /></a>
2021-03-21 23:25:03 +00:00
See the <a href="https://docs.djangoproject.com/en/dev/misc/design-philosophies/">django design philosophy</a> for why we chose it: while django comes with a full stack (db, request/response, URL mapping, HTML templates) the layers of the stack are independent and individually replaceable.
2020-06-04 02:12:54 +01:00
2020-07-30 01:21:03 +01:00
<p>We have to keep up to date with new rleases of django, see <a href="trogdjango.html">Upgrading Django for Troggle</a>.
2020-06-04 02:12:54 +01:00
<h3>Troggle parsers and input files</h3>
2020-06-04 02:12:54 +01:00
<div class="onright">
<figure>
2020-08-02 21:58:32 +01:00
<a href="https://djangobook.com/mdj2-django-structure/"><img src="../i/mtv_drawing2.jpg"></a>
2020-06-04 02:12:54 +01:00
<br><figcaption>Django server and webpage (client)</figcaption>
</figure>
</div>
2020-05-18 22:25:07 +01:00
<p>To understand how troggle imports the data from the survex files, tunnel files, logbooks etc., see the <a href="trogimport.html">troggle import (databaseReset.py)</a> documentation.
<p>The following separate import operations are managed by the import utility <a href="trogimport.html">(databaseReset.py)</a>:
<ul>
<li>expo logbooks
<li>folk (people)
2020-05-18 22:25:07 +01:00
<li>wallets of notes & scans (surveyscans)
<li>cave survey data - survex files
<li>QMs - question marks
<li>drawings - tunnel & therion files
</ul>
<h3>Files generated by troggle</h3>
<p>There are only four places where this happens. This is where online forms are used to create cave entrance records and cave records, where a form is used to record the information about a wallet. These are created in the database but also exported as files so that when troggle is rebuilt and data reimported the new cave data is there.
<p>Any page in this handbook, and any logbook entry, can also be edited online and the page is saved as a file - and registered with the version control system.
2020-04-02 21:40:30 +01:00
<hr />
See: <a href="datamodel.html">Troggle data model</a> in python code <br />
2020-04-02 21:40:30 +01:00
Return to: <a href="trogintro.html">Troggle intro</a><br />
2020-07-30 01:21:03 +01:00
Troggle index:
<a href="trogindex.html">Index of all troggle documents</a><br />
<hr /></body>
2020-04-02 21:40:30 +01:00
</html>