iqvoc 4.0.5 → 4.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 4.0.6
2
+
3
+ * Bugfixes for Triplestore Sync and configuration
4
+
1
5
  ## 4.0.5
2
6
 
3
7
  * Fixed a bug where triple store sync wouldn't load in engine mode
data/Gemfile.lock CHANGED
@@ -87,8 +87,7 @@ GEM
87
87
  iq_rdf (0.1.8)
88
88
  builder
89
89
  bundler
90
- iq_triplestorage (0.1.2)
91
- typhoeus
90
+ iq_triplestorage (0.1.4)
92
91
  jdbc-mysql (5.1.13)
93
92
  jdbc-sqlite3 (3.7.2)
94
93
  journey (1.0.4)
@@ -182,9 +181,6 @@ GEM
182
181
  polyglot (>= 0.3.1)
183
182
  turn (0.9.6)
184
183
  ansi
185
- typhoeus (0.4.2)
186
- ffi (~> 1.0)
187
- mime-types (~> 1.18)
188
184
  tzinfo (0.3.33)
189
185
  uglifier (1.3.0)
190
186
  execjs (>= 0.3.0)
@@ -22,6 +22,9 @@ class TriplestoreSyncController < ApplicationController
22
22
  def index
23
23
  authorize! :use, :dashboard
24
24
 
25
+ flash.now[:info] = [I18n.t("txt.controllers.triplestore_sync.batch_hint",
26
+ :host => root_url(:lang => nil))]
27
+
25
28
  if Iqvoc.config["triplestore.url"] == Iqvoc.config.defaults["triplestore.url"]
26
29
  flash.now[:warning] = I18n.t("txt.controllers.triplestore_sync.config_warning")
27
30
  else
@@ -34,7 +37,7 @@ class TriplestoreSyncController < ApplicationController
34
37
  elsif username
35
38
  target_info = "#{target_info} (as #{username})" # XXX: i18n
36
39
  end
