talia_core 0.4.22 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. data/VERSION.yml +2 -2
  2. data/config/database.yml +9 -9
  3. data/config/rdfstore.yml +4 -4
  4. data/config/talia_core.yml +5 -2
  5. data/generators/generator_helpers.rb +66 -25
  6. data/generators/talia_admin/talia_admin_generator.rb +9 -9
  7. data/generators/talia_admin/templates/app/controllers/admin/admin_site_controller.rb +5 -0
  8. data/generators/talia_admin/templates/app/controllers/admin/custom_templates_controller.rb +7 -0
  9. data/generators/talia_admin/templates/app/controllers/admin/front_controller.rb +19 -0
  10. data/generators/talia_admin/templates/app/controllers/admin/talia_collections_controller.rb +7 -0
  11. data/generators/talia_admin/templates/app/controllers/admin/talia_sources_controller.rb +17 -0
  12. data/generators/talia_admin/templates/app/controllers/admin/users_controller.rb +7 -0
  13. data/generators/talia_admin/templates/app/controllers/users_controller.rb +7 -0
  14. data/generators/talia_admin/templates/app/helpers/admin/front_helper.rb +2 -0
  15. data/generators/talia_admin/templates/app/helpers/admin/talia_sources_helper.rb +7 -0
  16. data/generators/talia_admin/templates/app/helpers/users_helper.rb +2 -0
  17. data/generators/talia_admin/templates/app/models/guest.rb +7 -0
  18. data/generators/talia_admin/templates/app/models/talia_collection.rb +56 -0
  19. data/generators/talia_admin/templates/app/models/talia_source.rb +43 -0
  20. data/generators/talia_admin/templates/app/models/user.rb +59 -0
  21. data/generators/talia_admin/templates/app/models/user_mailer.rb +14 -0
  22. data/generators/talia_admin/templates/app/viewhints/talia_source_hints.rb +3 -0
  23. data/generators/talia_admin/templates/app/views/admin/custom_templates/index.dryml +7 -0
  24. data/generators/talia_admin/templates/app/views/admin/front/index.dryml +29 -0
  25. data/generators/talia_admin/templates/app/views/admin/front/summary.dryml +103 -0
  26. data/generators/talia_admin/templates/app/views/admin/talia_collections/index.dryml +7 -0
  27. data/generators/talia_admin/templates/app/views/admin/talia_sources/index.dryml +17 -0
  28. data/generators/talia_admin/templates/app/views/admin/talia_sources/show.dryml +8 -0
  29. data/generators/talia_admin/templates/app/views/admin/users/index.dryml +7 -0
  30. data/generators/talia_admin/templates/app/views/taglibs/admin_site.dryml +91 -0
  31. data/generators/talia_admin/templates/app/views/taglibs/application.dryml +9 -0
  32. data/generators/talia_admin/templates/app/views/taglibs/auto/admin/rapid/cards.dryml +34 -0
  33. data/generators/talia_admin/templates/app/views/taglibs/auto/admin/rapid/forms.dryml +71 -0
  34. data/generators/talia_admin/templates/app/views/taglibs/auto/admin/rapid/pages.dryml +543 -0
  35. data/generators/talia_admin/templates/app/views/taglibs/auto/rapid/cards.dryml +37 -0
  36. data/generators/talia_admin/templates/app/views/taglibs/auto/rapid/forms.dryml +35 -0
  37. data/generators/talia_admin/templates/app/views/taglibs/auto/rapid/pages.dryml +175 -0
  38. data/generators/talia_admin/templates/app/views/taglibs/front_site.dryml +1 -0
  39. data/generators/talia_admin/templates/app/views/taglibs/themes/clean/clean.dryml +10 -0
  40. data/generators/talia_admin/templates/app/views/user_mailer/forgot_password.erb +10 -0
  41. data/generators/talia_admin/templates/config/hobo_initializer.rb +1 -0
  42. data/generators/talia_admin/templates/migrations/create_users.rb +22 -0
  43. data/generators/talia_admin/templates/public/hobothemes/clean/images/101-3B5F87-ACD3E6.png +0 -0
  44. data/generators/talia_admin/templates/public/hobothemes/clean/images/30-3E547A-242E42.png +0 -0
  45. data/generators/talia_admin/templates/public/hobothemes/clean/images/30-DBE1E5-FCFEF5.png +0 -0
  46. data/generators/talia_admin/templates/public/hobothemes/clean/images/300-ACD3E6-fff.png +0 -0
  47. data/generators/talia_admin/templates/public/hobothemes/clean/images/50-ACD3E6-fff.png +0 -0
  48. data/generators/talia_admin/templates/public/hobothemes/clean/images/fieldbg.gif +0 -0
  49. data/generators/talia_admin/templates/public/hobothemes/clean/images/pencil.png +0 -0
  50. data/generators/talia_admin/templates/public/hobothemes/clean/images/small_close.png +0 -0
  51. data/generators/talia_admin/templates/public/hobothemes/clean/images/spinner.gif +0 -0
  52. data/generators/talia_admin/templates/public/hobothemes/clean/stylesheets/clean.css +326 -0
  53. data/generators/talia_admin/templates/public/hobothemes/clean/stylesheets/rapid-ui.css +100 -0
  54. data/generators/talia_admin/templates/public/javascripts/IE7.js +2 -0
  55. data/generators/talia_admin/templates/public/javascripts/blank.gif +0 -0
  56. data/generators/talia_admin/templates/public/javascripts/dryml-support.js +132 -0
  57. data/generators/talia_admin/templates/public/javascripts/hobo-rapid.js +937 -0
  58. data/generators/talia_admin/templates/public/javascripts/ie7-recalc.js +166 -0
  59. data/generators/talia_admin/templates/public/javascripts/lowpro.js +43 -25
  60. data/generators/talia_admin/templates/public/stylesheets/application.css +0 -0
  61. data/generators/talia_admin/templates/public/stylesheets/hobo-rapid.css +94 -0
  62. data/generators/talia_admin/templates/public/stylesheets/reset.css +95 -0
  63. data/generators/talia_admin/templates/test/fixtures/users.yml +7 -0
  64. data/generators/talia_admin/templates/test/functional/admin/{custom_templates_controller_test.rb → front_controller_test.rb} +1 -1
  65. data/generators/talia_admin/templates/test/functional/users_controller_test.rb +8 -0
  66. data/generators/talia_admin/templates/test/unit/user_test.rb +8 -0
  67. data/generators/talia_base/talia_base_generator.rb +24 -17
  68. data/generators/talia_oai/USAGE +0 -0
  69. data/generators/talia_oai/talia_oai_generator.rb +19 -0
  70. data/generators/talia_oai/templates/oai_controller.rb +9 -0
  71. data/generators/talia_oai/templates/oai_initializer.rb +16 -0
  72. data/lib/custom_template.rb +24 -0
  73. data/lib/talia_core/active_source_parts/class_methods.rb +1 -1
  74. data/lib/talia_core/active_source_parts/finders.rb +4 -0
  75. data/lib/talia_core/collection.rb +4 -0
  76. data/lib/talia_core/oai/active_source_model.rb +113 -0
  77. data/lib/talia_core/oai/active_source_oai_adapter/class_methods.rb +17 -0
  78. data/lib/talia_core/oai/active_source_oai_adapter.rb +106 -0
  79. data/lib/talia_core/semantic_property.rb +1 -0
  80. data/lib/talia_core/semantic_relation.rb +1 -0
  81. data/test/talia_core/active_source_test.rb +13 -0
  82. metadata +71 -59
  83. data/generators/talia_admin/templates/controllers/admin/background_controller.rb +0 -52
  84. data/generators/talia_admin/templates/controllers/admin/custom_templates_controller.rb +0 -25
  85. data/generators/talia_admin/templates/controllers/admin/locales_controller.rb +0 -15
  86. data/generators/talia_admin/templates/controllers/admin/roles_controller.rb +0 -8
  87. data/generators/talia_admin/templates/controllers/admin/sources_controller.rb +0 -9
  88. data/generators/talia_admin/templates/controllers/admin/translations_controller.rb +0 -61
  89. data/generators/talia_admin/templates/controllers/admin/users_controller.rb +0 -10
  90. data/generators/talia_admin/templates/controllers/admin_controller.rb +0 -7
  91. data/generators/talia_admin/templates/helpers/admin/background_helper.rb +0 -60
  92. data/generators/talia_admin/templates/helpers/admin/custom_templates_helper.rb +0 -5
  93. data/generators/talia_admin/templates/helpers/admin/locales_helper.rb +0 -2
  94. data/generators/talia_admin/templates/helpers/admin/roles_helper.rb +0 -2
  95. data/generators/talia_admin/templates/helpers/admin/sources_helper.rb +0 -65
  96. data/generators/talia_admin/templates/helpers/admin/translations_helper.rb +0 -51
  97. data/generators/talia_admin/templates/helpers/admin/users_helper.rb +0 -11
  98. data/generators/talia_admin/templates/helpers/admin_helper.rb +0 -30
  99. data/generators/talia_admin/templates/migrations/populate_users.rb +0 -14
  100. data/generators/talia_admin/templates/models/role.rb +0 -3
  101. data/generators/talia_admin/templates/public/javascripts/backend.js +0 -24
  102. data/generators/talia_admin/templates/public/stylesheets/talia_core/backend.css +0 -463
  103. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/body_bg.gif +0 -0
  104. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/footer_bg.gif +0 -0
  105. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/header.jpg +0 -0
  106. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/header_bg.gif +0 -0
  107. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/menu.jpg +0 -0
  108. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/menu_bg.gif +0 -0
  109. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/opednid.gif +0 -0
  110. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/page_bg.jpg +0 -0
  111. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/triangolino.gif +0 -0
  112. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/triangolino_full.gif +0 -0
  113. data/generators/talia_admin/templates/test/functional/admin/locales_controller_test.rb +0 -35
  114. data/generators/talia_admin/templates/test/functional/admin/sources_controller_test.rb +0 -109
  115. data/generators/talia_admin/templates/test/functional/admin/translations_controller_test.rb +0 -93
  116. data/generators/talia_admin/templates/test/functional/admin/users_controller_test.rb +0 -67
  117. data/generators/talia_admin/templates/test/functional/admin_controller_test.rb +0 -15
  118. data/generators/talia_admin/templates/views/admin/background/_finished.html.erb +0 -9
  119. data/generators/talia_admin/templates/views/admin/background/_pending.html.erb +0 -1
  120. data/generators/talia_admin/templates/views/admin/background/_progress.html.erb +0 -15
  121. data/generators/talia_admin/templates/views/admin/background/_running.html.erb +0 -11
  122. data/generators/talia_admin/templates/views/admin/background/environment.html.erb +0 -12
  123. data/generators/talia_admin/templates/views/admin/background/show.html.erb +0 -17
  124. data/generators/talia_admin/templates/views/admin/background/stderr.html.erb +0 -6
  125. data/generators/talia_admin/templates/views/admin/background/stdin.html.erb +0 -6
  126. data/generators/talia_admin/templates/views/admin/background/stdout.html.erb +0 -6
  127. data/generators/talia_admin/templates/views/admin/custom_templates/_content_form_column.rhtml +0 -2
  128. data/generators/talia_admin/templates/views/admin/custom_templates/_template_type_form_column.rhtml +0 -2
  129. data/generators/talia_admin/templates/views/admin/index.html.erb +0 -5
  130. data/generators/talia_admin/templates/views/admin/locales/new.html.erb +0 -9
  131. data/generators/talia_admin/templates/views/admin/sources/_show.html.erb +0 -13
  132. data/generators/talia_admin/templates/views/admin/translations/_new_translation.html.erb +0 -7
  133. data/generators/talia_admin/templates/views/admin/translations/_translation.html.erb +0 -10
  134. data/generators/talia_admin/templates/views/admin/translations/edit.html.erb +0 -16
  135. data/generators/talia_admin/templates/views/layouts/admin.html.erb +0 -56
  136. data/generators/talia_base/templates/script/setup_talia_backend +0 -43
