gb_mapfish_appserver 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -81,24 +81,18 @@ class GeoController < ApplicationController
81
81
 
82
82
  private
83
83
 
84
- # http://blog.plataformatec.com.br/2009/09/exporting-data-to-csv-and-excel-in-your-rails-app/
85
- BOM = "\377\376" #Byte Order Mark
86
-
87
84
  def send_csv_excel(features)
88
85
  require 'csv'
89
- require 'iconv'
90
- export = StringIO.new
91
- if features.size > 0
92
- CSV::Writer.generate(export, "\t") do |csv|
93
- csv << features.first.csv_header
94
- features.each do |obj|
95
- csv << obj.csv_row
96
- end
86
+
87
+ # add byte order mark and use CRLF row breaks for Excel
88
+ bom = "\xEF\xBB\xBF"
89
+ csv_data = CSV.generate(bom, {:write_headers => true, :col_sep => ";", :row_sep => "\r\n"}) do |csv|
90
+ csv << features.first.csv_header unless features.empty?
91
+ features.each do |adresse|
92
+ csv << adresse.csv_row
97
93
  end
98
- export.rewind
99
94
  end
100
- csv_data = export.read
101
- csv_data = BOM + Iconv.conv("utf-16le", "utf-8", csv_data)
95
+
102
96
  send_data(csv_data, :filename => "features_#{geo_model.table_name}.csv", :type => 'text/csv; header=present')
103
97
  end
104
98
 
@@ -476,8 +476,8 @@ class PrintController < ApplicationController
476
476
  'attributes' => {}
477
477
  }
478
478
 
479
- # report
480
- ['layout', 'outputFormat'].each do |k|
479
+ # report (NOTE: keep dpi for possible image conversion)
480
+ ['layout', 'outputFormat', 'dpi'].each do |k|
481
481
  print_params[k] = print_v2_params[k] if print_v2_params.has_key?(k)
482
482
  end
483
483
 
@@ -42,15 +42,15 @@ class TopicsController < ApplicationController
42
42
  authorize! :show, topic
43
43
  query_topic['topicobj'] = topic
44
44
  if params['bbox']
45
- query_topic['results'] = topic.query(current_ability, query_topic, params['bbox'], nearest)
45
+ query_topic['results'] = topic.query(current_ability, query_topic, params['bbox'], nearest, current_user)
46
46
  elsif params['rect']
47
47
  x1, y1, x2, y2 = params['rect'].split(',').collect(&:to_f)
48
48
  rect = "POLYGON((#{x1} #{y1}, #{x1} #{y2}, #{x2} #{y2}, #{x2} #{y1} ,#{x1} #{y1}))"
49
- query_topic['results'] = topic.query(current_ability, query_topic, rect, nearest)
49
+ query_topic['results'] = topic.query(current_ability, query_topic, rect, nearest, current_user)
50
50
  elsif params['circle']
51
- query_topic['results'] = topic.query(current_ability, query_topic, params['circle'], nearest)
51
+ query_topic['results'] = topic.query(current_ability, query_topic, params['circle'], nearest, current_user)
52
52
  elsif params['poly']
53
- query_topic['results'] = topic.query(current_ability, query_topic, params['poly'], nearest)
53
+ query_topic['results'] = topic.query(current_ability, query_topic, params['poly'], nearest, current_user)
54
54
  else
55
55
  # problem
56
56
  end
@@ -128,7 +128,7 @@ EOS
128
128
  allowed_fields
129
129
  end
130
130
 
131
- def query(ability, query_topic, searchgeo, nearest=nil)
131
+ def query(ability, query_topic, searchgeo, nearest=nil, user=nil)
132
132
  # use layer setting by default
133
133
  nearest = search_nearest if nearest.nil?
134
134
 
@@ -154,7 +154,7 @@ EOS
154
154
  feature_class.send(custom_query_method, self, query_topic, searchgeo)
