-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostproc.sh
executable file
·106 lines (91 loc) · 3.03 KB
/
postproc.sh
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
#!/usr/bin/env bash
cd data
tar -cvzf ../module/data.tar.gz *
cd ..
cd module
# Add a `copyDeviceId` call to autogenerated `newTransect()` function
# definition.
string="
setUuid(tabgroup, null);
newTabGroup(tabgroup);
String autoNumDest = \"\";
autoNumDest = \"Transect\/Transect\/Transect_ID\";
incAutoNum(autoNumDest);"
replacement="$string
copyDeviceId();"
perl -0777 -i.original -pe "s/\\Q$string/$replacement/igs" ui_logic.bsh
# Delete autogenerated onClickLoginLogin definition.
string="
onClickLoginLogin () {
\/\/ TODO: Add some things which should happen when this element is clicked
newTab(\"Control\", true);
}"
replacement=""
perl -0777 -i.original -pe "s/\\Q$string/$replacement/igs" ui_logic.bsh
# Delete autogenerated loadSiteFrom definition.
# Overriden in "logic/dynamic-ui-open-close.bsh".
string="
loadSiteFrom(String uuid) {
String tabgroup = \"Site\";
setUuid(tabgroup, uuid);
if (isNull(uuid)) return;
showTabGroup(tabgroup, uuid);
}"
replacement=""
perl -0777 -i.original -pe "s/\\Q$string/$replacement/igs" ui_logic.bsh
# Delete autogenerated loadFeatureFrom definition.
# Overriden in "logic/dynamic-ui-feature-tabs.bsh".
string="
loadFeatureFrom(String uuid) {
String tabgroup = \"Feature\";
setUuid(tabgroup, uuid);
if (isNull(uuid)) return;
showTabGroup(tabgroup, uuid);
}"
replacement=""
perl -0777 -i.original -pe "s/\\Q$string/$replacement/igs" ui_logic.bsh
# I hate this regex so much. Anyway, what it does is match everything in the
# function definition, including the name, parens and opening curly brace, but
# excluding the closing curly brace. This allows us to stick a line right before
# the closing curly brace.
string="(new([a-zA-Z]+)\\(\\){((?!\\n}).)+)"
replacement="\\1
inherit\\2Fields();"
perl -0777 -i.original -pe "s/$string/$replacement/igs" ui_logic.bsh
string="disableAutoSave\(tabgroup\);"
replacement="$string
clearGpsInTabGroup(tabgroup);"
perl -0777 -i.original -pe "s/$string/$replacement/igs" ui_logic.bsh
# Extensions to Search tab
string="
<Entity_List\/>
<\/Search>"
replacement="
<Parent_Transect_ID_Guide\/>
<Parent_Transect_ID\/>
$string
"
perl -0777 -i.original -pe "s/$string/$replacement/is" ui_schema.xml
string="
<select1 appearance=\"compact\" ref=\"Entity_List\">
<label>{Entity_List}<\/label>
<item>
<label>Options not loaded<\/label>
<value>Options not loaded<\/value>
<\/item>
<\/select1>"
replacement="
<input ref=\"Parent_Transect_ID_Guide\" faims_web=\"true\">
<label><\/label>
<\/input>
<input ref=\"Parent_Transect_ID\">
<label>Parent Transect ID<\/label>
<\/input>$string"
perl -0777 -i.original -pe "s/$string/$replacement/is" ui_schema.xml
string="
<\/model>"
replacement="
<bind type=\"decimal\" nodeset=\"\/faims\/Control\/Search\/Parent_Transect_ID\"\/>$string"
perl -0777 -i.original -pe "s/$string/$replacement/is" ui_schema.xml
rm ui_logic.bsh.original
rm ui_schema.xml.original