muck-raker 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +24 -0
- data/Rakefile +76 -0
- data/VERSION +1 -0
- data/app/controllers/admin/recommender/feeds_controller.rb +174 -0
- data/app/controllers/recommender/default_controller.rb +15 -0
- data/app/controllers/recommender/entries_controller.rb +79 -0
- data/app/controllers/recommender/recommendations_controller.rb +46 -0
- data/app/controllers/recommender/search_controller.rb +82 -0
- data/app/helpers/muck_raker_helper.rb +29 -0
- data/app/models/click.rb +2 -0
- data/app/models/cloud_cache.rb +9 -0
- data/app/models/entry.rb +274 -0
- data/app/models/feed.rb +29 -0
- data/app/models/language.rb +2 -0
- data/app/models/oai_endpoint.rb +2 -0
- data/app/models/recommendation.rb +2 -0
- data/app/models/service.rb +2 -0
- data/app/models/subject.rb +2 -0
- data/app/models/user.rb +36 -0
- data/app/views/default/_advertisements.html.erb +30 -0
- data/app/views/default/_language_list.html.erb +5 -0
- data/app/views/default/index.html.erb +3 -0
- data/app/views/default/tour.html.erb +15 -0
- data/app/views/default/widgets.html.erb +4 -0
- data/app/views/documents/.tmp_not_found.html +0 -0
- data/app/views/entries/_cloud_type_selector.html.erb +9 -0
- data/app/views/entries/_result.html.erb +10 -0
- data/app/views/entries/_tag_cloud.html.erb +4 -0
- data/app/views/entries/_tags.html.erb +7 -0
- data/app/views/entries/browse_by_tags.html.erb +33 -0
- data/app/views/entries/collections.html.erb +28 -0
- data/app/views/entries/details.html.erb +39 -0
- data/app/views/entries/index.html.erb +8 -0
- data/app/views/entries/search.html.erb +21 -0
- data/app/views/entries/show.html.erb +19 -0
- data/app/views/entries/track_clicks.html.erb +0 -0
- data/app/views/feeds/_feed_selection.html.erb +1 -0
- data/app/views/feeds/edit.html.erb +107 -0
- data/app/views/feeds/harvest_now.html.erb +3 -0
- data/app/views/feeds/index.html.erb +95 -0
- data/app/views/feeds/new.html.erb +109 -0
- data/app/views/feeds/unban.html.erb +3 -0
- data/app/views/layouts/_flashes.html.erb +5 -0
- data/app/views/layouts/default.html.erb +35 -0
- data/app/views/layouts/default_old.html.erb +43 -0
- data/app/views/layouts/global/_header.html.erb +16 -0
- data/app/views/layouts/global/_search_box.html.erb +13 -0
- data/app/views/layouts/recommendations.html.erb +17 -0
- data/app/views/recommendations/document_not_found.html.erb +13 -0
- data/app/views/recommendations/index.pjs.erb +44 -0
- data/app/views/recommendations/index.rss.builder +37 -0
- data/app/views/recommendations/index.xml.builder +34 -0
- data/app/views/recommendations/index_js.pjs.erb +35 -0
- data/app/views/search/_languages.html.erb +6 -0
- data/app/views/search/_result.html.erb +9 -0
- data/app/views/search/_search_box.html.erb +9 -0
- data/app/views/search/index.html.erb +5 -0
- data/app/views/search/results.atom.builder +27 -0
- data/app/views/search/results.html.erb +35 -0
- data/app/views/search/results.pjs.erb +13 -0
- data/app/views/search/results.rdf.builder +24 -0
- data/app/views/search/results.rss.builder +31 -0
- data/app/views/search/results.xml.builder +19 -0
- data/config/muck_raker_routes.rb +39 -0
- data/config/solr/README.txt +0 -0
- data/config/solr/cores/de/conf/protwords.txt +21 -0
- data/config/solr/cores/de/conf/schema.xml +81 -0
- data/config/solr/cores/de/conf/solrconfig.xml +304 -0
- data/config/solr/cores/de/conf/stopwords.txt +341 -0
- data/config/solr/cores/de/conf/synonyms.txt +31 -0
- data/config/solr/cores/en/conf/protwords.txt +21 -0
- data/config/solr/cores/en/conf/schema.xml +83 -0
- data/config/solr/cores/en/conf/solrconfig.xml +304 -0
- data/config/solr/cores/en/conf/stopwords.txt +341 -0
- data/config/solr/cores/en/conf/synonyms.txt +31 -0
- data/config/solr/cores/es/conf/protwords.txt +21 -0
- data/config/solr/cores/es/conf/schema.xml +81 -0
- data/config/solr/cores/es/conf/solrconfig.xml +304 -0
- data/config/solr/cores/es/conf/stopwords.txt +206 -0
- data/config/solr/cores/es/conf/synonyms.txt +31 -0
- data/config/solr/cores/fr/conf/protwords.txt +21 -0
- data/config/solr/cores/fr/conf/schema.xml +82 -0
- data/config/solr/cores/fr/conf/solrconfig.xml +304 -0
- data/config/solr/cores/fr/conf/stopwords.txt +57 -0
- data/config/solr/cores/fr/conf/synonyms.txt +31 -0
- data/config/solr/cores/ja/conf/protwords.txt +21 -0
- data/config/solr/cores/ja/conf/schema.xml +69 -0
- data/config/solr/cores/ja/conf/solrconfig.xml +304 -0
- data/config/solr/cores/ja/conf/stopwords.txt +341 -0
- data/config/solr/cores/ja/conf/synonyms.txt +31 -0
- data/config/solr/cores/nl/conf/protwords.txt +21 -0
- data/config/solr/cores/nl/conf/schema.xml +78 -0
- data/config/solr/cores/nl/conf/solrconfig.xml +304 -0
- data/config/solr/cores/nl/conf/stopwords.txt +45691 -0
- data/config/solr/cores/nl/conf/synonyms.txt +31 -0
- data/config/solr/cores/ru/conf/protwords.txt +21 -0
- data/config/solr/cores/ru/conf/schema.xml +78 -0
- data/config/solr/cores/ru/conf/solrconfig.xml +304 -0
- data/config/solr/cores/ru/conf/stopwords.txt +341 -0
- data/config/solr/cores/ru/conf/synonyms.txt +31 -0
- data/config/solr/cores/zh/conf/protwords.txt +21 -0
- data/config/solr/cores/zh/conf/schema.xml +72 -0
- data/config/solr/cores/zh/conf/solrconfig.xml +304 -0
- data/config/solr/cores/zh/conf/stopwords.txt +341 -0
- data/config/solr/cores/zh/conf/synonyms.txt +31 -0
- data/config/solr/solr.xml +50 -0
- data/db/bootstrap/feeds.yml +4268 -0
- data/db/bootstrap/oai_endpoints.yml +6 -0
- data/db/bootstrap/services.yml +172 -0
- data/db/migrate/20090602191243_create_muck_raker.rb +304 -0
- data/install.rb +1 -0
- data/lib/muck_raker/initialize_routes.rb +8 -0
- data/lib/muck_raker/languages.rb +53 -0
- data/lib/muck_raker.rb +6 -0
- data/locales/en.yml +42 -0
- data/rails/init.rb +27 -0
- data/raker/lib/aggregatord.jar +0 -0
- data/raker/lib/aggregatord.properties +45 -0
- data/raker/lib/apache-solr-common-1.3.0.jar +0 -0
- data/raker/lib/apache-solr-core-1.3.0.jar +0 -0
- data/raker/lib/apache-solr-dataimporthandler-1.3.0.jar +0 -0
- data/raker/lib/axis.jar +0 -0
- data/raker/lib/commons-codec-1.3.jar +0 -0
- data/raker/lib/commons-csv-1.0-SNAPSHOT-r609327.jar +0 -0
- data/raker/lib/commons-daemon.jar +0 -0
- data/raker/lib/commons-dbcp-1.2.1.jar +0 -0
- data/raker/lib/commons-discovery-0.2.jar +0 -0
- data/raker/lib/commons-fileupload-1.2.jar +0 -0
- data/raker/lib/commons-httpclient-3.1.jar +0 -0
- data/raker/lib/commons-io-1.3.1.jar +0 -0
- data/raker/lib/commons-logging-1.0.4.jar +0 -0
- data/raker/lib/commons-pool-1.3.jar +0 -0
- data/raker/lib/delicious-1.13.jar +0 -0
- data/raker/lib/flickrapi-1.0a9.jar +0 -0
- data/raker/lib/geronimo-stax-api_1.0_spec-1.0.1.jar +0 -0
- data/raker/lib/javax.jms.jar +0 -0
- data/raker/lib/jaxrpc.jar +0 -0
- data/raker/lib/jdom.jar +0 -0
- data/raker/lib/jericho.jar +0 -0
- data/raker/lib/junit-4.3.jar +0 -0
- data/raker/lib/log4j-1.2.8.jar +0 -0
- data/raker/lib/lucene-analyzers-2.4-dev.jar +0 -0
- data/raker/lib/lucene-core-2.4-dev.jar +0 -0
- data/raker/lib/lucene-highlighter-2.4-dev.jar +0 -0
- data/raker/lib/lucene-memory-2.4-dev.jar +0 -0
- data/raker/lib/lucene-queries-2.4-dev.jar +0 -0
- data/raker/lib/lucene-snowball-2.4-dev.jar +0 -0
- data/raker/lib/lucene-spellchecker-2.4-dev.jar +0 -0
- data/raker/lib/mail.jar +0 -0
- data/raker/lib/mysql-connector-java-5.1.7-bin.jar +0 -0
- data/raker/lib/recommenderd.jar +0 -0
- data/raker/lib/recommenderd.properties +64 -0
- data/raker/lib/rome-1.0.jar +0 -0
- data/raker/lib/rome.properties +90 -0
- data/raker/lib/solr-commons-csv-pom.xml.template +36 -0
- data/raker/lib/solr-lucene-analyzers-pom.xml.template +35 -0
- data/raker/lib/solr-lucene-contrib-pom.xml.template +48 -0
- data/raker/lib/solr-lucene-core-pom.xml.template +36 -0
- data/raker/lib/solr-lucene-highlighter-pom.xml.template +38 -0
- data/raker/lib/solr-lucene-queries-pom.xml.template +38 -0
- data/raker/lib/solr-lucene-snowball-pom.xml.template +36 -0
- data/raker/lib/solr-lucene-spellchecker-pom.xml.template +36 -0
- data/raker/lib/stax-utils.jar +0 -0
- data/raker/lib/wsdl4j-1.5.1.jar +0 -0
- data/raker/lib/wstx-asl-3.2.7.jar +0 -0
- data/tasks/bootstrap.rake +18 -0
- data/tasks/raker.rake +68 -0
- data/test/recommender_test.rb +8 -0
- data/test/test_helper.rb +20 -0
- data/uninstall.rb +1 -0
- metadata +253 -0
@@ -0,0 +1,107 @@
|
|
1
|
+
<script type="text/javascript">
|
2
|
+
function validate()
|
3
|
+
{
|
4
|
+
title = document.getElementById("feed_title");
|
5
|
+
if (!title.value)
|
6
|
+
{
|
7
|
+
alert("You must specify a Title for the collection.");
|
8
|
+
return false;
|
9
|
+
}
|
10
|
+
short_title = document.getElementById("feed_short_title");
|
11
|
+
if (!short_title.value)
|
12
|
+
{
|
13
|
+
alert("You must specify a Short Title for the collection.");
|
14
|
+
return false;
|
15
|
+
}
|
16
|
+
h_title = document.getElementById("feed_harvested_from_title");
|
17
|
+
if (!h_title.value)
|
18
|
+
{
|
19
|
+
alert("You must specify a Repository Title.");
|
20
|
+
return false;
|
21
|
+
}
|
22
|
+
h_short_title = document.getElementById("feed_harvested_from_short_title");
|
23
|
+
if (!h_short_title.value)
|
24
|
+
{
|
25
|
+
alert("You must specify a Repository Short Title.");
|
26
|
+
return false;
|
27
|
+
}
|
28
|
+
rss_uri = document.getElementById("feed_uri");
|
29
|
+
if (!rss_uri.value)
|
30
|
+
{
|
31
|
+
alert("You must specify the Address of the Collection Metadata.");
|
32
|
+
return false;
|
33
|
+
}
|
34
|
+
if (rss_uri.value.indexOf("http://") != 0)
|
35
|
+
{
|
36
|
+
rss_uri.value = "http://" + rss_uri.value;
|
37
|
+
}
|
38
|
+
display_uri = document.getElementById("feed_display_uri");
|
39
|
+
if (display_uri.value && display_uri.value.indexOf("http://") != 0)
|
40
|
+
{
|
41
|
+
display_uri.value = "http://" + display_uri.value;
|
42
|
+
}
|
43
|
+
return true;
|
44
|
+
}
|
45
|
+
</script>
|
46
|
+
|
47
|
+
<h1>Edit Collection Metadata: <%= @feed.title %></h1>
|
48
|
+
|
49
|
+
<%= error_messages_for :feed %>
|
50
|
+
|
51
|
+
<% form_for :feed, @feed, :url => feed_path(@feed), :html => {:method => :put, :onsubmit => "return validate()"} do |f| %>
|
52
|
+
|
53
|
+
<p>
|
54
|
+
<b>Collection Title</b><br />
|
55
|
+
<%= f.text_field :title, :size => 100 %>
|
56
|
+
</p>
|
57
|
+
|
58
|
+
<p>
|
59
|
+
<b>Collection Short Title (this will be appended to resource titles)</b><br />
|
60
|
+
<%= f.text_field :short_title, {:maxlength => 30, :size => 30} %>
|
61
|
+
</p>
|
62
|
+
|
63
|
+
<p>
|
64
|
+
<b>Repository Title</b><br />
|
65
|
+
<%= f.text_field :harvested_from_title, :size => 100 %>
|
66
|
+
</p>
|
67
|
+
|
68
|
+
<p>
|
69
|
+
<b>Repository Short Title</b><br />
|
70
|
+
<%= f.text_field :harvested_from_short_title, {:maxlength => 30, :size => 30} %>
|
71
|
+
</p>
|
72
|
+
|
73
|
+
<p>
|
74
|
+
<b>Address of the Collection Metadata</b><br />
|
75
|
+
<%= f.text_field :uri, :size => 100 %>
|
76
|
+
</p>
|
77
|
+
|
78
|
+
<p>
|
79
|
+
<b>Address of the Collection Home Page</b><br />
|
80
|
+
<%= f.text_field :display_uri, :size => 100 %>
|
81
|
+
</p>
|
82
|
+
|
83
|
+
<p>
|
84
|
+
<b>Type of Metadata:</b>
|
85
|
+
<select name="feed[service_id]">
|
86
|
+
<option value="0">RSS</option>
|
87
|
+
<option value="13"<%= @feed.service_id == 13 ? " selected" : ""%>>OAI</option>
|
88
|
+
</select>
|
89
|
+
<br/>If you specify OAI, you must specify the full url to the ListRecords request (not just the OAI endpoint)
|
90
|
+
</p>
|
91
|
+
|
92
|
+
<p>
|
93
|
+
<b>Description</b><br />
|
94
|
+
<%= f.text_field :description, :size => 100 %>
|
95
|
+
</p>
|
96
|
+
|
97
|
+
<p>
|
98
|
+
<b>How Often to Harvest the Collection</b><br />
|
99
|
+
<%= select :feed, "refresh_interval_hours", [["Once a day", "24"], ["Once a week", "168"], ["Once a month", "672"]] %>
|
100
|
+
</p>
|
101
|
+
|
102
|
+
<p>
|
103
|
+
<%= submit_tag "Update Feed" %>
|
104
|
+
</p>
|
105
|
+
|
106
|
+
<% end %>
|
107
|
+
|
@@ -0,0 +1,95 @@
|
|
1
|
+
<h1>OER Recommender - Registered Collections</h1>
|
2
|
+
|
3
|
+
<div style="font-size:80%">
|
4
|
+
|
5
|
+
<p>
|
6
|
+
<a href="/feeds/new">Register a New Collection</a> |
|
7
|
+
<a href="/logout">Logout</a>
|
8
|
+
</p>
|
9
|
+
<table border="1" cellpadding="6px;">
|
10
|
+
<tr>
|
11
|
+
<th>ID</th>
|
12
|
+
<th>Title</th>
|
13
|
+
<th>Actions</th>
|
14
|
+
<th>Description</th>
|
15
|
+
<th>Harvest interval (hrs)</th>
|
16
|
+
<th>Harvested at</th>
|
17
|
+
<th>Failed harvests</th>
|
18
|
+
<th>Status</th>
|
19
|
+
<th>URI</th>
|
20
|
+
</tr>
|
21
|
+
|
22
|
+
<% for feed in @feeds %>
|
23
|
+
<tr>
|
24
|
+
<td><%= feed.id.to_s %></td>
|
25
|
+
<td><%= link_to feed.title, "/feeds/" + feed.id.to_s + "/entries" %> <%= link_to "[go]", feed.display_uri, :style => "color:red" %></td>
|
26
|
+
<td>
|
27
|
+
<%= link_to 'Edit', edit_feed_path(feed) %>
|
28
|
+
<%
|
29
|
+
=begin %>
|
30
|
+
<% if feed.status >= 0 %>
|
31
|
+
<%= link_to 'Ban', ban_feed_path(feed), :confirm => 'Are you sure?', :method => :post %>
|
32
|
+
<% else %>
|
33
|
+
<%= link_to 'Unban', unban_feed_path(feed), :confirm => 'Are you sure?', :method => :post %>
|
34
|
+
<% end %>
|
35
|
+
<%= link_to 'Harvest', harvest_now_feed_path(feed), :method => :post %>
|
36
|
+
<%= link_to 'Delete', feed_path(feed), :method => :delete %>
|
37
|
+
<%
|
38
|
+
=end %>
|
39
|
+
</td>
|
40
|
+
<td><%=h feed.description %></td>
|
41
|
+
<td><%=h feed.refresh_interval_hours %></td>
|
42
|
+
<td><%=h feed.last_harvested_at %></td>
|
43
|
+
<td><%=h feed.failed_requests %></td>
|
44
|
+
<td><%=h feed.error_message ? "Failed last request:" + feed.error_message : feed.status >= 0 ? "Ok" : "Banned" %></td>
|
45
|
+
<td><%=h feed.uri %></td>
|
46
|
+
</tr>
|
47
|
+
<% end %>
|
48
|
+
|
49
|
+
</table>
|
50
|
+
|
51
|
+
<% if @banned_feeds.size > 0 %>
|
52
|
+
|
53
|
+
<h1>Banned Feeds</h1>
|
54
|
+
|
55
|
+
<table>
|
56
|
+
<tr>
|
57
|
+
<th width="200px;">Title</th>
|
58
|
+
<th>Description</th>
|
59
|
+
<th>Refresh interval</th>
|
60
|
+
<th>Harvested at</th>
|
61
|
+
<th>Failed harvests</th>
|
62
|
+
<th>Email</th>
|
63
|
+
<th>Status</th>
|
64
|
+
<th>Actions</th>
|
65
|
+
</tr>
|
66
|
+
|
67
|
+
<% for feed in @banned_feeds %>
|
68
|
+
<tr>
|
69
|
+
<td><%= link_to feed.title, "/feeds/" + feed.id.to_s + "/entries" %> <%= link_to "[go]", feed.display_uri, :style => "color:red" %></td>
|
70
|
+
<td>
|
71
|
+
<%= link_to 'Edit', edit_feed_path(feed) %>
|
72
|
+
<%
|
73
|
+
=begin %>
|
74
|
+
<% if feed.status >= 0 %>
|
75
|
+
<%= link_to 'Ban', ban_feed_path(feed), :confirm => 'Are you sure?', :method => :post %>
|
76
|
+
<% else %>
|
77
|
+
<%= link_to 'Unban', unban_feed_path(feed), :confirm => 'Are you sure?', :method => :post %>
|
78
|
+
<% end %>
|
79
|
+
<%= link_to 'Harvest', harvest_now_feed_path(feed), :method => :post %>
|
80
|
+
<%= link_to 'Delete', feed_path(feed), :method => :delete %>
|
81
|
+
<%
|
82
|
+
=end %>
|
83
|
+
</td>
|
84
|
+
<td><%=h feed.description %></td>
|
85
|
+
<td><%=h feed.harvest_interval %></td>
|
86
|
+
<td><%=h feed.last_harvested_at %></td>
|
87
|
+
<td><%=h feed.failed_requests %></td>
|
88
|
+
<td><%=h feed.error_message ? "Failed last request:" + feed.error_message : feed.status >= 0 ? "Ok" : "Banned" %></td>
|
89
|
+
<td><%=h feed.uri %></td>
|
90
|
+
</tr>
|
91
|
+
<% end %>
|
92
|
+
|
93
|
+
</table>
|
94
|
+
</div>
|
95
|
+
<% end %>
|
@@ -0,0 +1,109 @@
|
|
1
|
+
<script type="text/javascript">
|
2
|
+
function validate()
|
3
|
+
{
|
4
|
+
title = document.getElementById("feed_title");
|
5
|
+
if (!title.value)
|
6
|
+
{
|
7
|
+
alert("You must specify a Title for the collection.");
|
8
|
+
return false;
|
9
|
+
}
|
10
|
+
short_title = document.getElementById("feed_short_title");
|
11
|
+
if (!short_title.value)
|
12
|
+
{
|
13
|
+
alert("You must specify a Short Title for the collection.");
|
14
|
+
return false;
|
15
|
+
}
|
16
|
+
h_title = document.getElementById("feed_harvested_from_title");
|
17
|
+
if (!h_title.value)
|
18
|
+
{
|
19
|
+
alert("You must specify a Harvested From Title.");
|
20
|
+
return false;
|
21
|
+
}
|
22
|
+
h_short_title = document.getElementById("feed_harvested_from_short_title");
|
23
|
+
if (!h_short_title.value)
|
24
|
+
{
|
25
|
+
alert("You must specify a Harevested From Short Title.");
|
26
|
+
return false;
|
27
|
+
}
|
28
|
+
rss_uri = document.getElementById("feed_uri");
|
29
|
+
if (!rss_uri.value)
|
30
|
+
{
|
31
|
+
alert("You must specify the Address of the Repository Metadata RSS.");
|
32
|
+
return false;
|
33
|
+
}
|
34
|
+
if (rss_uri.value.indexOf("http://") != 0)
|
35
|
+
{
|
36
|
+
rss_uri.value = "http://" + rss_uri.value;
|
37
|
+
}
|
38
|
+
display_uri = document.getElementById("feed_display_uri");
|
39
|
+
if (display_uri.value && display_uri.value.indexOf("http://") != 0)
|
40
|
+
{
|
41
|
+
display_uri.value = "http://" + display_uri.value;
|
42
|
+
}
|
43
|
+
return true;
|
44
|
+
}
|
45
|
+
</script>
|
46
|
+
|
47
|
+
<div style="float:left;">
|
48
|
+
<h1>OER Recommender - Register a Collection</h1>
|
49
|
+
|
50
|
+
<%= error_messages_for :feed %>
|
51
|
+
|
52
|
+
<% form_for(:feed, :url => "/feeds", :html => {:onsubmit => "return validate()"}) do |f| %>
|
53
|
+
|
54
|
+
<p>
|
55
|
+
<b>Title</b><br />
|
56
|
+
<%= f.text_field :title, :size => 100 %>
|
57
|
+
</p>
|
58
|
+
|
59
|
+
<p>
|
60
|
+
<b>Short Title (this will be appended to resource titles)</b><br />
|
61
|
+
<%= f.text_field :short_title, {:maxlength => 30, :size => 30} %>
|
62
|
+
</p>
|
63
|
+
|
64
|
+
<p>
|
65
|
+
<b>Repository Title</b><br />
|
66
|
+
<%= f.text_field :harvested_from_title, :size => 100 %>
|
67
|
+
</p>
|
68
|
+
|
69
|
+
<p>
|
70
|
+
<b>Repository Short Title</b><br />
|
71
|
+
<%= f.text_field :harvested_from_short_title, {:maxlength => 30, :size => 30} %>
|
72
|
+
</p>
|
73
|
+
|
74
|
+
<p>
|
75
|
+
<b>Address of the Collection Metadata</b><br />
|
76
|
+
<%= f.text_field :uri, :size => 100 %>
|
77
|
+
</p>
|
78
|
+
|
79
|
+
<p>
|
80
|
+
<b>Address of the Collection Home Page</b><br />
|
81
|
+
<%= f.text_field :display_uri, :size => 100 %>
|
82
|
+
</p>
|
83
|
+
|
84
|
+
<p>
|
85
|
+
<b>Type of Metadata:</b>
|
86
|
+
<select name="feed[service_id]">
|
87
|
+
<option value="0">RSS</option>
|
88
|
+
<option value="13">OAI</option>
|
89
|
+
</select>
|
90
|
+
<br/>If you specify OAI, you must specify the full url to the ListRecords request (not just the OAI endpoint)
|
91
|
+
</p>
|
92
|
+
|
93
|
+
<p>
|
94
|
+
<b>Collection Description</b><br />
|
95
|
+
<%= f.text_field :description, :size => 100 %>
|
96
|
+
</p>
|
97
|
+
|
98
|
+
<p>
|
99
|
+
<b>How Often to Harvest the Collection</b><br />
|
100
|
+
<%= select :feed, "refresh_interval_hours", [["Once a day", "24"], ["Once a week", "168"], ["Once a month", "672"]] %>
|
101
|
+
</p>
|
102
|
+
|
103
|
+
<p>
|
104
|
+
<%= submit_tag "Add Collection" %>
|
105
|
+
</p>
|
106
|
+
|
107
|
+
<% end %>
|
108
|
+
</div>
|
109
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= session[:locale] %>" lang="<%= session[:locale] %>">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
5
|
+
<%= @no_index == true ? '<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"><META NAME="Googlebot" CONTENT="nofollow">' : '' %>
|
6
|
+
<title><%= @page_title.nil? ? "" : @page_title + " - " %>OER Recommender</title>
|
7
|
+
<%= stylesheet_link_tag 'default' %>
|
8
|
+
<%= javascript_include_tag "jquery-1.3.2.min.js" %>
|
9
|
+
<%= javascript_include_tag "jquery.jgrowl_minimized.js" %>
|
10
|
+
<%= javascript_include_tag "application.js" %>
|
11
|
+
<%= javascript_tag %[const AUTH_TOKEN = #{form_authenticity_token.inspect};] if protect_against_forgery? %>
|
12
|
+
<%= yield :head -%>
|
13
|
+
</head>
|
14
|
+
<body>
|
15
|
+
<div id="wrapper">
|
16
|
+
<%= render :partial => 'layouts/global/header' %>
|
17
|
+
<div id="content-wrapper">
|
18
|
+
<div id="content">
|
19
|
+
<%= yield :layout %>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
<script type="text/javascript" language="JavaScript">
|
24
|
+
jQuery(document).ready(function(){
|
25
|
+
<%= yield :ready %>
|
26
|
+
});
|
27
|
+
</script>
|
28
|
+
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
29
|
+
</script>
|
30
|
+
<script type="text/javascript">
|
31
|
+
_uacct = "<%=GlobalConfig.google_analytics_key%>";
|
32
|
+
urchinTracker();
|
33
|
+
</script>
|
34
|
+
</body>
|
35
|
+
</html>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= session[:locale] %>" lang="<%= session[:locale] %>">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
5
|
+
<%= @no_index == true ? '<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"><META NAME="Googlebot" CONTENT="nofollow">' : '' %>
|
6
|
+
<title>OER Recommender<%= @page_title.nil? ? "" : " - " + @page_title %></title>
|
7
|
+
<%= stylesheet_link_tag 'default' %>
|
8
|
+
<%= javascript_include_tag "jquery-1.3.2.min.js" %>
|
9
|
+
<%= javascript_include_tag "jquery.jgrowl_minimized.js" %>
|
10
|
+
<%= javascript_include_tag "application.js" %>
|
11
|
+
<%= javascript_tag %[const AUTH_TOKEN = #{form_authenticity_token.inspect};] if protect_against_forgery? %>
|
12
|
+
<%= yield :head -%>
|
13
|
+
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
14
|
+
</script>
|
15
|
+
<script type="text/javascript">
|
16
|
+
_uacct = "<%=GlobalConfig.google_analytics_key%>";
|
17
|
+
urchinTracker();
|
18
|
+
</script>
|
19
|
+
</head>
|
20
|
+
<body>
|
21
|
+
<div id="wrapper">
|
22
|
+
<div id="header">
|
23
|
+
<h1 class="home_page_title"><%= t(:title) %></h1>
|
24
|
+
<p style="color: green">
|
25
|
+
<%= flash[:notice] %>
|
26
|
+
</p>
|
27
|
+
<p>
|
28
|
+
<%= t(:tag_line) %>
|
29
|
+
</p>
|
30
|
+
</div>
|
31
|
+
<div id="content-wrapper">
|
32
|
+
<div id="content">
|
33
|
+
<%= yield :layout %>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
<script type="text/javascript" language="JavaScript">
|
38
|
+
jQuery(document).ready(function(){
|
39
|
+
<%= yield :ready %>
|
40
|
+
});
|
41
|
+
</script>
|
42
|
+
</body>
|
43
|
+
</html>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<div id="header">
|
2
|
+
<div>
|
3
|
+
<div id="logo">
|
4
|
+
<a href="/"><img border="0" src="/images/logo_folksemantic.jpg" alt="Folksemantic" title="Folksemantic"/></a>
|
5
|
+
<div id="tag-line"><%= t(:tag_line) %></div>
|
6
|
+
</div>
|
7
|
+
<div style="float:left;margin-top:21px;margin-left:45px;background:navy;width:150px;padding:6px;font-size:20px;font-weight:bold;color:white;text-align:center;">Take a Tour</div>
|
8
|
+
<%= render :partial => 'layouts/global/search_box' %>
|
9
|
+
</div>
|
10
|
+
<div class="clear"></div>
|
11
|
+
<% if flash[:notice] %>
|
12
|
+
<p style="color: green">
|
13
|
+
<%= flash[:notice] %>
|
14
|
+
</p>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div id="search-controls">
|
2
|
+
<% form_tag(:controller => 'search', :action => 'results') do %>
|
3
|
+
<%= text_field_tag(:form_terms, @terms.nil? ? t(:search) : @terms, :id => 'search-box') %>
|
4
|
+
<%= submit_tag(t(:search_button), :class => "input-button") %>
|
5
|
+
<div style="width:230px;text-align:right;margin-top:3px;"><a href="">sign up</a> | <a href="">sign in</a> <img src="/images/flags/flag_en.png" style="vertical-align:middle"/></div>
|
6
|
+
<!--
|
7
|
+
<br/>
|
8
|
+
<input type="radio" name="scope" value="all" />All
|
9
|
+
<input type="radio" name="scope" value="ocws" />Courses
|
10
|
+
<input type="hidden" name="locale" value="<%= session[:locale] %>">
|
11
|
+
-->
|
12
|
+
<% end %>
|
13
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
7
|
+
<title>Recommendations: <%= controller.action_name %></title>
|
8
|
+
<%= stylesheet_link_tag 'scaffold' %>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
|
12
|
+
<p style="color: green"><%= flash[:notice] %></p>
|
13
|
+
|
14
|
+
<%= yield %>
|
15
|
+
|
16
|
+
</body>
|
17
|
+
</html>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Recommendations for <%= params[:u] %></title>
|
4
|
+
</head>
|
5
|
+
<body>
|
6
|
+
<h1>Requested Document Not Indexed</h1>
|
7
|
+
<p>The document you requested recommendations has not been indexed by OER Recommender:</p>
|
8
|
+
<p><%= h params[:u] %></p>
|
9
|
+
</body>
|
10
|
+
</html>
|
11
|
+
|
12
|
+
|
13
|
+
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<%
|
2
|
+
@json_recommendations = @document.json_recommendations(@limit, params[:order] || "mixed", true, params[:omit_feeds] || nil)
|
3
|
+
if !@json_recommendations.nil?
|
4
|
+
@direct_link_text = params[:direct_link_text] || t(:direct_link)
|
5
|
+
%>
|
6
|
+
var catalog_page = <%= !@document.direct_link.nil? and @uri == @document.permalink %>;
|
7
|
+
var document_host = '<%= @host %>';
|
8
|
+
var recs = <%= @json_recommendations %>;
|
9
|
+
var app = "http://www.oerrecommender.org/";
|
10
|
+
<% if @details == true -%>
|
11
|
+
function truncate(text, length) {
|
12
|
+
nEnd = text.indexOf(" ", 200);
|
13
|
+
if (nEnd < 200) return text;
|
14
|
+
else return text.substring(0, nEnd) + " ...";
|
15
|
+
}
|
16
|
+
var asMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
|
17
|
+
function format_date(published_at) {
|
18
|
+
date = new Date();
|
19
|
+
date.setTime(Date.parse(published_at));
|
20
|
+
return date.getDate() + " " + asMonths[date.getMonth()] + " " + date.getUTCFullYear();
|
21
|
+
}
|
22
|
+
<% end %>
|
23
|
+
document.write('<div class="oer_recommender_container">');
|
24
|
+
<% if params[:title] %>document.write('<div class="oer_recommender_title"><%= t(:gm_title) %></div>');<% end %>
|
25
|
+
document.write('<div class="oer_recommender_list">');
|
26
|
+
for(nRec = 0; nRec < recs.length; nRec++) {
|
27
|
+
r = recs[nRec];
|
28
|
+
metadata_link = catalog_page && document_host == r.uri.substring(0, document_host.length);
|
29
|
+
direct_link = metadata_link && r.direct_link;
|
30
|
+
document.write('<p class="oer_recommender_item">');
|
31
|
+
document.write('<a class="oer_recommender_recommendation_link" href="' + app + 'r?id=' + r.id + (metadata_link ? "&target=metadata" : "") + '">' + r.title + ' (' + r.collection + ')</a>');
|
32
|
+
if (direct_link) document.write(' <a class="oer_recommender_direct_link" href="' + app + 'r?id=' + r.id + '&target=direct_link"><%= @direct_link_text %></a>');
|
33
|
+
<% if @details == true -%>
|
34
|
+
document.write(' <span class="oer_recommender_published_at">(' + format_date(r.published_at) + ')</span>');
|
35
|
+
document.write(' <span class="oer_recommender_relevance_score"><%= t(:relevance)%>: ' + Math.round(r.relevance*100)/100 + '</span>');
|
36
|
+
document.write('<br/><span class="oer_recommender_description">' + truncate(r.description) + '</span>');
|
37
|
+
document.write('<br/><span class="oer_recommender_uri">' + r.uri + '</span>');
|
38
|
+
<% end -%>
|
39
|
+
document.write('</a></p>');
|
40
|
+
}
|
41
|
+
document.write('</div>');
|
42
|
+
<% if params[:more_link] %>document.write('<div class="oer_recommender_more_link"><a href="' + app + 'documents/<%= @document.id %>"><%= t(:gm_more_prompt) %></a></div>');<% end %>
|
43
|
+
document.write('</div>');
|
44
|
+
<% end %>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
if @document.nil?
|
2
|
+
@recommendations = Array.new
|
3
|
+
else
|
4
|
+
@recommendations = @document.ranked_recommendations(@limit, params[:order] || "mixed")
|
5
|
+
end
|
6
|
+
|
7
|
+
headers["Content-Type"] = "application/rss+xml"
|
8
|
+
xml.instruct!
|
9
|
+
|
10
|
+
xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/", "xmlns:oerr" => "http://www.oerrecommender.org/oerr/elements/1.0/" do
|
11
|
+
xml.channel do
|
12
|
+
|
13
|
+
xml.title "OER Recommender recommendations for " + @document.permalink
|
14
|
+
xml.link url_for(request.env["REQUEST_URI"])
|
15
|
+
# xml.pubDate CGI.rfc1123_date @entries.first.updated_at if @entries.any?
|
16
|
+
# xml.description "Blog posts for " + @event.title
|
17
|
+
xml.generator 'OER Recommender'
|
18
|
+
|
19
|
+
@recommendations.each do |recommendation|
|
20
|
+
xml.item do
|
21
|
+
xml.link recommendation["uri"]
|
22
|
+
xml.oerr :clicks, recommendation["clicks"]
|
23
|
+
xml.oerr :relevance, round(recommendation["relevance"])
|
24
|
+
xml.title recommendation["title"]
|
25
|
+
if recommendation["description"] != nil
|
26
|
+
xml.description "type" => "html" do
|
27
|
+
xml.text! recommendation["description"]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
# xml.pubDate CGI.rfc1123_date recommendation.created_at
|
31
|
+
xml.guid "http://www.oerrecommender.org/r?id=" + recommendation["id"].to_s
|
32
|
+
# xml.author "#{entry.author} (#{entry.author})"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
xml.instruct!
|
2
|
+
|
3
|
+
if @document.nil?
|
4
|
+
xml.recommendations
|
5
|
+
else
|
6
|
+
|
7
|
+
@recommendations = @document.ranked_recommendations(@limit, params[:order] || "mixed", @details)
|
8
|
+
xml.recommendations(:document_id => @document.nil? ? "" : @document.id, :uri => @uri, :title => t(:gm_title), :more_prompt => t(:gm_more_prompt), :direct_link_text => t(:direct_link), :locale => @document.language) do
|
9
|
+
@recommendations.each do |recommendation|
|
10
|
+
xml.recommendation do
|
11
|
+
xml.title recommendation["title"]
|
12
|
+
xml.collection recommendation["collection"]
|
13
|
+
xml.link "http://www.oerrecommender.org/r?id=" + recommendation["id"].to_s
|
14
|
+
# xml.link "http://localhost:3000/r?id=" + recommendation["id"].to_s
|
15
|
+
xml.has_direct_link "true" if (recommendation["direct_link"] != nil and @uri[0..20] == recommendation["uri"][0..20])
|
16
|
+
|
17
|
+
if @details == true
|
18
|
+
xml.direct_link "http://www.oerrecommender.org/r?id=" + recommendation["id"].to_s + "&u=" + recommendation["direct_link"] if recommendation["direct_link"] != nil
|
19
|
+
xml.uri recommendation["uri"]
|
20
|
+
xml.direct_uri recommendation["direct_link"]
|
21
|
+
xml.description recommendation["description"]
|
22
|
+
xml.clicks recommendation["clicks"]
|
23
|
+
xml.average_time_at_dest recommendation["avg_time_on_target"]
|
24
|
+
xml.relevance round(recommendation["relevance"])
|
25
|
+
xml.published_at recommendation["published_at"]
|
26
|
+
xml.author recommendation["author"]
|
27
|
+
xml.tag_list recommendation["tag_list"]
|
28
|
+
else
|
29
|
+
xml.description ""
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<% if @recs.size > 0 %>
|
2
|
+
function avg(aRecs){dSum = 0; for(nRec = 0; nRec < aRecs.length; nRec++) {dSum += aRecs[nRec].relevance;} return dSum/aRecs.length;}
|
3
|
+
function std(aRecs,dAvg){dSum = 0; for(nRec = 0; nRec < aRecs.length; nRec++) {dSum += Math.pow((aRecs[nRec].relevance-dAvg),2);} return Math.sqrt(dSum/aRecs.length);}
|
4
|
+
function calcThreshold(aRecs){var average = avg(aRecs);var standard_deviation = std(aRecs, average); return average + standard_deviation;}
|
5
|
+
function sortByClicks(r1,r2){return r2.clicks-r1.clicks;}
|
6
|
+
function randomize(aRecs){var i = aRecs.length;if (i == 0) return aRecs;while (--i){var j = Math.floor(Math.random()*(i+1));var ti = aRecs[i];var tj=aRecs[j];aRecs[i]= tj;aRecs[j]=ti;} return aRecs;}
|
7
|
+
function sortRecs(aRecs)
|
8
|
+
{
|
9
|
+
var relevance_threshold = calcThreshold(aRecs);
|
10
|
+
var nClickThreshold = 10;
|
11
|
+
var aPopular = new Array();
|
12
|
+
var aRelevant = new Array();
|
13
|
+
var aLoosers = new Array();
|
14
|
+
for(nRec = 0; nRec < aRecs.length; nRec++) {
|
15
|
+
r = aRecs[nRec];
|
16
|
+
if (r.clicks > nClickThreshold) aPopular.push(r);
|
17
|
+
else if (r.relevance > relevance_threshold) aRelevant.push(r);
|
18
|
+
else aLoosers.push(r);
|
19
|
+
}
|
20
|
+
return aPopular.sort(sortByClicks).concat(randomize(aRelevant),randomize(aLoosers));
|
21
|
+
}
|
22
|
+
var aRecommendations = [
|
23
|
+
<% @recs.each do |r| -%>
|
24
|
+
{"id":<%= r.id %>, "clicks":<%= r.clicks %>, "relevance":<%= r.relevance %>, "uri":"<%= r.uri %>", "title":"<%= r.title.gsub(/"/, '"').gsub(/'/, "'") %>", "source":"(<%= r.source %>)"},
|
25
|
+
<% end -%>];
|
26
|
+
document.write('<div class="oer_recommender_container"><div class="oer_recommender_title">Related Resources</div><div class="oer_recommender_list">');
|
27
|
+
var aSortedRecs = sortRecs(aRecommendations);
|
28
|
+
for(nRec = 0; nRec < aSortedRecs.length; nRec++)
|
29
|
+
{
|
30
|
+
r = aSortedRecs[nRec];
|
31
|
+
document.write('<p class="oer_recommender_item"><a href="http://www.oerrecommender.org/r?id=' + r.id + "&u=" + r.uri + '" title="' + r.source + ' ' + r.title + '">' + r.title + '</a></p>');
|
32
|
+
}
|
33
|
+
document.write('</div></div>');
|
34
|
+
<% end %>
|
35
|
+
<%= @recs_json %>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<select id="locale" name="locale" <%= (@auto_switch.nil? ? "" : "onchange=\"document.location='/?locale='+document.getElementById('locale').value\"")%>>
|
2
|
+
<% @languages.each do |language|%>
|
3
|
+
<option value="<%= language.code %>"<%= language.code == session[:locale] ? " selected" : "" %>><%= language.name %></option>
|
4
|
+
<% end %>
|
5
|
+
</select>
|
6
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% link = result.direct_link.nil? ? result.permalink : result.direct_link %>
|
2
|
+
<p>
|
3
|
+
<%= link_to result.title + " (" + result.collection + ")", link, :class => "title_link", :rel => "nofollow" %>
|
4
|
+
<span class='published_at'>(<%= result.published_at.strftime("%d %b %Y") %>)</span>
|
5
|
+
<span class='relevance_score'><%= t(:relevance) %>: <%= round(result.solr_score) %></span>
|
6
|
+
<% if !result.direct_link.nil? %> - <%= link_to t(:metadata), result.permalink, :class => "catalog_link" %><% end %>
|
7
|
+
<% if result.description.length > 0 %><br/><span class="description"><%= truncate_words(result.description) %></span><% end %>
|
8
|
+
<br/><span class="uri"><%= link %></span> - <%= link_to t(:related_resources), "/documents/" + result.id.to_s, :class => "related_resources_link", :rel => "nofollow" %>
|
9
|
+
</p>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% form_tag(:controller => 'search', :action => 'results') do %>
|
2
|
+
<%= text_field_tag(:form_terms, @terms.nil? ? "" : @terms, :size => 30) %>
|
3
|
+
<%= submit_tag(t(:search), :class => "input-button") %>
|
4
|
+
<%= render(:partial => "search/languages") %>
|
5
|
+
<% end %>
|
6
|
+
<p class="help_links"><%= link_to t(:demo), "/help/demo" %>
|
7
|
+
| <%= link_to t(:collections_long), "/collections" %>
|
8
|
+
| <%= link_to t(:developers_long), "/help/integration" %>
|
9
|
+
- <%= t(:powered_by) %> <a href="http://lucene.apache.org/">Lucene</a></p>
|