155
155
  elsif feature_class.respond_to?(:identify_query)
156
156
  logger.debug "*** Custom identify_query on layer #{name}"
157
- feature_class.identify_query(searchgeo, searchdistance)
157
+ feature_class.identify_query(self, query_topic, searchgeo, ability, user)
158
158
  else
159
159
  logger.debug "*** Identify on layer #{name} with query fields #{query_fields(ability)} at #{searchgeo.inspect}"
160
160
  feature_class.identify_filter(searchgeo, searchdistance, nearest).where(where_filter).select(query_fields(ability)).all
@@ -179,12 +179,12 @@ class Topic < ActiveRecord::Base
179
179
  perms.collect(&:role)
180
180
  end
181
181
 
182
- def query(ability, query_topic, searchbbox, nearest=nil)
182
+ def query(ability, query_topic, searchbbox, nearest=nil, user=nil)
183
183
  active_layers = query_topic['layers'].split(',')
184
184
  qlayers = query_layers(ability, active_layers)
185
185
  results = []
186
186
  qlayers.each do |layer|
187
- result = layer.query(ability, query_topic, searchbbox, nearest)
187
+ result = layer.query(ability, query_topic, searchbbox, nearest, user)
188
188
  results << result unless result.nil?
189
189
  end
190
190
  results
@@ -1,3 +1,3 @@
1
1
  module GbMapfishAppserver
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,211 +1,170 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gb_mapfish_appserver
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Pirmin Kalberer
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-12-03 00:00:00.000000000 Z
12
+ date: 2016-02-01 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rails
15
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &4624460 !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
19
21
  version: 3.2.13
20
22
  type: :runtime
21
23
  prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ~>
25
- - !ruby/object:Gem::Version
26
- version: 3.2.13
24
+ version_requirements: *4624460
27
25
  - !ruby/object:Gem::Dependency
28
26
  name: json
29
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &4623660 !ruby/object:Gem::Requirement
28
+ none: false
30
29
  requirements:
31
30
  - - ! '>='
32
31
  - !ruby/object:Gem::Version
33
32
  version: '0'
34
33
  type: :runtime
35
34
  prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ! '>='
39
- - !ruby/object:Gem::Version
40
- version: '0'
35
+ version_requirements: *4623660
41
36
  - !ruby/object:Gem::Dependency
42
37
  name: acts_as_tree
43
- requirement: !ruby/object:Gem::Requirement
38
+ requirement: &4622600 !ruby/object:Gem::Requirement
39
+ none: false
44
40
  requirements:
45
- - - '='
41
+ - - =
46
42
  - !ruby/object:Gem::Version
47
43
  version: 0.2.0
48
44
  type: :runtime
49
45
  prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '='
53
- - !ruby/object:Gem::Version
54
- version: 0.2.0
46
+ version_requirements: *4622600
55
47
  - !ruby/object:Gem::Dependency
56
48
  name: devise
57
- requirement: !ruby/object:Gem::Requirement
49
+ requirement: &4621780 !ruby/object:Gem::Requirement
50
+ none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
61
54
  version: 2.2.0
62
55
  type: :runtime
63
56
  prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ~>
67
- - !ruby/object:Gem::Version
68
- version: 2.2.0
57
+ version_requirements: *4621780
69
58
  - !ruby/object:Gem::Dependency
70
59
  name: cancan
71
- requirement: !ruby/object:Gem::Requirement
60
+ requirement: &4621180 !ruby/object:Gem::Requirement
61
+ none: false
72
62
  requirements:
73
- - - '='
63
+ - - =
74
64
  - !ruby/object:Gem::Version
75
65
  version: 1.6.8
76
66
  type: :runtime
77
67
  prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - '='
81
- - !ruby/object:Gem::Version
82
- version: 1.6.8
68
+ version_requirements: *4621180
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: rails_admin
85
- requirement: !ruby/object:Gem::Requirement
71
+ requirement: &4620360 !ruby/object:Gem::Requirement
72
+ none: false
86
73
  requirements:
