talia_core 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. data/README.rdoc +6 -27
  2. data/VERSION.yml +3 -2
  3. data/config/database.yml +11 -11
  4. data/config/talia_core.yml +11 -6
  5. data/config/talia_core.yml.example +11 -6
  6. data/generators/talia_base/talia_base_generator.rb +3 -0
  7. data/generators/talia_base/templates/README +1 -1
  8. data/generators/talia_base/templates/app/controllers/source_data_controller.rb +1 -1
  9. data/generators/talia_base/templates/app/controllers/sources_controller.rb +31 -12
  10. data/generators/talia_base/templates/app/helpers/sources_helper.rb +77 -1
  11. data/generators/talia_base/templates/app/views/layouts/sources.html.erb +22 -0
  12. data/generators/talia_base/templates/app/views/sources/_data_list.html.erb +17 -0
  13. data/generators/talia_base/templates/app/views/sources/_property_item.html.erb +10 -0
  14. data/generators/talia_base/templates/app/views/sources/_property_list.html.erb +13 -0
  15. data/generators/talia_base/templates/app/views/sources/index.html.erb +16 -11
  16. data/generators/talia_base/templates/app/views/sources/semantic_templates/default/default.html.erb +8 -19
  17. data/generators/talia_base/templates/config/routes.rb +11 -0
  18. data/generators/talia_base/templates/migrations/create_semantic_relations.rb +2 -1
  19. data/generators/talia_base/templates/public/images/core/arrow.png +0 -0
  20. data/generators/talia_base/templates/public/images/core/building.png +0 -0
  21. data/generators/talia_base/templates/public/images/core/contents_top_left.gif +0 -0
  22. data/generators/talia_base/templates/public/images/core/document-horizontal-text.png +0 -0
  23. data/generators/talia_base/templates/public/images/core/document.png +0 -0
  24. data/generators/talia_base/templates/public/images/core/gear.png +0 -0
  25. data/generators/talia_base/templates/public/images/core/group.png +0 -0
  26. data/generators/talia_base/templates/public/images/core/header_bg.gif +0 -0
  27. data/generators/talia_base/templates/public/images/core/image.png +0 -0
  28. data/generators/talia_base/templates/public/images/core/imagebig.png +0 -0
  29. data/generators/talia_base/templates/public/images/core/left_edge.gif +0 -0
  30. data/generators/talia_base/templates/public/images/core/letter.png +0 -0
  31. data/generators/talia_base/templates/public/images/core/line.png +0 -0
  32. data/generators/talia_base/templates/public/images/core/logo.gif +0 -0
  33. data/generators/talia_base/templates/public/images/core/map.png +0 -0
  34. data/generators/talia_base/templates/public/images/core/period.png +0 -0
  35. data/generators/talia_base/templates/public/images/core/person.png +0 -0
  36. data/generators/talia_base/templates/public/images/core/person_default.png +0 -0
  37. data/generators/talia_base/templates/public/images/core/place.png +0 -0
  38. data/generators/talia_base/templates/public/images/core/source.png +0 -0
  39. data/generators/talia_base/templates/public/images/core/television.png +0 -0
  40. data/generators/talia_base/templates/public/images/core/text.png +0 -0
  41. data/generators/talia_base/templates/public/images/core/type.png +0 -0
  42. data/generators/talia_base/templates/public/images/core/video.png +0 -0
  43. data/generators/talia_base/templates/public/stylesheets/img/arrow.png +0 -0
  44. data/generators/talia_base/templates/public/stylesheets/main.css +276 -0
  45. data/generators/talia_base/templates/script/configure_talia +1 -1
  46. data/generators/talia_base/templates/script/setup_talia_backend +2 -0
  47. data/lib/core_ext/platform.rb +1 -0
  48. data/lib/core_ext/string.rb +6 -0
  49. data/lib/talia_core/active_source.rb +62 -3
  50. data/lib/talia_core/active_source_parts/class_methods.rb +36 -122
  51. data/lib/talia_core/active_source_parts/finders.rb +158 -0
  52. data/lib/talia_core/active_source_parts/predicate_handler.rb +7 -8
  53. data/lib/talia_core/active_source_parts/xml/generic_reader.rb +95 -11
  54. data/lib/talia_core/active_source_parts/xml/rdf_builder.rb +6 -13
  55. data/lib/talia_core/active_source_parts/xml/source_reader.rb +8 -3
  56. data/lib/talia_core/data_types/data_loader.rb +14 -6
  57. data/lib/talia_core/data_types/data_record.rb +5 -1
  58. data/lib/talia_core/data_types/iip_data.rb +1 -1
  59. data/lib/talia_core/data_types/mime_mapping.rb +8 -3
  60. data/lib/talia_core/errors.rb +4 -0
  61. data/lib/talia_core/initializer.rb +1 -8
  62. data/lib/talia_core/property_string.rb +58 -0
  63. data/lib/talia_core/semantic_collection_item.rb +3 -2
  64. data/lib/talia_core/semantic_collection_wrapper.rb +236 -198
  65. data/lib/talia_core/source.rb +130 -178
  66. data/lib/talia_core/source_types/collection.rb +15 -0
  67. data/lib/talia_core/source_types/dc_resource.rb +22 -0
  68. data/lib/talia_core/source_types/dummy_source.rb +22 -0
  69. data/lib/talia_core.rb +0 -1
  70. data/lib/talia_util/import_job_helper.rb +44 -16
  71. data/lib/talia_util/io_helper.rb +21 -1
  72. data/lib/talia_util/rake_tasks.rb +48 -72
  73. data/lib/talia_util/rdf_update.rb +22 -13
  74. data/lib/talia_util/test_helpers.rb +1 -1
  75. data/lib/talia_util.rb +0 -2
  76. data/test/core_ext/string_test.rb +5 -0
  77. data/test/talia_core/active_source_test.rb +151 -14
  78. data/test/talia_core/generic_xml_test.rb +46 -2
  79. data/test/talia_core/initializer_test.rb +0 -1
  80. data/test/talia_core/property_string_test.rb +78 -0
  81. data/test/talia_core/source_reader_test.rb +5 -1
  82. data/test/talia_core/source_test.rb +23 -32
  83. data/test/talia_util/import_job_helper_test.rb +1 -1
  84. data/test/talia_util/io_helper_test.rb +44 -0
  85. metadata +399 -373
  86. data/generators/talia_base/templates/app/views/sources/semantic_templates/default/province.html.erb +0 -19
  87. data/lib/acts_as_roled.rb +0 -11
  88. data/lib/talia_core/collection.rb +0 -13
  89. data/lib/talia_core/dc_resource.rb +0 -20
  90. data/lib/talia_core/dummy_source.rb +0 -20
  91. data/lib/talia_core/rails_ext/actionpack/action_controller/record_identifier.rb +0 -13
  92. data/lib/talia_core/rails_ext/actionpack/action_controller.rb +0 -1
  93. data/lib/talia_core/rails_ext/actionpack.rb +0 -1
  94. data/lib/talia_core/rails_ext.rb +0 -1
  95. data/lib/talia_util/data_import.rb +0 -91
  96. data/lib/talia_util/yaml_import.rb +0 -80
