daengine 0.2.11 → 0.2.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,14 +1,16 @@
1
+ require 'active_resource'
2
+ require 'daengine'
1
3
  # Represents a generic piece of content for display on an OFI web property
2
4
  # This model represents the 'human edited' version of website content, final displayed
3
5
  # pages will be 'value added' with system-sourced data and 'mashed-in' data
4
6
  #
5
- class ContentServiceResource < ActiveResource::Base
6
- self.site = Daengine.config[:content_service_url]
7
- self.prefix = "/litcenter-service/query/"
8
- self.element_name = "resource"
7
+ class ContentServiceResource < ActiveResource::Base
9
8
 
10
- def self.find_all
11
- ContentServiceResource.find(:all, :params => {:contentQuery => "audienceIds='490,5270';;expired='false'"})
12
- end
9
+ # self.site = Daengine.config[:content_service_url]
10
+ self.prefix = "/litcenter-service/query/"
11
+ self.element_name = "resource"
13
12
 
14
- end
13
+ def self.find_all
14
+ ContentServiceResource.find(:all, :params => {:contentQuery => "audienceIds='490,5270';;expired='false'"})
15
+ end
16
+ end
@@ -19,7 +19,7 @@ class DigitalAsset
19
19
  field :content_organization_ids, type: Array, default: []
20
20
  field :program_ids, type: Array, default: []
21
21
  field :omniture_codes, type: Array, default: []
22
- field :orderable, :type => String
22
+ field :orderable, :type => Boolean
23
23
  key :guid
24
24
 
25
25
  # field :documents, type: Hash
@@ -41,6 +41,7 @@ class DigitalAsset
41
41
  scope :product_in, ->(types) {where(:product_ids.in => types)}
42
42
  scope :stale, -> {where(:updated_at.lte => 2.minutes.ago)}
43
43
  scope :orderable_is, ->(orderable) {where(:orderable => orderable)}
44
+ scope :orderable, -> {where(orderable: true)}
44
45
 
45
46
  # validations
46
47
  validates_presence_of :guid, :title, :changed_at, :published_at,
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env jruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'process_assets' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'daengine'
10
+
11
+ config = YAML.load_file(ARGV[0])
12
+
13
+ t = Daengine.execute_content_service(config)
14
+
15
+ puts t
data/lib/daengine.rb CHANGED
@@ -2,6 +2,7 @@ require "daengine/version"
2
2
  require 'daengine/engine'
3
3
  require File.expand_path('../../app/models/digital_asset',__FILE__)
4
4
  require File.expand_path('../../app/models/taxonomy_term',__FILE__)
5
+ require File.expand_path('../../app/models/content_service_resource',__FILE__)
5
6
  require 'daengine/teamsite_metadata_parser'
6
7
  require 'daengine/digital_asset_processor'
7
8
  require 'daengine/taxonomy_parser'
@@ -8,6 +8,7 @@ module Daengine
8
8
 
9
9
  def self.process_orderable
10
10
  result = DigitalAsset.all
11
+ ContentServiceResource.site = Daengine.config[:content_service_url] # for some reason this doesn't work from the class itself
11
12
  cs = ContentServiceResource.find_all
12
13
  result.each{ |da| set_orderable(da,cs)}
13
14
  end
@@ -15,7 +16,7 @@ module Daengine
15
16
  def self.set_orderable(da,cs)
16
17
  cs.each do |c|
17
18
  if da.sami_code == c.attributes[:samiCode]
18
- da.orderable = c.attributes[:orderable]
19
+ da.orderable = c.attributes[:orderable] == 'true'
19
20
  da.save!
20
21
  break
21
22
  end
@@ -1,3 +1,3 @@
1
1
  module Daengine
2
- VERSION = "0.2.11"
2
+ VERSION = "0.2.12"
3
3
  end