@@ -276,7 +276,7 @@ module TaliaCore
276
276
  # that method exists; otherwise it'll return nil
277
277
  def uri_string_for(value)
278
278
  result = if value.is_a? String
279
- return nil if(value =~ /\A\d+\Z/) # This looks like a record id, encoded as a string
279
+ return nil if(value =~ /\A\d+(-.*)?\Z/) # This looks like a record id or record param, encoded as a string
280
280
  # if this is a local name, prepend the local namespace
281
281
  (value =~ /:/) ? value : (N::LOCAL + value).uri
282
282
  elsif(value.respond_to?(:uri))
@@ -20,6 +20,10 @@ module TaliaCore
20
20
  if(args.last.is_a?(Hash))
21
21
  options = args.last
22
22
  options.to_options!
23
+
24
+ # Hack the "default" ordering
25
+ options[:order] = 'id' if(options[:order] == :default)
26
+
23
27
  prefetching = options.delete(:prefetch_relations)
24
28
  if(options.empty?) # If empty we remove the args hash, so that the 1-param uri search works
25
29
  args.pop
@@ -0,0 +1,4 @@
1
+ module TaliaCore
2
+ class Collection < Source
3
+ end
4
+ end
@@ -0,0 +1,113 @@
1
+ require 'oai'
2
+
3
+ module TaliaCore
4
+ module Oai
5
+
6
+ # Basic OAI Model for ActiveSources. This provides basic OAI functionality
7
+ # on ActiveSource in the same way the ActiveRecordWrapper provides the
8
+ # functionality on ActiveRecord.
9
+ #
10
+ # All #find() and related calls will "wrap" the ActiveSource models using
11
+ # using the ActiveSourceOaiAdapter class. You may provide your own adapter
12
+ # class if needed.
13
+ class ActiveSourceModel < OAI::Provider::Model
14
+
15
+ attr_accessor :model_adapter
16
+
17
+ def initialize(model_adapter = ActiveSourceOaiAdapter)
18
+ @model_adapter = (model_adapter || ActiveSourceOaiAdapter)
19
+ @timestamp_field = "created_at"
20
+ @limit = 20
21
+ end
22
+
23
+ def earliest
24
+ select_first_or_last('asc').send(timestamp_field)
25
+ end
26
+
27
+ def latest
28
+ select_first_or_last('desc').send(timestamp_field)
29
+ end
30
+
31
+ def last_id(options)
32
+ select_first_or_last('desc', options).id
33
+ end
34
+
35
+ def sets
36
+ raise OAI::SetException # TODO: Support sets
37
+ end
38
+
39
+ def find(selector, options = {})
40
+ return select_partial(options[:resumption_token]) if(options[:resumption_token])
41
+
42
+ conditions = sql_conditions(options)
43
+
44
+ if(selector == :first)
45
+ model_adapter.get_wrapper_for(ActiveSource.find(selector, :prefetch_relations => true, :conditions => conditions))
46
+ elsif(selector == :all)
47
+ select_partial(OAI::Provider::ResumptionToken.new(last_id(conditions), options.merge(:last => 0)))
48
+ else
49
+ model_adapter.get_wrapper_for(ActiveSource.find(selector, :prefetch_relations => true, :conditions => conditions))
50
+ end
51
+ rescue ActiveRecord::RecordNotFound
52
+ nil
53
+ end
54
+
55
+ private
56
+
57
+ # Selects a partial result set from a resumption token
58
+ def select_partial(token)
59
+ token = OAI::Provider::ResumptionToken.parse(token) if(token.is_a?(String))
60
+
61
+ conditions = token_conditions(token)
62
+ total = ActiveSource.count(:id, :conditions => conditions)
63
+
64
+ return [] if(total == 0)
65
+
66
+ records = ActiveSource.find(:all, :conditions => token_conditions(token),
67
+ :limit => @limit,
68
+ :order => 'id asc',
69
+ :prefetch_relations => true
70
+ )
71
+ raise(OAI::ResumptionTokenException) unless(records)
72
+
73
+ last_id = records.last.id
74
+ OAI::Provider::PartialResult.new(model_adapter.get_wrapper_for(records), token.next(last_id))
75
+ end
76
+
77
+ def select_first_or_last(order, conditions = nil)
78
+ select_options = { :select => "id, #{timestamp_field}", :order => "#{timestamp_field} #{order}" }
79
+ select_options[:conditions] = conditions if(conditions)
80
+ TaliaCore::ActiveSource.find(:first, select_options)
81
+ end
82
+
83
+ # Sql condition for the given token
84
+ def token_conditions(token)
85
+ sql = sql_conditions(token.to_conditions_hash)
86
+ sql_add_fragment_to(sql, 'id > ?', token.last) if(token.last != 0)
87
+ sql
88
+ end
89
+
90
+ # build a sql conditions statement from an OAI options hash
91
+ def sql_conditions(opts)
92
+ from = Time.parse(opts[:from].to_s).utc
93
+ untl = Time.parse(opts[:until].to_s).utc
94
+ sql = ["#{timestamp_field} >= ? AND #{timestamp_field} <= ?", from, untl]
95
+
96
+ return sql
97
+ end
98
+
99
+ # Adds the given fragment to the sql string and adds the vars to the
100
+ # variables that are present for the sql. The old_fragment ist an array
101
+ # with an SQL string template and following variables, as used by
102
+ # ActiveRecord
103
+ def sql_add_fragment_to(old_fragment, new_frag, *vars)
104
+ old_fragment[0] << ' AND ('
105
+ old_fragment[0] << new_frag
106
+ old_fragment[0] << ')'
107
+ old_fragment.concat(vars)
108
+ end
109
+
110
+ end
111
+
112
+ end
113
+ end
@@ -0,0 +1,17 @@
1
+ module TaliaCore
2
+ module Oai
3
+
4
+ module OaiAdapterClassMethods
5
+
6
+ def namespaced_field(namespace, *fields)
7
+ fields.each do |field|
8
+ define_method(field.to_sym) do
9
+ @record.predicate(namespace, field.to_s).values
10
+ end
11
+ end
12
+ end
13
+
14
+ end
15
+
16
+ end
17
+ end
@@ -0,0 +1,106 @@
1
+ require 'oai'
2
+ require_or_load File.join(File.dirname(__FILE__), 'active_source_oai_adapter', 'class_methods')
3
+
4
+ module TaliaCore
5
+ module Oai
6
+
7
+ # Wraps an ActiveSource record so that it provides the accessor methods
8
+ # for DublinCore. In a nutshell, this makes the object look like an
9
+ # ActiveRecord with "fields" like "title" or "subject". The OAI provider
10
+ # can access those fields to automatically read the metatdata from the
11
+ # records.
12
+ #
13
+ # == Wrapping an ActiveSource
14
+ #
15
+ # Use ActiveSourceOaiAdapter.get_wrapper_for(record) to create a new
16
+ # wrapper object for a given ActiveSource. Usually the ActiveSourceModel
17
+ # will do this automatically.
18
+ #
19
+ # == Extending the adapter
20
+ #
21
+ # If you need more specific functionality, you may subclass the adapter
22
+ # or write your own adapter class that includes OaiAdapterClassMethods
23
+ #
24
+ # In both cases you'll get the #namespace_field class method - this will
25
+ # allow you to define accessors to properties in the following way:
26
+ #
27
+ # # This maps the dcns:title and dcns:foo properties on the original
28
+ # # source to the #title and #foo accessors
29
+ # namespace_field :dcns, :title, :foo
30
+ #
31
+ class ActiveSourceOaiAdapter
32
+
33
+ extend OaiAdapterClassMethods
34
+
35
+ namespaced_field :dcns, :title, :subject, :description, :publisher,
36
+ :contributor, :date, :format,
37
+ :source, :language, :relation, :coverage, :rights
38
+
39
+ namespaced_field :dct, :isPartOf, :abstract
40
+
41
+ # namespaced field for Europeana
42
+ namespaced_field :userTag, :unstored, :object, :provider,
43
+ :uri, :year, :hasObject, :country
44
+
45
+ # Type information. Base class is not terribly useful, but needed to
46
+ # overwrite default #type method
47
+ def type
48
+ ''
49
+ end
50
+
51
+ def initialize(record)
52
+ assit_kind_of(ActiveSource, record)
53
+ @record = record
54
+ end
55
+
56
+ # Get the author/creator
57
+ def creator
58
+ @record[N::DCNS.creator].collect do |creator|
59
+ if(creator.is_a?(TaliaCore::ActiveSource))
60
+ author = ''
61
+ author_name = creator.hyper::author_name.first
62
+ author << author_name << ' ' if(author_name)
63
+ author_surname = creator.hyper::author_surname.first || ''
64
+ author << author_surname if(author_surname)
65
+ author = "No lookup. Author should be at #{creator.uri}" if(author == '')
66
+ author
67
+ else
68
+ creator
69
+ end
70
+ end
71
+ end
72
+
73
+ # Identifier for the resource
74
+ def identifier
75
+ @record.uri.to_s
76
+ end
77
+
78
+ # Timestamp for the record
79
+ def created_at
80
+ @record.created_at
81
+ end
82
+
83
+ # Id for the record
84
+ def id
85
+ @record.id
86
+ end
87
+
88
+ # Tries to instanciate a wrapper object for the record, using the
89
+ # wrapper class that corresponds to the given record's class
90
+ def self.get_wrapper_for(records)
91
+ if(records.is_a?(ActiveSource))
92
+ self.new(record)
93
+ elsif(records.respond_to?(:collect))
94
+ records.collect { |rec| self.new(rec) }
95
+ elsif(records.nil?)
96
+ nil
97
+ else
98
+ raise(ArgumentError, "Don't know how to wrap #{records.inspect}")
99
+ end
100
+ end
101
+
102
+
103
+ end
104
+
105
+ end
106
+ end
@@ -1,6 +1,7 @@
1
1
  module TaliaCore
