Skip to content

Commit

Permalink
repository-wide fixity status
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Mar 19, 2013
1 parent 6da3182 commit 60b4af5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/about_controller.rb
Expand Up @@ -9,6 +9,10 @@ def repository
@events_feed = connection.events
end

def fixity

end

private
def connection
ActiveFedora::Base.connection_for_pid(0)
Expand Down
23 changes: 23 additions & 0 deletions app/views/about/fixity.html.erb
@@ -0,0 +1,23 @@
<h1>Fixity Summary</h1>
<%
fixity_xml = ActiveFedora::Base.connection_for_pid(0).client["../../fcrepo-fixity/rest/results/statistics/general"].get
doc = Nokogiri::XML(fixity_xml).xpath('//general-stat')
%>

<dl>
<dt>Number of Objects</dt>
<dd><%= ActiveFedora::Base.connection_for_pid(0).profile['numberOfObjects'] %> objects</dd>

<dt>Ran fixity checks on</dt>
<dd><%= doc.attr('object-count') %> objects</dd>

<dt>and recovered</dt>
<dd><%= doc.attr('repair-count') %> datastreams</dd>

<dt>but there were </dt>
<dd><%= doc.attr('error-count') %> unrecoverable errors</dd>

</dl>


<div><%= link_to "Fixity Dashboard", "http://fcrepo4.fcrepo.org/fcrepo-fixity/" %></div>
2 changes: 2 additions & 0 deletions app/views/about/repository.html.erb
Expand Up @@ -8,6 +8,8 @@
<% end %>
</dl>

<%= link_to "Fixity Report", repository_fixity_url %>

<h2>Events</h2>
<ul>
<% @events_feed.items.each do |item| %>
Expand Down

0 comments on commit 60b4af5

Please sign in to comment.