@@ -0,0 +1,11 @@
1
+ MONGODB [DEBUG] Logging level is currently :debug which could negatively impact client-side performance. You should set your logging level no lower than :info in production.
2
+ MONGODB (39ms) admin['$cmd'].find({:ismaster=>1}).limit(-1)
3
+ MONGODB [DEBUG] Logging level is currently :debug which could negatively impact client-side performance. You should set your logging level no lower than :info in production.
4
+ MONGODB (37ms) admin['$cmd'].find({:ismaster=>1}).limit(-1)
5
+ MONGODB [DEBUG] Logging level is currently :debug which could negatively impact client-side performance. You should set your logging level no lower than :info in production.
6
+ MONGODB (36ms) admin['$cmd'].find({:ismaster=>1}).limit(-1)
7
+ MONGODB [DEBUG] Logging level is currently :debug which could negatively impact client-side performance. You should set your logging level no lower than :info in production.
8
+ MONGODB (37ms) admin['$cmd'].find({:ismaster=>1}).limit(-1)
9
+ MONGODB (352ms) dummy_development['system.namespaces'].find({})
10
+ MONGODB (76ms) dummy_development['$cmd'].find({:create=>"digital_assets"}).limit(-1)
11
+ MONGODB (14ms) dummy_development['$cmd'].find({"count"=>"digital_assets", "query"=>{}, "fields"=>nil}).limit(-1)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: daengine
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.11
5
+ version: 0.2.12
6
6
  platform: ruby
7
7
  authors:
8
8
  - sbhatia
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-08-06 00:00:00.000000000Z
13
+ date: 2012-08-07 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -73,23 +73,19 @@ email:
73
73
  executables:
74
74
  - process_assets
75
75
  - process_taxonomy
76
+ - process_availability
76
77
  extensions: []
77
78
  extra_rdoc_files: []
78
79
  files:
79
- - app/assets/javascripts/digital_assets.js
80
- - app/assets/stylesheets/digital_assets.css
81
80
  - app/controllers/digital_assets_controller.rb
82
81
  - app/helpers/digital_assets_helper.rb
83
82
  - app/models/content_service_resource.rb
84
83
  - app/models/digital_asset.rb
85
84
  - app/models/taxonomy_term.rb
86
85
  - app/service/asset_lookup_service.rb
87
- - app/views/digital_assets/edit.html.erb
88
86
  - app/views/digital_assets/index.html.erb
89
- - app/views/digital_assets/new.html.erb
90
87
  - app/views/digital_assets/search.html.erb
91
88
  - app/views/digital_assets/show.html.erb
92
- - app/views/digital_assets/_form.html.erb
93
89
  - config/routes.rb
94
90
  - lib/daengine.rb
95
91
  - lib/daengine/content_service_processor.rb
@@ -131,6 +127,7 @@ files:
131
127
  - spec/dummy/config/initializers/wrap_parameters.rb
132
128
  - spec/dummy/config/locales/en.yml
133
129
  - spec/dummy/db/test.sqlite3
130
+ - spec/dummy/log/development.log
134
131
  - spec/dummy/log/test.log
135
132
  - spec/dummy/public/404.html
136
133
  - spec/dummy/public/422.html
@@ -156,6 +153,7 @@ files:
156
153
  - spec/models/digital_asset_spec.rb
157
154
  - bin/process_assets
158
155
  - bin/process_taxonomy
156
+ - bin/process_availability
159
157
  homepage: https://github.com/johnsinco/daengine
160
158
  licenses: []
161
159
  post_install_message:
@@ -208,6 +206,7 @@ test_files:
208
206
  - spec/dummy/config/initializers/wrap_parameters.rb
209
207
  - spec/dummy/config/locales/en.yml
210
208
  - spec/dummy/db/test.sqlite3
209
+ - spec/dummy/log/development.log
211
210
  - spec/dummy/log/test.log
212
211
  - spec/dummy/public/404.html
213
212
  - spec/dummy/public/422.html
@@ -1,2 +0,0 @@
1
- // Place all the behaviors and hooks related to the matching controller here.
2
- // All this logic will automatically be available in application.js.
@@ -1,4 +0,0 @@
1
- /*
2
- Place all the styles related to the matching controller here.
3
- They will automatically be included in application.css.
4
- */
@@ -1,17 +0,0 @@
1
- <%= form_for(@digital_asset) do |f| %>
2
- <% if @digital_asset.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(@digital_asset.errors.count, "error") %> prohibited this digital_asset from being saved:</h2>
5
-
6
- <ul>
7
- <% @digital_asset.errors.full_messages.each do |msg| %>
8
- <li><%= msg %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
13
-
14
- <div class="actions">
15
- <%= f.submit %>
16
- </div>
17
- <% end %>
@@ -1,6 +0,0 @@
1
- <h1>Editing digital_asset</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Show', @digital_asset %> |
6
- <%= link_to 'Back', digital_assets_path %>
@@ -1,5 +0,0 @@
1
- <h1>New digital_asset</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Back', digital_assets_path %>