infopark_fiona7 0.71.1.0 → 0.71.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/fiona7_ui.js +5 -18
- data/app/controllers/fiona7/release_controller.rb +8 -5
- data/lib/fiona7/builder/obj_builder.rb +1 -1
- data/lib/fiona7/json/obj_decorator.rb +5 -1
- data/lib/fiona7/scrivito_user.rb +2 -0
- data/lib/fiona7/type_loader.rb +1 -0
- data/lib/fiona7/type_synchronizer.rb +1 -1
- data/lib/fiona7/verity_search_engine.rb +24 -22
- data/lib/fiona7/version.rb +1 -1
- data/lib/fiona7/widget_resolver.rb +11 -4
- data/lib/fiona7/workspace.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6138dff9bbb3210c8e77bb4b11d3972134f83954
|
4
|
+
data.tar.gz: 10aece82213930a7034b49dd23b6a74bfc5586d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97616528eb79c32a0f34b4ffe12ab72632baf778cb5baa26299d461b36c697b5b796ebc3c5de95b9191ee7a2c0eb36c40737205b5500b59d9ea61bfff7bcad12
|
7
|
+
data.tar.gz: 53f3de235ab3adc20b6693758da37db68dd09f6577d5236726917fea813d6415ee4c0c9ca20a853857ff234b499e1324abbb3d6fd3062b4160a09b07129625e6
|
@@ -165,6 +165,10 @@
|
|
165
165
|
if (action == 'release' && !obj.modification()) {
|
166
166
|
return scrivito.t('commands.release_obj.not_modified_obj');
|
167
167
|
}
|
168
|
+
if (action == 'release' && obj.has_restriction()) {
|
169
|
+
return obj.restriction_messages().join("; ");
|
170
|
+
|
171
|
+
}
|
168
172
|
},
|
169
173
|
|
170
174
|
update: function() {
|
@@ -177,7 +181,7 @@
|
|
177
181
|
scrivito.with_saving_overlay(scrivito.ajax('PUT', 'objs/' + obj.id() + '/release?comment=' + (comment || "")).then(function() {
|
178
182
|
scrivito.reload();
|
179
183
|
}).fail(function(error) {
|
180
|
-
scrivito.alert_dialog(scrivito.t('
|
184
|
+
scrivito.alert_dialog(scrivito.t('commands.'+action+'_obj.failed'));
|
181
185
|
}));
|
182
186
|
});
|
183
187
|
}
|
@@ -194,23 +198,6 @@
|
|
194
198
|
|
195
199
|
return;
|
196
200
|
|
197
|
-
/* patch the create page command to not create incomprehensible paths */
|
198
|
-
scrivito.child_list_element.create_instance = function(cms_element) {
|
199
|
-
var ret = original_create_instance.call(this, cms_element);
|
200
|
-
if (typeof ret === "object") {
|
201
|
-
ret.create_child = function(obj_class) {
|
202
|
-
var path = (cms_element.path() + '/' + obj_class).replace(/\/\//g, "/");
|
203
|
-
|
204
|
-
return scrivito.obj.create({
|
205
|
-
_path: path,
|
206
|
-
_obj_class: obj_class
|
207
|
-
});
|
208
|
-
};
|
209
|
-
}
|
210
|
-
return ret;
|
211
|
-
};
|
212
|
-
|
213
|
-
|
214
201
|
/* enforce permissions */
|
215
202
|
var originalGuiStart = scrivito.gui.start;
|
216
203
|
scrivito.gui.start = function () {
|
@@ -32,12 +32,12 @@ module Fiona7
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def recursively_find_objects(set, obj, already_encountered)
|
35
|
-
# already_encountered
|
35
|
+
# substract already_encountered to prevent loops
|
36
36
|
widgets_of_this_object = widgets(obj) - already_encountered
|
37
37
|
referenced_objects_of_this_object = referenced_objects(obj) - already_encountered
|
38
38
|
|
39
39
|
already_encountered.merge(widgets_of_this_object)
|
40
|
-
already_encountered.merge(
|
40
|
+
already_encountered.merge(referenced_objects_of_this_object)
|
41
41
|
|
42
42
|
widgets_of_this_object.each do |widget|
|
43
43
|
recursively_find_objects(set, widget, already_encountered)
|
@@ -63,11 +63,14 @@ module Fiona7
|
|
63
63
|
referenced = Set.new
|
64
64
|
|
65
65
|
type_definition = Fiona7::TypeRegister.instance.read_mangled(obj.obj_class)
|
66
|
-
type_definition.
|
67
|
-
if attribute.type == :reference || attribute.type == :referencelist
|
66
|
+
type_definition.attrs.each do |attribute|
|
67
|
+
if attribute.type == :reference || attribute.type == :referencelist && attribute.name != "child_order"
|
68
68
|
(obj[attribute.real_name] || []).each do |link|
|
69
69
|
if link.internal?
|
70
|
-
|
70
|
+
destination_object = link.destination_object
|
71
|
+
if destination_object && (destination_object.image? || destination_object.generic?)
|
72
|
+
referenced << link.destination_object
|
73
|
+
end
|
71
74
|
end
|
72
75
|
end
|
73
76
|
end
|
@@ -87,7 +87,11 @@ module Fiona7
|
|
87
87
|
{id: "%032d" % @obj.id.to_s}
|
88
88
|
end
|
89
89
|
when :enum, :multienum, :text, :string
|
90
|
-
|
90
|
+
if real_attribute_name == "suppress_export"
|
91
|
+
@obj[real_attribute_name].to_s
|
92
|
+
else
|
93
|
+
@obj[real_attribute_name]
|
94
|
+
end
|
91
95
|
when :stringlist
|
92
96
|
if Fiona7.mode == :legacy && real_attribute_name == "channels"
|
93
97
|
@obj["channels"] || []
|
data/lib/fiona7/scrivito_user.rb
CHANGED
@@ -36,6 +36,8 @@ module Fiona7
|
|
36
36
|
obj = Fiona7::WriteObj.find_by_path(path)
|
37
37
|
if !obj || !obj.permission.release?(rsession_user.user_name)
|
38
38
|
I18n.t(:"fiona7.publish_permission_resticted", path: path)
|
39
|
+
elsif obj && !obj.valid?(:release)
|
40
|
+
obj.errors.join("\n")
|
39
41
|
end
|
40
42
|
end
|
41
43
|
end
|
data/lib/fiona7/type_loader.rb
CHANGED
@@ -31,6 +31,7 @@ module Fiona7
|
|
31
31
|
type_definition.add_attr('valid_from', :date, 'valid_from', :date)
|
32
32
|
type_definition.add_attr('valid_until', :date, 'valid_until', :date)
|
33
33
|
type_definition.add_attr('channels', :stringlist, 'channels', :stringlist)
|
34
|
+
type_definition.add_attr('suppress_export', :enum, 'suppress_export', :enum, ['0', '1'])
|
34
35
|
|
35
36
|
if self.rc_obj_class.obj_type == 'publication' || self.rc_obj_class.obj_type == 'document'
|
36
37
|
type_definition.add_attr('body', :html, 'body', :html)
|
@@ -45,7 +45,7 @@ module Fiona7
|
|
45
45
|
|
46
46
|
def builder_attributes
|
47
47
|
self.type_definition.attrs.map do |attribute_definition|
|
48
|
-
next if ['title', 'blob', 'body', 'valid_from', 'valid_until', 'channels'].include?(attribute_definition.real_name)
|
48
|
+
next if ['title', 'blob', 'body', 'valid_from', 'valid_until', 'channels', 'suppress_export'].include?(attribute_definition.real_name)
|
49
49
|
|
50
50
|
desc = {
|
51
51
|
real_name: attribute_definition.real_name,
|
@@ -64,47 +64,44 @@ module Fiona7
|
|
64
64
|
|
65
65
|
def build_query_string(query)
|
66
66
|
query = normalize_query(query)
|
67
|
-
|
68
|
-
full_text_query_string(extract_words(query))
|
69
|
-
else
|
70
|
-
complex_query_string(query)
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
def full_text_query?(query)
|
75
|
-
query.any? {|q| q[:field] == :'*' && (q[:operator] == :prefix_search || q[:operator] == :search)}
|
67
|
+
complex_query_string(query)
|
76
68
|
end
|
77
69
|
|
78
70
|
def complex_query_string(query)
|
79
71
|
conditions = query.map do |q|
|
80
|
-
|
81
|
-
|
82
|
-
next
|
83
|
-
end
|
84
|
-
|
85
|
-
resolved_field = resolve_field_name(q[:field])
|
72
|
+
unresolved_field = q[:field]
|
73
|
+
resolved_field = resolve_field_name(unresolved_field)
|
86
74
|
|
87
75
|
# paths are sadly not in the search index.
|
88
76
|
next if resolved_field == :visiblePath
|
89
77
|
|
90
78
|
case q[:operator]
|
91
79
|
when :equal
|
92
|
-
if
|
80
|
+
if unresolved_field == :_modification
|
93
81
|
'("edited" <#IN> state)'
|
94
82
|
else
|
95
83
|
field_operator_value(resolved_field, "=", q[:value])
|
96
84
|
end
|
97
85
|
when :search
|
98
|
-
|
86
|
+
if unresolved_field == :'*'
|
87
|
+
full_text_query_string(as_values_array(q[:value]))
|
88
|
+
else
|
89
|
+
field_operator_value(resolved_field, "<#CONTAINS>", q[:value])
|
90
|
+
end
|
99
91
|
when :greater_than
|
100
92
|
field_operator_value(resolved_field, ">", q[:value])
|
101
93
|
when :less_than
|
102
94
|
field_operator_value(resolved_field, "<", q[:value])
|
103
95
|
when :prefix, :prefix_search
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
96
|
+
if unresolved_field == :'*'
|
97
|
+
values = as_values_array(q[:value])
|
98
|
+
values = values.map {|v| "#{v}*" }
|
99
|
+
full_text_query_string(values)
|
100
|
+
else
|
101
|
+
values = as_values_array(q[:value])
|
102
|
+
values = values.map {|v| "#{v}*" }
|
103
|
+
values_operator_field(values, "<#IN>", resolved_field)
|
104
|
+
end
|
108
105
|
else
|
109
106
|
raise "Operator: #{q[:operator]} not supported"
|
110
107
|
end
|
@@ -171,7 +168,12 @@ module Fiona7
|
|
171
168
|
end
|
172
169
|
end
|
173
170
|
|
174
|
-
def
|
171
|
+
def as_values_array(values)
|
172
|
+
values = [values] unless values.kind_of?(Array)
|
173
|
+
values
|
174
|
+
end
|
175
|
+
|
176
|
+
def extract_words(q)
|
175
177
|
q = query.find {|q| q[:field] == :'*' && (q[:operator] == :prefix_search || q[:operator] == :search) }
|
176
178
|
if q[:value].kind_of?(Array)
|
177
179
|
q[:value]
|
data/lib/fiona7/version.rb
CHANGED
@@ -24,13 +24,20 @@ module Fiona7
|
|
24
24
|
self.id_map = widget_id_to_object_id_map.dup
|
25
25
|
self.path_map = Hash[
|
26
26
|
widget_id_to_object_id_map.map {|widget_id, obj_id|
|
27
|
-
|
28
|
-
|
27
|
+
path = object_id_to_widget_instance_map[obj_id].try(:path)
|
28
|
+
next unless path
|
29
|
+
[widget_id, object_id_to_widget_instance_map[obj_id].try(:path)]
|
30
|
+
}.compact
|
29
31
|
]
|
30
32
|
self.instance_map = Hash[
|
31
33
|
widget_id_to_object_id_map.map {|widget_id, obj_id|
|
32
|
-
|
33
|
-
|
34
|
+
object = object_id_to_widget_instance_map[obj_id]
|
35
|
+
if !object
|
36
|
+
Rails.logger.error("Unable to find widget with id #{widget_id} (obj_id = #{obj_Id})")
|
37
|
+
next
|
38
|
+
end
|
39
|
+
[widget_id, object]
|
40
|
+
}.compact
|
34
41
|
]
|
35
42
|
end
|
36
43
|
end
|
data/lib/fiona7/workspace.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infopark_fiona7
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.71.1.
|
4
|
+
version: 0.71.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomasz Przedmojski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|