-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvardefs.example.yml
More file actions
314 lines (285 loc) · 10.8 KB
/
vardefs.example.yml
File metadata and controls
314 lines (285 loc) · 10.8 KB
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
################################################
# Vardef example
#
# For more examples and a more detailed
# reference on what gets generated, see
# ./VardefModifier/Test.php
#
################################################
---
#################################################
# Change the defualt properties that are used when adding new fields
# to see the default default properties, look in ./defaults.yml file
defaults:
# Make all url fields added in this file required (If nothing else is specified)
url:
required: true
# Make all varchar fields to be
varchar:
len: 3
#################################################
#################################################
# Adds fields, relationships and indices
add:
#################################################
# Adds fields to the vardef
#
# See ./vardefs.template.yml to see all available types
# Also look in ./defaults.yml for what default
# properties all types contains
#
# The format of all labels will be:
# LBL_<field name to upper case>
#
fields:
#################################################
# Add varchar fields..
varchar:
# Without any options
- my_field
# Add a field with properties
my_other_field:
len: 3
#################################################
#################################################
# Adds integer fields
int:
# see https://github.com/tekimaki/spyc for complete yaml syntax reference.
my_int_field: { len: 2 }
#################################################
#################################################
# Adds text fields
text:
- my_textarea
#################################################
#################################################
relate:
account_type:
# the module property is always required in this field type
module: Accounts
rname: type
#################################################
#################################################
flex_relate:
insuranceproductdetail:
name:
options: dri_insurancesubcovers_insuranceproductdetail_list
parent_type: dri_insurancesubcovers_insuranceproductdetail_list
#################################################
#################################################
flex_relate_link:
dri_insurancesubcovers:
module: DRI_InsuranceSubCovers
prefix: gob
#################################################
#################################################
enum:
# The options name of this field will be:
# <module name to lower case>_type_list
- type
kind:
required: true
options: global_kinds_list
#################################################
#################################################
multienum:
# The options name of this field will be:
# <module name to lower case>_codes_list
- codes
#################################################
#################################################
# Adds new address group containing following fields:
#
# - primary_address_street
# - primary_address_city
# - primary_address_state
# - primary_address_postalcode
# - primary_address_country
#
address:
- primary
#################################################
#################################################
# Dependencies.
# In this example the field is hidden unless
# the dependency is satisfied.
#
varchar:
someField:
dependency: equal($status,"Converted")
#################################################
#################################################
link:
#################################################
# Will create a link to the Contacts module where
# on the other side where added a relationship
# to the current module
# eg this where added written on the Contacts vardef.yml
# add:
# relationships:
# - <module name>
#
# the name of the link field will be 'contacts'
#
- Contacts
#################################################
#################################################
# Adds a link field for a named relationship
# in the Cases module vardef.yml
#
# If this where added:
# add:
# relationships:
# owner: <module name>
#
# The following will link up the relationship
# on this side.
#
# The name of the link field will be 'owned_cases'
#
owned_cases:
module: Cases
relationship_name: owner
#################################################
#################################################
#################################################
# Add relationship fields and definitions
relationships:
#################################################
# Adds a relationship to Accounts
#
# Will add fields:
# account_id
# account_name
# account_link
#
# And a index to the account_id field
#
# The relationship name of this relation will be <object name>_accounts
- Accounts
#################################################
#################################################
# Adds a relationship to Accounts called store
#
# Will add fields:
# store_id
# store_name
# store_link
#
# And a index to the store_id field
#
# The relationship name of this relation will be:
# <object name>_store_accounts
store: Accounts
#################################################
#################################################
# Adds a relationship to Contacts called person
#
# Will add fields:
# person_id
# person_name: this field will be required
# person_link
#
# And a index to the person_id field
#
# The relationship name of this relation will be <object name>_person_contacts
person: { module: Contacts, required: true }
#################################################
#################################################
# Adds a relationship to Tasks
#
# Will add fields:
# task_id
# task_name: this field will be required
# task_link
#
# In this case a index will NOT be added to task_id
#
# The label LBL_MY_TASK_LABEL will be set to all fields added
#
# The relationship name of this relation will be <object name>_tasks
Tasks:
required: true
vname: LBL_MY_TASK_LABEL
index: false
#################################################
#################################################
# Adds a relationship to ProductTypes
#
# Will add fields:
# producttype_id: the properties in the "id" array below will be merged to this field definition
# producttype_name: the properties in the "name" array below will be merged to this field definition
# producttype_link
#
# And a index to the person_id field
#
# The relationship name of this relation will be <object name>_producttypes
ProductTypes:
id:
function:
name: getProductTypeDropdDown
returns: html
name:
function:
name: getProductTypeNameDropDown
returns: html
#################################################
#################################################
# The activity relation is a rather special case.
#
# What this does is to add relationship definitions
# to the Tasks, Notes, Meetings, Calls and Emails
# modules in order to be able to add the activity
# subpanel definitions to the modles detail view.
#
# The link field names will be:
# - tasks: link to the Tasks module
# - notes: link to the Notes module
# - meetings: link to the Meetings module
# - calls: link to the Calls module
# - emails: link to the Emails module
#
- Activities
#################################################
#################################################
# Add indices
indices:
#################################################
# A index to the name field:
- name
#################################################
#################################################
# A unique index to the field my_key:
my_key: { type: unique }
#################################################
#################################################
# Short hand for above syntax:
my_key: unique
#################################################
#################################################
# A index containg field1, field2, field3:
- [ field1, field2, field3 ]
#################################################
#################################################
# A index field field1 and field2 called idx_my_index:
- { fields: [ field1, field2 ], name: idx_my_index }
#################################################
#################################################
#################################################
# Make changes in the vardef
change:
fields:
type:
# Change the len property of the type field to 4
len: 4
#################################################
#################################################
# Removes fields and properties of fields, relationships and indices
remove:
fields:
# Remove the name field completely
- name
some_field:
# Remove the required property of the "some_field" field.
- required
#################################################