-
Notifications
You must be signed in to change notification settings - Fork 0
/
module.xml
161 lines (145 loc) · 4.09 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
<?xml version="1.0" ?>
<module>
<Login f="nodata">
<User_List>
<Users t="dropdown" f="user nocertainty noannotation"/>
<Log_in t="button" ll="Control"/>
<Sign_up t="button" l="signup"/>
</User_List>
</Login>
<Control f="nodata">
<Control f="noscroll">
<New_Fish t="button" f="nocertainty noannotation" l="Fish"/>
<List_of_Fish t="list" f="nocertainty noannotation" e="Fish"/>
</Control>
<search>
Search
</search>
</Control>
<Fish>
<Fish>
<author f="id">
Author
<str>
<pos>1</pos>
<fmt>$2: </fmt>
</str>
</author>
<timestamp f="id">
Timestamp
<str>
<pos>3</pos>
<fmt>$2</fmt>
</str>
</timestamp>
<Attach_Photo t="camera"/>
<gps>Fill_in_GPS</gps>
<Fish_Type t="picture" f="id">
<desc>Select the appropriate fish</desc>
<str>
<pos>2</pos>
<fmt>$1 - </fmt>
</str>
<opts>
<opt p="MangroveJack.jpg">MangroveJack</opt>
<opt p="Carp.jpg">Carp</opt>
<opt p="Barramundi.jpg">Barramundi</opt>
<opt p="Bass.jpg">Bass</opt>
<opt p="Perch.jpg">Perch</opt>
<opt p="Garfish.jpg">Garfish</opt>
</opts>
</Fish_Type>
<Size_in_cm b="decimal" f="notnull">
Size (cm)
<desc>Measure the fish in centimetres</desc>
</Size_in_cm>
<Sex t="radio">
<opts>
<opt>Male</opt>
<opt>Female</opt>
<opt>Unknown</opt>
</opts>
</Sex>
<Location b="string">
<desc>Detailed description of the fishing location</desc>
</Location>
<Depth_in_cm b="decimal">Depth (cm)</Depth_in_cm>
<Weather_Conditions t="checkbox">
<opts>
<opt>Sunny</opt>
<opt>Cloudy</opt>
<opt>Stormy</opt>
<opt>Rain</opt>
<opt>Lots of Rain</opt>
</opts>
</Weather_Conditions>
<Fishing_Methods t="dropdown">
<opts>
<opt>No Observation</opt>
<opt>Bait</opt>
<opt>Lure</opt>
<opt>Fly</opt>
<opt>Net</opt>
</opts>
</Fishing_Methods>
<Number_of_Fishers_in_Party b="decimal">
<desc>How many people were actively fishing?</desc>
</Number_of_Fishers_in_Party>
<Comments b="string"/>
<Released t="radio">
Released?
<desc>Was the fish released?</desc>
<opts>
<opt>Yes</opt>
<opt>No</opt>
<opt>No Observation</opt>
</opts>
</Released>
<Tag_no b="string">
Tag no (if released)
<desc>Retype the tag number if the fish was released</desc>
</Tag_no>
</Fish>
</Fish>
<logic><![CDATA[
/***************************** CUSTOM VALIDATION ******************************/
String getName(String ref, String defaultName) {
String refOri = "Fish/Fish/Size_in_cm";
if (ref.equals(refOri))
return defaultName + " field must have a value between 20.00-100.0";
return defaultName;
}
String getCond(String ref, String defaultCond) {
return defaultCond;
}
// Overrides autogenerated definition
boolean isValidField(String ref) {
String refOri = "Fish/Fish/Size_in_cm";
if (!ref.equals(refOri))
return !isNull(getFieldValue(ref)); // Do blank check
// Do range check
String val = getFieldValue(refOri);
double dblVal;
try {
dblVal = Double.parseDouble(val);
} catch(NumberFormatException e) {
dblVal = -1.0;
}
double fltMin = 20.0;
double fltMax = 100.0;
return dblVal >= fltMin &&
dblVal <= fltMax;
}
// Overrides autogenerated definition
List fieldPair(String ref, String name, String cond) {
String refOri = "Locus/Cut/Orientation_Degree";
name = getName(ref, name);
cond = getCond(ref, cond);
List fp = new ArrayList();
fp.add(ref);
fp.add(name);
fp.add(cond);
return fp;
}
]]></logic>
</module>