37
- flash.now[:info] = I18n.t("txt.controllers.triplestore_sync.config_info",
40
+ flash.now[:info] << I18n.t("txt.controllers.triplestore_sync.config_info",
38
41
  :target_info => target_info)
39
42
  end
40
43
 
@@ -151,7 +151,7 @@ class Collection::Base < Concept::Base
151
151
  #******** Validation methods
152
152
 
153
153
  # This only prevent circles of length 2.
154
- # # TODO: This shuold be a real circle detector (but still performant) or be
154
+ # TODO: This should be a real circle detector (but still performant) or be
155
155
  # removed (seems to me like the better idea).
156
156
  def circular_subcollections
157
157
  Iqvoc::Collection.base_class.by_origin(@member_collection_origins).each do |subcollection|
@@ -21,8 +21,10 @@
21
21
  <div class="row">
22
22
  <div class="<%= content_for?(:sidebar) ? "span9" : "span12" %>" id="content">
23
23
  <%= yield :page_header %>
24
- <% flash.each do |type, msg| %>
25
- <%= alert(type) { msg } %>
24
+ <% flash.each do |type, messages| %>
25
+ <% (messages.is_a?(Array) ? messages : [messages]).each do |msg| %>
26
+ <%= alert(type) { msg } %>
27
+ <% end %>
26
28
  <% end %>
27
29
  <%= yield %>
28
30
  </div>
@@ -1,4 +1,4 @@
1
- <h1>The Structure of Domain Terminologies in iQvoc</h1>
1
+ <%= page_header :title => "The Structure of Domain Terminologies in iQvoc" %>
2
2
 
3
3
  <p>Domain terminologies are implemented based on the
4
4
  <a href="http://www.w3.org/TR/skos-reference/">Simple Knowledge Organisation System</a>
@@ -337,6 +337,7 @@ de:
337
337
  error: "Bei der Synchronisierung traten Fehler auf - einige Einträge wurden nicht synchronisiert."
338
338
  config_info: "Synchronisierung mit Triplestore: %{target_info}"
339
339
  config_warning: "Bisher wurde kein Triplestore konfiguriert."
340
+ batch_hint: "Für große Datenmengen sollte vom Systemadministrator `rake sync:all[%{host}]` ausgeführt werden."
340
341
 
341
342
  models:
342
343
  label:
@@ -344,6 +344,7 @@ en:
344
344
  error: "An error occurred during the synchronization process - some entities have not been synchronized."
345
345
  config_info: "Synchronizing with triplestore: %{target_info}"
346
346
  config_warning: "Triplestore has not been configured yet."
347
+ batch_hint: "For a large data sets please advise your sysadmin to execute `rake sync:all[%{host}]`."
347
348
 
348
349
  models:
349
350
  label:
data/config/routes.rb CHANGED
@@ -28,6 +28,9 @@ Rails.application.routes.draw do
28
28
  resources :concepts
29
29
  resources :collections
30
30
 
31
+ get "triplestore_sync" => "triplestore_sync#index"
32
+ post "triplestore_sync" => "triplestore_sync#sync"
33
+
31
34
  match "/" => "frontpage#index"
32
35
 
33
36
  match "concepts/:origin/branch(.:format)" => "concepts/versions#branch", :as => "concept_versions_branch"
@@ -56,9 +59,6 @@ Rails.application.routes.draw do
56
59
  get "help" => "pages#help", :as => "help"
57
60
 
58
61
  root :to => 'frontpage#index', :format => nil
59
-
60
- get "triplestore_sync" => "triplestore_sync#index"
61
- post "triplestore_sync" => "triplestore_sync#sync"
62
62
  end
63
63
 
64
64
  match '/scheme(.:format)' => 'rdf#scheme', :as => 'scheme'
@@ -78,7 +78,7 @@ module Iqvoc
78
78
  raise UnregisteredSetting unless @defaults.include?(key)
79
79
  self.class.validate_value(value)
80
80
 
81
- json = JSON.dump(value)
81
+ json = JSON.dump([value])[1..-2] # temporary array wrapper ensures valid JSON text
82
82
  if setting = ConfigurationSetting.find_by_key(key)
83
83
  setting.update_attributes(:value => json)
84
84
  else
@@ -94,11 +94,11 @@ module Iqvoc
94
94
 
95
95
  # populate settings caches
96
96
  # (subsequent updates will happen automatically via the respective setters)
97
- def initialize_cache(force=false)
97
+ def initialize_cache
98
98
  # cache customized settings
99
99
  db_settings = ConfigurationSetting.all rescue [] # database table might not exist yet (pre-migration)
100
100
  db_settings.each do |setting|
101
- @records[setting.key] = JSON.load(setting.value)
101
+ @records[setting.key] = JSON.load("[#{setting.value}]")[0] # temporary array wrapper ensures valid JSON text
102
102
  end
103
103
 
104
104
  # cache current settings
@@ -12,7 +12,7 @@ class Iqvoc::RDFSync
12
12
  @target_port = options[:port]
13
13
  @username = options[:username]
14
14
  @password = options[:password]
15
- @batch_size = options[:batch_size]
15
+ @batch_size = options[:batch_size] || 100
16
16
  @view_context = options[:view_context] # XXX: not actually optional
17
17
  raise(ArgumentError, "missing view context") unless @view_context # XXX: smell (see above)
18
18
  end
data/lib/iqvoc/version.rb CHANGED
@@ -15,5 +15,5 @@
15
15
  # limitations under the License.
16
16
 
17
17
  module Iqvoc
18
- VERSION = "4.0.5"
18
+ VERSION = "4.0.6"
19
19
  end
@@ -0,0 +1,57 @@
1
+ namespace :sync do
2
+ task :all, [:host] => :environment do |t, args|
3
+ require 'iqvoc'
4
+ require 'iqvoc/rdf_sync'
5
+
6
+ if Iqvoc.config["triplestore.url"] == Iqvoc.config.defaults["triplestore.url"] # XXX: duplicates controller
7
+ puts I18n.t("txt.controllers.triplestore_sync.config_warning")
8
+ fail
9
+ end
10
+
11
+ ROOT = args[:host]
12
+ raise(ArgumentError, "host not specified") unless ROOT
13
+
14
+ include Rails.application.routes.url_helpers
15
+ default_url_options[:host] = ROOT
16
+
17
+ class FakeController
18
+ include Iqvoc::RDFSync::Helper
19
+ delegate :url_helpers, :to => "Rails.application.routes"
20
+
21
+ def root_url(*args)
22
+ ROOT
23
+ end
24
+
25
+ def view_context(*args)
26
+ default_url_options[:host] = root_url
27
+ view = FakeView.new(Rails.root.join("app", "views"))
28
+ view.controller = self
29
+ return view
30
+ end
31
+
32
+ # delegate URL helpers
33
+ def method_missing(name, *args, &block)
34
+ url_helpers.send(name, *args, &block)
35
+ end
36
+ end
37
+
38
+ class FakeView < ActionView::Base
39
+ include ApplicationHelper
40
+
41
+ attr_accessor :controller
42
+
43
+ # delegate URL helpers
44
+ def method_missing(name, *args, &block)
45
+ @controller.send(name, *args, &block)
46
+ end
47
+ end
48
+
49
+ puts I18n.t("txt.controllers.triplestore_sync.config_info",
50
+ :target_info => Iqvoc.config["triplestore.url"]) + " (host: #{ROOT})"
51
+ success = FakeController.new.triplestore_syncer.all
52
+ unless success
53
+ puts I18n.t("txt.controllers.triplestore_sync.error")
54
+ fail
55
+ end
56
+ end
57
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iqvoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.5
4
+ version: 4.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-11-05 00:00:00.000000000 Z
14
+ date: 2012-11-09 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
18
- requirement: &70184502750260 !ruby/object:Gem::Requirement
18
+ requirement: !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,15 @@ dependencies:
23
23
  version: 3.2.1
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70184502750260
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
28
+ requirements:
29
+ - - ~>
30
+ - !ruby/object:Gem::Version
31
+ version: 3.2.1
27
32
  - !ruby/object:Gem::Dependency
28
33
  name: bundler
29
- requirement: &70184502749760 !ruby/object:Gem::Requirement
34
+ requirement: !ruby/object:Gem::Requirement
30
35
  none: false
31
36
  requirements:
32
37
  - - ! '>='
@@ -34,10 +39,15 @@ dependencies:
34
39
  version: '0'
35
40
  type: :runtime
36
41
  prerelease: false
37
- version_requirements: *70184502749760
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
38
48
  - !ruby/object:Gem::Dependency
39
49
  name: kaminari
40
- requirement: &70184502748860 !ruby/object:Gem::Requirement
50
+ requirement: !ruby/object:Gem::Requirement
41
51
  none: false
42
52
  requirements:
43
53
  - - ! '>='
@@ -45,10 +55,15 @@ dependencies:
45
55
  version: '0'
46
56
  type: :runtime
47
57
  prerelease: false
48
- version_requirements: *70184502748860
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
49
64
  - !ruby/object:Gem::Dependency
50
65
  name: authlogic
51
- requirement: &70184502748140 !ruby/object:Gem::Requirement
66
+ requirement: !ruby/object:Gem::Requirement
52
67
  none: false
53
68
  requirements:
54
69
  - - ! '>='
@@ -56,10 +71,15 @@ dependencies:
56
71
  version: '0'
57
72
  type: :runtime
58
73
  prerelease: false
59
- version_requirements: *70184502748140
74
+ version_requirements: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
60
80
  - !ruby/object:Gem::Dependency
61
81
  name: cancan
62
- requirement: &70184502747340 !ruby/object:Gem::Requirement
82
+ requirement: !ruby/object:Gem::Requirement
63
83
  none: false
64
84
  requirements:
65
85
  - - ! '>='
@@ -67,10 +87,15 @@ dependencies:
67
87
  version: '0'
68
88
  type: :runtime
69
89
  prerelease: false
70
- version_requirements: *70184502747340
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ! '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
71
96
  - !ruby/object:Gem::Dependency
72
97
  name: iq_rdf
73
- requirement: &70184502746420 !ruby/object:Gem::Requirement
98
+ requirement: !ruby/object:Gem::Requirement
74
99
  none: false
75
100
  requirements:
76
101
  - - ~>
@@ -78,10 +103,15 @@ dependencies:
78
103
  version: 0.1.2
79
104
  type: :runtime
80
105
  prerelease: false
81
- version_requirements: *70184502746420
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ~>
110
+ - !ruby/object:Gem::Version
111
+ version: 0.1.2
82
112
  - !ruby/object:Gem::Dependency
83
113
  name: json
84
- requirement: &70184502745460 !ruby/object:Gem::Requirement
114
+ requirement: !ruby/object:Gem::Requirement
85
115
  none: false
86
116
  requirements:
87
117
  - - ! '>='
@@ -89,10 +119,15 @@ dependencies:
89
119
  version: '0'
90
120
  type: :runtime
91
121
  prerelease: false
92
- version_requirements: *70184502745460
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ none: false
124
+ requirements:
125
+ - - ! '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
93
128
  - !ruby/object:Gem::Dependency
94
129
  name: rails_autolink
95
- requirement: &70184502744860 !ruby/object:Gem::Requirement
130
+ requirement: !ruby/object:Gem::Requirement
96
131
  none: false
97
132
  requirements:
98
133
  - - ! '>='
@@ -100,10 +135,15 @@ dependencies:
100
135
  version: '0'
101
136
  type: :runtime
102
137
  prerelease: false
103
- version_requirements: *70184502744860
138
+ version_requirements: !ruby/object:Gem::Requirement
139
+ none: false
140
+ requirements:
141
+ - - ! '>='
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
104
144
  - !ruby/object:Gem::Dependency
105
145
  name: fastercsv
106
- requirement: &70184502743660 !ruby/object:Gem::Requirement
146
+ requirement: !ruby/object:Gem::Requirement
107
147
  none: false
108
148
  requirements:
109
149
  - - ! '>='
@@ -111,10 +151,15 @@ dependencies:
111
151
  version: '0'
112
152
  type: :runtime
113
153
  prerelease: false
114
- version_requirements: *70184502743660
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ none: false
156
+ requirements:
157
+ - - ! '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
115
160
  - !ruby/object:Gem::Dependency
116
161
  name: simple_form
117
- requirement: &70184502759300 !ruby/object:Gem::Requirement
162
+ requirement: !ruby/object:Gem::Requirement
118
163
  none: false
119
164
  requirements:
120
165
  - - ! '>='
@@ -122,10 +167,15 @@ dependencies:
122
167
  version: '0'
123
168
  type: :runtime
124
169
  prerelease: false
125
- version_requirements: *70184502759300
170
+ version_requirements: !ruby/object:Gem::Requirement
171
+ none: false
172
+ requirements:
173
+ - - ! '>='
174
+ - !ruby/object:Gem::Version
175
+ version: '0'
126
176
  - !ruby/object:Gem::Dependency
127
177
  name: sass-rails
128
- requirement: &70184502756620 !ruby/object:Gem::Requirement
178
+ requirement: !ruby/object:Gem::Requirement
129
179
  none: false
130
180
  requirements:
131
181
  - - ~>
@@ -133,10 +183,15 @@ dependencies:
133
183
  version: 3.2.5
134
184
  type: :runtime
135
185
  prerelease: false
136
- version_requirements: *70184502756620
186
+ version_requirements: !ruby/object:Gem::Requirement
187
+ none: false
188
+ requirements:
189
+ - - ~>
190
+ - !ruby/object:Gem::Version
191
+ version: 3.2.5
137
192
  - !ruby/object:Gem::Dependency
138
193
  name: iq_triplestorage
139
- requirement: &70184502755280 !ruby/object:Gem::Requirement
194
+ requirement: !ruby/object:Gem::Requirement
140
195
  none: false
141
196
  requirements:
142
197
  - - ! '>='
@@ -144,7 +199,12 @@ dependencies:
144
199
  version: '0'
145
200
  type: :runtime
146
201
  prerelease: false
147
- version_requirements: *70184502755280
202
+ version_requirements: !ruby/object:Gem::Requirement
203
+ none: false
204
+ requirements:
205
+ - - ! '>='
206
+ - !ruby/object:Gem::Version
207
+ version: '0'
148
208
  description: iQvoc - a SKOS(-XL) vocabulary management system built on the Semantic
149
209
  Web
150
210
  email:
@@ -440,6 +500,7 @@ files:
440
500
  - lib/tasks/heroku.rake
441
501
  - lib/tasks/importer.rake
442
502
  - lib/tasks/setup.rake
503
+ - lib/tasks/sync.rake
443
504
  - lib/templates/erb/scaffold/_form.html.erb
444
505
  - test/factories.rb
445
506
  - test/integration/alphabetical_test.rb
@@ -533,7 +594,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
533
594
  version: '0'
534
595
  requirements: []
535
596
  rubyforge_project:
536
- rubygems_version: 1.8.11
597
+ rubygems_version: 1.8.23
537
598
  signing_key:
538
599
  specification_version: 3
539
600
  summary: iQvoc