myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3595] branches/packs: cd ^/branches/packs ; svn


From: noreply
Subject: [myexperiment-hackers] [3595] branches/packs: cd ^/branches/packs ; svn merge -r3557:3594 ^/trunk
Date: Tue, 16 Jul 2013 15:34:12 +0000 (UTC)

Revision
3595
Author
dgc
Date
2013-07-16 15:34:11 +0000 (Tue, 16 Jul 2013)

Log Message

cd ^/branches/packs ; svn merge -r3557:3594 ^/trunk

Modified Paths

Removed Paths

Diff

Modified: branches/packs/Gemfile (3594 => 3595)


--- branches/packs/Gemfile	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/Gemfile	2013-07-16 15:34:11 UTC (rev 3595)
@@ -20,6 +20,7 @@
 gem "rdf", "~> 1.0.6"
 gem "rdf-raptor", "~> 1.0.1"
 gem "rdf-n3", "~> 1.0.0"
+gem "rdf-turtle", "~> 1.0.6"
 gem "recaptcha", "~> 0.3.4"
 gem "encrypted_strings", "~> 0.3.3"
 gem "encrypted_attributes", "~> 0.4.1"

Deleted: branches/packs/README_LOGIN (3594 => 3595)


--- branches/packs/README_LOGIN	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/README_LOGIN	2013-07-16 15:34:11 UTC (rev 3595)
@@ -1,116 +0,0 @@
-== About
-
-This is a port of the standard LoginGenerator to use OpenID for
-authentication.  It is distributed with the Ruby OpenID library.
-
-Read more at:
-* http://openidenabled.com
-* http://openidenabled.com/openid/libraries/ruby
-* http://openid.net
-
-== Installation
-
-If you are reading this, then you have installed the openid_login
-system, but there are still a few things you have to do
-manually. First open your app/controllers/application.rb and add
-
-  require_dependency "openid_login_system"
-
-to the top of the file and include the login system with
-
-  include OpenidLoginSystem 
-
-The beginning of your ApplicationController.
-It should look something like this : 
-
-  require_dependency "openid_login_system"
-
-  class ApplicationController < ActionController::Base
-    include OpenidLoginSystem
-    model :user
-
-After you have done the modifications the the AbstractController you can import
-the user model into the database. This model is meant as an example and you
-should extend it. 
-
-The model :user is required when you are hitting problems to the degree of
-"Session could not be restored becuase not all items in it are known"
-
-== Requirements
-
-You need a database table corresponding to the User model. 
-
-  mysql syntax:
-  CREATE TABLE users (
-    id int(11) NOT NULL auto_increment,
-    openid_url varchar(256) default NULL,
-    PRIMARY KEY  (id)
-  );
-\xA0
-  postgres :
-  CREATE TABLE "users" (
-  \xA0"id" SERIAL NOT NULL UNIQUE,
-  \xA0"openid_url" VARCHAR(256),
-  \xA0PRIMARY KEY("id")
-  ) WITH OIDS;
-
-  sqlite:
-  CREATE TABLE 'users' (
-    'id' INTEGER PRIMARY KEY NOT NULL,
-    'openid_url' VARCHAR(256) DEFAULT NULL
-  );
-
-Of course your user model can have any amount of extra fields. This is just a
-starting point
-
-== How to use it 
-
-Now you can go around and happily add "before_filter :login_required" to the
-controllers which you would like to protect. 
-
-After integrating the login system with your rails application
-navigate to your new controller's login method. There you may login
-which will create a new User object if you've never logged in
-before. After you are done you should have a look at your DB, and
-you'll see the record for your User with the openid_url you entered.
-
-
-== Tips & Tricks
-
-How do I...
-
-  ... access the user who is currently logged in
-
-  A: You can get the user id from the session using @session[:user_id]
-     Example: 
-	
-	@session[:user_id] 
-
-       To get the User object:
-
-	user = User.find(@session[:user_id])
-
-      	The OpenidController also has a find_user method
-     	which will return the User object of the logged in user, or nil
-	if no user is logged in.
-	
-
-  ... restrict access to only a few methods? 
-  
-  A: Use before_filters build in scoping. 
-     Example: 
-       before_filter :login_required, : [:myaccount, :changepassword]
-       before_filter :login_required, :except => [:index]
-     
-  ... check if a user is logged-in in my views?
-  
-  A: @session[:user_id] will tell you. Here is an example helper which you can use to make this more pretty:
-     Example: 
-       def user?
-         address@hidden:user_id].nil?
-       end
-
-
-
-
-