2
2
 
3
3
  class SemanticProperty < ActiveRecord::Base
4
+
4
5
  validates_presence_of :value
5
6
  end
6
7
 
@@ -1,5 +1,6 @@
1
1
  module TaliaCore
2
2
  class SemanticRelation < ActiveRecord::Base
3
+
3
4
  belongs_to :subject, :class_name => 'TaliaCore::ActiveSource'
4
5
  belongs_to :object, :polymorphic => true
5
6
  before_destroy :discard_property
@@ -365,6 +365,19 @@ module TaliaCore
365
365
  src = ActiveSource.new('http://testassignandsave_nil/')
366
366
  assert_raise(ArgumentError) { src['rdfs:something'] << nil }
367
367
  end
368
+
369
+ def test_find_default_order
370
+ result = ActiveSource.find(:all, :order => :default)
371
+ assert_equal(result.size, ActiveSource.count)
372
+ end
373
+
374
+ def test_find_with_param
375
+ first = ActiveSource.find(:first)
376
+ param = first.to_param
377
+ param += "-more-garbage"
378
+ refound = ActiveSource.find(param)
379
+ assert_equal(first, refound)
380
+ end
368
381
 
369
382
  def test_find_through
370
383
  result = ActiveSource.find(:all, :find_through => ['http://testvalue.org/pred_find_through', active_sources(:find_through_target).uri])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: talia_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.22
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danilo Giacomi
@@ -13,7 +13,7 @@ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
15
 
