Modified: branches/eprints-integration/app/controllers/packs_controller.rb (2495 => 2496)
--- branches/eprints-integration/app/controllers/packs_controller.rb 2010-08-11 20:40:44 UTC (rev 2495)
+++ branches/eprints-integration/app/controllers/packs_controller.rb 2010-08-18 16:41:39 UTC (rev 2496)
@@ -3,6 +3,8 @@
# Copyright (c) 2007 University of Manchester and the University of Southampton.
# See license.txt for details.
+require 'lib/dublin_core'
+
class PacksController < ApplicationController
include ApplicationHelper
@@ -317,9 +319,17 @@
# \A[a-z]+:// - Matches '<protocol>://<address>'
uri = preprocess_uri(params[:uri])
entry.uri = uri
-
alternate_uri = preprocess_uri(params[:alternate_uri])
entry.alternate_uri = alternate_uri
+ # Dublin Core Tool
+ dcdata = DublinCore::extract_dublin_core_data_from_page(uri)
+ unless dcdata.nil?
+ entry.dc_title = dcdata["dc.title"]
+ entry.dc_creator = dcdata["dc.creator"]
+ entry.dc_description = dcdata["dc.description"]
+ entry.dc_format = dcdata["dc.format"]
+ entry.dc_identifier = dcdata["dc.identifier"]
+ end
end
entry.comment = params[:comment]
@@ -410,6 +420,7 @@
end
end
+
protected
# Check that a protocol is specified in the URI; prepend HTTP:// otherwise
@@ -468,6 +479,8 @@
end
end
+
+
private
def error(notice, message, attr=:id)
@@ -497,4 +510,6 @@
final_errs.add_to_base(msg)
end
end
+
+
end