data/README.rdoc CHANGED
@@ -4,38 +4,17 @@ This is the "core" of the Talia semantic digital web library system. Talia can
4
4
  be used with Ruby on Rails, or as a standalone package.
5
5
 
6
6
  More documentation can be found on the Talia website:
7
- http:///trac.talia.discovery-project.eu/
7
+ http://net7sviluppo.com/trac/talia/
8
8
 
9
9
  The RDoc documentation may be created directly from the sources, or you can find
10
10
  it at http://net7.github.com/talia_core/
11
11
 
12
- = Installation
12
+ = Installation and Configuration
13
13
 
14
- If you have the Talia files on your sytem, you're almost there. For now,
15
- please consult the web page for installation instructions.
14
+ If you want to get started with Talia, check out the installation guide at
16
15
 
17
- = Configuration
16
+ http://net7sviluppo.com/trac/talia/wiki/TaliaInstallation
18
17
 
19
- When you're in Rails, you can start Talia in the environment.rb, using the
20
- TaliaCore::Initializer - if you're building a standalone application, it's
21
- almost the same (although you'll have to use standalone_db=yes to configure
22
- ActiveRecord manually)
18
+ The guide for the Discovery Project partners is also still available at
23
19
 
24
- There are some sample configuration files in the distribution:
25
-
26
- * talia_core.yml - This file contains the main configuration.
27
- * database.yml - Standalon Db configuration. Same format as for Rails.
28
- * rdfstore.yml - RDF storage configuration.
29
-
30
- The default configuration (talia_core.yml) will use the database.yml and
31
- rdfstore.yml to configure the data storage. See the example filme for an
32
- explanation of the options. The database configuration will only be used if
33
- you are running Talia standalone; otherwise you must use RAILS' existing
34
- database connection.
35
-
36
- The options for the RDF store vary depending on the store that you have selected,
37
- but some examples are provideed.
38
-
39
- = DB Migrations
40
-
41
- = Importing data
20
+ http://net7sviluppo.com/trac/talia/wiki/InstallTaliaForDiscoveryPartners
data/VERSION.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  ---
2
- :minor: 4
3
2
  :major: 0
4
- :patch: 3
3
+ :minor: 4
4
+ :patch: 4
5
+ :build:
data/config/database.yml CHANGED
@@ -1,19 +1,19 @@
1
1
  ---
2
- production:
2
+ development:
3
3
  adapter: jdbcmysql
4
+ database: talia_library_talia_development
5
+ username: rails
6
+ password: rails
4
7
  host: localhost
5
- password: talia
6
- username: talia
7
- database: talia_2_3_new_talia_production
8
8
  test:
9
9
  adapter: jdbcmysql
10
+ database: talia_library_talia_test
11
+ username: rails
12
+ password: rails
10
13
  host: localhost
11
- password: talia
12
- username: talia
13
- database: talia_2_3_new_talia_test
14
- development:
14
+ production:
15
15
  adapter: jdbcmysql
16
+ database: talia_library_talia_production
17
+ username: rails
18
+ password: rails
16
19
  host: localhost
17
- password: talia
18
- username: talia
19
- database: talia_2_3_new_talia_development
@@ -1,14 +1,19 @@
1
1
  ---
2
- site_name: Talia 2.3.
3
- rdf_connection_file: rdfstore
4
- ardf_log_level: 0
5
2
  local_uri: http://localhost:5000/
6
3
  default_namespace_uri: http://default.dummy/
7
- iip_root_directory_location:
4
+ rdf_connection_file: rdfstore
5
+ ardf_log_level: 0
8
6
  standalone_db: true
9
7
  db_file: database
10
8
  namespaces:
11
- dcns: http://purl.org/dc/elements/1.1/
9
+ hyper: http://www.hypernietzsche.org/ontology/
10
+ foaf: http://xmlns.com/foaf/0.1/
11
+ skos: http://www.w3.org/2004/02/skos/core#
12
12
  dct: http://purl.org/dc/terms/
13
13
  dcmit: http://purl.org/dc/dcmitype/
14
- hyper: http://www.hypernietzsche.org/ontology/
14
+ dcns: http://purl.org/dc/elements/1.1/
15
+ luccadom: http://trac.talia.discovery-project.eu/wiki/LuccaOntology#
16
+ talias: http://trac.talia.discovery-project.eu/wiki/StructuralOntology#
17
+ taliadom: http://trac.talia.discovery-project.eu/wiki/SampleDomainOntology#
18
+ site_name: Talia Library
19
+ iip_root_directory_location:
@@ -32,11 +32,16 @@ namespaces:
32
32
  # library.
33
33
  # HyperNietzsche namespace
34
34
  hyper: "http://www.hypernietzsche.org/ontology/"
35
+ # FOAF
36
+ foaf: http://xmlns.com/foaf/0.1/
37
+ # SKOS
38
+ skos: http://www.w3.org/2004/02/skos/core#
35
39
  # DublinCore namespace
40
+ dct: http://purl.org/dc/terms/
41
+ dcmit: http://purl.org/dc/dcmitype/
36
42
  dcns: "http://purl.org/dc/elements/1.1/"
37
- dct: "http://purl.org/dc/terms/"
38
- dcmit: "http://purl.org/dc/dcmitype/"
39
-
40
-
41
-
42
-
43
+ # Used in demo apps
44
+ luccadom: http://trac.talia.discovery-project.eu/wiki/LuccaOntology#
45
+ talias: http://trac.talia.discovery-project.eu/wiki/StructuralOntology#
46
+ taliadom: http://trac.talia.discovery-project.eu/wiki/SampleDomainOntology#
47
+ sesame: http://www.openrdf.org/schema/sesame#
@@ -27,6 +27,9 @@ class TaliaBaseGenerator < Rails::Generator::Base
27
27
  # The default ontologies
28
28
  files_in m, 'ontologies'
29
29
 
30
+ # The whole public dir
31
+ files_in m, 'public'
32
+
30
33
  # Set up the rake tasks, only if we come from a gem
31
34
  if(Gem.source_index.find_name('talia_core').first)
32
35
  m.directory 'lib/tasks'
@@ -6,7 +6,7 @@ script/configure_talia
6
6
  to set up the main configuration for database and RDF store. You can also
7
7
  create the configuration by hand.
8
8
 
9
- WARNING: Talia can create HUGE loge files, depending on the level. It is
9
+ WARNING: Talia can create HUGE log files, depending on the level. It is
10
10
  highly recommended that you at least add something like this to your
11
11
  environment.rb file:
12
12
 
@@ -37,7 +37,7 @@ class SourceDataController < ApplicationController
37
37
  def send_record_data(record)
38
38
  send_data record.content_string, :type => record.mime_type,
39
39
  :disposition => 'inline',
40
- :filename => "#{params[:location]}.tif"
40
+ :filename => record.location
41
41
  end
42
42
 
43
43
  end
@@ -1,7 +1,7 @@
1
1
  class SourcesController < ApplicationController
2
2
  include TaliaCore
3
3
 
4
- before_filter :setup_format, :except => [ 'dispatch', 'index' ]
4
+ before_filter :setup_format, :only => [ 'show' ]
5
5
 
6
6
  PER_PAGE = 10
7
7
 
@@ -10,14 +10,15 @@ class SourcesController < ApplicationController
10
10
  def index
11
11
  @rdf_types ||= self.class.source_types
12
12
 
13
- conditions = if(filter = params[:filter])
14
- { :find_through => [N::RDF.type, N::URI.make_uri(filter, '+')] }
15
- else
16
- {}
13
+ conditions = { :prefetch_relations => true, :include => :data_records }
14
+ if(filter = params[:filter])
15
+ conditions.merge!(:find_through => [N::RDF.type, N::URI.make_uri(filter, '+')])
17
16
  end
18
17
  if(will_paginate?)
18
+ @pagination = true
19
19
  @sources = TaliaCore::ActiveSource.paginate(conditions.merge(:page => params[:page]))
20
20
  else
21
+ @pagination = false
21
22
  @sources = TaliaCore::ActiveSource.find(:all, conditions)
22
23
  end
23
24
  end
@@ -66,9 +67,29 @@ class SourcesController < ApplicationController
66
67
  self.send(caller) if(self.respond_to?(caller))
67
68
  end
68
69
  respond_to do |format|
70
+ format.html { render :action => template_for(@source) }
69
71
  format.xml { render :text => @source.to_xml }
70
72
  format.rdf { render :text => @source.to_rdf }
71
- format.html { render :action => template_for(@source) }
73
+ end
74
+ end
75
+
76
+ # Autocompletion actions
77
+
78
+ def auto_complete_for_uri
79
+ if(s_uri = params[:record][:source])
80
+ s_uri_parts = s_uri.split(':')
81
+ options = { :limit => 10 }
82
+ @records = if(s_uri.include?('://'))
83
+ TaliaCore::ActiveSource.find_by_partial_uri(s_uri, options)
84
+ elsif(s_uri_parts.size == 2)
85
+ TaliaCore::ActiveSource.find_by_partial_local(s_uri_parts.first, s_uri_parts.last, options)
86
+ else
87
+ TaliaCore::ActiveSource.find_by_uri_token(s_uri, options)
88
+ end
89
+
90
+ render :inline => "<%= content_tag(:ul, @records.map { |rec| content_tag(:li, h(N::URI.new(rec.uri).to_name_s)) }) %>"
91
+ else
92
+ render :inline => ''
72
93
  end
73
94
  end
74
95
 
@@ -81,8 +102,6 @@ class SourcesController < ApplicationController
81
102
  params[:id] = split_id.first
82
103
  params[:format] = (split_id.size > 1) ? split_id.last : 'html'
83
104
  end
84
-
85
- private
86
105
 
87
106
  # Indicates if pagination is available.
88
107
  def will_paginate?
@@ -108,7 +127,7 @@ class SourcesController < ApplicationController
108
127
  # * If no other template is found, this will return the default template name
109
128
  def template_for(source)
110
129
  source.types.each do |type|
111
- if(template = template_map[type.uri.to_s])
130
+ if(template = template_map[type.uri.to_s.downcase])
112
131
  return template
113
132
  end
114
133
  end
@@ -149,14 +168,14 @@ class SourcesController < ApplicationController
149
168
  # template for a source. This scans the template directory and connects
150
169
  # the templates to the right RDF types
151
170
  def map_templates_in(dir)
152
- namespace = N::Namespace[File.basename(dir)]
153
- namsp_object = N::Namespace[namespace]
171
+ namespace = File.basename(dir)
172
+ namesp_object = N::Namespace[namespace]
154
173
  TaliaCore.logger.warn("WARNING: Template files in #{dir} are never used, no namespace: #{namespace}.") unless(namesp_object)
155
174
  return unless(namesp_object)
156
175
  Dir["#{dir}/*"].each do |template|
157
176
  next unless(File.file?(template))
158
177
  template = template_basename(template)
159
- @template_map[(namsp_object + template).to_s] = "semantic_templates/#{namespace}/#{template}"
178
+ @template_map[(namesp_object + template).to_s.downcase] = "semantic_templates/#{namespace}/#{template}"
160
179
  end
161
180
  end
162
181
 
@@ -17,7 +17,83 @@ module SourcesHelper
17
17
 
18
18
  # Gets the title for a source
19
19
  def title_for(source)
20
- (source[N::DCNS.title].first || N::URI.new(source.uri).local_part)
20
+ (source[N::DCNS.title].first || source[N::RDF.label].first || N::URI.new(source.uri).local_name.titleize)
21
+ end
22
+
23
+ # If the element is a resource, create a link to the local resource page. Otherwise the element
24
+ # will be passed through unmodified
25
+ def semantic_target(element)
26
+ if(element.respond_to?(:uri))
27
+ uri = N::URI.new(element.uri)
28
+ # TODO: Could check if we are actually dealing with local uris here
29
+ link_to(uri.to_name_s, :controller => 'sources', :action => 'dispatch', :dispatch_uri => uri.local_name)
30
+ else
31
+ element
32
+ end
33
+ end
34
+
35
+ # Takes a list of data records and creates an image tag for each record, with a
36
+ # symbol image corresponding to the records mime type. The image will link to the
37
+ # record itself.
38
+ #
39
+ # You may modify this to suit your needs, and have a look at the
40
+ # #data_record_options method while you do.
41
+ def data_icons(data_records)
42
+ result = ''
43
+ data_records.each do |rec|
44
+ link_data = data_record_options(rec)
45
+ result << link_to(
46
+ image_tag("core/#{link_data.first}.png", :alt => rec.location, :title => rec.location),
47
+ { :controller => 'source_data',
48
+ :action => 'show',
49
+ :id => rec.id },
50
+ link_data.last
51
+ )
52
+ end
53
+
54
+ result
55
+ end
56
+
57
+ # Creates a little image for each (RDF) type. By default,
58
+ # it will use the same picture for (almost) everything,
59
+ # but you can add additional images easily by adding more entries
60
+ def type_images(types)
61
+ @type_map ||= {
62
+ N::TALIA.Source => 'source',
63
+ N::FOAF.Group => 'group',
64
+ N::FOAF.Person => 'person'
65
+ }
66
+ result = ''
67
+ types.each do |t|
68
+ image = @type_map[t] || 'source'
69
+ name = t.local_name.titleize
70
+ result << link_to(image_tag("core/#{image}.png", :alt => name, :title => name),
71
+ :action => 'index', :filter => t.to_name_s('+')
72
+ )
73
+ end
74
+ result
75
+ end
76
+
77
+ private
78
+
79
+ # Gives back a result list, the first element being the name of the image file
80
+ # without the extension. The second element is a hash containing options for
81
+ # the link to that data element. E.g. it would be possible to pass a css
82
+ # class giving
83
+ #
84
+ # ['image_name', {:class => 'my_class'}]
85
+ #
86
+ # Edit this method to suit your needs
87
+ def data_record_options(record)
88
+ if(record.mime.include?('image/'))
89
+ ['image', {:class => 'cbox_image'}]
90
+ elsif(record.mime.include?('text/'))
91
+ ['text', {:class =>'cbox_inline' }]
92
+ elsif(record.mime == 'application/xml')
93
+ ['text', {:class => 'cbox_inline'}]
94
+ else
95
+ ['gear', {}]
96
+ end
21
97
  end