Modified: branches/packs/app/controllers/application_controller.rb (3594 => 3595)


--- branches/packs/app/controllers/application_controller.rb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/controllers/application_controller.rb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -300,7 +300,7 @@
     # Work out which groups have view access after the changes were made and
     # generate activities for them.
 
-    contributable.contribution.policy.permissions.find(:all, :conditions => conditions).each do |permission|
+    contributable.contribution.policy.reload.permissions.find(:all, :conditions => conditions).each do |permission|
       next if old_groups.include?(permission.contributor)
       Activity.create_activities(:subject => user, :action ="" 'create', :object => permission, :contributable => contributable)
     end

Modified: branches/packs/app/controllers/memberships_controller.rb (3594 => 3595)


--- branches/packs/app/controllers/memberships_controller.rb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/controllers/memberships_controller.rb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -1,3 +1,4 @@
+# encoding: utf-8
 # myExperiment: app/controllers/memberships_controller.rb
 #
 # Copyright (c) 2007 University of Manchester and the University of Southampton.
@@ -82,9 +83,6 @@
 
     respond_to do |format|
       if @membership.accept!
-
-        Activity.create_activities(:subject => @membership.user, :action ="" 'create', :object => @membership)
-
         flash[:notice] = 'Membership was successfully accepted.'
         format.html { redirect_to network_url(@membership.network_id) }
       else

Modified: branches/packs/app/controllers/networks_controller.rb (3594 => 3595)


--- branches/packs/app/controllers/networks_controller.rb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/controllers/networks_controller.rb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -56,7 +56,7 @@
   def membership_invite
     @membership = Membership.new(:user_id => params[:user_id], :network_id => @network.id, :message => params[:membership][:message], :invited_by => current_user)
 
-    if (user = User.find_by_id(params[:user_id]))
+    if (user = User.find_by_id(params[:user_id])).nil?
       render_404("User not found.")
     elsif !(address@hidden || Membership.find_by_user_id_and_network_id(params[:user_id], @network.id) ||
            Network.find(@network.id).owner?(user))

Modified: branches/packs/app/controllers/tags_controller.rb (3594 => 3595)


--- branches/packs/app/controllers/tags_controller.rb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/controllers/tags_controller.rb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -1,3 +1,4 @@
+# encoding: utf-8
 # myExperiment: app/controllers/tags_controller.rb
 #
 # Copyright (c) 2007 University of Manchester and the University of Southampton.

Modified: branches/packs/app/controllers/workflows_controller.rb (3594 => 3595)


--- branches/packs/app/controllers/workflows_controller.rb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/controllers/workflows_controller.rb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -188,7 +188,7 @@
 
     TavernaToGalaxy.generate(@workflow, @viewing_version_number, params[:server], zip_file_name)
 
-    zip_file = File.read(zip_file_name)
+    zip_file = File.binread(zip_file_name)
     File.unlink(zip_file_name)
 
     Download.create(:contribution => @workflow.contribution,

Modified: branches/packs/app/helpers/activities_helper.rb (3594 => 3595)


--- branches/packs/app/helpers/activities_helper.rb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/helpers/activities_helper.rb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -5,7 +5,7 @@
 
 module ActivitiesHelper
 
-  def activity_link(activity, source)
+  def activity_link(activity, source, label = nil)
 
     case source
     when :subject
@@ -19,7 +19,7 @@
       label = activity.context.label
     when :auth
       thing = activity.auth
-      label = activity.auth.label
+      label ||= activity.auth.label
     end
 
     thing = thing.versioned_resource if thing.respond_to?(:versioned_resource)
@@ -253,7 +253,7 @@
     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_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"

Modified: branches/packs/app/helpers/application_helper.rb (3594 => 3595)


--- branches/packs/app/helpers/application_helper.rb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/helpers/application_helper.rb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -90,7 +90,7 @@
       return nil
     end
     
-    name = truncate_to ? truncate(user.name, :length => truncate_to) : name = user.name
+    name = truncate_to ? truncate(user.name, :length => truncate_to) : user.name
     
     return link_to(h(name), user_url(user), :title => tooltip_title_attrib(h(user.name)))
   end

Modified: branches/packs/app/models/workflow.rb (3594 => 3595)


--- branches/packs/app/models/workflow.rb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/models/workflow.rb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -52,7 +52,7 @@
 
   acts_as_rdf_serializable('application/x-turtle',
       :generation_error_message => "Failed to generate RDF, please check the given workflow file is valid.") do |workflow|
-    workflow.processor_class.new(workflow.content_blob.data).extract_rdf_structure(workflow)
+    workflow.processor_class.new(workflow.content_blob.data).extract_rdf_structure(workflow) unless workflow.processor_class.nil?
   end
 
   has_previews

Modified: branches/packs/app/views/blobs/_table.rhtml (3594 => 3595)


--- branches/packs/app/views/blobs/_table.rhtml	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/views/blobs/_table.rhtml	2013-07-16 15:34:11 UTC (rev 3595)
@@ -34,7 +34,7 @@
           <a name="<%= blob.local_name.gsub(/ /, "_") %>"></a>
           <p class="title">
             <%= icon "blob", nil, nil, nil, '' %>
-            <% truncated_title = truncate(blob.title, :length => 55) %>
+            <% truncated_title = h(truncate(blob.title, :length => 55)) %>
             <%=link_to(query ? highlight_all(truncated_title, query) : truncated_title, blob_path(blob),
                        :title => blob.title) %>
           </p>

Modified: branches/packs/app/views/content/_index.rhtml (3594 => 3595)


--- branches/packs/app/views/content/_index.rhtml	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/views/content/_index.rhtml	2013-07-16 15:34:11 UTC (rev 3595)
@@ -35,7 +35,7 @@
                   <input class='checkbox' type='checkbox'  <% if object[:selected] %> checked='checked' <% end %> />
                   <a href="" url_with_params(request.path, object[:label_uri]) -%>">
                     <div class='count'><%= object[:count] -%></div>
-                    <div class='label'><span class='truncate'><%= object[:label] -%></span></div>
+                    <div class='label'><span class='truncate'><%= h(object[:label]) -%></span></div>
                   </a>
                 </div>
               <% end %>
@@ -53,18 +53,7 @@
     <% end %>
   </div>
   <div class="main">
-    <div class="sort">
-      Sort by:
-      <select  = this.options[this.selectedIndex].value;">
-        <% @pivot[:pivot_options]["order"].each do |args| %>
-          <option value="<%= url_with_params(request.path, request.query_parameters.merge({:order => args["option"]})) -%>"
-          <% if params[:order] == args["option"] -%> selected="selected"<% end -%>><%= args["label"] -%></option>
-        <% end %>
-      </select>
-    </div>
-    <div>
-      <%= render :partial => "layouts/paginate", :locals => { :collection => @pivot[:results] } %>
-    </div>
+    <%= render :partial => "layouts/paginate", :locals => { :collection => @pivot[:results], :sort_by => @pivot[:pivot_options]["order"], :num_options => @pivot[:pivot_options]["num_options"] } %>
     <div class="summary">
       <div class="result-count">
         Showing <%= pluralize(@pivot[:results].total_entries, 'result') -%>.
@@ -116,9 +105,7 @@
         <% end %>
       </div>
     <% end %>
-    <div>
-      <%= render :partial => "layouts/paginate", :locals => { :collection => @pivot[:results], :sort_by => @pivot[:pivot_options]["order"], :num_options => @pivot[:pivot_options]["num_options"] } %>
-    </div>
+    <%= render :partial => "layouts/paginate", :locals => { :collection => @pivot[:results], :sort_by => @pivot[:pivot_options]["order"], :num_options => @pivot[:pivot_options]["num_options"] } %>
   </div>
 </div>
 

Modified: branches/packs/app/views/contributions/_versions.rhtml (3594 => 3595)


--- branches/packs/app/views/contributions/_versions.rhtml	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/views/contributions/_versions.rhtml	2013-07-16 15:34:11 UTC (rev 3595)
@@ -4,7 +4,7 @@
   <% resource.versions.each do |version| %>
     <li>
       <div class="title">
-        <%= link_to(version.title, send(path, resource, version.version)) %>
+        <%= link_to(h(version.title), send(path, resource, version.version)) %>
       </div>
       <div class="metadata">
 

Modified: branches/packs/app/views/layouts/_myexperiment.html.erb (3594 => 3595)


--- branches/packs/app/views/layouts/_myexperiment.html.erb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/views/layouts/_myexperiment.html.erb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -9,7 +9,7 @@
   <% if @lod_xml %><link rel="alternate" href="" @lod_xml -%>" type="application/xml" title="REST XML" /><% end %>
   <link rel="shortcut icon" href="" type="image/x-icon"/>
   <%= stylesheet_link_tag 'reset-fonts-grids', 'base-min', 'acts_as_taggable_stylesheet',
-                          'star_rating', 'gadgets', 'misc_skinning', address@hidden"stylesheets"] %>
+                          'star_rating', 'gadgets', 'misc_skinning', 'pagination', address@hidden"stylesheets"] %>
   <%= _javascript__include_tag :defaults, "boxover.js", "tabs.js", "folds.js" %>
 
   <% if controller.action_name.downcase == "timeline" %>

Modified: branches/packs/app/views/layouts/_paginate.rhtml (3594 => 3595)


--- branches/packs/app/views/layouts/_paginate.rhtml	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/views/layouts/_paginate.rhtml	2013-07-16 15:34:11 UTC (rev 3595)
@@ -1,28 +1,25 @@
-<%= stylesheet_link_tag "pagination" %>
+<div class="digg_pagination">
+  <%= will_paginate(collection, :outer_window => 0, :inner_window => 2) -%>
 
-<% if local_assigns[:sort_by] %>
-  <div style="float: right; margin: 1em;">
-    Sort by:
-    <select  = this.options[this.selectedIndex].value;">
-      <% sort_by.each do |args| %>
-        <option value="<%= url_for(request.query_parameters.merge("order" => args["option"])) -%>" <% if params[:order] == args["option"] -%> selected="selected"<% end -%>><%= args["label"] -%></option>
-      <% end %>
-    </select>
-
-    <% if local_assigns[:num_options] %>
-      <br />
-      <br />
-      Results per page:
+  <% if local_assigns[:sort_by] %>
+    <div style="float: right; text-align: right">
+      Sort by:
       <select  = this.options[this.selectedIndex].value;">
-        <% num_options.each do |num_option| %>
-          <option value="<%= url_for(request.query_parameters.merge("num" => num_option)) -%>" <% if params[:num] == num_option -%> selected="selected"<% end -%>><%= num_option -%></option>
+        <% sort_by.each do |args| %>
+          <option value="<%= url_with_params(request.path, request.query_parameters.merge({:order => args["option"]})) -%>"
+          <% if params[:order] == args["option"] -%> selected="selected"<% end -%>><%= args["label"] -%></option>
         <% end %>
       </select>
-    <% end %>
-  </div>
-<% end %>
-
-<div class="digg_pagination" style="text-align: center">
-  <%= will_paginate(collection, :outer_window => 0, :inner_window => 2) -%>
+      <% if local_assigns[:num_options] %>
+        <br /><br />
+        Results per page:
+        <select  = this.options[this.selectedIndex].value;">
+          <% num_options.each do |num_option| %>
+            <option value="<%= url_for(request.query_parameters.merge("num" => num_option)) -%>" <% if params[:num] == num_option -%> selected="selected"<% end -%>><%= num_option -%></option>
+          <% end %>
+        </select>
+      <% end %>
+    </div>
+  <% end %>
 </div>
 

Modified: branches/packs/app/views/networks/_table.rhtml (3594 => 3595)


--- branches/packs/app/views/networks/_table.rhtml	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/views/networks/_table.rhtml	2013-07-16 15:34:11 UTC (rev 3595)
@@ -41,7 +41,7 @@
         <% else %>
           <%= icon "network-member", nil, nil, nil, '' %>
         <% end %>
-        <% truncated_title = truncate(network.title, :length => 45) %>
+        <% truncated_title = h(truncate(network.title, :length => 45)) %>
         <%=link_to(query ? highlight_all(truncated_title, query) : truncated_title, network_path(network),
                    :title => network.title) %>
       </p>

Modified: branches/packs/app/views/packs/_table.rhtml (3594 => 3595)


--- branches/packs/app/views/packs/_table.rhtml	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/views/packs/_table.rhtml	2013-07-16 15:34:11 UTC (rev 3595)
@@ -35,7 +35,7 @@
           <a name="<%= pack.title.gsub(/ /, "_") %>"></a>
           <p class="title">
             <%= icon "pack", nil, nil, nil, '' %>
-            <% truncated_title = truncate(pack.title, :length => 55) %>
+            <% truncated_title = h(truncate(pack.title, :length => 55)) %>
             <%=link_to(query ? highlight_all(truncated_title, query) : truncated_title, pack_path(pack),
                        :title => pack.title) %>
           </p>

Modified: branches/packs/app/views/packs/edit.rhtml (3594 => 3595)


--- branches/packs/app/views/packs/edit.rhtml	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/views/packs/edit.rhtml	2013-07-16 15:34:11 UTC (rev 3595)
@@ -17,7 +17,7 @@
 	<center>
 		<div class="box_form" style="width: 550px; margin: 1em 0; text-align: left;">
 			<p><b>Title: </b></p>
-			<%= f.text_field :title, :size => 86 %>
+			<%= f.text_field :title, :size => 80, :style => 'width: 100%' %>
 			
 		  <p><b>Description: </b></p>
 			<%= f.text_area(:description, :width => '550px', :height => '300px', :class => 'ckeditor') %>

Modified: branches/packs/app/views/packs/new.rhtml (3594 => 3595)


--- branches/packs/app/views/packs/new.rhtml	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/views/packs/new.rhtml	2013-07-16 15:34:11 UTC (rev 3595)
@@ -13,7 +13,7 @@
   <center>
 		<div class="box_form" style="width: 550px; margin: 1em 0; text-align: left;">
 			<p><b>Title: </b></p>
-			<%= text_field_tag "pack[title]", nil, :size => 86 %>
+			<%= text_field_tag "pack[title]", nil, :size => 80, :style => 'width: 100%' %>
 			
 		  <p><b>Description: </b></p>
       <%= text_area_tag 'pack[description]', nil, :width => '550px', :height => '300px', :class => 'ckeditor' -%>

Modified: branches/packs/app/views/tags/_tags_form.rhtml (3594 => 3595)


