rbbt-views 2.0.1 → 2.0.2

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.
@@ -743,6 +743,8 @@ module WorkflowREST
743
743
  result = step.load
744
744
 
745
745
  case
746
+ when workflow.task_info(task_name)[:result_type] == :binary
747
+ send_file step.path
746
748
  when workflow.task_info(task_name)[:result_type] == :annotations
747
749
  Annotated.tsv(result, :all).to_s
748
750
  when Array === result
@@ -38,7 +38,7 @@ module Entity
38
38
  klass += " " << options[:extra_classes] || "" if options.include? :extra_classes
39
39
  klass += " " << html_class if self.respond_to? :html_class
40
40
 
41
- main_annotation = options[:entity_type] || annotation_types.select{|a| Entity === a}.last.to_s
41
+ main_annotation = options[:entity_type] || annotation_types.select{|a| a.include? Entity::REST}.last.to_s
42
42
  entity_type = self.respond_to?(:format)? main_annotation +
43
43
  ":" +
44
44
  CGI.escape(self.format || "") : main_annotation
@@ -93,7 +93,9 @@ module Entity
93
93
  path = list_file(entity_type, id) unless path != nil and File.exists? path
94
94
 
95
95
  begin
96
- Annotated.load_tsv TSV.open(path)
96
+ list = Annotated.load_tsv TSV.open(path)
97
+ list.extend AnnotatedArray
98
+ list
97
99
  rescue
98
100
  nil
99
101
  end
@@ -138,17 +140,16 @@ module Entity
138
140
  klass += " " << options[:extra_classes] if options.include? :extra_classes
139
141
  klass += " " << html_class if self.respond_to? :html_class
140
142
 
141
- main_annotation = options[:entity_type] || annotation_types.select{|a| Entity === a}.last.to_s
143
+ main_annotation = options[:entity_type] || annotation_types.select{|a| a.include? Entity::REST}.last.to_s
142
144
  entity_type = self.respond_to?(:format)? main_annotation +
143
145
  ":" +
144
146
  CGI.escape(self.format || "") : main_annotation
145
147
 
146
148
 
147
- Entity::REST.save_list(annotation_types.last.to_s, id, self) unless reuse
149
+ Entity::REST.save_list(main_annotation, id, self) unless reuse
148
150
 
149
- annotations_str = self.info(true).reject{|k,v| [:annotation_types, :format].include?(k)}.collect{|k,v| [k, CGI.escape(v.to_s)] * "="} * "&amp;"
150
151
 
151
- "<a class='entity_list #{klass}' href='#{File.join("/entity_list", entity_type, CGI.escape(id)) + (! annotations_str.empty? ? '?' + annotations_str : "")}' title='#{text}'>#{text}</a>"
152
+ "<a class='entity_list #{klass}' href='#{File.join("/entity_list", entity_type, CGI.escape(id))}' title='#{text}'>#{text}</a>"
152
153
  end
153
154
 
154
155
  def action_link(action, text = nil, inputs = {})
@@ -181,14 +182,15 @@ module Entity
181
182
  klass += " " << options.delete(:extra_classes) if options.include? :extra_classes
182
183
  klass += " " << html_class if self.respond_to? :html_class
183
184
 
184
- main_annotation = options[:entity_type] || annotation_types.select{|a| Entity === a}.last.to_s
185
+ main_annotation = options[:entity_type] || annotation_types.select{|a| a.include? Entity::REST}.last.to_s
186
+
185
187
  entity_type = self.respond_to?(:format)? main_annotation +
186
188
  ":" +
187
189
  CGI.escape(self.format || "") : main_annotation
188
190
 
189
- Entity::REST.save_list(annotation_types.last.to_s, id, self) unless reuse
191
+ Entity::REST.save_list(main_annotation, id, self) unless reuse
190
192
 
191
- annotations_str = self.info.merge(options).reject{|k,v| [:annotation_types, :format].include?(k)}.collect{|k,v| [k, CGI.escape(v.to_s)] * "="} * "&amp;"
193
+ annotations_str = options.collect{|k,v| [k, CGI.escape(v.to_s)] * "="} * "&amp;"
192
194
 
193
195
  "<a class='entity_list_action #{klass}' href='#{File.join("/entity_list_action", entity_type, action, CGI.escape(id)) + (!annotations_str.empty? ? '?' + annotations_str : "")}' title='#{text}'>#{text}</a>"
194
196
  end
@@ -77,7 +77,16 @@ module RbbtHTMLHelpers
77
77
  else
78
78
  Log.debug("Saving user defaults for #{key}")
79
79
  user_action_defaults.write_and_close do
80
- user_action_defaults[key] = Hash[*(params.collect{|k,v| [k,v]}.flatten(1))]
80
+ begin
81
+ hash = {}
82
+ params.each{|k,v| hash[k.to_s.dup] = v.to_s.dup}
83
+ user_action_defaults[key.to_s.dup] = hash
84
+ rescue
85
+ Log.warn($!.message)
86
+ Log.warn("Error saving user defaults: #{[user, entity, action, params.inspect] * ", "}. Erasing")
87
+ user_action_defaults.delete key.dump
88
+ raise "Error saving default parameters. Cleared. Try reloading the page"
89
+ end
81
90
  end
82
91
  end
83
92
  end
@@ -282,7 +282,7 @@ module RbbtHTMLHelpers
282
282
  end
283
283
 
284
284
  if entity_class
285
- entity_class.setup(entity, *locals.values_at(*entity_class.all_annotations).collect{|v|
285
+ entity_class.setup(entity, *locals.values_at(*entity_class.annotations).collect{|v|
286
286
  case v
287
287
  when "false"
288
288
  false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-views
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-09 00:00:00.000000000 Z
12
+ date: 2013-01-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra