myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3776] branches/packs: pack snapshots, improved P


From: noreply
Subject: [myexperiment-hackers] [3776] branches/packs: pack snapshots, improved PROV display
Date: Mon, 11 Nov 2013 09:48:43 +0000 (UTC)

Revision
3776
Author
dgc
Date
2013-11-11 09:48:42 +0000 (Mon, 11 Nov 2013)

Log Message

pack snapshots, improved PROV display

Modified Paths

Diff

Modified: branches/packs/app/controllers/blobs_controller.rb (3775 => 3776)


--- branches/packs/app/controllers/blobs_controller.rb	2013-11-11 09:16:49 UTC (rev 3775)
+++ branches/packs/app/controllers/blobs_controller.rb	2013-11-11 09:48:42 UTC (rev 3776)
@@ -8,6 +8,7 @@
 class BlobsController < ApplicationController
 
   include ApplicationHelper
+  include ResearchObjectsHelper
 
   before_filter :login_required, :except => [:index, :show, :download, :named_download, :named_download_with_version, :statistics, :search, :auto_complete]
 
@@ -180,11 +181,12 @@
           @blob.contribution.update_attributes(params[:contribution])
         
           policy_err_msg = update_policy(@blob, params, current_user)
+          post_process_file(@blob.research_object, @blob.content_blob.data, @blob.research_object.uri + @blob.local_name)
 
           update_credits(@blob, params)
           update_attributions(@blob, params)
 
-          post_process_file(@blob, @blob.research_object.uri + @blob.local_name)
+          post_process_file(@blob.research_object, @blob.content_blob.data, @blob.research_object.uri + @blob.local_name)
         
           if policy_err_msg.blank?
             update_layout(@blob, params[:layout]) unless params[:policy_type] == "group"
@@ -493,41 +495,4 @@
     end
   end
 
-  def annotate_resources(research_object, resource_uris, body_graph, content_type = 'application/rdf+xml')
-    research_object.create_annotation(
-        :body_graph   => body_graph,
-        :content_type => content_type,
-        :resources    => resource_uris,
-        :creator_uri  => "/users/#{current_user.id}")
-  end
-
-  def post_process_file(file, resource_uri)
-
-    # Process robundle
-
-    if file.content_blob.data[0..3] == "PK\x03\x04"
-
-      bundle_content = file.content_blob.data
-
-      begin
-        zip_file = Tempfile.new('workflow_run.zip.')
-        zip_file.binmode
-        zip_file.write(bundle_content)
-        zip_file.close
-        
-        Zip::ZipFile.open(zip_file.path) { |zip|
-
-          wfdesc = zip.get_entry(".ro/annotations/workflow.wfdesc.ttl").get_input_stream.read
-          wfprov = zip.get_entry("workflowrun.prov.ttl").get_input_stream.read
-
-          annotate_resources(file.research_object, [resource_uri], wfdesc, 'text/turtle')
-          annotate_resources(file.research_object, [resource_uri], wfprov, 'text/turtle')
-        }
-
-      rescue
-        raise unless Rails.env == "production"
-      end
-    end
-  end
-
 end

Modified: branches/packs/app/controllers/packs_controller.rb (3775 => 3776)


--- branches/packs/app/controllers/packs_controller.rb	2013-11-11 09:16:49 UTC (rev 3775)
+++ branches/packs/app/controllers/packs_controller.rb	2013-11-11 09:48:42 UTC (rev 3776)
@@ -602,20 +602,12 @@
     end
   end
 
-  def annotate_resources(resource_uris, body_graph, content_type = 'application/rdf+xml')
-    @pack.research_object.create_annotation(
-        :body_graph   => body_graph,
-        :content_type => content_type,
-        :resources    => resource_uris,
-        :creator_uri  => "/users/#{current_user.id}")
-  end
-
   def annotate_resource_type(resource_uri, type_uri)
 
     body = RDF::Graph.new
     body << [RDF::URI(resource_uri), RDF.type, RDF::URI(type_uri)]
 
-    annotate_resources([resource_uri], body)
+    annotate_resources(@pack.research_object, [resource_uri], body)
   end
 
   def post_process_created_resource(pack, entry, resource_uri, params)
@@ -628,6 +620,12 @@
       annotate_resource_type(resource_uri, params[:type])
     end
 
+    if WORKFLOW_RUN.include?(params[:type])
+      if entry.kind_of?(PackContributableEntry)
+        post_process_file(@pack.research_object, entry.contributable.content_blob.data, resource_uri)
+      end
+    end
+
     # Folder selection is performed on the following with decreasing order of
     # priority.
     #

Modified: branches/packs/app/controllers/workflows_controller.rb (3775 => 3776)


--- branches/packs/app/controllers/workflows_controller.rb	2013-11-11 09:16:49 UTC (rev 3775)
+++ branches/packs/app/controllers/workflows_controller.rb	2013-11-11 09:48:42 UTC (rev 3776)
@@ -8,6 +8,7 @@
 class WorkflowsController < ApplicationController
 
   include ApplicationHelper
+  include ResearchObjectsHelper
 
   before_filter :login_required, :except => [:index, :show, :download, :named_download, :galaxy_tool, :galaxy_tool_download, :statistics, :launch, :search, :auto_complete]
   
@@ -1107,14 +1108,4 @@
     end
     return ok
   end
-
-  def transform_wf(research_object, resource_uri)
-    format = "application/vnd.taverna.t2flow+xml"
-    token = Conf.wf_ro_service_bearer_token
-    uri = Wf4Ever::TransformationClient.create_job(Conf.wf_ro_service_uri, resource_uri.to_s, format, research_object.uri, token)
-puts "      [Conf.wf_ro_service_uri, resource_uri, format, @pack.research_object.uri, token] = #{      [Conf.wf_ro_service_uri, resource_uri, format, research_object.uri, token].inspect}"
-    puts "################## Transforming at " + uri
-
-    uri
-  end
 end

Modified: branches/packs/app/helpers/activities_helper.rb (3775 => 3776)


--- branches/packs/app/helpers/activities_helper.rb	2013-11-11 09:16:49 UTC (rev 3775)
+++ branches/packs/app/helpers/activities_helper.rb	2013-11-11 09:48:42 UTC (rev 3776)
@@ -200,73 +200,78 @@
 
   def activity_title(activity_set)
 
-    activity = activity_set.first
+    begin
 
-    case activity.objekt ? "#{activity.objekt_type} #{activity.action}" : activity.action
-    when "Announcement create"
-      "#{activity_link(activity, :subject)} announced #{activity_link(activity, :object)}"
-    when "Announcement edit"
-      "#{activity_link(activity, :subject)} edited #{activity_link(activity, :object)}"
-    when "Blob create"
-      "#{activity_link(activity, :subject)} uploaded #{activity_link(activity, :object)}"
-    when "Blob edit"
-      "#{activity_link(activity, :subject)} edited #{activity_link(activity, :object)}"
-    when "BlobVersion create"
-      "#{activity_link(activity, :subject)} uploaded version #{activity.extra} of #{activity_link(activity, :object)}"
-    when "BlobVersion edit"
-      "#{activity_link(activity, :subject)} edited version #{activity.extra} of #{activity_link(activity, :object)}"
-    when "Bookmark create"
-      "#{activity_link(activity, :subject)} favourited #{activity_link(activity, :object)}"
-    when "Citation create"
-      "#{activity_link(activity, :subject)} added the citation #{activity_link(activity, :object)} to #{activity_link(activity, :auth)}"
-    when "Citation edit"
-      "#{activity_link(activity, :subject)} edited the citation #{activity_link(activity, :object)} on #{activity_link(activity, :auth)}"
-    when "Comment create"
-      "#{activity_link(activity, :subject)} commented:"
-    when "Friendship create"
-      user1 = activity.subject = activity.context ? activity.objekt.user : activity.objekt.friend
-      user2 = activity.subject = activity.context ? activity.objekt.friend : activity.objekt.user
-      "#{link_to(h(user1.name), polymorphic_path(user1))} is friends with #{link_to(h(user2.name), polymorphic_path(user2))}"
-    when "Network create"
-      "#{activity_link(activity, :subject)} created the #{activity_link(activity, :object)} group"
-    when "Network edit"
-      "#{activity_link(activity, :subject)} edited the #{activity_link(activity, :object)} group"
-    when "Pack create"
-      "#{activity_link(activity, :subject)} created #{activity_link(activity, :object)}"
-    when "Pack edit"
-      "#{activity_link(activity, :subject)} edited #{activity_link(activity, :object)}"
-    when "Rating create"
-      "#{activity_link(activity, :subject)} rated #{activity_link(activity, :auth)} with #{activity.extra}"
-    when "Review create"
-      "#{activity_link(activity, :subject)} reviewed #{activity_link(activity, :auth)}"
-    when "Review edit"
-      "#{activity_link(activity, :subject)} edited a review on #{activity_link(activity, :auth)}"
-    when "Tagging create"
-      "#{activity_link(activity, :subject)} tagged #{activity_link(activity, :auth)} with #{sentence(activity_set.map { |a| link_to(h(a.objekt.tag.name), tag_path(a.objekt.tag)) })}"
-    when "Workflow create"
-      "#{activity_link(activity, :subject)} uploaded #{activity_link(activity, :object)}"
-    when "Workflow edit"
-      "#{activity_link(activity, :subject)} edited #{activity_link(activity, :object)}"
-    when "WorkflowVersion create"
-      "#{activity_link(activity, :subject)} uploaded version #{activity.extra} of #{activity_link(activity, :object)}"
-    when "WorkflowVersion edit"
-      "#{activity_link(activity, :subject)} edited version #{activity.extra} of #{activity_link(activity, :object)}"
-    when "edit"
-      "#{activity_link(activity, :subject)} edited their profile"
-    when "register"
-      "#{activity_link(activity, :subject)} joined #{Conf.sitename}"
-    when "Membership create"
-      "#{sentence(activity_set.map { |a| activity_link(a, :subject) })} joined the #{activity_link(activity, :context)} group"
-    when "Permission create"
-      "#{activity_link(activity, :subject)} shared #{activity_link(activity, :auth, activity.objekt_label)}"
-    when "FeedItem create"
-      link_to(strip_tags(activity.objekt.title), activity.objekt.link, :rel => "nofollow")
-    when "GroupAnnouncement create"
-      activity_link(activity, :object)
-    when "Resource create"
-      if ore_path = activity.objekt.ore_path
-        "#{activity_link(activity, :subject)} added #{activity_link(activity, :object)}"
+      activity = activity_set.first
+
+      case activity.objekt ? "#{activity.objekt_type} #{activity.action}" : activity.action
+      when "Announcement create"
+        "#{activity_link(activity, :subject)} announced #{activity_link(activity, :object)}"
+      when "Announcement edit"
+        "#{activity_link(activity, :subject)} edited #{activity_link(activity, :object)}"
+      when "Blob create"
+        "#{activity_link(activity, :subject)} uploaded #{activity_link(activity, :object)}"
+      when "Blob edit"
+        "#{activity_link(activity, :subject)} edited #{activity_link(activity, :object)}"
+      when "BlobVersion create"
+        "#{activity_link(activity, :subject)} uploaded version #{activity.extra} of #{activity_link(activity, :object)}"
+      when "BlobVersion edit"
+        "#{activity_link(activity, :subject)} edited version #{activity.extra} of #{activity_link(activity, :object)}"
+      when "Bookmark create"
+        "#{activity_link(activity, :subject)} favourited #{activity_link(activity, :object)}"
+      when "Citation create"
+        "#{activity_link(activity, :subject)} added the citation #{activity_link(activity, :object)} to #{activity_link(activity, :auth)}"
+      when "Citation edit"
+        "#{activity_link(activity, :subject)} edited the citation #{activity_link(activity, :object)} on #{activity_link(activity, :auth)}"
+      when "Comment create"
+        "#{activity_link(activity, :subject)} commented:"
+      when "Friendship create"
+        user1 = activity.subject = activity.context ? activity.objekt.user : activity.objekt.friend
+        user2 = activity.subject = activity.context ? activity.objekt.friend : activity.objekt.user
+        "#{link_to(h(user1.name), polymorphic_path(user1))} is friends with #{link_to(h(user2.name), polymorphic_path(user2))}"
+      when "Network create"
+        "#{activity_link(activity, :subject)} created the #{activity_link(activity, :object)} group"
+      when "Network edit"
+        "#{activity_link(activity, :subject)} edited the #{activity_link(activity, :object)} group"
+      when "Pack create"
+        "#{activity_link(activity, :subject)} created #{activity_link(activity, :object)}"
+      when "Pack edit"
+        "#{activity_link(activity, :subject)} edited #{activity_link(activity, :object)}"
+      when "Rating create"
+        "#{activity_link(activity, :subject)} rated #{activity_link(activity, :auth)} with #{activity.extra}"
+      when "Review create"
+        "#{activity_link(activity, :subject)} reviewed #{activity_link(activity, :auth)}"
+      when "Review edit"
+        "#{activity_link(activity, :subject)} edited a review on #{activity_link(activity, :auth)}"
+      when "Tagging create"
+        "#{activity_link(activity, :subject)} tagged #{activity_link(activity, :auth)} with #{sentence(activity_set.map { |a| link_to(h(a.objekt.tag.name), tag_path(a.objekt.tag)) })}"
+      when "Workflow create"
+        "#{activity_link(activity, :subject)} uploaded #{activity_link(activity, :object)}"
+      when "Workflow edit"
+        "#{activity_link(activity, :subject)} edited #{activity_link(activity, :object)}"
+      when "WorkflowVersion create"
+        "#{activity_link(activity, :subject)} uploaded version #{activity.extra} of #{activity_link(activity, :object)}"
+      when "WorkflowVersion edit"
+        "#{activity_link(activity, :subject)} edited version #{activity.extra} of #{activity_link(activity, :object)}"
+      when "edit"
+        "#{activity_link(activity, :subject)} edited their profile"
+      when "register"
+        "#{activity_link(activity, :subject)} joined #{Conf.sitename}"
+      when "Membership create"
+        "#{sentence(activity_set.map { |a| activity_link(a, :subject) })} joined the #{activity_link(activity, :context)} group"
+      when "Permission create"
+        "#{activity_link(activity, :subject)} shared #{activity_link(activity, :auth, activity.objekt_label)}"
+      when "FeedItem create"
+        link_to(strip_tags(activity.objekt.title), activity.objekt.link, :rel => "nofollow")
+      when "GroupAnnouncement create"
+        activity_link(activity, :object)
+      when "Resource create"
+        if ore_path = activity.objekt.ore_path
+          "#{activity_link(activity, :subject)} added #{activity_link(activity, :object)}"
+        end
       end
+
+    rescue
     end
   end
 

Modified: branches/packs/app/helpers/research_objects_helper.rb (3775 => 3776)


--- branches/packs/app/helpers/research_objects_helper.rb	2013-11-11 09:16:49 UTC (rev 3775)
+++ branches/packs/app/helpers/research_objects_helper.rb	2013-11-11 09:48:42 UTC (rev 3776)
@@ -366,5 +366,50 @@
   def item_link(item, resource, statements)
     link_to(h(resource_label(resource, statements)), item_uri_with_resource(item, resource))
   end
+
+  def annotate_resources(research_object, resource_uris, body_graph, content_type = 'application/rdf+xml')
+    research_object.create_annotation(
+        :body_graph   => body_graph,
+        :content_type => content_type,
+        :resources    => resource_uris,
+        :creator_uri  => "/users/#{current_user.id}")
+  end
+
+  def post_process_file(research_object, data, resource_uri)
+
+    # Process robundle
+
+    if data[0..3] == "PK\x03\x04"
+
+      begin
+        zip_file = Tempfile.new('workflow_run.zip.')
+        zip_file.binmode
+        zip_file.write(data)
+        zip_file.close
+        
+        Zip::ZipFile.open(zip_file.path) { |zip|
+
+          wfdesc = zip.get_entry(".ro/annotations/workflow.wfdesc.ttl").get_input_stream.read
+          wfprov = zip.get_entry("workflowrun.prov.ttl").get_input_stream.read
+
+          annotate_resources(research_object, [resource_uri], wfdesc, 'text/turtle')
+          annotate_resources(research_object, [resource_uri], wfprov, 'text/turtle')
+        }
+
+      rescue
+        raise unless Rails.env == "production"
+      end
+    end
+  end
+
+  def transform_wf(research_object, resource_uri)
+    format = "application/vnd.taverna.t2flow+xml"
+    token = Conf.wf_ro_service_bearer_token
+    uri = Wf4Ever::TransformationClient.create_job(Conf.wf_ro_service_uri, resource_uri.to_s, format, research_object.uri, token)
+puts "      [Conf.wf_ro_service_uri, resource_uri, format, @pack.research_object.uri, token] = #{      [Conf.wf_ro_service_uri, resource_uri, format, research_object.uri, token].inspect}"
+    puts "################## Transforming at " + uri
+
+    uri
+  end
 end
 