--- branches/packs/app/views/tags/_tags_form.rhtml	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/views/tags/_tags_form.rhtml	2013-07-16 15:34:11 UTC (rev 3595)
@@ -62,7 +62,7 @@
 	      <div style="padding: 0 1em;">
 		    <% unless (tags = current_user.tags.sort {|a,b| a.name.downcase <=> b.name.downcase }).empty? %>
 					<% tags.each do |t| %>
-			  			<a href=""  t.name %>'); return false;"><%= t.name %></a><span style="color: #999999;"> | </span> 
+			  			<a href=""  h(t.name) %>'); return false;"><%= h(t.name) %></a><span style="color: #999999;"> | </span>
 					<% end %>
 				<% else %>
 					<p><i>You have not tagged anything yet</i></p>

Modified: branches/packs/app/views/workflows/_main_metadata_form.rhtml (3594 => 3595)


--- branches/packs/app/views/workflows/_main_metadata_form.rhtml	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/views/workflows/_main_metadata_form.rhtml	2013-07-16 15:34:11 UTC (rev 3595)
@@ -63,7 +63,7 @@
 					<b>Title</b>
 					<span class="required">*</span>
 				</p>
-				<%= text_field_tag "workflow[title]", (params[:workflow].nil? ? '' : params[:workflow][:title]), :size => 50 %>
+				<%= text_field_tag "workflow[title]", (params[:workflow].nil? ? '' : params[:workflow][:title]), :size => 80, :style => 'width: 100%' %>
 				
 				<!-- Preview Image -->
 				<p><b>Preview Image</b></p>

Modified: branches/packs/app/views/workflows/_table.rhtml (3594 => 3595)


--- branches/packs/app/views/workflows/_table.rhtml	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/app/views/workflows/_table.rhtml	2013-07-16 15:34:11 UTC (rev 3595)
@@ -44,7 +44,7 @@
 
           <p class="title">
             <%= icon "workflow", nil, nil, nil, '' %>
-            <% truncated_title = truncate(workflow.title, :length => 45) %>
+            <% truncated_title = h(truncate(workflow.title, :length => 45)) %>
             <%=link_to(query ? highlight_all(truncated_title, query) : truncated_title, workflow_path(workflow),
                        :title => workflow.title) %>
             <span style="font-weight:normal;">

Modified: branches/packs/lib/acts_as_rdf_serializable.rb (3594 => 3595)


--- branches/packs/lib/acts_as_rdf_serializable.rb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/lib/acts_as_rdf_serializable.rb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -53,6 +53,7 @@
           begin
             @rdf = self.to_rdf
           rescue
+            raise unless Rails.env == "production"
             errors.add_to_base(self.rdf_serializable_options[:generation_error_message] || "RDF failed to generate")
             false
           else

Modified: branches/packs/lib/rest.rb (3594 => 3595)


--- branches/packs/lib/rest.rb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/lib/rest.rb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -2528,7 +2528,7 @@
   PREFIX wf4ever:<http://purl.org/wf4ever/wf4ever#>
   #{sparql_prefixes}
 