16
- date: 2009-12-21 00:00:00 +01:00
16
+ date: 2010-02-01 00:00:00 +01:00
17
17
  default_executable: talia
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
@@ -87,14 +87,14 @@ dependencies:
87
87
  version: 0.6.1
88
88
  version:
89
89
  - !ruby/object:Gem::Dependency
90
- name: oai
90
+ name: oai_talia
91
91
  type: :runtime
92
92
  version_requirement:
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - ">="
96
96
  - !ruby/object:Gem::Version
97
- version: 0.0.12
97
+ version: 0.0.15
98
98
  version:
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: builder
@@ -147,61 +147,66 @@ files:
147
147
  - generators/generator_helpers.rb
148
148
  - generators/talia_admin/USAGE
149
149
  - generators/talia_admin/talia_admin_generator.rb
150
- - generators/talia_admin/templates/controllers/admin/background_controller.rb
151
- - generators/talia_admin/templates/controllers/admin/custom_templates_controller.rb
152
- - generators/talia_admin/templates/controllers/admin/locales_controller.rb
153
- - generators/talia_admin/templates/controllers/admin/roles_controller.rb
154
- - generators/talia_admin/templates/controllers/admin/sources_controller.rb
155
- - generators/talia_admin/templates/controllers/admin/translations_controller.rb
156
- - generators/talia_admin/templates/controllers/admin/users_controller.rb
157
- - generators/talia_admin/templates/controllers/admin_controller.rb
158
- - generators/talia_admin/templates/helpers/admin/background_helper.rb
159
- - generators/talia_admin/templates/helpers/admin/custom_templates_helper.rb
160
- - generators/talia_admin/templates/helpers/admin/locales_helper.rb
161
- - generators/talia_admin/templates/helpers/admin/roles_helper.rb
162
- - generators/talia_admin/templates/helpers/admin/sources_helper.rb
163
- - generators/talia_admin/templates/helpers/admin/translations_helper.rb
164
- - generators/talia_admin/templates/helpers/admin/users_helper.rb
165
- - generators/talia_admin/templates/helpers/admin_helper.rb
166
- - generators/talia_admin/templates/migrations/populate_users.rb
167
- - generators/talia_admin/templates/models/role.rb
168
- - generators/talia_admin/templates/public/javascripts/backend.js
150
+ - generators/talia_admin/templates/app/controllers/admin/admin_site_controller.rb
151
+ - generators/talia_admin/templates/app/controllers/admin/custom_templates_controller.rb
152
+ - generators/talia_admin/templates/app/controllers/admin/front_controller.rb
153
+ - generators/talia_admin/templates/app/controllers/admin/talia_collections_controller.rb
154
+ - generators/talia_admin/templates/app/controllers/admin/talia_sources_controller.rb
155
+ - generators/talia_admin/templates/app/controllers/admin/users_controller.rb
156
+ - generators/talia_admin/templates/app/controllers/users_controller.rb
157
+ - generators/talia_admin/templates/app/helpers/admin/front_helper.rb
158
+ - generators/talia_admin/templates/app/helpers/admin/talia_sources_helper.rb
159
+ - generators/talia_admin/templates/app/helpers/users_helper.rb
160
+ - generators/talia_admin/templates/app/models/guest.rb
161
+ - generators/talia_admin/templates/app/models/talia_collection.rb
162
+ - generators/talia_admin/templates/app/models/talia_source.rb
163
+ - generators/talia_admin/templates/app/models/user.rb
164
+ - generators/talia_admin/templates/app/models/user_mailer.rb
165
+ - generators/talia_admin/templates/app/viewhints/talia_source_hints.rb
166
+ - generators/talia_admin/templates/app/views/admin/custom_templates/index.dryml
167
+ - generators/talia_admin/templates/app/views/admin/front/index.dryml
168
+ - generators/talia_admin/templates/app/views/admin/front/summary.dryml
169
+ - generators/talia_admin/templates/app/views/admin/talia_collections/index.dryml
170
+ - generators/talia_admin/templates/app/views/admin/talia_sources/index.dryml
171
+ - generators/talia_admin/templates/app/views/admin/talia_sources/show.dryml
172
+ - generators/talia_admin/templates/app/views/admin/users/index.dryml
173
+ - generators/talia_admin/templates/app/views/taglibs/admin_site.dryml
174
+ - generators/talia_admin/templates/app/views/taglibs/application.dryml
175
+ - generators/talia_admin/templates/app/views/taglibs/auto/admin/rapid/cards.dryml
176
+ - generators/talia_admin/templates/app/views/taglibs/auto/admin/rapid/forms.dryml
177
+ - generators/talia_admin/templates/app/views/taglibs/auto/admin/rapid/pages.dryml
178
+ - generators/talia_admin/templates/app/views/taglibs/auto/rapid/cards.dryml
179
+ - generators/talia_admin/templates/app/views/taglibs/auto/rapid/forms.dryml
180
+ - generators/talia_admin/templates/app/views/taglibs/auto/rapid/pages.dryml
181
+ - generators/talia_admin/templates/app/views/taglibs/front_site.dryml
182
+ - generators/talia_admin/templates/app/views/taglibs/themes/clean/clean.dryml
183
+ - generators/talia_admin/templates/app/views/user_mailer/forgot_password.erb
184
+ - generators/talia_admin/templates/config/hobo_initializer.rb
185
+ - generators/talia_admin/templates/migrations/create_users.rb
186
+ - generators/talia_admin/templates/public/hobothemes/clean/images/101-3B5F87-ACD3E6.png
187
+ - generators/talia_admin/templates/public/hobothemes/clean/images/30-3E547A-242E42.png
188
+ - generators/talia_admin/templates/public/hobothemes/clean/images/30-DBE1E5-FCFEF5.png
189
+ - generators/talia_admin/templates/public/hobothemes/clean/images/300-ACD3E6-fff.png
190
+ - generators/talia_admin/templates/public/hobothemes/clean/images/50-ACD3E6-fff.png
191
+ - generators/talia_admin/templates/public/hobothemes/clean/images/fieldbg.gif
192
+ - generators/talia_admin/templates/public/hobothemes/clean/images/pencil.png
193
+ - generators/talia_admin/templates/public/hobothemes/clean/images/small_close.png
194
+ - generators/talia_admin/templates/public/hobothemes/clean/images/spinner.gif
195
+ - generators/talia_admin/templates/public/hobothemes/clean/stylesheets/clean.css
196
+ - generators/talia_admin/templates/public/hobothemes/clean/stylesheets/rapid-ui.css
197
+ - generators/talia_admin/templates/public/javascripts/IE7.js
198
+ - generators/talia_admin/templates/public/javascripts/blank.gif
199
+ - generators/talia_admin/templates/public/javascripts/dryml-support.js
200
+ - generators/talia_admin/templates/public/javascripts/hobo-rapid.js
201
+ - generators/talia_admin/templates/public/javascripts/ie7-recalc.js
169
202
  - generators/talia_admin/templates/public/javascripts/lowpro.js
170
- - generators/talia_admin/templates/public/stylesheets/talia_core/backend.css
171
- - generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/body_bg.gif
172
- - generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/footer_bg.gif
173
- - generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/header.jpg
174
- - generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/header_bg.gif
175
- - generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/menu.jpg
176
- - generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/menu_bg.gif
177
- - generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/opednid.gif
178
- - generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/page_bg.jpg
179
- - generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/triangolino.gif
180
- - generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/triangolino_full.gif
181
- - generators/talia_admin/templates/test/functional/admin/custom_templates_controller_test.rb
182
- - generators/talia_admin/templates/test/functional/admin/locales_controller_test.rb
183
- - generators/talia_admin/templates/test/functional/admin/sources_controller_test.rb
184
- - generators/talia_admin/templates/test/functional/admin/translations_controller_test.rb
185
- - generators/talia_admin/templates/test/functional/admin/users_controller_test.rb
186
- - generators/talia_admin/templates/test/functional/admin_controller_test.rb
187
- - generators/talia_admin/templates/views/admin/background/_finished.html.erb
188
- - generators/talia_admin/templates/views/admin/background/_pending.html.erb
189
- - generators/talia_admin/templates/views/admin/background/_progress.html.erb
190
- - generators/talia_admin/templates/views/admin/background/_running.html.erb
191
- - generators/talia_admin/templates/views/admin/background/environment.html.erb
192
- - generators/talia_admin/templates/views/admin/background/show.html.erb
193
- - generators/talia_admin/templates/views/admin/background/stderr.html.erb
194
- - generators/talia_admin/templates/views/admin/background/stdin.html.erb
195
- - generators/talia_admin/templates/views/admin/background/stdout.html.erb
196
- - generators/talia_admin/templates/views/admin/custom_templates/_content_form_column.rhtml
197
- - generators/talia_admin/templates/views/admin/custom_templates/_template_type_form_column.rhtml
198
- - generators/talia_admin/templates/views/admin/index.html.erb
199
- - generators/talia_admin/templates/views/admin/locales/new.html.erb
200
- - generators/talia_admin/templates/views/admin/sources/_show.html.erb
201
- - generators/talia_admin/templates/views/admin/translations/_new_translation.html.erb
202
- - generators/talia_admin/templates/views/admin/translations/_translation.html.erb
203
- - generators/talia_admin/templates/views/admin/translations/edit.html.erb
204
- - generators/talia_admin/templates/views/layouts/admin.html.erb
203
+ - generators/talia_admin/templates/public/stylesheets/application.css
204
+ - generators/talia_admin/templates/public/stylesheets/hobo-rapid.css
205
+ - generators/talia_admin/templates/public/stylesheets/reset.css
206
+ - generators/talia_admin/templates/test/fixtures/users.yml
207
+ - generators/talia_admin/templates/test/functional/admin/front_controller_test.rb
208
+ - generators/talia_admin/templates/test/functional/users_controller_test.rb
209
+ - generators/talia_admin/templates/test/unit/user_test.rb
205
210
  - generators/talia_base/USAGE
206
211
  - generators/talia_base/talia_base_generator.rb
207
212
  - generators/talia_base/templates/README
@@ -274,9 +279,12 @@ files:
274
279
  - generators/talia_base/templates/public/stylesheets/talia_core/main.css
275
280
  - generators/talia_base/templates/script/configure_talia
276
281
  - generators/talia_base/templates/script/prepare_images
277
- - generators/talia_base/templates/script/setup_talia_backend
278
282
  - generators/talia_base/templates/talia.sh
279
283
  - generators/talia_base/templates/tasks/talia_core.rk
284
+ - generators/talia_oai/USAGE
285
+ - generators/talia_oai/talia_oai_generator.rb
286
+ - generators/talia_oai/templates/oai_controller.rb
287
+ - generators/talia_oai/templates/oai_initializer.rb
280
288
  - lib/JXslt/jxslt.rb
281
289
  - lib/core_ext.rb
282
290
  - lib/core_ext/platform.rb
@@ -300,6 +308,7 @@ files:
300
308
  - lib/talia_core/agent.rb
301
309
  - lib/talia_core/background_jobs/job.rb
302
310
  - lib/talia_core/background_jobs/progress_job.rb
311
+ - lib/talia_core/collection.rb
303
312
  - lib/talia_core/data_types/data_loader.rb