Modified: branches/packs/app/models/activity.rb (3775 => 3776)


--- branches/packs/app/models/activity.rb	2013-11-11 09:16:49 UTC (rev 3775)
+++ branches/packs/app/models/activity.rb	2013-11-11 09:48:42 UTC (rev 3776)
@@ -138,7 +138,11 @@
 
       when "Resource"
 
-        contexts << object.context.pack
+        case object.context
+        when PackContributableEntry, PackRemoteEntry
+          contexts << object.context.pack
+        end
+
         auth = object
     end
 

Modified: branches/packs/app/models/pack.rb (3775 => 3776)


--- branches/packs/app/models/pack.rb	2013-11-11 09:16:49 UTC (rev 3775)
+++ branches/packs/app/models/pack.rb	2013-11-11 09:48:42 UTC (rev 3776)
@@ -671,7 +671,10 @@
 
     inhibit_timestamps do
  
-      version = versions.build(
+      pack_entry_map = {}
+      resource_map = {}
+
+      new_pack_version = versions.build(
           :version          => current_version,
           :contributor      => contributor,
           :title            => title,
@@ -680,7 +683,7 @@
 
       contributable_entries.each do |entry|
 
-        version.contributable_entries.build(
+        pack_entry_map[entry] = new_pack_version.contributable_entries.build(
             :pack => self,
             :contributable_id => entry.contributable_id,
             :contributable_type => entry.contributable_type,
@@ -694,7 +697,7 @@
 
       remote_entries.each do |entry|
 
-        tt = version.remote_entries.build(
+        pack_entry_map[entry] = new_pack_version.remote_entries.build(
             :pack => self,
             :title => entry.title,
             :uri => entry.uri,
@@ -705,9 +708,62 @@
             :created_at => entry.created_at,
             :updated_at => entry.updated_at)
       end
+
+      # Calculate new research object version index
+
+      new_research_object = new_pack_version.build_research_object(
+          :slug => "#{research_object.slug}v#{current_version}",
+          :version => current_version,
+          :user => contributor)
+
+      research_object.resources.each do |resource|
+
+        new_resource = new_research_object.resources.build(
+          :context => resource.context,
+          :sha1 => resource.sha1,
+          :size => resource.size,
+          :content_type => resource.content_type,
+          :path => resource.path,
+          :entry_name => resource.entry_name,
+          :creator_uri => resource.creator_uri,
+          :proxy_in_path => resource.proxy_in_path,
+          :proxy_for_path => resource.proxy_for_path,
+          :ao_body_path => resource.ao_body_path,
+          :resource_map_path => resource.resource_map_path,
+          :aggregated_by_path => resource.aggregated_by_path,
+          :is_resource => resource.is_resource,
+          :is_aggregated => resource.is_aggregated,
+          :is_proxy => resource.is_proxy,
+          :is_annotation => resource.is_annotation,
+          :is_resource_map => resource.is_resource_map,
+          :is_folder => resource.is_folder,
+          :is_folder_entry => resource.is_folder_entry,
+          :is_root_folder => resource.is_root_folder,
+          :created_at => resource.created_at,
+          :updated_at => resource.updated_at,
+          :uuid => resource.uuid,
+          :title => resource.title)
+
+        resource_map[resource] = new_resource
+
+        if resource.content_blob
+          new_resource.build_content_blob(:data ="" resource.content_blob.data)
+        end
+
+      end
+
+      research_object.annotation_resources.each do |annotation_resource|
+        
+        new_research_object.annotation_resources.build(
+          :annotation => resource_map[annotation_resource.annotation],
+          :resource_path => annotation_resource.resource_path)
+
+      end
+ 
     end
     
     save
+
   end
 
   def describe_version(version_number)

Modified: branches/packs/app/models/pack_version.rb (3775 => 3776)


--- branches/packs/app/models/pack_version.rb	2013-11-11 09:16:49 UTC (rev 3775)
+++ branches/packs/app/models/pack_version.rb	2013-11-11 09:48:42 UTC (rev 3776)
@@ -3,6 +3,8 @@
 # Copyright (c) 2012 University of Manchester and the University of Southampton.
 # See license.txt for details.
 
+require 'has_research_object'
+
 class PackVersion < ActiveRecord::Base
 
   validates_presence_of :title
@@ -30,6 +32,8 @@
                WHERE pack_id = #{pack_id} AND version = #{version}
                ORDER BY created_at DESC'
 
+  has_research_object
+
   def items_count
     contributable_entries.count + remote_entries.count
   end

Modified: branches/packs/app/views/items/_inputs.html.erb (3775 => 3776)


--- branches/packs/app/views/items/_inputs.html.erb	2013-11-11 09:16:49 UTC (rev 3775)
+++ branches/packs/app/views/items/_inputs.html.erb	2013-11-11 09:48:42 UTC (rev 3776)
@@ -4,18 +4,22 @@
   <h3>Inputs</h3>
   <table class="simple">
     <tr>
-      <th>Label</th>
-      <th>Zip entry</th>
+      <th>Input</th>
+      <th>Value</th>
     </tr>
   <% inputs.each do |input| %>
     <% local_path = statements.query([input, RDF::URI("http://ns.taverna.org.uk/2012/tavernaprov/content"), nil]).first_object %>
-    <% sha1 = statements.query([local_path, RDF::URI("http://ns.taverna.org.uk/2012/tavernaprov/sha1"), nil]).first_literal %>
+    <% chars = statements.query([local_path, RDF::URI("http://www.w3.org/2011/content#chars"), nil]).first_literal %>
     <% b1 = statements.query([nil, RDF::URI("http://www.w3.org/ns/prov#entity"), input]).first_subject %>
     <% role = statements.query([b1, RDF::URI("http://www.w3.org/ns/prov#hadRole"), nil]).first_object %>
     <% label = statements.query([role, RDF::RDFS.label, nil]).first_literal %>
       <tr>
         <td><%=h label -%></td>
-        <td><%=h local_path -%></td>
+        <td>
+          <% if chars %>
+            <%=h chars -%>
+          <% end %>
+        </td>
       </tr>
   <% end %>
   </table>

Modified: branches/packs/app/views/items/_outputs.html.erb (3775 => 3776)


--- branches/packs/app/views/items/_outputs.html.erb	2013-11-11 09:16:49 UTC (rev 3775)
+++ branches/packs/app/views/items/_outputs.html.erb	2013-11-11 09:48:42 UTC (rev 3776)
@@ -4,18 +4,22 @@
   <h3>Outputs</h3>
   <table class="simple">
     <tr>
-      <th>Label</th>
-      <th>Size</th>
+      <th>Output</th>
+      <th>Value</th>
     </tr>
     <% outputs.each do |output| %>
       <% zip_entry = statements.query([output, RDF::URI("http://ns.taverna.org.uk/2012/tavernaprov/content"), nil]).first_object %>
       <% param = statements.query([output, RDF::URI("http://purl.org/wf4ever/wfprov#describedByParameter"), nil]).first_object %>
       <% label = statements.query([param, RDF::RDFS.label, nil]).first_literal %>
-      <% sha1 = statements.query([zip_entry, RDF::URI("http://ns.taverna.org.uk/2012/tavernaprov/sha1"), nil]).first_literal %>
+      <% chars = statements.query([zip_entry, RDF::URI("http://www.w3.org/2011/content#chars"), nil]).first_literal %>
       <% size = statements.query([zip_entry, RDF::URI("http://ns.taverna.org.uk/2012/tavernaprov/byteCount"), nil]).first_literal %>
       <tr>
         <td><%=h label -%></td>
-        <td><%=h size -%></td>
+        <td>
+          <% if chars %>
+            <%=h chars -%>
+          <% end %>
+        </td>
       </tr>
     <% end %>
   </table>

Modified: branches/packs/app/views/items/show.html.erb (3775 => 3776)


--- branches/packs/app/views/items/show.html.erb	2013-11-11 09:16:49 UTC (rev 3775)
+++ branches/packs/app/views/items/show.html.erb	2013-11-11 09:48:42 UTC (rev 3776)
@@ -150,20 +150,22 @@
             <h4>Inputs</h4>
             <table class="simple">
               <tr>
-                <th>Label</th>
-                <th>SHA1</th>
-                <th>Zip entry</th>
+                <th>Input</th>
+                <th>Value</th>
               </tr>
             <% inputs.each do |input| %>
               <% local_path = @statements.query([input, RDF::URI("http://ns.taverna.org.uk/2012/tavernaprov/content"), nil]).first_object %>
-              <% sha1 = @statements.query([local_path, RDF::URI("http://ns.taverna.org.uk/2012/tavernaprov/sha1"), nil]).first_literal %>
               <% b1 = @statements.query([nil, RDF::URI("http://www.w3.org/ns/prov#entity"), input]).first_subject %>
               <% role = @statements.query([b1, RDF::URI("http://www.w3.org/ns/prov#hadRole"), nil]).first_object %>
+              <% chars = @statements.query([local_path, RDF::URI("http://www.w3.org/2011/content#chars"), nil]).first_literal %>
               <% label = @statements.query([role, RDF::RDFS.label, nil]).first_literal %>
                 <tr>
                   <td><%=h label -%></td>
-                  <td><%=h sha1 -%></td>
-                  <td><%=h local_path -%></td>
+                  <td>
+                    <% if chars %>
+                      <%=h chars.to_s -%>
+                    <% end %>
+                  </td>
                 </tr>
             <% end %>
             </table>
@@ -175,21 +177,23 @@
             <h4>Outputs</h4>
             <table class="simple">
               <tr>
-                <th>Label</th>
-                <th>SHA1</th>
-                <th>Zip entry</th>
+                <th>Output</th>
+                <th>Value</th>
                 <th>Size</th>
               </tr>
               <% outputs.each do |output| %>
                 <% zip_entry = @statements.query([output, RDF::URI("http://ns.taverna.org.uk/2012/tavernaprov/content"), nil]).first_object %>
                 <% param = @statements.query([output, RDF::URI("http://purl.org/wf4ever/wfprov#describedByParameter"), nil]).first_object %>
                 <% label = @statements.query([param, RDF::RDFS.label, nil]).first_literal %>
-                <% sha1 = @statements.query([zip_entry, RDF::URI("http://ns.taverna.org.uk/2012/tavernaprov/sha1"), nil]).first_literal %>
+                <% chars = @statements.query([zip_entry, RDF::URI("http://www.w3.org/2011/content#chars"), nil]).first_literal %>
                 <% size = @statements.query([zip_entry, RDF::URI("http://ns.taverna.org.uk/2012/tavernaprov/byteCount"), nil]).first_literal %>
                 <tr>
                   <td><%=h label -%></td>
-                  <td><%=h sha1 -%></td>
-                  <td><%=h zip_entry -%></td>
+                  <td>
+                    <% if chars %>
+                      <%=h chars -%>
+                    <% end %>
+                  </td>
                   <td><%=h size -%></td>
                 </tr>
               <% end %>

Modified: branches/packs/app/views/packs/show.rhtml (3775 => 3776)


--- branches/packs/app/views/packs/show.rhtml	2013-11-11 09:16:49 UTC (rev 3775)
+++ branches/packs/app/views/packs/show.rhtml	2013-11-11 09:48:42 UTC (rev 3776)
@@ -13,11 +13,9 @@
   <li><%= icon('folder', pack_items_path(@pack), nil, nil, 'View Items') -%></li>
   <li><%= icon('annotations', pack_annotations_path(@pack), nil, nil, 'Annotations') -%></li>
   <li><%= icon('disk', zipped_research_object_url(@pack.research_object.slug) + "/", nil, nil, "Download") %></li>
-  <% if false %>
   <% if @authorised_to_edit -%>
     <li><%= icon('new', snapshot_pack_path(@pack), nil, { :confirm => 'Are you sure that you would like to create a new snapshot of this Pack?', :method => :post }, 'Create snapshot') %></li>
   <% end %>	
-  <% end %>
   <% if Authorization.check("destroy", @pack, current_user) %>
     <li><%= icon('destroy', pack_path(@pack), nil, { :confirm => 'This deletes the Pack and all metadata such as tags and comments, BUT does not delete the actual items pointed to in the Pack. Are you sure you would like to delete this Pack?', :method => :delete }, 'Delete Pack') %></li>
   <% end %>

Modified: branches/packs/config/default_settings.yml (3775 => 3776)


--- branches/packs/config/default_settings.yml	2013-11-11 09:16:49 UTC (rev 3775)
+++ branches/packs/config/default_settings.yml	2013-11-11 09:48:42 UTC (rev 3776)
@@ -1592,6 +1592,7 @@
     - label:  Hardware
       type:   string 
       symbol: :description
+      searchable: true
 
     - label:  Link
       type:   string

Modified: branches/packs/config/routes.rb (3775 => 3776)


--- branches/packs/config/routes.rb	2013-11-11 09:16:49 UTC (rev 3775)
+++ branches/packs/config/routes.rb	2013-11-11 09:48:42 UTC (rev 3776)
@@ -111,6 +111,8 @@
   map.pack_version           '/packs/:id/versions/:version',         :conditions => { :method => :get }, :controller => 'packs', :action ="" 'show'
   map.formatted_pack_version '/packs/:id/versions/:version.:format', :conditions => { :method => :get }, :controller => 'packs', :action ="" 'show'
 
+  map.pack_version_items     '/packs/:id/versions/:version/items',   :conditions => { :method => :get }, :controller => 'items', :action ="" 'index'
+
   map.blob_version_suggestions '/files/:id/versions/:version/suggestions', :conditions => { :method => :get }, :controller => 'blobs', :action ="" 'suggestions'
   map.blob_version_process_suggestions '/files/:id/versions/:version/process_suggestions', :conditions => { :method => :post }, :controller => 'blobs', :action ="" 'process_suggestions'
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]