87
74
  - - ~>
88
75
  - !ruby/object:Gem::Version
89
76
  version: 0.4.9
90
77
  type: :runtime
91
78
  prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ~>
95
- - !ruby/object:Gem::Version
96
- version: 0.4.9
79
+ version_requirements: *4620360
97
80
  - !ruby/object:Gem::Dependency
98
81
  name: fastercsv
99
- requirement: !ruby/object:Gem::Requirement
82
+ requirement: &4618960 !ruby/object:Gem::Requirement
83
+ none: false
100
84
  requirements:
101
85
  - - ! '>='
102
86
  - !ruby/object:Gem::Version
103
87
  version: '0'
104
88
  type: :runtime
105
89
  prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ! '>='
109
- - !ruby/object:Gem::Version
110
- version: '0'
90
+ version_requirements: *4618960
111
91
  - !ruby/object:Gem::Dependency
112
92
  name: sass
113
- requirement: !ruby/object:Gem::Requirement
93
+ requirement: &4633360 !ruby/object:Gem::Requirement
94
+ none: false
114
95
  requirements:
115
96
  - - ~>
116
97
  - !ruby/object:Gem::Version
117
98
  version: 3.2.12
118
99
  type: :runtime
119
100
  prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ~>
123
- - !ruby/object:Gem::Version
124
- version: 3.2.12
101
+ version_requirements: *4633360
125
102
  - !ruby/object:Gem::Dependency
126
103
  name: GeoRuby
127
- requirement: !ruby/object:Gem::Requirement
104
+ requirement: &4631940 !ruby/object:Gem::Requirement
105
+ none: false
128
106
  requirements:
129
107
  - - ! '>='
130
108
  - !ruby/object:Gem::Version
131
109
  version: 0.1.4
132
110
  type: :runtime
133
111
  prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ! '>='
137
- - !ruby/object:Gem::Version
138
- version: 0.1.4
112
+ version_requirements: *4631940
139
113
  - !ruby/object:Gem::Dependency
140
114
  name: rgeo
141
- requirement: !ruby/object:Gem::Requirement
115
+ requirement: &4631200 !ruby/object:Gem::Requirement
116
+ none: false
142
117
  requirements:
143
118
  - - ~>
144
119
  - !ruby/object:Gem::Version
145
120
  version: 0.3.20
146
121
  type: :runtime
147
122
  prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ~>
151
- - !ruby/object:Gem::Version
152
- version: 0.3.20
123
+ version_requirements: *4631200
153
124
  - !ruby/object:Gem::Dependency
154
125
  name: rgeo-geojson
155
- requirement: !ruby/object:Gem::Requirement
126
+ requirement: &4630040 !ruby/object:Gem::Requirement
127
+ none: false
156
128
  requirements:
157
129
  - - ~>
158
130
  - !ruby/object:Gem::Version
159
131
  version: 0.2.3
160
132
  type: :runtime
161
133
  prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ~>
165
- - !ruby/object:Gem::Version
166
- version: 0.2.3
134
+ version_requirements: *4630040
167
135
  - !ruby/object:Gem::Dependency
168
136
  name: hpricot
169
- requirement: !ruby/object:Gem::Requirement
137
+ requirement: &4629180 !ruby/object:Gem::Requirement
138
+ none: false
170
139
  requirements:
171
140
  - - ! '>='
172
141
  - !ruby/object:Gem::Version
173
142
  version: '0'
174
143
  type: :runtime
175
144
  prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ! '>='
179
- - !ruby/object:Gem::Version
180
- version: '0'
145
+ version_requirements: *4629180
181
146
  - !ruby/object:Gem::Dependency
182
147
  name: pg
