mio-config 2.21.0 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mio/model/metadatadefinition/definition.rb +14 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb67b22af89ca2490ea12efd759c8589b623803f
|
4
|
+
data.tar.gz: 2bcb4dd13448867eb87da4379bc5a59a2b6337da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8ccce1d8cad34374fba7d69d3878c0ebe3be634e6291f41f6ccf16fe77907911482dab5cc55c67d022ac1a3f1bba3024e2bdf0b44e63b8397ff3929fde14bef
|
7
|
+
data.tar.gz: 6ee8cebc698a792ad503e3c354fd30c07001bab93e97f827b2ae1d58ff605cfe5159b349c1f70643caf2c42b3fa3e504f9930fcc3db079a7368488cd8abcc0d8
|
@@ -6,17 +6,18 @@ class Mio
|
|
6
6
|
|
7
7
|
field :name, String, 'Metadata Definition Name'
|
8
8
|
field :displayName, String, 'Display name'
|
9
|
-
field :type, String, 'Metdata type
|
9
|
+
field :type, String, 'Metdata type single-option|text|url|boolean|image', 'text', /^(single-option|text|url|boolean|image|string|complex)$/
|
10
10
|
field :description, String, 'Metadata Definition Description'
|
11
11
|
field :searchable, Symbol, 'Indexed and searchable', :true
|
12
12
|
field :editable, Symbol, 'Editable field', :true
|
13
13
|
field :required, Symbol, 'Required mandatory metadata item', :true
|
14
14
|
field :isVisible, Symbol, 'Control visible', :true
|
15
|
-
field :formType, String, 'Form control type', 'textarea' , /^(select|textarea|text|checkbox|file)$/
|
15
|
+
field :formType, String, 'Form control type', 'textarea' , /^(select|textarea|text|checkbox|file|)$/
|
16
16
|
field :maxLength, Fixnum, 'MaxLength', -1
|
17
17
|
field :validationHandler, String, 'Validation handler', ''
|
18
18
|
field :options, Array, 'Array of options', []
|
19
|
-
field :
|
19
|
+
field :children, Array, 'Array of child definitions', []
|
20
|
+
field :multiplicity, String, 'Multiplicity', '1', /^(0\.\.\*|1\.\.\*|1)$/
|
20
21
|
|
21
22
|
nested true
|
22
23
|
|
@@ -32,7 +33,8 @@ class Mio
|
|
32
33
|
maxLength: @args.maxLength,
|
33
34
|
validationHandler: @args.validationHandler,
|
34
35
|
options: @args.options,
|
35
|
-
|
36
|
+
children: @args.children,
|
37
|
+
multiplicity: @args.multiplicity,
|
36
38
|
isVisible: @args.isVisible
|
37
39
|
}
|
38
40
|
end
|
@@ -47,8 +49,6 @@ class Mio
|
|
47
49
|
'tv.nativ.mio.metadata.variable.def.validation.MaxLengthValidationHandler'
|
48
50
|
when 'url'
|
49
51
|
'tv.nativ.mio.metadata.resource.def.MioURLVariable$URLValidationHandler'
|
50
|
-
when 'string'
|
51
|
-
'tv.nativ.mio.metadata.variable.def.validation.MaxLengthValidationHandler'
|
52
52
|
else
|
53
53
|
''
|
54
54
|
end
|
@@ -59,12 +59,15 @@ class Mio
|
|
59
59
|
type = @args.type
|
60
60
|
end
|
61
61
|
children.send(type+'_', name: @args.name, display_name: @args.displayName) do |child|
|
62
|
+
unless @args.multiplicity.nil?
|
63
|
+
child.parent['multiplicity'] = @args.multiplicity
|
64
|
+
end
|
62
65
|
child.searchable @args.searchable.to_s
|
63
66
|
child.editable @args.editable.to_s
|
64
67
|
child.required @args.required
|
65
68
|
child.isVisible @args.isVisible
|
66
69
|
unless @args.maxLength.equal?(-1)
|
67
|
-
|
70
|
+
child.send("max-length", @args.maxLength )
|
68
71
|
end
|
69
72
|
if @args.validation_handler.nil? || @args.validation_handler == ''
|
70
73
|
child.validation handler: validation_handler_by_type(type)
|
@@ -80,11 +83,11 @@ class Mio
|
|
80
83
|
end
|
81
84
|
end
|
82
85
|
end
|
83
|
-
if !@args.
|
86
|
+
if !@args.children.nil? && @args.children.length > 0
|
84
87
|
child.children do |children|
|
85
|
-
@args.
|
86
|
-
definition = Mio::Model::MetadataDefinition::Definition.new @client, OpenStruct.new(
|
87
|
-
definition.build_xml children,
|
88
|
+
@args.children.each do |childDef|
|
89
|
+
definition = Mio::Model::MetadataDefinition::Definition.new @client, OpenStruct.new(childDef)
|
90
|
+
definition.build_xml children, childDef[:type]
|
88
91
|
end
|
89
92
|
end
|
90
93
|
end
|