22
98
 
23
99
  end
@@ -0,0 +1,22 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
6
+ <title><%= h(yield(:title) || "Talia | The Digital Library") %></title>
7
+ <%= stylesheet_link_tag 'main' %>
8
+ </head>
9
+ <body>
10
+ <div id="title_bar">
11
+ <h1><%= link_to h(yield(:title) || "Talia | The Digital Library"), 'root_path', :title => 'Home page'%></h1>
12
+ <p class="header_subtitle">Subtitle</p>
13
+ </div>
14
+
15
+ <!-- header end -->
16
+ <!-- contents: main part of the page - divided into external and internal -->
17
+ <div id="contents">
18
+ <%= yield %>
19
+ </div>
20
+
21
+ </body>
22
+ </html>
@@ -0,0 +1,17 @@
1
+ <div class="properties_list">
2
+ <ul>
3
+ <% for record in @source.data_records %>
4
+ <li>
5
+ <p>
6
+ <% record_options = data_record_options(record) %>
7
+ <span class="predicate">
8
+ <%= link_to(record.location, { :controller => 'source_data', :action => 'show', :id => record.id }, record_options.last )%>
9
+ </span>
10
+ <span class="value">
11
+ <%= image_tag("demo/#{record_options.first}.png", :alt => record.mime, :title => record.mime) %> (<%= record.mime %>)
12
+ </span>
13
+ </p>
14
+ </li>
15
+ <% end %>
16
+ </ul>
17
+ </div>
@@ -0,0 +1,10 @@
1
+ <li>
2
+ <p>
3
+ <span class="predicate"><%= property_item %></span>
4
+ <span class="value">
5
+ <% for value in values %>
6
+ <%= semantic_target(value) %><br/>
7
+ <% end %>
8
+ </span>
9
+ </p>
10
+ </li>
@@ -0,0 +1,13 @@
1
+ <div class ="properties_list">
2
+ <ul>
3
+ <% for attribute, value in @source.attributes %>
4
+ <%= render(:partial => 'property_item', :object => attribute, :locals => { :values => [value] }) %>
5
+ <% end %>
6
+ <% for predicate in @source.direct_predicates %>
7
+ <%= render(:partial => 'property_item', :object => predicate.to_name_s, :locals => { :values => @source[predicate] }) %>
8
+ <% end %>
9
+ <% for predicate in @source.inverse_predicates %>
10
+ <%= render(:partial => 'property_item', :object => "#{predicate.to_name_s} (inverse)", :locals => { :values => @source.inverse[predicate] }) %>
11
+ <% end %>
12
+ </ul>
13
+ </div>
@@ -1,13 +1,18 @@
1
- <h1>Sources found: <%= @sources.total_entries %></h1>
2
-
3
- <div class="tags">
4
- <% for type in @rdf_types %>
5
- <span class="<%= current_filter?(type) ? 'tag_selected' : 'tag' %>"><%= filter_link_for(type) %></span>
6
- <% end %>
1
+ <div class="sources_list">
2
+ <h1>Sources found: <%= @pagination ? @sources.total_entries : @sources.size %></h1>
3
+ <ul>
4
+ <% for source in @sources %>
5
+ <% next if(source.is_a?(TaliaCore::SourceTypes::DummySource)) %>
6
+ <li>
7
+ <p>
8
+ <span class="source_type"><%= type_images(source.types) %></span>
9
+ <span class="source_title"><%= title_for(source) %></span>
10
+ <span class="source-data"><%= data_icons(source.data_records) %></span>
11
+ <span class="more"> <%= link_to 'more...', :action => 'dispatch', :dispatch_uri => N::URI.new(source.uri).local_name %></span>
12
+ </p>
13
+ </li>
14
+ <% end %>
15
+ </ul>
7
16
  </div>