183
- requirement: !ruby/object:Gem::Requirement
148
+ requirement: &4627780 !ruby/object:Gem::Requirement
149
+ none: false
184
150
  requirements:
185
151
  - - ~>
186
152
  - !ruby/object:Gem::Version
187
153
  version: 0.14.0
188
154
  type: :runtime
189
155
  prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - ~>
193
- - !ruby/object:Gem::Version
194
- version: 0.14.0
156
+ version_requirements: *4627780
195
157
  - !ruby/object:Gem::Dependency
196
158
  name: activerecord-postgis-adapter
197
- requirement: !ruby/object:Gem::Requirement
159
+ requirement: &4626740 !ruby/object:Gem::Requirement
160
+ none: false
198
161
  requirements:
199
- - - '='
162
+ - - =
200
163
  - !ruby/object:Gem::Version
201
164
  version: 0.4.1
202
165
  type: :runtime
203
166
  prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - '='
207
- - !ruby/object:Gem::Version
208
- version: 0.4.1
167
+ version_requirements: *4626740
209
168
  description: Mapfish Appserver is a framework for web mapping applications using OGC
210
169
  standards and the Mapfish protocol.
211
170
  email:
@@ -470,26 +429,27 @@ files:
470
429
  - test/test_helper.rb
471
430
  homepage: http://mapfish-appserver.github.io/
472
431
  licenses: []
473
- metadata: {}
474
432
  post_install_message:
475
433
  rdoc_options: []
476
434
  require_paths:
477
435
  - lib
478
436
  required_ruby_version: !ruby/object:Gem::Requirement
437
+ none: false
479
438
  requirements:
480
439
  - - ! '>='
481
440
  - !ruby/object:Gem::Version
482
441
  version: '0'
483
442
  required_rubygems_version: !ruby/object:Gem::Requirement
443
+ none: false
484
444
  requirements:
485
445
  - - ! '>='
486
446
  - !ruby/object:Gem::Version
487
447
  version: '0'
488
448
  requirements: []
489
449
  rubyforge_project:
490
- rubygems_version: 2.2.2
450
+ rubygems_version: 1.8.11
491
451
  signing_key:
492
- specification_version: 4
452
+ specification_version: 3
493
453
  summary: Mapfish application server.
494
454
  test_files:
495
455
  - test/dummy/README.rdoc
@@ -621,4 +581,3 @@ test_files:
621
581
  - test/gb_mapfish_appserver_test.rb
622
582
  - test/integration/navigation_test.rb
623
583
  - test/test_helper.rb
624
- has_rdoc:
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZmFkMTY4MDk4Njg0YTdmNmJlYTU3MjU5NmZkMjI4Mzg5MWI2ZmFiYw==
5
- data.tar.gz: !binary |-
6
- MDczMjlkNmFiY2VjNjkwNzY3OWViNDNhMTUwMTE2MzI1NzgzZDg1Mg==
7
- SHA512:
8
- metadata.gz: !binary |-
9
- ZmRhNmNhNGM1YTJjOGI5YmU3MTZkNjg3ZDRjZmRjZmNjMjA5ZGRlYTk5ODIx
10
- NDBiMmZlMDllYWFmY2Y1MGE0OWE1YjNhY2E2MjQxNDVmZDFlOTgzNTM5YTA1
11
- MzE2MTBmOTAwYWU0YjA4ZDRjN2FiYmQ5NDMzYzEyZmZhNDA4ZjI=
12
- data.tar.gz: !binary |-
13
- YTgyYTFmMWNhYWNmMjYyMDkxNDBmNjNkNDg0ZDMzYzE5MDI5ODM5ZDk0ZTZh
14
- NjcwYThiNmZlYTM3ZmJhNTcyMzk2ZWFiZjQ3YWU0MzEwOWY4ODZlZTQxYjY0
15
- MjY5YmZiZDMxZGYxMjc0NDAyMGRiZjQ4Y2M5MTBhMDE1NTJkN2M=