-  SELECT ?workflow_uri WHERE {
+  SELECT DISTINCT ?workflow_uri WHERE {
     GRAPH ?workflow_uri {
       ?w a wfdesc:Workflow .
       #{sparql_query}

Modified: branches/packs/lib/workflow_processors/blog2_template.rb (3594 => 3595)


--- branches/packs/lib/workflow_processors/blog2_template.rb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/lib/workflow_processors/blog2_template.rb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -4,8 +4,10 @@
 # See license.txt for details.
 
 # Defines an interface that all workflow type processors need to adhere to.
+
+require 'file_upload'
+
 module WorkflowProcessors
-  require 'file_upload'
   class Blog2Template < Interface
     
     # Begin Class Methods

Modified: branches/packs/lib/workflow_processors/galaxy.rb (3594 => 3595)


--- branches/packs/lib/workflow_processors/galaxy.rb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/lib/workflow_processors/galaxy.rb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -3,10 +3,10 @@
 # Copyright (c) 2010 University of Manchester and the University of Southampton.
 # See license.txt for details.
 
+require 'libxml'
+
 module WorkflowProcessors
 
-  require 'libxml'
-  
   class Galaxy < WorkflowProcessors::Interface
 
     Mime::Type.register "application/vnd.galaxy.workflow+json", :galaxy_workflow

Modified: branches/packs/lib/workflow_processors/statjr_ebook.rb (3594 => 3595)


--- branches/packs/lib/workflow_processors/statjr_ebook.rb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/lib/workflow_processors/statjr_ebook.rb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -3,6 +3,9 @@
 # Copyright (c) 2008 University of Manchester and the University of Southampton.
 # See license.txt for details.
 
+require "zip/zip"
+require 'rdf/raptor'
+
 module WorkflowProcessors
 
   class StatjrEbook < WorkflowProcessors::Interface
@@ -131,9 +134,6 @@
 
     module Parser
 
-      require "zip/zip"
-      require 'rdf/raptor'
-
       def self.parse(stream)
         begin
           Tempfile.open("deep", "tmp") do |zip_file|

Modified: branches/packs/lib/workflow_processors/taverna2.rb (3594 => 3595)


--- branches/packs/lib/workflow_processors/taverna2.rb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/lib/workflow_processors/taverna2.rb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -3,17 +3,17 @@
 # Copyright (c) 2008 University of Manchester and the University of Southampton.
 # See license.txt for details.
 
+require 't2flow/model'
+require 't2flow/parser'
+require 't2flow/dot'
+require 'libxml'
+require 'rdf'
+require 'rdf/n3'
+require 'rdf/turtle'
+require 'file_upload'
+
 module WorkflowProcessors
 
-  require 't2flow/model'
-  require 't2flow/parser'
-  require 't2flow/dot'
-  require 'libxml'
-  require 'rdf'
-  require 'rdf/n3'
-  
-  require 'file_upload'
-
   class Taverna2 < Interface
     # Register Taverna 2 MIME Types
     Mime::Type.register "application/vnd.taverna.t2flow+xml", :t2flow

Modified: branches/packs/lib/workflow_processors/taverna_scufl.rb (3594 => 3595)


--- branches/packs/lib/workflow_processors/taverna_scufl.rb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/lib/workflow_processors/taverna_scufl.rb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -3,13 +3,12 @@
 # Copyright (c) 2008 University of Manchester and the University of Southampton.
 # See license.txt for details.
 
+require 'scufl/model'
+require 'scufl/parser'
+require 'scufl/dot'
+require 'file_upload'
+
 module WorkflowProcessors
-  
-  require 'scufl/model'
-  require 'scufl/parser'
-  require 'scufl/dot'
-  
-  require 'file_upload'
 
   class TavernaScufl < WorkflowProcessors::Interface
     # Register Taverna MIME Types

Modified: branches/packs/public/component_query_demo.html (3594 => 3595)


--- branches/packs/public/component_query_demo.html	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/public/component_query_demo.html	2013-07-16 15:34:11 UTC (rev 3595)
@@ -20,7 +20,7 @@
       PREFIX wfdesc:&lt;http://purl.org/wf4ever/wfdesc#&gt;<br/>
       <i>{sparql_prefixes}</i><br/><br/>
       <div>
-      SELECT ?workflow_uri WHERE {
+      SELECT DISTINCT ?workflow_uri WHERE {
         <div style="margin-left: 2em;">
         GRAPH ?workflow_uri {
           <div style="margin-left: 2em;">

Modified: branches/packs/public/stylesheets/pagination.css (3594 => 3595)


--- branches/packs/public/stylesheets/pagination.css	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/public/stylesheets/pagination.css	2013-07-16 15:34:11 UTC (rev 3595)
@@ -1,6 +1,8 @@
 .digg_pagination {
   background: white;
   cursor: default;
+  margin-bottom: 0.5em;
+  overflow: auto;
   /* self-clearing method: */ }
 .digg_pagination a, .digg_pagination span, .digg_pagination em {
   padding: 0.2em 0.5em;
@@ -34,11 +36,6 @@
   color: #000033;
   background: #456aaa;
   padding: 0.1em 0.25em; }
-.digg_pagination:after {
-  display: block;
-  height: 0;
-  clear: both;
-  visibility: hidden; }
 * html .digg_pagination {
   height: 1%; }
 *:first-child + html .digg_pagination {

Modified: branches/packs/test/fixtures/profiles.yml (3594 => 3595)


--- branches/packs/test/fixtures/profiles.yml	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/test/fixtures/profiles.yml	2013-07-16 15:34:11 UTC (rev 3595)
@@ -48,3 +48,13 @@
   body:
   created_at: 2007-05-01 06:56:26
   updated_at: 2007-05-01 06:56:26
+
+utf8user_profile:
+  id: 6
+  user_id: 6
+  picture_id:
+  email:
+  website:
+  body:
+  created_at: 2007-05-01 06:56:26
+  updated_at: 2007-05-01 06:56:26

Modified: branches/packs/test/fixtures/users.yml (3594 => 3595)


--- branches/packs/test/fixtures/users.yml	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/test/fixtures/users.yml	2013-07-16 15:34:11 UTC (rev 3595)
@@ -70,3 +70,17 @@
   created_at: 2007-05-01 06:56:26
   updated_at: 2007-05-01 06:56:26
 
+
+utf8_user:
+  id: 6
+  openid_url:
+  name:  Dâvïd 웃유
+  username: utf8user
+  salt: <%= SALT %>
+  crypted_password: <%= User.encrypt('secret', SALT) %>
+  email: address@hidden
+  email_confirmed_at: 2007-05-01 06:56:26
+  activated_at: 2007-05-01 06:56:26
+  last_seen_at: 2007-05-01 06:56:26
+  created_at: 2007-05-01 06:56:26
+  updated_at: 2007-05-01 06:56:26
\ No newline at end of file

Modified: branches/packs/test/functional/workflows_controller_test.rb (3594 => 3595)


--- branches/packs/test/functional/workflows_controller_test.rb	2013-07-16 14:39:50 UTC (rev 3594)
+++ branches/packs/test/functional/workflows_controller_test.rb	2013-07-16 15:34:11 UTC (rev 3595)
@@ -1,3 +1,4 @@
+# encoding: utf-8
 # myExperiment: test/functional/workflows_controller_test.rb
 #
 # Copyright (c) 2007 University of Manchester and the University of Southampton.
@@ -3,5 +4,5 @@
 # See license.txt for details.
 
-require File.dirname(__FILE__) + '/../test_helper'
+require_relative '../test_helper'
 require 'workflows_controller'
 
@@ -36,9 +37,17 @@
 
     assert_redirected_to workflow_path(assigns(:workflow))
     assert_equal old_count+1, Workflow.count
+
+    # Test searches
+
+    workflow = Workflow.last
+
+    # Basic test that the workflow was indexed in Solr and that it appears in a search result.
+    assert Workflow.search { fulltext "dilbert" }.results.include?(workflow)
   end
 
   def test_should_show_workflow
+
     get :show, :id => 1
     assert_response :success
   end
@@ -98,4 +107,18 @@
 
     TripleStore.instance.repo = {}
   end
+
+  def test_can_tag_workflow
+    login_as(:john)
+    wf = workflows(:workflow_dilbert)
+
+    assert_equal 0, wf.tags.size
+
+    post :tag, :id => wf.id, :tag_list => 'new tag, utf-8 ㈛ ㈘ ㈔'
+
+    assert_response :success
+    assert_equal 2, wf.tags.size
+    assert_includes wf.tags.map {|t| t.name}, 'utf-8 ㈛ ㈘ ㈔'
+    assert_includes wf.tags.map {|t| t.name}, 'new tag'
+  end
 end

reply via email to

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