mio-config 2.2.0 → 2.3.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebb01782fede6f0e8f83cc84eacc98bcf13b2a98
|
4
|
+
data.tar.gz: f5645b0e827640c097d58c2edc8c079197fabc73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2aff49bc4af3ac170af91b0c53b7541a2af4245a52b5f46adbddff4c3d4f2e098149080a8963bef5c26808a7a65d0bddd7a853915cb9a4b70b8da8c81eef7b3b
|
7
|
+
data.tar.gz: 74d12e1cde8508020bc2917710fde4e5d08728ab78d6d0c840bd755f6e6d2657d6152ea96d6f256f923a0d8947b3b737f9ddfa72e1cec80f13e97b2313aae449
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'nokogiri'
|
2
2
|
|
3
3
|
class Mio
|
4
4
|
class Model
|
@@ -21,55 +21,90 @@ class Mio
|
|
21
21
|
visibilityIds: @args.visibility}
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
24
|
+
def validation_handler_by_type type
|
25
|
+
case type
|
26
|
+
when 'text'
|
27
|
+
'tv.nativ.mio.metadata.variable.def.validation.MaxLengthValidationHandler'
|
28
|
+
when 'image'
|
29
|
+
'tv.nativ.mio.metadata.resource.def.MioFileVariable.FileValidationHandler'
|
30
|
+
when 'string'
|
31
|
+
'tv.nativ.mio.metadata.variable.def.validation.MaxLengthValidationHandler'
|
32
|
+
when 'url'
|
33
|
+
'tv.nativ.mio.metadata.resource.def.MioURLVariable$URLValidationHandler'
|
34
|
+
else
|
35
|
+
''
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def build_options_xml children, hash
|
40
|
+
children.send("option-child", name: hash.fetch(:name),
|
41
|
+
default: hash.fetch(:default),
|
42
|
+
value: hash.fetch(:value),
|
43
|
+
display_name: hash.fetch(:displayName));
|
44
|
+
end
|
45
|
+
|
46
|
+
def build_children_xml children, hash, type=nil
|
47
|
+
if type.nil?
|
48
|
+
type = hash.fetch(:type)
|
49
|
+
end
|
50
|
+
children.send(type+'_', name: hash.fetch(:name), display_name: hash.fetch(:displayName)) do |child|
|
51
|
+
child.searchable hash.fetch(:searchable).to_s
|
52
|
+
child.editable hash.fetch(:editable).to_s
|
53
|
+
child.required hash.fetch(:required)
|
54
|
+
if hash.key?(:maxLength)
|
55
|
+
max_length = hash.fetch(:maxLength)
|
56
|
+
unless max_length.nil? && max_length.equal?(-1)
|
57
|
+
child.send("max-length", max_length )
|
58
|
+
end
|
59
|
+
end
|
60
|
+
if hash.key?(:validationHandler)
|
61
|
+
validation_handler = hash.fetch(:validationHandler)
|
62
|
+
unless validation_handler.nil?
|
63
|
+
child.validation handler: validation_handler
|
64
|
+
else
|
65
|
+
child.validation handler: validation_handler_by_type(type)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
if hash.key?(:formType)
|
69
|
+
child.send("form-type", hash.fetch(:formType))
|
70
|
+
end
|
71
|
+
if hash.key?(:options)
|
72
|
+
options = hash.fetch(:options)
|
73
|
+
unless options.nil? && options.length > 0
|
74
|
+
child.children do |children|
|
75
|
+
options.each do |option|
|
76
|
+
build_options_xml children, option
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
if hash.key?(:strings)
|
82
|
+
strings = hash.fetch(:strings)
|
83
|
+
unless strings.nil? && strings.length > 0
|
84
|
+
child.children do |children|
|
85
|
+
strings.each do |string|
|
86
|
+
build_children_xml children, string, 'string'
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
30
90
|
end
|
31
91
|
end
|
32
|
-
xml
|
33
92
|
end
|
34
93
|
|
35
94
|
def definition_xml
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
text.editable definition.fetch(:editable).to_s;
|
48
|
-
text.required definition.fetch(:required);
|
49
|
-
text.validation(handler: definition.fetch(:validationHandler));
|
50
|
-
text.tag! "form-type" do |x|
|
51
|
-
x.text! definition.fetch(:formType);
|
52
|
-
end
|
53
|
-
end
|
54
|
-
when "select"
|
55
|
-
children.tag!("single-option", name: definition.fetch(:name)) do |singleOption|
|
56
|
-
singleOption.searchable definition.fetch(:searchable).to_s;
|
57
|
-
singleOption.editable definition.fetch(:editable).to_s;
|
58
|
-
singleOption.required definition.fetch(:required);
|
59
|
-
singleOption.children do |children|
|
60
|
-
definition.fetch(:options).each do |option|
|
61
|
-
children.tag!("option-child", name: option.fetch(:name),
|
62
|
-
default: option.fetch(:default),
|
63
|
-
value: option.fetch(:value),
|
64
|
-
display_name: option.fetch(:displayName));
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
95
|
+
xml_builder = Nokogiri::XML::Builder.new do |xml|
|
96
|
+
xml.metadata(name: @args.name ) {
|
97
|
+
xml.searchable @args.searchable.to_s
|
98
|
+
xml.editable @args.editable.to_s
|
99
|
+
xml.required @args.required.to_s
|
100
|
+
xml.children do |children|
|
101
|
+
@args.definitions.each do |definition|
|
102
|
+
build_children_xml children, definition
|
103
|
+
end
|
104
|
+
end
|
105
|
+
}
|
71
106
|
end
|
72
|
-
|
107
|
+
xml_builder.to_xml
|
73
108
|
end
|
74
109
|
|
75
110
|
def go
|
@@ -5,12 +5,14 @@ class Mio
|
|
5
5
|
set_resource :metadatadefinition
|
6
6
|
|
7
7
|
field :name, String, 'Metadata Definition Name'
|
8
|
+
field :displayName, String, 'Display name'
|
9
|
+
field :type, String, 'Metdata type text|single-option|checkbox|image', 'textarea'
|
8
10
|
field :description, String, 'Metadata Definition Description'
|
9
|
-
field :type, String, 'Metadata type'
|
10
11
|
field :searchable, Symbol, 'Indexed and searchable', :true
|
11
12
|
field :editable, Symbol, 'Editable field', :true
|
12
13
|
field :required, Symbol, 'Required mandatory metadata item', :true
|
13
14
|
field :formType, String, 'Form control type'
|
15
|
+
field :maxLength, Fixnum, 'MaxLength', -1
|
14
16
|
field :validationHandler, String, 'Validation handler', nil
|
15
17
|
field :options, Array, 'Array of options', nil
|
16
18
|
|
data/lib/mio/model/{create_place_holder_group_asset.rb → place_holder_group_asset_action.rb}
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
class Mio
|
2
2
|
class Model
|
3
|
-
class
|
3
|
+
class PlaceHolderGroupAssetAction < Model
|
4
4
|
set_resource :actions
|
5
5
|
|
6
6
|
field :name, String, 'Name of the place holder asset'
|
@@ -22,7 +22,6 @@ class Mio
|
|
22
22
|
}
|
23
23
|
end
|
24
24
|
|
25
|
-
|
26
25
|
def metadata_definition_id metadata_definition_name
|
27
26
|
r = 'metadataDefinitions'
|
28
27
|
metadata_definitions = @client.find_all(r)
|
@@ -35,7 +34,6 @@ class Mio
|
|
35
34
|
md['id']
|
36
35
|
end
|
37
36
|
|
38
|
-
|
39
37
|
def config_hash
|
40
38
|
{"name": @args.name,
|
41
39
|
"asset-type": 'group-asset',
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mio-config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jspc
|
@@ -11,20 +11,6 @@ bindir: bin
|
|
11
11
|
cert_chain: []
|
12
12
|
date: 2016-04-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: builder
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - ">="
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '0'
|
21
|
-
type: :runtime
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '0'
|
28
14
|
- !ruby/object:Gem::Dependency
|
29
15
|
name: colorize
|
30
16
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,6 +67,20 @@ dependencies:
|
|
81
67
|
- - "~>"
|
82
68
|
- !ruby/object:Gem::Version
|
83
69
|
version: '2.9'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: nokogiri
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '1.6'
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '1.6'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: rake
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,7 +109,6 @@ files:
|
|
109
109
|
- "./lib/mio/migrations.rb"
|
110
110
|
- "./lib/mio/model.rb"
|
111
111
|
- "./lib/mio/model/autoload.rb"
|
112
|
-
- "./lib/mio/model/create_place_holder_group_asset.rb"
|
113
112
|
- "./lib/mio/model/groovy_script.rb"
|
114
113
|
- "./lib/mio/model/groovy_script_wait.rb"
|
115
114
|
- "./lib/mio/model/hotfolder.rb"
|
@@ -117,6 +116,7 @@ files:
|
|
117
116
|
- "./lib/mio/model/metadata_definition.rb"
|
118
117
|
- "./lib/mio/model/metadatadefinition/definition.rb"
|
119
118
|
- "./lib/mio/model/metadatadefinition/option.rb"
|
119
|
+
- "./lib/mio/model/place_holder_group_asset_action.rb"
|
120
120
|
- "./lib/mio/model/s3.rb"
|
121
121
|
- "./lib/mio/model/variant.rb"
|
122
122
|
- "./lib/mio/model/workflow.rb"
|