-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostproc.sh
executable file
·95 lines (89 loc) · 3.12 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
#!/usr/bin/env bash
cd data
tar -cvzf ../module/data.tar.gz * >/dev/null
cd ..
# Start working on our module definition files...
cd module
# In the ui_schema.xml, replace the "Entity Types" dropdown menu with an
# "Entity Types" dropdown, a "Select User" dropdown, and a "Select Square"
# dropdown. These new three dropdowns will appear in columns because of our use
# of the `<group>` element and `faims_style` attribute. (Check the FAIMS
# cookbook for more info.)
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="
<group ref=\"Colgroup_1\" faims_style=\"orientation\">
<label\/>
<group ref=\"Col_0\" faims_style=\"even\">
<label\/>
<select1 ref=\"Select_User\">
<label>\{Select_User\}<\/label>
<item>
<label>Options not loaded<\/label>
<value>Options not loaded<\/value>
<\/item>
<\/select1>
<\/group>
<group ref=\"Col_1\" faims_style=\"even\">
<label\/>
<select1 ref=\"Select_Date\">
<label>\{Select_Date\}<\/label>
<item>
<label>Options not loaded<\/label>
<value>Options not loaded<\/value>
<\/item>
<\/select1>
<\/group>
<group ref=\"Col_2\" faims_style=\"even\">
<label\/>
<select1 ref=\"Select_Frog_Type\">
<label>\{Select_Frog_Type\}<\/label>
<item>
<label>Options not loaded<\/label>
<value>Options not loaded<\/value>
<\/item>
<\/select1>
<\/group>
<\/group>
<select1 appearance=\"compact\" ref=\"Entity_List\">
<label>\{Entity_List\}<\/label>
<item>
<label>Options not loaded<\/label>
<value>Options not loaded<\/value>
<\/item>
<\/select1>"
perl -0777 -i.original -pe "s/$string/$replacement/igs" ui_schema.xml
# The UI schema requires that we also define the dropdowns in its <model> tags.
string="
<Entity_List\/>"
replacement="
<Colgroup_1>
<Col_0>
<Select_User\/>
<\/Col_0>
<Col_1>
<Select_Date\/>
<\/Col_1>
<Col_2>
<Select_Frog_Type\/>
<\/Col_2>
<\/Colgroup_1>
<Select_User\/>
<Entity_List\/>"
perl -0777 -i.original -pe "s/$string/$replacement/igs" ui_schema.xml
# Add entries to the arch16n file. This includes new entries for the "Select
# User" and "Select Square" dropdowns.
cat << EOF >> english.0.properties
Select_Date=Select Date
Select_Frog_Type=Select Frog Type
Select_User=Select User
EOF
# Perl created backup files when we modified the UI schema and validation
# schema. They're not needed any more.
rm ui_schema.xml.original