-
Notifications
You must be signed in to change notification settings - Fork 0
/
module.xml
677 lines (636 loc) · 16.7 KB
/
module.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
<?xml version="1.0" ?>
<module suppressWarnings="true">
<User f="nodata">
<User f="noscroll">
<Select_User t="list" f="user nocertainty noannotation" l="Control"/>
</User>
</User>
<Control f="nodata">
<Excavation_Data f="noscroll">
<Job_Name/>
<autonum/>
<New_Trench t="button" l="Trench"/>
<List_of_Trenches t="list" e="Trench"/>
</Excavation_Data>
<Spits f="noscroll">
<List_of_Spits t="list" e="Spit"/>
</Spits>
<search/>
</Control>
<Trench>
<Trench_Info>
<Job_Name f="id readonly nocertainty noannotation">
<str>
<pos>2</pos>
<fmt>$2 - </fmt>
</str>
</Job_Name>
<author f="id nocertainty noannotation">
<str>
<pos>3</pos>
<fmt>$2</fmt>
</str>
</author>
<Trench_ID f="id notnull nocertainty noannotation">
<str>
<pos>1</pos>
<fmt>$2 - </fmt>
</str>
</Trench_ID>
<gps/>
<Dimensions>
<opts>
<opt>No Observation</opt>
<opt>1 x 1m</opt>
<opt>2 x 1m</opt>
<opt>0.5m x 0.5m</opt>
<opt>Other (add annotation)</opt>
</opts>
</Dimensions>
<Artefacts_Present t="radio">
<opts>
<opt>No Observation</opt>
<opt>Yes</opt>
<opt>No</opt>
</opts>
</Artefacts_Present>
<Landform_Genesis t="checkbox">
<opts>
<opt>Eroded</opt>
<opt>Aggraded</opt>
<opt>Stable</opt>
<opt>Elevated</opt>
<opt>Built up</opt>
<opt>Subsided</opt>
<opt>Excavated</opt>
<opt>Other</opt>
</opts>
</Landform_Genesis>
<Landform_Element t="checkbox">
<opts>
<opt>Crest</opt>
<opt>Slope (add Slope Details)</opt>
<opt>Flat</opt>
<opt>Cliff/Escarpment</opt>
<opt>Open Depression</opt>
<opt>Closed Depression</opt>
<opt>Ridgeline</opt>
<opt>Other (add annotation)</opt>
</opts>
</Landform_Element>
<Fill_Slope_Details t="button"/>
<Geomorphic_Context>
<opts>
<opt>No Observation</opt>
<opt>Aeolian (Dune)</opt>
<opt>Alluvial</opt>
<opt>Colluvial</opt>
<opt>Lacustrine</opt>
<opt>Volcanic</opt>
<opt>Sedimentary</opt>
<opt>Metamorphic</opt>
<opt>Estuarine</opt>
<opt>Marine</opt>
<opt>Other</opt>
</opts>
</Geomorphic_Context>
<Aspect/>
<Distance_to_Water_km b="decimal">
Distance to Water (km)
</Distance_to_Water_km>
<Samples_Collected t="checkbox">
<opts>
<opt>Soil</opt>
<opt>Charcoal</opt>
<opt>TL/OSL</opt>
<opt>Other</opt>
</opts>
</Samples_Collected>
<Samples_Details/>
<Take_Photo t="camera"/>
<Attach_Sketches t="file"/>
<View_Attached_Files t="viewfiles"/>
</Trench_Info>
<Units f="noscroll">
<New_Unit t="button" lc="Unit"/>
<List_of_Units t="list" ec="Unit"/>
</Units>
<Slope f="hidden">
<Slope_Degree b="decimal"/>
<Slope_Detail>
<opts>
<opt>No Observation</opt>
<opt>Simple</opt>
<opt>Upper</opt>
<opt>Middle</opt>
<opt>Lower</opt>
<opt>Other</opt>
</opts>
</Slope_Detail>
<Slope_Detail_2>
<opts>
<opt>No Observation</opt>
<opt>Waxing</opt>
<opt>Waning</opt>
<opt>Maximal</opt>
<opt>Minimal</opt>
<opt>Other</opt>
</opts>
</Slope_Detail_2>
</Slope>
<Spits f="noscroll">
<New_Spit t="button" lc="Spit"/>
<List_of_Spits t="list" ec="Spit"/>
</Spits>
<PhotoLog f="noscroll">
<New_Photograph_Log t="button" lc="Photograph_Log"/>
<List_of_Photograph_Logs t="list" ec="Photograph_Log"/>
</PhotoLog>
<Notes f="noscroll">
<New_Note t="button" lc="Note"/>
<List_of_Notes t="list" ec="Note"/>
</Notes>
<Vars f="hidden">
<timestamp/>
</Vars>
</Trench>
<Unit>
<Soil>
<Unit_Job_Name f="readonly">
Job Name
</Unit_Job_Name>
<Unit_Trench_ID f="readonly">
Trench ID
</Unit_Trench_ID>
<author f="readonly"/>
<Unit_Unit_ID f="id autonum notnull">
Unit ID
<str><fmt>$2 - </fmt></str>
</Unit_Unit_ID>
<Horizon f="id notnull">
<str><fmt>$2</fmt></str>
</Horizon>
<Depth_cm b="decimal">
Depth (cm)
</Depth_cm>
<pH b="decimal"/>
<Colour/>
<Texture>
<opts>
<opt>No Observation</opt>
<opt>Sand
<opt>Loamy Sand</opt>
<opt>Clayey Sand</opt>
<opt>Silty Sand</opt>
</opt>
<opt>Clay
<opt>Sandy Clay</opt>
<opt>Silty Clay</opt>
</opt>
<opt>Loam
<opt>Loam</opt>
<opt>Sandy Loam</opt>
<opt>Silty Clay Loam</opt>
<opt>Sandy Clay Loam</opt>
<opt>Clay Loam</opt>
<opt>Clay Loam Sandy</opt>
<opt>Silty Clay Loam</opt>
</opt>
</opts>
</Texture>
<Moisture>
<opts>
<opt>No Observation</opt>
<opt>Dry</opt>
<opt>Moderately moist</opt>
<opt>Moist</opt>
<opt>Wet</opt>
</opts>
</Moisture>
<Grain_size>
<opts>
<opt>No Observation</opt>
<opt>Very fine</opt>
<opt>Fine</opt>
<opt>Medium</opt>
<opt>Coarse</opt>
</opts>
</Grain_size>
<Consistency>
<opts>
<opt>No Observation</opt>
<opt>Loose</opt>
<opt>Soft/friable</opt>
<opt>Hard/Firm</opt>
<opt>Extremely Hard</opt>
</opts>
</Consistency>
<Cementation>
<opts>
<opt>No Observation</opt>
<opt>Weakly cemented</opt>
<opt>Strongly cemented</opt>
</opts>
</Cementation>
<Inclusions t="checkbox">
<opts>
<opt>No Observation</opt>
<opt>Charcoal</opt>
<opt>Grass roots (add Grass roots details)</opt>
<opt>Tree roots</opt>
<opt>Gravel</opt>
<opt>Mineral pan</opt>
<opt>Other (add annotation)</opt>
</opts>
</Inclusions>
<Fill_in_Grass_Roots_Details t="button"/>
<Disturbance t="checkbox">
<opts>
<opt>Ploughing</opt>
<opt>Bioturbation</opt>
<opt>Stock trampling</opt>
<opt>Burrows</opt>
<opt>Other (add annotation)</opt>
</opts>
</Disturbance>
<Unit_Notes/>
<Unit_Photograph t="camera"/>
</Soil>
<Artefacts f="noscroll">
<New_Artefact t="button" lc="Artefact"/>
<List_of_Artefacts t="list" ec="Artefact"/>
</Artefacts>
<Grass_Roots f="hidden">
<Root_Size>
<opts>
<opt>No Observation</opt>
<opt>Very fine</opt>
<opt>Fine</opt>
<opt>Medium</opt>
<opt>Coarse</opt>
</opts>
</Root_Size>
<Root_Abundance>
<opts>
<opt>No Observation</opt>
<opt>Few</opt>
<opt>Common</opt>
<opt>Many</opt>
<opt>Abundant</opt>
</opts>
</Root_Abundance>
</Grass_Roots>
</Unit>
<Spit>
<Spit_Info>
<Spit_Job_Name f="readonly noannotation nocertainty">
Job Name
</Spit_Job_Name>
<Spit_Trench_ID f="id readonly noannotation nocertainty">
Trench ID
<str>
<pos>1</pos>
<fmt>Trench ID: $2 </fmt>
</str>
</Spit_Trench_ID>
<author f="noannotation nocertainty"/>
<Spit_ID f="id notnull autonum noannotation nocertainty">
<str>
<pos>2</pos>
<fmt>Spit ID: $2</fmt>
</str>
</Spit_ID>
<Bucket_Count b="decimal"/>
<Thickness b="decimal">
Thickness (m)
</Thickness>
<Attach_Photograph t="camera"/>
<Spit_Notes/>
<Pantone_ID/>
<Color_Name/>
</Spit_Info>
<Artefacts f="noscroll">
<New_Artefact t="button" lc="Artefact"/>
<List_of_Artefacts t="list" ec="Artefact"/>
</Artefacts>
</Spit>
<Photograph_Log>
<Photograph_Log>
<Photograph_Log_Job_Name f="readonly noannotation nocertainty">
Job Name
</Photograph_Log_Job_Name>
<Photograph_Log_Trench_ID f="readonly noannotation nocertainty">
Trench ID
</Photograph_Log_Trench_ID>
<author f="readonly noannotation nocertainty"/>
<timestamp f="readonly noannotation nocertainty"/>
<Photograph_Reference_ID f="id notnull"/>
<Photograph_Log_Description>
Description
</Photograph_Log_Description>
</Photograph_Log>
</Photograph_Log>
<Note>
<Note>
<Note_Job_Name f=" readonly noannotation nocertainty">
Job Name
</Note_Job_Name>
<Note_Trench_ID f=" readonly noannotation nocertainty">
Trench ID
</Note_Trench_ID>
<author f="id readonly noannotation nocertainty">
<str>
<pos>2</pos>
<fmt>$2 - </fmt>
</str>
</author>
<timestamp f="id readonly noannotation nocertainty">
<str>
<pos>3</pos>
<fmt>$2</fmt>
</str>
</timestamp>
<Note_Label f="id noannotation nocertainty notnull">
<str>
<pos>1</pos>
<fmt>$2 - </fmt>
</str>
</Note_Label>
<Note/>
</Note>
</Note>
<Artefact>
<Artefact>
<Artefact_Spit_ID f="id readonly">
Spit ID
<str>
<pos>1</pos>
<fmt>{{ if $2 then "Spit ID: $2 - " }}</fmt>
</str>
</Artefact_Spit_ID>
<Artefact_ID f="id autonum notnull">
<str>
<pos>3</pos>
<fmt>Artefact ID: $2 - </fmt>
</str>
</Artefact_ID>
<Artefact_Unit_ID f="id readonly">
Unit ID
<str>
<pos>2</pos>
<fmt>{{ if $2 then "Unit ID: $2 - " }}</fmt>
</str>
</Artefact_Unit_ID>
<X b="decimal"/>
<Y b="decimal"/>
<Z b="decimal"/>
<Artefact_Class f="id notnull notnull">
<str>
<pos>4</pos>
<fmt>$1</fmt>
</str>
<opts>
<opt>No Observation
<desc>data not collected</desc>
</opt>
<opt>Chipped Stone
<opt>Blade</opt>
<opt>Core</opt>
<opt>Cache</opt>
<opt>Other</opt>
</opt>
<opt>Ground Stone
<opt>Bead</opt>
<opt>Grinder</opt>
<opt>Pestle</opt>
<opt>Shaft Straightener</opt>
<opt>Pendant</opt>
<opt>Incised Stone</opt>
<opt>Polisher</opt>
<opt>Other</opt>
</opt>
<opt>Bone
<opt>Point</opt>
<opt>Bead</opt>
<opt>Other</opt>
</opt>
<opt>Shell
<opt>Bead</opt>
<opt>Other</opt>
</opt>
<opt>Plant
<opt>Charcoal</opt>
<opt>Hackberry</opt>
<opt>Charred Seed</opt>
<opt>Siliceous Material</opt>
<opt>Phytolith</opt>
<opt>Impression Cast</opt>
<opt>Other</opt>
</opt>
<opt>Ochre</opt>
<opt>Clay Object
<opt>Figurine</opt>
<opt>Geometric object</opt>
<opt>Token</opt>
<opt>Other</opt>
</opt>
<opt>Ceramic
<opt>Coarse</opt>
<opt>Fine</opt>
<opt>Terracotta</opt>
<opt>Other</opt>
</opt>
<opt>Glass
<opt>Black</opt>
<opt>Colourless</opt>
<opt>Coloured</opt>
</opt>
<opt>Metal
<opt>Ferrous</opt>
<opt>Copper-alloy</opt>
<opt>Other</opt>
</opt>
<opt>Building Materials</opt>
<opt>Miscellaneous
<desc>Add detail in the Annotation field</desc>
</opt>
</opts>
</Artefact_Class>
<Artefact_Measurement_cm>
Artefact Measurement (cm)
</Artefact_Measurement_cm>
<Artefact_Description>
Description
</Artefact_Description>
<Artefact_Photograph t="camera"/>
</Artefact>
</Artefact>
<logic><![CDATA[
//Checking they have the correct projection EPSG:28355: GDA94 / MGA zone 55
checkProjection() {
showWarning("Projection Alert","You are using projection EPSG " + getModuleSrid() + ". To change the projection, do the following:\n1. Log into the FAIMS Web Server.\n2. Open this module.\n3. Click edit module.\n4. Change the value in the \"Module SRID:\" to a projection of your choice.");
}
checkProjection();
/********************************* VALIDATION *********************************/
boolean validateJobName() {
String ref = "Control/Excavation_Data/Job_Name";
String val = getFieldValue(ref);
if (isNull(val)) {
String head = "Validation Error";
String body = "You must fill in the Job Name before you can create a ";
body += "Trench";
showWarning(head, body);
return false;
}
return true;
}
// Overrides autogenerated definition
void onClickControlNewTrench () {
if (!validateJobName()) {
return;
}
parentTabgroup__ = "Control";
newTrench();
}
// Overrides autogenerated definition
void onClickControlNewSpit () {
if (!validateJobName()) {
return;
}
parentTabgroup__ = "Control";
newSpit();
}
/******************************** INHERITANCE *********************************/
inheritFieldValue(
"Control/Excavation_Data/Job_Name",
"Trench/Trench_Info/Job_Name",
false
);
inheritFieldValue(
"Trench/Trench_Info/Job_Name",
"Unit/Soil/Unit_Job_Name",
false
);
inheritFieldValue(
"Trench/Trench_Info/Trench_ID",
"Unit/Soil/Unit_Trench_ID",
false
);
inheritFieldValue(
"Trench/Trench_Info/Job_Name",
"Spit/Spit_Info/Spit_Job_Name",
false
);
inheritFieldValue(
"Trench/Trench_Info/Trench_ID",
"Spit/Spit_Info/Spit_Trench_ID",
false
);
inheritFieldValue(
"Trench/Trench_Info/Job_Name",
"Photograph_Log/Photograph_Log/Photograph_Log_Job_Name",
false
);
inheritFieldValue(
"Trench/Trench_Info/Trench_ID",
"Photograph_Log/Photograph_Log/Photograph_Log_Trench_ID",
false
);
inheritFieldValue(
"Trench/Trench_Info/Job_Name",
"Note/Note/Note_Job_Name",
false
);
inheritFieldValue(
"Trench/Trench_Info/Trench_ID",
"Note/Note/Note_Trench_ID",
false
);
inheritFieldValue(
"Spit/Spit_Info/Spit_ID",
"Artefact/Artefact/Artefact_Spit_ID"
);
inheritFieldValue(
"Unit/Soil/Unit_Unit_ID",
"Artefact/Artefact/Artefact_Unit_ID"
);
/***************************** TRENCH DUPLICATION *****************************/
blankTrenchId() {
String ref = "Trench/Trench_Info/Trench_ID";
String val = "";
setFieldValue(ref, val);
}
addOnEvent("Trench", "copy", "blankTrenchId()");
/************************* FILL SLOPE DETAILS BUTTON **************************/
void showSlopeTab(boolean onLoad) {
String q = "";
q += " SELECT vocabid";
q += " FROM vocabulary";
q += " JOIN attributekey USING (attributeid)";
q += " WHERE attributename = 'Landform Element'";
q += " AND vocabname = '{Slope__add_Slope_Details_}'";
FetchCallback cb = new FetchCallback() {
onFetch(result) {
if (result == null) return;
for(vocabid : getFieldValue("Trench/Trench_Info/Landform_Element")) {
if(vocabid.getName().equals(result.get(0))) {
showTab("Trench/Slope");
if(onLoad) {
showTab("Trench/Trench_Info");
}
return;
}
if(onLoad) {
showTab("Trench/Slope");
} else {
cancelTab("Trench/Slope", false);
showToast("Slope was not selected in Landform Element");
}
}
}
onError(message) {
showToast(message);
}
};
fetchOne(q, cb);
}
addOnEvent("Trench/Trench_Info/Fill_Slope_Details", "click", "showSlopeTab(false)");
addOnEvent("Trench", "fetch", "showSlopeTab(true )");
addOnEvent("Trench", "create", "cancelTab(\"Trench/Slope\", false)");
/********************* FILL IN GRASS ROOTS DETAILS BUTTON *********************/
showGrassRootsTab(Boolean onLoad) {
String q = "";
q += " SELECT vocabid";
q += " FROM vocabulary";
q += " JOIN attributekey USING (attributeid)";
q += " WHERE attributename = 'Inclusions'";
q += " AND vocabname = '{Grass_roots__add_Grass_roots_details_}'";
fetchOne(q, new FetchCallback() {
onFetch(result) {
if (result == null) return;
for(vocabid : getFieldValue("Unit/Soil/Inclusions")) {
if(vocabid.getName().equals(result.get(0))) {
showTab("Unit/Grass_Roots");
if(onLoad) {
showTab("Unit/Soil");
}
return;
}
if(!onLoad) {
showToast("Grass Roots was not selected in Inclusions");
} else {
showTab("Unit/Grass_Roots");
cancelTab("Unit/Grass_Roots", false);
}
}
}
onError(message) {
showToast(message);
}
});
}
addOnEvent("Unit/Soil/Fill_in_Grass_Roots_Details", "click", "showGrassRootsTab(false)");
addOnEvent("Unit", "fetch", "showGrassRootsTab(true )");
addOnEvent("Unit", "create", "cancelTab(\"Unit/Grass_Roots\", false)");
]]></logic>
</module>