304
313
  - lib/talia_core/data_types/data_record.rb
305
314
  - lib/talia_core/data_types/delayed_copier.rb
@@ -318,6 +327,9 @@ files:
318
327
  - lib/talia_core/dummy_handler.rb
319
328
  - lib/talia_core/errors.rb
320
329
  - lib/talia_core/initializer.rb
330
+ - lib/talia_core/oai/active_source_model.rb
331
+ - lib/talia_core/oai/active_source_oai_adapter.rb
332
+ - lib/talia_core/oai/active_source_oai_adapter/class_methods.rb
321
333
  - lib/talia_core/ordered_source.rb
322
334
  - lib/talia_core/property_string.rb
323
335
  - lib/talia_core/rdf_import.rb
@@ -1,52 +0,0 @@
1
- require 'bj'
2
-
3
- class Admin::BackgroundController < ApplicationController
4
- layout 'admin', :except => [:update_progress]
5
- require_role 'admin'
6
-
7
- active_scaffold 'Bj::Table::Job' do |config|
8
- # runner = Bj::Runner.ping
9
- runner_label = "no runner active"
10
- config.label = "Job Management (#{runner_label})"
11
-
12
- if(!Bj.config[Bj::Runner.no_tickle_key])
13
- config.action_links.add('tickle', :label => 'Tickle Runner', :action => 'tickle', :parameters => {:id => '0'})
14
- end
15
-
16
- config.actions.exclude :create, :update, :delete
17
- config.show.link.inline = false
18
- config.columns = [ :state, :tag, :pid, :submitter, :runner, :submitted_at ]
19
- end
20
-
21
- def tickle
22
- Bj::Runner.tickle
23
- redirect_to :action => 'index'
24
- end
25
-
26
- def show
27
- @job = Bj::Table::Job.find(params['id'])
28
- end
29
-
30
- def stdin
31
- @job = Bj::Table::Job.find(params['id'])
32
- end
33
-
34
- def stdout
35
- @job = Bj::Table::Job.find(params['id'])
36
- end
37
-
38
- def stderr
39
- @job = Bj::Table::Job.find(params['id'])
40
- end
41
-
42
- def environment
43
- @job = Bj::Table::Job.find(params['id'])
44
- @environment = @job.env ? YAML.load(@job.env) : nil
45
- end
46
-
47
- def update_progress
48
- @job = Bj::Table::Job.find(params['id'])
49
- @progress_job = TaliaCore::BackgroundJobs::ProgressJob.find(:first, :conditions => { :job_id => @job.id })
50
- render :partial => 'progress'
51
- end
52
- end
@@ -1,25 +0,0 @@
1
- class Admin::CustomTemplatesController < ApplicationController
2
- layout 'admin'
3
- require_role 'admin'
4
-
5
- active_scaffold :custom_template do |config|
6
- config.columns = [:name, :template_type, :content]
7
- config.action_links.add 'clear_cache', :label => 'Clear Cache'
8
- end
9
-
10
- def clear_cache
11
- CustomTemplate.find(:all).each do |template|
12
- expire_page(:controller => '/custom_templates', :action => template.template_type, :id => template.name)
13
- end
14
- render :text => 'Template cache cleared'
15
- end
16
-
17
- protected
18
-
19
- # Before an updated record, clean out the cache for that page
20
- def before_update_save(record)
21
- expire_page(:controller => '/custom_templates', :action => record.template_type, :id => record.name)
22
- puts "EXPIRED"
23
- end
24
-
25
- end
@@ -1,15 +0,0 @@
1
- class Admin::LocalesController < ApplicationController
2
- layout 'admin'
3
-
4
- def new
5
- end
6
-
7
- def create
8
- if I18n.add_locale(params[:name], params[:code])
9
- redirect_to edit_admin_translation_path(params[:code])
10
- else
11
- flash[:error] = "Invalid locale, please check the format and make sure the language is available."
12
- render :action => 'new'
13
- end
14
- end
15
- end
@@ -1,8 +0,0 @@
1
- class Admin::RolesController < ApplicationController
2
- require_role 'admin'
3
- layout 'admin'
4
-
5
- active_scaffold :role do |config|
6
- # config.columns[:users].association.reverse = :user
7
- end
8
- end
@@ -1,9 +0,0 @@
1
- class Admin::SourcesController < ApplicationController
2
- require_role 'admin'
3
- layout 'admin'
4
-
5
- active_scaffold 'TaliaCore::ActiveSource' do |config|
6
- config.columns = [:uri, :type]
7
- end
8
-
9
- end