8
17
 
9
- <% for source in @sources %>
10
- <p><%= link_to title_for(source), source.uri.to_s %> (<%= source.class.name %>)</p>
11
- <% end %>
12
-
13
- <%= will_paginate @sources %>
18
+ <%= if(@pagination) ; will_paginate @sources ; end %>
@@ -1,21 +1,10 @@
1
1
  <div class="back"><%= index_link %></div>
2
2
 
3
- <h2><%= @source.uri.to_name_s %></h2>
4
- <table>
5
- <% for attribute, value in @source.attributes %>
6
- <tr>
7
- <td><%= attribute %></td>
8
- <td><%= value %></td>
9
- </tr>
10
- <% end %>
11
- <% for predicate in @source.direct_predicates %>
12
- <tr>
13
- <td><%= predicate %></td>
14
- <td>
15
- <% @source[predicate].each do |val| %>
16
- <%= val %><br/>
17
- <% end %>
18
- </td>
19
- </tr>
20
- <% end %>
21
- </table>
3
+ <h2><%= @source[N::DCNS.title].first || @source[N::RDFS.label].first || @source.uri.to_name_s %></h2>
4
+
5
+ <%= render(:partial => 'property_list') %>
6
+
7
+ <% if(@source.data_records.size > 0) %>
8
+ <h2>Data Records</h2>
9
+ <%= render(:partial => 'data_list') %>
10
+ <% end %>
@@ -15,6 +15,14 @@ ActionController::Routing::Routes.draw do |map|
15
15
 
16
16
  map.resource :session
17
17
 
18
+ map.logout '/logout', :controller => 'sessions', :action => 'destroy'
19
+ map.login '/login', :controller => 'sessions', :action => 'new'
20
+ map.register '/register', :controller => 'users', :action => 'create'
21
+ map.signup '/signup', :controller => 'users', :action => 'new'
22
+ map.resources :users
23
+
24
+ map.resource :session
25
+
18
26
  # The priority is based upon order of creation: first created -> highest priority.
19
27
 
20
28
  # Sample of regular route:
@@ -52,8 +60,11 @@ ActionController::Routing::Routes.draw do |map|
52
60
  admin.resources :locales
53
61
  admin.resources :background, :active_scaffold => true
54
62
  admin.resources :custom_templates, :active_scaffold => true
63
+ admin.resources :data_records, :active_scaffold => true
55
64
  end
56
65
 
66
+ map.connect 'sources/auto_complete_for_uri', :controller => 'sources', :action => 'auto_complete_for_uri'
67
+
57
68
  # Routes for login and users handling
58
69
  map.resources :users
59
70
  map.login 'login', :controller => 'sessions', :action => 'create'
@@ -8,7 +8,8 @@ class CreateSemanticRelations < ActiveRecord::Migration
8
8
  end
9
9
 
10
10
  add_index :semantic_relations, :predicate_uri, :unique => false
11
-
11
+ add_index :semantic_relations, :subject_id, :unique => false
12
+ add_index :semantic_relations, :object_id, :unique => false
12
13
  end
13
14
 
14
15
  def self.down