myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3429] branches/wf4ever: cd branches/wf4ever ; sv


From: noreply
Subject: [myexperiment-hackers] [3429] branches/wf4ever: cd branches/wf4ever ; svn merge -r 3208:3428 ^/ trunk
Date: Mon, 18 Feb 2013 12:37:27 +0000 (UTC)

Revision
3429
Author
dgc
Date
2013-02-18 12:37:26 +0000 (Mon, 18 Feb 2013)

Log Message

cd branches/wf4ever ; svn merge -r 3208:3428 ^/trunk

Modified Paths

Added Paths

Removed Paths

Diff

Modified: branches/wf4ever/Gemfile (3428 => 3429)


--- branches/wf4ever/Gemfile	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/Gemfile	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,6 +1,6 @@
 source "http://rubygems.org"
 
-gem "rails", "2.3.14"
+gem "rails", "2.3.17"
 gem "mysql", "~> 2.8.1"
 gem "rubyzip", "~> 0.9.4"
 gem "oauth", "~> 0.4.3"
@@ -21,6 +21,8 @@
 gem "rdf-raptor", "~> 0.4.1"
 gem "rdf-n3"
 gem "recaptcha", "~> 0.3.4"
+gem "encrypted_strings", "~> 0.3.3"
+gem "encrypted_attributes", "~> 0.4.1"
 gem "wf4ever-transformation-client", "~> 0.3.0"
 gem "wf4ever-rosrs-client", "~> 0.2.0"
 

Modified: branches/wf4ever/app/controllers/application_controller.rb (3428 => 3429)


--- branches/wf4ever/app/controllers/application_controller.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/controllers/application_controller.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -6,10 +6,12 @@
 # Filters added to this controller apply to all controllers in the application.
 # Likewise, all the methods added will be available for all controllers.
 
+require 'pivoting'
 require 'rdf'
 require 'wf4ever/rosrs_client'
 
 class ApplicationController < ActionController::Base
+
   helper :all # include all helpers, all the time
   protect_from_forgery # See ActionController::RequestForgeryProtection for details
 
@@ -186,19 +188,28 @@
 
     # this method will return an error message is something goes wrong (empty string in case of success)
     error_msg = ""
-    
 
     # BEGIN validation and initialisation
-    
+
+    # If a group policy was selected, use that, and delete the old custom one (if there was one).
+    if params[:policy_type] == "group"
+      if contributable.contribution.policy && !contributable.contribution.policy.group_policy?
+        contributable.contribution.policy.destroy
+      end
+      contributable.contribution.policy_id = params[:group_policy]
+      contributable.contribution.save
+      return
+    end
+
     # This variable will hold current settings of the policy in case something
     # goes wrong and a revert would be needed at some point
     last_saved_policy = nil
     
     return if params[:sharing].nil? or params[:sharing][:class_id].blank?
-    
+
     sharing_class  = params[:sharing][:class_id]
     updating_class = (params[:updating] and !params[:updating][:class_id].blank?) ? params[:updating][:class_id] : "6"
-    
+
     # Check allowed sharing_class values
     return unless [ "0", "1", "2", "3", "4", "7" ].include? sharing_class
     
@@ -214,9 +225,9 @@
     
     # BEGIN initialisation and validation
 
-    unless contributable.contribution.policy
+    if contributable.contribution.policy.nil? || contributable.contribution.policy.group_policy?
       last_saved_policy = Policy._default(current_user, nil) # second parameter ensures that this policy is not applied anywhere
-      
+
       policy = Policy.new(:name => 'auto',
           :contributor_type => 'User', :contributor_id => current_user.id,
           :share_mode         => sharing_class,
@@ -259,10 +270,25 @@
       policy.delete_all_user_permissions
     end
     
-    
+
     # Process explicit Group permissions now
+    process_permissions(policy, params)
+
+    logger.debug("------ Workflow create summary ------------------------------------")
+    logger.debug("current_user   = #{current_user.id}")
+    logger.debug("updating_class = #{updating_class}")
+    logger.debug("sharing_class  = #{sharing_class}")
+    logger.debug("policy         = #{policy}")
+    logger.debug("group_sharing  = #{params[:group_sharing]}")
+    logger.debug("-------------------------------------------------------------------")
+
+    # returns some message in case of errors (or empty string in case of success)
+    return error_msg
+  end
+
+  def process_permissions(policy, params)
     if params[:group_sharing]
-      
+
       # First delete any Permission objects that don't have a checked entry in the form
       policy.permissions.each do |p|
         params[:group_sharing].each do |n|
@@ -274,17 +300,17 @@
           end
         end
       end
-    
+
       # Now create or update Permissions
       params[:group_sharing].each do |n|
-        
+
         # Note: n[1] is used because n is an array and n[1] returns it's value (which in turn is a hash)
         # In this hash, is a value with key 'id' is present then the checkbox for that group was checked.
         if n[1][:id]
-          
+
           n_id = n[1][:id].to_i
           level = n[1][:level]
-          
+
           unless (perm = Permission.find(:first, :conditions => ["policy_id = ? AND contributor_type = ? AND contributor_id = ?", policy.id, 'Network', n_id]))
             # Only create new Permission if it doesn't already exist
             p = Permission.new(:policy => policy, :contributor => (Network.find(n_id)))
@@ -293,31 +319,20 @@
             # Update the 'level' on the existing permission
             perm.set_level!(level) if level
           end
-          
+
         else
-          
+
           n_id = n[0].to_i
-          
+
           # Delete permission if it exists (because this one is unchecked)
           if (perm = Permission.find(:first, :conditions => ["policy_id = ? AND contributor_type = ? AND contributor_id = ?", policy.id, 'Network', n_id]))
             perm.destroy
           end
-          
+
         end
-      
+
       end
     end
-
-    logger.debug("------ Workflow create summary ------------------------------------")
-    logger.debug("current_user   = #{current_user.id}")
-    logger.debug("updating_class = #{updating_class}")
-    logger.debug("sharing_class  = #{sharing_class}")
-    logger.debug("policy         = #{policy}")
-    logger.debug("group_sharing  = #{params[:group_sharing]}")
-    logger.debug("-------------------------------------------------------------------")
-
-    # returns some message in case of errors (or empty string in case of success)
-    return error_msg
   end
 
   def update_credits(creditable, params)
@@ -418,604 +433,22 @@
     send_file(file_name, *opts)
   end
 
-  # Pivot code
-
-  def calculate_pivot(opts = {})
-
-    begin
-      expr = parse_filter_expression(opts[:params]["filter"], opts[:pivot_options], :active_filters => opts[:active_filters])
-    rescue Exception => ex
-      problem = "Problem with query _expression_: #{ex}"
-    end
-
-    pivot = contributions_list(opts[:params], opts[:user], opts[:pivot_options],
-        :model            => opts[:model],
-        :auth_type        => opts[:auth_type],
-        :auth_id          => opts[:auth_id],
-        :group_by         => opts[:group_by],
-        :active_filters   => opts[:active_filters],
-        :lock_filter      => opts[:locked_filters],
-        :search_models    => opts[:search_models],
-        :search_limit     => opts[:search_limit],
-        :filters          => expr)
-
-    [pivot, problem]
-  end
-  
-  TOKEN_UNKNOWN         = 0x0000
-  TOKEN_AND             = 0x0001
-  TOKEN_OR              = 0x0002
-  TOKEN_WORD            = 0x0003
-  TOKEN_OPEN            = 0x0004
-  TOKEN_CLOSE           = 0x0005
-  TOKEN_STRING          = 0x0006
-  TOKEN_EOS             = 0x00ff
-
-  NUM_TOKENS            = 6
-
-  STATE_INITIAL         = 0x0000
-  STATE_EXPECT_OPEN     = 0x0100
-  STATE_EXPECT_STR      = 0x0200
-  STATE_EXPECT_EXPR_END = 0x0300
-  STATE_EXPECT_END      = 0x0400
-  STATE_COMPLETE        = 0x0500
-
-  def parse_filter_expression(expr, pivot_options, opts = {})
-
-    def unescape_string(str)
-      str.match(/^"(.*)"$/)[1].gsub(/\\"/, '"')
-    end
-
-    return nil if expr.nil?
-
-    state  = STATE_INITIAL
-    data   = ""
-
-    begin
-
-      tokens = expr.match(/^
-
-          \s* (\sAND\s)         | # AND operator
-          \s* (\sOR\s)          | # OR operator
-          \s* (\w+)             | # a non-keyword word
-          \s* (\()              | # an open paranthesis
-          \s* (\))              | # a close paranthesis
-          \s* ("(\\.|[^\\"])*")   # double quoted string with backslash escapes
-
-          /ix)
-
-      if tokens.nil?
-        token = TOKEN_UNKNOWN
-      else
-        (1..NUM_TOKENS).each do |i|
-          token = i if tokens[i]
-        end
-      end
-
-      if token == TOKEN_UNKNOWN
-        token = TOKEN_EOS if expr.strip.empty?
-      end
-
-      case state | token
-        when STATE_INITIAL         | TOKEN_WORD   : state = STATE_EXPECT_OPEN     ; data << { :name => tokens[0], :expr => [] }
-        when STATE_EXPECT_OPEN     | TOKEN_OPEN   : state = STATE_EXPECT_STR
-        when STATE_EXPECT_STR      | TOKEN_STRING : state = STATE_EXPECT_EXPR_END ; data.last[:expr] << tokens[0] 
-        when STATE_EXPECT_EXPR_END | TOKEN_AND    : state = STATE_EXPECT_STR      ; data.last[:expr] << :and 
-        when STATE_EXPECT_EXPR_END | TOKEN_OR     : state = STATE_EXPECT_STR      ; data.last[:expr] << :or 
-        when STATE_EXPECT_EXPR_END | TOKEN_CLOSE  : state = STATE_EXPECT_END
-        when STATE_EXPECT_END      | TOKEN_AND    : state = STATE_INITIAL         ; data << :and 
-        when STATE_EXPECT_END      | TOKEN_OR     : state = STATE_INITIAL         ; data << :or 
-        when STATE_EXPECT_END      | TOKEN_EOS    : state = STATE_COMPLETE
-
-        else raise "Error parsing query _expression_"
-      end
-
-      expr = tokens.post_match unless state == STATE_COMPLETE
-
-    end while state != STATE_COMPLETE
-
-    # validate and reduce expressions to current capabilities
-
-    valid_filters = pivot_options["filters"].map do |f| f["query_option"] end
-    valid_filters = valid_filters.select do |f| opts[:active_filters].include?(f) end
-
-    data.each do |category|
-      case category
-      when :or
-        raise "Unsupported query _expression_"
-      when :and
-        # Fine
-      else
-        raise "Unknown filter category" unless valid_filters.include?(category[:name])
-
-        counts = { :and => 0, :or => 0 }
-
-        category[:expr].each do |bit|
-          counts[bit] = counts[bit] + 1 if bit.class == Symbol
-        end
-
-        raise "Unsupported query _expression_" if counts[:and] > 0 && counts[:or] > 0
-
-        # haven't implemented 'and' within a particular filter yet
-        raise "Unsupported query _expression_" if counts[:and] > 0
-
-        if category[:expr].length == 1
-          category[:expr] = { :terms => [unescape_string(category[:expr].first)] }
-        else
-          category[:expr] = {
-            :operator => category[:expr][1],
-            :terms    => category[:expr].select do |t|
-              t.class == String
-            end.map do |t|
-              unescape_string(t)
-            end
-          }
-        end
-      end
-    end
-
-    data
-  end
-
-  def contributions_list(params = nil, user = nil, pivot_options = nil, opts = {})
-
-    def escape_sql(str)
-      str.gsub(/\\/, '\&\&').gsub(/'/, "''")
-    end
-
-    def build_url(params, opts, expr, parts, pivot_options, extra = {})
-
-      query = {}
-
-      if parts.include?(:filter)
-        bits = []
-        pivot_options["filters"].each do |filter|
-          if !opts[:lock_filter] || opts[:lock_filter][filter["query_option"]].nil?
-            if find_filter(expr, filter["query_option"])
-              bits << filter["query_option"] + "(\"" + find_filter(expr, filter["query_option"])[:expr][:terms].map do |t| t.gsub(/"/, '\"') end.join("\" OR \"") + "\")"
-            end
-          end
-        end
-
-        if bits.length > 0
-          query["filter"] = bits.join(" AND ")
-        end
-      end
-
-      query["query"]        = params[:query]        if params[:query]
-      query["order"]        = params[:order]        if parts.include?(:order)
-      query["filter_query"] = params[:filter_query] if parts.include?(:filter_query)
-
-      query.merge!(extra)
-
-      query
-    end
-
-    def comparison(lhs, rhs)
-      if rhs.length == 1
-        "#{lhs} = '#{escape_sql(rhs.first)}'"
-      else
-        "#{lhs} IN ('#{rhs.map do |bit| escape_sql(bit) end.join("', '")}')"
-      end
-    end
-
-    def create_search_results_table(search_query, opts)
-
-      begin
-        solr_results = opts[:search_models].first.multi_solr_search(search_query,
-            :models         => opts[:search_models],
-            :limit          => opts[:search_limit],
-            :results_format => :ids)
-      rescue
-        return false
-      end
-
-      conn = ActiveRecord::Base.connection
-
-      conn.execute("CREATE TEMPORARY TABLE search_results (id INT AUTO_INCREMENT UNIQUE KEY, result_type VARCHAR(255), result_id INT)")
-
-      # This next part converts the search results to SQL values
-      #
-      # from:  { "id" => "Workflow:4" }, { "id" => "Pack:6" }, ...
-      # to:    "(NULL, 'Workflow', '4'), (NULL, 'Pack', '6'), ..."
-
-      if solr_results.results.length > 0
-        insert_part = solr_results.results.map do |result|
-          "(NULL, " + result["id"].split(":").map do |bit|
-            "'#{bit}'"
-          end.join(", ") + ")"
-        end.join(", ")
- 
-        conn.execute("INSERT INTO search_results VALUES #{insert_part}")
-      end
-
-      true
-    end
-
-    def drop_search_results_table
-      ActiveRecord::Base.connection.execute("DROP TABLE IF EXISTS search_results")
-    end
-
-    def column(column, opts)
-      if column == :auth_type
-        opts[:auth_type]
-      else
-        column
-      end
-    end
-
-    def calculate_filter(collection, params, filter, pivot_options, user, opts = {})
-
-      # apply all the joins and conditions except for the current filter
-
-      joins      = []
-      conditions = []
-
-      pivot_options["filters"].each do |other_filter|
-        if filter_list = find_filter(opts[:filters], other_filter["query_option"])
-          unless opts[:inhibit_other_conditions]
-            conditions << comparison(column(other_filter["id_column"], opts), filter_list[:expr][:terms]) unless other_filter == filter
-          end
-          joins += other_filter["joins"] if other_filter["joins"]
-        end
-      end
-
-      filter_id_column    = column(filter["id_column"],    opts)
-      filter_label_column = column(filter["label_column"], opts)
-
-      joins += filter["joins"] if filter["joins"]
-      conditions << "#{filter_id_column} IS NOT NULL" if filter["not_null"]
-
-      unless opts[:inhibit_filter_query]
-        if params[:filter_query]
-          conditions << "(#{filter_label_column} LIKE '%#{escape_sql(params[:filter_query])}%')"
-        end
-      end
-
-      current = find_filter(opts[:filters], filter["query_option"]) ? find_filter(opts[:filters], filter["query_option"])[:expr][:terms] : []
-
-      if opts[:ids].nil?
-        limit = 10
-      else
-        conditions << "(#{filter_id_column} IN ('#{opts[:ids].map do |id| escape_sql(id) end.join("','")}'))"
-        limit = nil
-      end
-
-      conditions = conditions.length.zero? ? nil : conditions.join(" AND ")
-
-      count_expr = "COUNT(DISTINCT #{opts[:auth_type]}, #{opts[:auth_id]})"
-
-      objects = collection.find(
-          :all,
-          :select => "#{filter_id_column} AS filter_id, #{filter_label_column} AS filter_label, #{count_expr} AS filter_count",
-          :joins => merge_joins(joins, pivot_options, collection.permission_conditions, :auth_type => opts[:auth_type], :auth_id => opts[:auth_id]),
-          :conditions => conditions,
-          :group => "#{filter_id_column}",
-          :limit => limit,
-          :order => "#{count_expr} DESC, #{filter_label_column}")
-
-      objects = objects.select do |x| !x[:filter_id].nil? end
-
-      objects = objects.map do |object|
-
-        value = object.filter_id.to_s
-        selected = current.include?(value)
-
-        label_expr = deep_clone(opts[:filters])
-        label_expr -= [find_filter(label_expr, filter["query_option"])] if find_filter(label_expr, filter["query_option"])
-
-        unless selected && current.length == 1
-          label_expr << { :name => filter["query_option"], :expr => { :terms => [value] } }
-        end
-
-        checkbox_expr = deep_clone(opts[:filters])
-
-        if expr_filter = find_filter(checkbox_expr, filter["query_option"])
-
-          if selected
-            expr_filter[:expr][:terms] -= [value]
-          else
-            expr_filter[:expr][:terms] += [value]
-          end
-
-          checkbox_expr -= [expr_filter] if expr_filter[:expr][:terms].empty?
-
-        else
-          checkbox_expr << { :name => filter["query_option"], :expr => { :terms => [value] } }
-        end
-
-        label_uri = build_url(params, opts, label_expr, [:filter, :order], pivot_options, "page" => nil)
-
-        checkbox_uri = build_url(params, opts, checkbox_expr, [:filter, :order], pivot_options, "page" => nil)
-
-        label = object.filter_label.clone
-        label = visible_name(label) if filter["visible_name"]
-        label = label.capitalize    if filter["capitalize"]
-
-        plain_label = object.filter_label
-
-        if params[:filter_query]
-          label.sub!(Regexp.new("(#{params[:filter_query]})", Regexp::IGNORECASE), '<b>\1</b>')
-        end
-
-        {
-          :object       => object,
-          :value        => value,
-          :label        => label,
-          :plain_label  => plain_label,
-          :count        => object.filter_count,
-          :checkbox_uri => checkbox_uri,
-          :label_uri    => label_uri,
-          :selected     => selected
-        }
-      end
-
-      [current, objects]
-    end
-
-    def calculate_filters(collection, params, opts, pivot_options, user)
-
-      # produce the filter list
-
-      filters = deep_clone(pivot_options["filters"])
-      cancel_filter_query_url = nil
-
-      filters.each do |filter|
-
-        # calculate the top n items of the list
-
-        filter[:current], filter[:objects] = calculate_filter(collection, params, filter, pivot_options, user, opts)
-
-        # calculate which active filters are missing (because they weren't in the
-        # top part of the list or have a count of zero)
-
-        missing_filter_ids = filter[:current] - filter[:objects].map do |ob| ob[:value] end
-
-        if missing_filter_ids.length > 0
-          filter[:objects] += calculate_filter(collection, params, filter, pivot_options, user, opts.merge(:ids => missing_filter_ids))[1]
-        end
-
-        # calculate which active filters are still missing (because they have a
-        # count of zero)
-
-        missing_filter_ids = filter[:current] - filter[:objects].map do |ob| ob[:value] end
-        
-        if missing_filter_ids.length > 0
-          zero_list = calculate_filter(collection, params, filter, pivot_options, user, opts.merge(:ids => missing_filter_ids, :inhibit_other_conditions => true))[1]
-
-          zero_list.each do |x| x[:count] = 0 end
-
-          zero_list.sort! do |a, b| a[:label] <=> b[:label] end
-
-          filter[:objects] += zero_list
-        end
-      end
-
-      [filters, cancel_filter_query_url]
-    end
-
-    def find_filter(filters, name)
-      filters.find do |f|
-        f[:name] == name
-      end
-    end
-
-    def merge_joins(joins, pivot_options, permission_conditions, opts = {})
-      if joins.length.zero?
-        nil
-      else
-        joins.uniq.map do |j|
-          text = pivot_options["joins"][j].clone
-          text.gsub!(/RESULT_TYPE/,         opts[:auth_type])
-          text.gsub!(/RESULT_ID/,           opts[:auth_id])
-          text.gsub!(/VIEW_CONDITIONS/,     permission_conditions[:view_conditions])
-          text.gsub!(/DOWNLOAD_CONDITIONS/, permission_conditions[:download_conditions])
-          text.gsub!(/EDIT_CONDITIONS/,     permission_conditions[:edit_conditions])
-          text
-        end.join(" ")
-      end
-    end
-
-    pivot_options["filters"] = pivot_options["filters"].select do |f|
-      opts[:active_filters].include?(f["query_option"])
-    end
-
-    joins      = []
-    conditions = []
-
-    # parse the filter _expression_ if provided.  convert filter _expression_ to
-    # the old format.  this will need to be replaced eventually
-
-    opts[:filters] ||= []
-    
-    include_reset_url = opts[:filters].length > 0
-
-    # filter out top level logic operators for now
-
-    opts[:filters] = opts[:filters].select do |bit|
-      bit.class == Hash
-    end
-
-    # apply locked filters
-
-    if opts[:lock_filter]
-      opts[:lock_filter].each do |filter, value|
-        opts[:filters] << { :name => filter, :expr => { :terms => [value] } }
-      end
-    end
-
-    # perform search if requested
-
-    query_problem = false
-
-    if params["query"]
-      drop_search_results_table
-      if !create_search_results_table(params["query"], opts)
-        params["query"] = nil
-        query_problem = true
-      end
-    end
-
-    if params[:query]
-      klass     = SearchResult
-      auth_type = "search_results.result_type"
-      auth_id   = "search_results.result_id"
-      group_by  = "search_results.result_type, search_results.result_id"
-    else
-      klass     = opts[:model]     || Contribution
-      auth_type = opts[:auth_type] || "contributions.contributable_type"
-      auth_id   = opts[:auth_id]   || "contributions.contributable_id"
-      group_by  = opts[:group_by]  || "contributions.contributable_type, contributions.contributable_id"
-    end
-
-    # determine joins, conditions and order for the main results
-
-    pivot_options["filters"].each do |filter|
-      if filter_list = find_filter(opts[:filters], filter["query_option"])
-        conditions << comparison(column(filter["id_column"], opts.merge( { :auth_type => auth_type, :auth_id => auth_id } )), filter_list[:expr][:terms])
-        joins += filter["joins"] if filter["joins"]
-      end
-    end
-
-    order_options = pivot_options["order"].find do |x|
-      x["option"] == params[:order]
-    end
-
-    order_options ||= pivot_options["order"].first
-
-    joins += order_options["joins"] if order_options["joins"]
-
-    having_bits = []
-
-#   pivot_options["filters"].each do |filter|
-#     if params["and_#{filter["query_option"]}"]
-#       having_bits << "GROUP_CONCAT(DISTINCT #{filter["id_column"]} ORDER BY #{filter["id_column"]}) = \"#{escape_sql(opts[:filters][filter["query_option"]])}\""
-#     end
-#   end
-
-    having_clause = ""
-
-    if having_bits.length > 0
-      having_clause = "HAVING #{having_bits.join(' AND ')}"
-    end
-
-    # perform the results query
-
-    collection = Authorization.scoped(klass,
-        :authorised_user => user,
-        :include_permissions => true,
-        :auth_type => auth_type,
-        :auth_id => auth_id)
-
-    results = collection.find(
-        :all,
-        :page => { :size => params["num"] ? params["num"].to_i : nil, :current => params["page"] },
-        :joins => merge_joins(joins, pivot_options, collection.permission_conditions, :auth_type => auth_type, :auth_id => auth_id),
-        :conditions => conditions.length.zero? ? nil : conditions.join(" AND "),
-        :group => "#{group_by} #{having_clause}",
-        :order => order_options["order"])
-        
-    # produce a query hash to match the current filters
-
-    opts[:filter_params] = {}
-
-    pivot_options["filters"].each do |filter|
-      if params[filter["query_option"]]
-        next if opts[:lock_filter] && opts[:lock_filter][filter["query_option"]]
-        opts[:filter_params][filter["query_option"]] = params[filter["query_option"]]
-      end
-    end
-
-    # produce the filter list
-
-    opts_for_filter_query = opts.merge( { :auth_type => auth_type,
-        :auth_id => auth_id, :group_by => group_by } )
-
-    filters, cancel_filter_query_url = calculate_filters(collection, params, opts_for_filter_query, pivot_options, user)
-
-    # produce the summary.  If a filter query is specified, then we need to
-    # recalculate the filters without the query to get all of them.
-
-    if params[:filter_query]
-      filters2 = calculate_filters(collection, params, opts_for_filter_query.merge( { :inhibit_filter_query => true } ), pivot_options, user)[0]
-    else
-      filters2 = filters
-    end
-
-    summary = ""
-
-    filters2.select do |filter|
-
-      next if opts[:lock_filter] && opts[:lock_filter][filter["query_option"]]
-
-      selected = filter[:objects].select do |x| x[:selected] end
-      current  = selected.map do |x| x[:value] end
-
-      if selected.length > 0
-        selected_labels = selected.map do |x|
-
-          expr = deep_clone(opts[:filters])
-
-          f = find_filter(expr, filter["query_option"])
-  
-          expr -= f[:expr][:terms] -= [x[:value]]
-          expr -= [f] if f[:expr][:terms].empty?
-
-          x[:plain_label] + ' <a href="" + url_for(build_url(params, opts, expr,
-          [:filter, :filter_query, :order], pivot_options)) +
-            '">' + " <img src='' /></a>"
-
-        end
-
-        bits = selected_labels.map do |label| label end.join(" <i>or</i> ")
-
-        summary << '<span class="filter-in-use"><b>' + filter["title"].capitalize + "</b>: " + bits + "</span> "
-      end
-    end
-
-    if params[:filter_query]
-      cancel_filter_query_url = build_url(params, opts, opts[:filters], [:filter, :order], pivot_options)
-    end
-
-    if include_reset_url
-      reset_filters_url = build_url(params, opts, opts[:filters], [:order], pivot_options)
-    end
-
-    # remove filters that do not help in narrowing down the result set
-
-    filters = filters.select do |filter|
-      if filter[:objects].empty?
-        false
-      elsif opts[:lock_filter] && opts[:lock_filter][filter["query_option"]]
-        false
-      else
-        true
-      end
-    end
-
-    {
-      :results                 => results,
-      :filters                 => filters,
-      :reset_filters_url       => reset_filters_url,
-      :cancel_filter_query_url => cancel_filter_query_url,
-      :filter_query_url        => build_url(params, opts, opts[:filters], [:filter], pivot_options),
-      :summary                 => summary,
-      :pivot_options           => pivot_options,
-      :query_problem           => query_problem
-    }
-  end
-
   #Applies the layout for the Network with the given network_id to the object (contributable)
   def update_layout(object,network_id)
-    if network_id.blank?
-      object.contribution.layout = nil
-      object.contribution.save
+    if object.is_a?(Policy)
+      policy = object
     else
+      policy = object.contribution.policy
+    end
+    if network_id.blank? || network_id == "Default"
+      policy.layout = nil
+      policy.save
+    else
       network = Network.find(network_id.to_i)
       # Have to call .reload on permissions or the cached permissions from before "update_policy" was called are used
-      if network && find_permission_for_contributor(object.contribution.policy.permissions.reload, "Network", network_id.to_i)
-        object.contribution.layout = network.layout_name
-        object.contribution.save
+      if network && find_permission_for_contributor(policy.permissions.reload, "Network", network_id.to_i)
+        policy.layout = network.layout_name
+        policy.save
       else
         object.errors.add_to_base("You may only choose layouts for groups that this #{object.class.name.downcase} is shared with.")
       end

Modified: branches/wf4ever/app/controllers/blobs_controller.rb (3428 => 3429)


--- branches/wf4ever/app/controllers/blobs_controller.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/controllers/blobs_controller.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -38,7 +38,7 @@
     
     send_data(@version.content_blob.data, :filename => @version.local_name, :type => @version.content_type.mime_type)
     
-    #send_file("#{RAILS_ROOT}/#{controller_name}/address@hidden/address@hidden/address@hidden", :filename => @blob.local_name, :type => @blob.content_type.mime_type)
+    #send_file("#{Rails.root}/#{controller_name}/address@hidden/address@hidden/address@hidden", :filename => @blob.local_name, :type => @blob.content_type.mime_type)
   end
 
   # GET /files/:id/download/:name
@@ -68,6 +68,13 @@
     respond_to do |format|
       format.html {
 
+        @query = params[:query]
+        @query_type = 'files'
+        pivot_options = Conf.pivot_options.dup
+        unless @query.blank?
+          pivot_options["order"] = [{"order" => "id ASC", "option" => "relevance", "label" => "Relevance"}] + pivot_options["order"]
+        end
+
         @pivot, problem = calculate_pivot(
 
             :pivot_options  => Conf.pivot_options,
@@ -85,9 +92,6 @@
 
         flash.now[:error] = problem if problem
 
-        @query = params[:query]
-        @query_type = 'files'
-
         # index.rhtml
       }
     end
@@ -148,7 +152,10 @@
       @blob = Blob.new(params[:blob])
       @blob.content_blob = ContentBlob.new(:data ="" data)
 
-      @blob.content_type = ContentType.find_or_create_by_mime_type(:user => current_user, :mime_type => content_type, :category=> 'Blob')
+      @blob.content_type = ContentType.find_or_create_by_mime_type(:user => current_user,
+                                                                   :title => content_type,
+                                                                   :mime_type => content_type,
+                                                                   :category=> 'Blob')
 
       respond_to do |format|
         if @blob.save
@@ -161,13 +168,12 @@
           @blob.contribution.update_attributes(params[:contribution])
         
           policy_err_msg = update_policy(@blob, params)
-          update_layout(@blob, params[:layout])
-        
+
           update_credits(@blob, params)
           update_attributions(@blob, params)
         
           if policy_err_msg.blank?
-
+            update_layout(@blob, params[:layout]) unless params[:policy_type] == "group"
             @version = @blob.find_version(1)
 
             format.html {
@@ -211,7 +217,10 @@
     if params[:blob][:data] && params[:blob][:data].size > 0
       @blob.build_content_blob(:data ="" params[:blob][:data].read)
       @blob.local_name = params[:blob][:data].original_filename
-      @blob.content_type = ContentType.find_or_create_by_mime_type(:user => current_user, :title => params[:blob][:data].content_type, :mime_type => params[:blob][:data].content_type, :category => 'Blob')
+      @blob.content_type = ContentType.find_or_create_by_mime_type(:user => current_user,
+                                                                   :title => params[:blob][:data].content_type,
+                                                                   :mime_type => params[:blob][:data].content_type,
+                                                                   :category => 'Blob')
     end
 
     params[:blob].delete(:data)
@@ -223,9 +232,10 @@
         policy_err_msg = update_policy(@blob, params)
         update_credits(@blob, params)
         update_attributions(@blob, params)
-        update_layout(@blob, params[:layout])
-        
+
         if policy_err_msg.blank?
+          update_layout(@blob, params[:layout]) unless params[:policy_type] == "group"
+
           format.html {
 
             if @blob.new_version_number

Deleted: branches/wf4ever/app/controllers/blog_posts_controller.rb (3428 => 3429)


--- branches/wf4ever/app/controllers/blog_posts_controller.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/controllers/blog_posts_controller.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,139 +0,0 @@
-# myExperiment: app/controllers/blog_posts_controller.rb
-#
-# Copyright (c) 2007 University of Manchester and the University of Southampton.
-# See license.txt for details.
-
-class BlogPostsController < ApplicationController
-  before_filter :login_required
-  
-  before_filter :find_blog_and_blog_posts, : [:index]
-  before_filter :find_blog_and_blog_post, : [:show, :edit, :update, :destroy]
-  before_filter :find_blog_auth, : [:new]
-  
-  # GET /blog_posts
-  def index
-    respond_to do |format|
-      format.html # index.rhtml
-    end
-  end
-
-  # GET /blog_posts/1
-  def show
-    respond_to do |format|
-      format.html # show.rhtml
-    end
-  end
-
-  # GET /blog_posts/new
-  def new
-    @blog_post = BlogPost.new(:blog => @blog)
-  end
-
-  # GET /blog_posts/1;edit
-  def edit
-
-  end
-
-  # POST /blog_posts
-  def create
-
-    return error('Creating new blog content is disabled', 'is disabled')
-    
-    @blog_post = BlogPost.new(params[:blog_post])
-
-    respond_to do |format|
-      if @blog_post.save
-        flash[:notice] = 'BlogPost was successfully created.'
-        format.html { redirect_to blog_url(@blog_post.blog) }
-      else
-        format.html { render :action ="" "new" }
-      end
-    end
-  end
-
-  # PUT /blog_posts/1
-  def update
-    respond_to do |format|
-      if @blog_post.update_attributes(params[:blog_post])
-        flash[:notice] = 'BlogPost was successfully updated.'
-        format.html { redirect_to blog_url(@blog_post.blog) }
-      else
-        format.html { render :action ="" "edit" }
-      end
-    end
-  end
-
-  # DELETE /blog_posts/1
-  def destroy
-    @blog_post.destroy
-
-    respond_to do |format|
-      format.html { redirect_to blog_url(@blog_post.blog) }
-    end
-  end
-  
-protected
-
-  def find_blog_auth
-
-    action_permissions = {
-      "create"  => "create",
-      "destroy" => "destroy",
-      "edit"    => "edit",
-      "index"   => "view",
-      "new"     => "create",
-      "show"    => "view",
-      "update"  => "edit"
-    }
-
-    begin
-      blog = Blog.find(params[:blog_id])
-      
-      if Authorization.check(action_permissions[action_name], blog, current_user)
-        @blog = blog
-      else
-        error("Blog not found (id not authorized)", "is invalid (not authorized)")
-      end
-    rescue ActiveRecord::RecordNotFound
-      error("Blog not found", "is invalid")
-    end
-  end
-  
-  def find_blog_posts
-    options = { :order => "created_at DESC" }
-    options = options.merge({ :conditions => ["blog_id = ?", @blog.id] }) if @blog
-    
-    @blog_posts = BlogPost.find(:all, options)
-  end
-  
-  def find_blog_post
-    begin
-      @blog_post = BlogPost.find(params[:id], :conditions => ["blog_id = ?", @blog.id])
-    rescue ActiveRecord::RecordNotFound
-      error("Blog Post not found", "is invalid")
-    end
-  end
-  
-  def find_blog_and_blog_posts
-    find_blog_auth
-    
-    find_blog_posts if @blog
-  end
-  
-  def find_blog_and_blog_post
-    find_blog_auth
-    
-    find_blog_post if @blog
-  end
-  
-private
-
-  def error(notice, message, attr=:id)
-    flash[:error] = notice
-    (err = BlogPost.new.errors).add(attr, message)
-    
-    respond_to do |format|
-      format.html { redirect_to blog_blog_posts_url(params[:blog_id]) }
-    end
-  end
-end

Deleted: branches/wf4ever/app/controllers/blogs_controller.rb (3428 => 3429)


--- branches/wf4ever/app/controllers/blogs_controller.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/controllers/blogs_controller.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,151 +0,0 @@
-# myExperiment: app/controllers/blogs_controller.rb
-#
-# Copyright (c) 2007 University of Manchester and the University of Southampton.
-# See license.txt for details.
-
-class BlogsController < ApplicationController
-  before_filter :login_required, :except => [:index, :show]
-  
-  before_filter :find_blogs, : [:index]
-  #before_filter :find_blog_auth, : [:show, :edit, :update, :destroy]
-  before_filter :find_blog_auth, :except => [:index, :new, :create, :update, :destroy]
-  
-  # GET /blogs
-  def index
-    respond_to do |format|
-      format.html # index.rhtml
-    end
-  end
-
-  # GET /blogs/1
-  def show
-    @viewing = Viewing.create(:contribution => @blog.contribution, :user => (logged_in? ? current_user : nil))
-    
-    @sharing_mode  = @blog.contribution.policy.share_mode
-    
-    respond_to do |format|
-      format.html # show.rhtml
-    end
-  end
-
-  # GET /blogs/new
-  def new
-    @blog = Blog.new
-
-    @sharing_mode  = 0
-  end
-
-  # GET /blogs/1;edit
-  def edit
-    @sharing_mode  = @blog.contribution.policy.share_mode
-  end
-
-  # POST /blogs
-  def create
-
-    return error('Creating new blog content is disabled', 'is disabled')
-
-    params[:blog][:contributor_type] = "User"
-    params[:blog][:contributor_id]   = current_user.id
-    
-    @blog = Blog.new(params[:blog])
-    
-    respond_to do |format|
-      if @blog.save
-
-        @blog.contribution.update_attributes(params[:contribution])
-
-        update_policy(@blog, params)
-        
-        flash[:notice] = 'Blog was successfully created.'
-        format.html { redirect_to blog_url(@blog) }
-      else
-        format.html { render :action ="" "new" }
-      end
-    end
-  end
-
-  # PUT /blogs/1
-  def update
-    
-    # remove protected columns
-    if params[:blog]
-      [:contributor_id, :contributor_type, :created_at, :updated_at].each do |column_name|
-        params[:blog].delete(column_name)
-      end
-    end
-    
-    respond_to do |format|
-      if @blog.update_attributes(params[:blog])
-        
-        # security fix (only allow the owner to change the policy)
-        @blog.contribution.update_attributes(params[:contribution]) if @blog.contribution.owner?(current_user)
-        
-        update_policy(@blog, params)
-
-        flash[:notice] = 'Blog was successfully updated.'
-        format.html { redirect_to blog_url(@blog) }
-      else
-        format.html { render :action ="" "edit" }
-      end
-    end
-  end
-
-  # DELETE /blogs/1
-  def destroy
-    @blog.destroy
-
-    respond_to do |format|
-      format.html { redirect_to blogs_url }
-    end
-  end
-  
-protected
-
-  def find_blogs
-    @blogs = Blog.find(:all, 
-                       :order => "title ASC, created_at DESC",
-                       :page => { :size => 20, 
-                                  :current => params[:page] })
-  end
-  
-  def find_blog_auth
-
-    action_permissions = {
-      "create"  => "create",
-      "destroy" => "destroy",
-      "edit"    => "edit",
-      "index"   => "view",
-      "new"     => "create",
-      "show"    => "view",
-      "update"  => "edit",
-    }
-
-    begin
-      blog = Blog.find(params[:id])
-      
-      if Authorization.check(action_permissions[action_name], blog, current_user)
-        @blog = blog
-      else
-        if logged_in? 
-          error("Blog not found (id not authorized)", "is invalid (not authorized)")
-        else
-          find_blog_auth if login_required
-        end
-      end
-    rescue ActiveRecord::RecordNotFound
-      error("Blog not found", "is invalid")
-    end
-  end
-  
-private
-
-  def error(notice, message, attr=:id)
-    flash[:error] = notice
-    (err = Blog.new.errors).add(attr, message)
-    
-    respond_to do |format|
-      format.html { redirect_to blogs_url }
-    end
-  end
-end

Modified: branches/wf4ever/app/controllers/content_types_controller.rb (3428 => 3429)


--- branches/wf4ever/app/controllers/content_types_controller.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/controllers/content_types_controller.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -12,8 +12,13 @@
 
     params[:num] = 25 unless params[:num]
 
-    @content_types = ContentType.find(:all, :order => 'title ASC',
-        :page => { :size => params[:num], :current => params[:page] })
+    if params[:mime_type]
+      @content_types = ContentType.find_all_by_mime_type(params[:mime_type], :order => 'title ASC',
+          :page => { :size => params[:num], :current => params[:page] })
+    else
+      @content_types = ContentType.find(:all, :order => 'title ASC',
+          :page => { :size => params[:num], :current => params[:page] })
+    end
   end
 
   # GET /content_types/1

Modified: branches/wf4ever/app/controllers/feedback_controller.rb (3428 => 3429)


--- branches/wf4ever/app/controllers/feedback_controller.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/controllers/feedback_controller.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,3 +1,5 @@
+require 'recaptcha'
+
 class FeedbackController < ApplicationController
   before_filter :only_index, :except => [:index, :create]
   

Copied: branches/wf4ever/app/controllers/group_policies_controller.rb (from rev 3428, trunk/app/controllers/group_policies_controller.rb) (0 => 3429)


--- branches/wf4ever/app/controllers/group_policies_controller.rb	                        (rev 0)
+++ branches/wf4ever/app/controllers/group_policies_controller.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,120 @@
+# myExperiment: app/controllers/group_policies_controller.rb
+#
+# Copyright (c) 2013 University of Manchester and the University of Southampton.
+# See license.txt for details.
+
+class GroupPoliciesController < ApplicationController
+
+  include ApplicationHelper
+  
+  before_filter :login_required
+  before_filter :find_group
+  before_filter :find_policy, : [:show, :edit, :update, :destroy]
+  before_filter :check_admin
+
+  def index
+    @policies = Policy.find_all_by_contributor_type_and_contributor_id('Network', @group.id)
+
+    respond_to do |format|
+      format.html
+    end
+  end
+
+  def show
+    respond_to do |format|
+      format.html { render :action ="" "edit" }
+    end
+  end
+
+  def new
+    @policy = Policy.new
+  end
+
+  def edit
+    
+  end
+
+  def create
+    @policy = Policy.new(:name => params[:name],
+                         :contributor => @group,
+                         :share_mode  => params[:share_mode],
+                         :update_mode => 6
+    )
+
+    respond_to do |format|
+      if @policy.save
+        process_permissions(@policy, params)
+        update_layout(@policy, params[:layout])
+        flash[:notice] = 'Policy was successfully created.'
+        format.html { redirect_to network_policies_path(@group) }
+      else
+        format.html { render :action ="" "new" }
+      end
+    end
+  end
+
+  def update
+    respond_to do |format|
+      if @policy.update_attributes(:name => params[:name], :share_mode => params[:share_mode])
+        process_permissions(@policy, params)
+        update_layout(@policy, params[:layout])
+        flash[:notice] = 'Policy was successfully updated'
+        format.html { redirect_to network_policies_path(@group) }
+      else
+        format.html { render :action ="" "edit" }
+      end
+    end
+  end
+
+  def destroy
+    if @policy.contributions.size == 0
+      @policy.destroy
+
+      respond_to do |format|
+        flash[:notice] = "Policy was successfully deleted"
+        format.html { redirect_to network_policies_path(@group) }
+      end
+    else
+      error("This policy is being used by address@hidden resources and may not be deleted.")
+    end
+  end
+  
+  
+  protected
+  
+  def find_group
+    begin
+      @group = Network.find(params[:network_id])
+    rescue ActiveRecord::RecordNotFound
+      error("Group couldn't be found")
+    end
+  end
+
+  def find_policy
+    begin
+      @policy = Policy.find(params[:id])
+    rescue ActiveRecord::RecordNotFound
+      error("Policy couldn't be found")
+    end
+  end
+
+  
+  def check_admin
+    unless @group.administrator?(current_user.id)
+      error("Only group administrators are allowed to manage policies")
+    end
+  end
+
+  private
+
+  def error(message)
+    flash[:error] = message
+    return_to_path = @group.nil? ? networks_path : network_policies_path(@group)
+    
+    respond_to do |format|
+      format.html { redirect_to return_to_path }
+    end
+  end
+
+  
+end

Modified: branches/wf4ever/app/controllers/networks_controller.rb (3428 => 3429)


--- branches/wf4ever/app/controllers/networks_controller.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/controllers/networks_controller.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -3,6 +3,8 @@
 # Copyright (c) 2007 University of Manchester and the University of Southampton.
 # See license.txt for details.
 
+require 'recaptcha'
+
 class NetworksController < ApplicationController
 
   include ApplicationHelper
@@ -402,6 +404,9 @@
 
   # POST /networks
   def create
+
+    params[:network][:user_id] = current_user.id
+
     @network = Network.new(params[:network])
 
     respond_to do |format|
@@ -421,6 +426,9 @@
 
   # PUT /networks/1
   def update
+
+    params[:network].delete(:user_id)
+
     respond_to do |format|
       if @network.update_attributes(params[:network])
         @network.refresh_tags(convert_tags_to_gem_format(params[:network][:tag_list]), current_user) if params[:network][:tag_list]
@@ -497,9 +505,12 @@
 
   def find_network_auth_owner
     begin
-      @network = Network.find(params[:id], :conditions => ["networks.user_id = ?", current_user.id], :include => [ :owner, :memberships ])
+      @network = Network.find(params[:id], :include => [ :owner, :memberships ])
+      unless @network.owner == current_user || current_user.admin?
+        error("Group not found (id not authorized)", "is invalid (not group administrator)")
+      end
     rescue ActiveRecord::RecordNotFound
-      error("Group not found (id not authorized)", "is invalid (not group adminsitrator)")
+      error("Group not found (id not authorized)", "is invalid (not group administrator)")
     end
   end
   

Modified: branches/wf4ever/app/controllers/oauth_controller.rb (3428 => 3429)


--- branches/wf4ever/app/controllers/oauth_controller.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/controllers/oauth_controller.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -110,6 +110,9 @@
       flash[:notice]="Client Application successfully registered!"
       redirect_to :action=""
     else
+      @permissions = TABLES['REST'][:data]
+      @address@hidden
+      @permissions_for=params[:key_permissions]
       render :action=""
     end
   end

Modified: branches/wf4ever/app/controllers/openid_controller.rb (3428 => 3429)


--- branches/wf4ever/app/controllers/openid_controller.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/controllers/openid_controller.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -72,7 +72,7 @@
   def consumer
     # create the OpenID store for storing associations and nonces,
     # putting it in your app's db directory
-    store_dir = Pathname.new(RAILS_ROOT).join('db').join('openid-store')
+    store_dir = Pathname.new(Rails.root).join('db').join('openid-store')
     store = OpenID::Store::Filesystem.new(store_dir)
 
     return OpenID::Consumer.new(session, store)

Modified: branches/wf4ever/app/controllers/packs_controller.rb (3428 => 3429)


--- branches/wf4ever/app/controllers/packs_controller.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/controllers/packs_controller.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -41,6 +41,13 @@
     respond_to do |format|
       format.html {
 
+        @query = params[:query]
+        @query_type = 'packs'
+        pivot_options = Conf.pivot_options.dup
+        unless @query.blank?
+          pivot_options["order"] = [{"order" => "id ASC", "option" => "relevance", "label" => "Relevance"}] + pivot_options["order"]
+        end
+
         @pivot, problem = calculate_pivot(
 
             :pivot_options  => Conf.pivot_options,
@@ -58,9 +65,6 @@
 
         flash.now[:error] = problem if problem
 
-        @query = params[:query]
-        @query_type = 'packs'
-
         # index.rhtml
       }
     end
@@ -357,9 +361,8 @@
 
         # update policy
         policy_err_msg = update_policy(@pack, params)
-        update_layout(@pack, params[:layout])
-        
         if policy_err_msg.blank?
+          update_layout(@pack, params[:layout]) unless params[:policy_type] == "group"
           flash[:notice] = 'Pack was successfully created.'
           format.html { redirect_to pack_url(@pack) }
         else
@@ -392,9 +395,8 @@
         
         @pack.refresh_tags(convert_tags_to_gem_format(params[:pack][:tag_list]), current_user) if params[:pack][:tag_list]
         policy_err_msg = update_policy(@pack, params)
-        update_layout(@pack, params[:layout])
-        
         if policy_err_msg.blank?
+          update_layout(@pack, params[:layout]) unless params[:policy_type] == "group"
           flash[:notice] = 'Pack was successfully updated.'
           format.html { redirect_to pack_url(@pack) }
         else
@@ -635,6 +637,24 @@
     end
   end
   
+  def snapshot
+
+    success = @pack.snapshot!
+
+    respond_to do |format|
+      format.html {
+        if success
+          @pack.reload
+          flash[:notice] = 'Pack snapshot was successfully created.'
+          redirect_to pack_version_path(@pack, @pack.versions.last.version)
+        else
+          flash[:error] = 'There was a problem with creating the snapshot.'
+          redirect_to pack_path(@pack)
+        end
+      }
+    end
+  end
+
   protected
   
   # Check that a protocol is specified in the URI; prepend HTTP:// otherwise
@@ -681,7 +701,8 @@
       "statistics"         => "view",
       "tag"                => "view",
       "update"             => "edit",
-      "update_item"        => "edit"
+      "update_item"        => "edit",
+      "snapshot"           => "edit"
     }
 
     pack = Pack.find(params[:id])
@@ -689,6 +710,8 @@
     if Authorization.check(action_permissions[action_name], pack, current_user)
       @pack = pack
       
+      @version = @pack.find_version(params[:version]) if params[:version]
+
       @authorised_to_edit = logged_in? && Authorization.check("edit", @pack, current_user)
       @authorised_to_download = Authorization.check("download", @pack, current_user)
       

Modified: branches/wf4ever/app/controllers/search_controller.rb (3428 => 3429)


--- branches/wf4ever/app/controllers/search_controller.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/controllers/search_controller.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -29,7 +29,11 @@
     end
 
     if @type == "all"
-      search_all
+      if shortcut = Conf.shortcut_keywords[params[:query].downcase]
+        redirect_to(shortcut)
+      else
+        search_all
+      end
     else
       case params[:type]
       when 'workflows'
@@ -185,10 +189,12 @@
   def search_all
 
     @query = params[:query]
+    pivot_options = Conf.pivot_options.dup
+    pivot_options["order"] = [{"order" => "id ASC", "option" => "relevance", "label" => "Relevance"}] + pivot_options["order"]
 
     @pivot, problem = calculate_pivot(
 
-        :pivot_options    => Conf.pivot_options,
+        :pivot_options    => pivot_options,
         :params           => params,
         :user             => current_user,
         :search_models    => [Workflow, Blob, Pack, User, Network, Service],

Modified: branches/wf4ever/app/controllers/sessions_controller.rb (3428 => 3429)


--- branches/wf4ever/app/controllers/sessions_controller.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/controllers/sessions_controller.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -178,7 +178,7 @@
   def consumer
     # create the OpenID store for storing associations and nonces,
     # putting it in your app's db directory
-    store_dir = Pathname.new(RAILS_ROOT).join('db').join('openid-store')
+    store_dir = Pathname.new(Rails.root).join('db').join('openid-store')
     store = OpenID::Store::Filesystem.new(store_dir)
 
     return OpenID::Consumer.new(session, store)

Modified: branches/wf4ever/app/controllers/users_controller.rb (3428 => 3429)


--- branches/wf4ever/app/controllers/users_controller.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/controllers/users_controller.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -4,10 +4,11 @@
 # See license.txt for details.
 
 require 'open-uri'
+require 'recaptcha'
 
 class UsersController < ApplicationController
 
-  contributable_actions = [:workflows, :files, :packs, :blogs]
+  contributable_actions = [:workflows, :files, :packs]
   show_actions = [:show, :news, :friends, :groups, :credits, :tags, :favourites] + contributable_actions
 
   before_filter :login_required, :except => [:index, :new, :create, :search, :all, :confirm_email, :forgot_password, :reset_password] + show_actions
@@ -90,11 +91,6 @@
     render :action ="" 'show'
   end
 
-  def blogs
-    @tab = "Blogs"
-    render :action ="" 'show'
-  end
-
   def credits
     @tab = "Credits"
     render :action ="" 'show'

Modified: branches/wf4ever/app/controllers/workflows_controller.rb (3428 => 3429)


--- branches/wf4ever/app/controllers/workflows_controller.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/controllers/workflows_controller.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -203,9 +203,16 @@
     respond_to do |format|
       format.html do
 
+        @query = params[:query]
+        @query_type = 'workflows'
+        pivot_options = Conf.pivot_options.dup
+        unless @query.blank?
+          pivot_options["order"] = [{"order" => "id ASC", "option" => "relevance", "label" => "Relevance"}] + pivot_options["order"]
+        end
+
         @pivot, problem = calculate_pivot(
 
-            :pivot_options  => Conf.pivot_options,
+            :pivot_options  => pivot_options,
             :params         => params,
             :user           => current_user,
             :search_models  => [Workflow],
@@ -220,9 +227,6 @@
 
         flash.now[:error] = problem if problem
 
-        @query = params[:query]
-        @query_type = 'workflows'
-
       end
       format.rss do
         address@hidden = Workflow.find(:all, :order => "updated_at DESC") # list all (if required)
@@ -361,12 +365,11 @@
         update_credits(@workflow, params)
         update_attributions(@workflow, params)
 
-        update_layout(@workflow, params[:layout])
-        
         # Refresh the types handler list of types if a new type was supplied this time.
         WorkflowTypesHandler.refresh_all_known_types! if params[:workflow][:type] == 'other'
 
         if policy_err_msg.blank?
+          update_layout(@workflow, params[:layout]) unless params[:policy_type] == "group"
         	flash[:notice] = 'Workflow was successfully created.'
           format.html {
             if (@workflow.get_tag_suggestions.length > 0 || (@workflow.body.nil? || @workflow.body == ''))
@@ -544,9 +547,8 @@
         update_credits(@workflow, params)
         update_attributions(@workflow, params)
 
-        update_layout(@workflow, params[:layout])
-
         if policy_err_msg.blank?
+          update_layout(@workflow, params[:layout]) unless params[:policy_type] == "group"
           flash[:notice] = 'Workflow was successfully updated.'
           format.html { redirect_to workflow_url(@workflow) }
         else

Modified: branches/wf4ever/app/helpers/application_helper.rb (3428 => 3429)


--- branches/wf4ever/app/helpers/application_helper.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/helpers/application_helper.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -230,25 +230,14 @@
     link_to("Request Friendship", new_user_friendship_url(:user_id => user_id))
   end
   
-  def versioned_workflow_link(workflow_id, version_number, long_description=true)
-    if workflow_id.kind_of? Fixnum
-      workflow = Workflow.find(:first, :conditions => ["id = ?", workflow_id])
-      return nil unless workflow
-    elsif workflow_id.kind_of? Workflow
-      workflow = workflow_id
+  def versioned_resource_link(resource, version_number, long_description=true)
+    ver = resource.find_version(version_number)
+    if ver
+      url = "" :version => version_number)
     else
       return nil
     end
     
-    if (ver = workflow.find_version(version_number))
-      url = "" => 'workflows',
-                    :action ="" 'show',
-                    :id => workflow.id,
-                    :version => version_number)
-    else
-      return nil
-    end
-    
     return nil unless url
     
     if long_description
@@ -386,14 +375,6 @@
       else
         return nil
       end
-    when "Blog"
-      if b = Blog.find(:first, :conditions => ["id = ?", contributableid])
-        name = h(b.title)
-        
-        return link ? link_to(name, blog_url(b)) : name
-      else
-        return nil
-      end
     when "Workflow"
       if w = Workflow.find(:first, :conditions => ["id = ?", contributableid])
         name = h(w.title)
@@ -703,8 +684,6 @@
       return "manhattan_studio/folder-closed_16.png"
     when "remote-resource"
       return "famfamfam_silk/page_world.png"
-    when "blog"
-      return "famfamfam_silk/note.png"
     when "workflow"
       return "redmond_studio/applications_16.png"
     when "policy"
@@ -780,7 +759,7 @@
     when "transfer_ownership"
       return "famfamfam_silk/key_go.png"
     when "content"
-      return "famfamfam_silk/application_side_list.png"  
+      return "famfamfam_silk/application_side_list.png"
     else
       return Conf.label_icons[method.to_s] if Conf.label_icons[method.to_s]
     end
@@ -1341,7 +1320,7 @@
     
     return rtn unless depth.to_i < 2
     
-    collections = [[contributor], contributor.contributions, contributor.workflows, contributor.blogs]
+    collections = [[contributor], contributor.contributions, contributor.workflows]
     recursions = []
     
     case contributor.class.to_s
@@ -1460,19 +1439,6 @@
         
         rtn << [item.created_at, "#{editor} created the #{link} #{item.contributable_type.downcase == "blob" ? "File" : item.contributable_type.downcase} for #{owner_string}."]
       end
-    when "Blog"
-      if restrict_contributor
-        return rtn unless (restrict_contributor.class.to_s == item.contributor_type.to_s and restrict_contributor.id.to_i == item.contributor_id.to_i)
-      end
-      
-      owner = contributor(item.contributor_id, item.contributor_type)
-    
-      item.posts.each do |blog_post|
-        next if before and blog_post.created_at > before
-        next if after and blog_post.created_at < after
-        
-        rtn << [blog_post.created_at, "#{owner} has created a new post on #{contributable(item.id, "Blog")}."]
-      end
     when "Workflow"
       item.versions.each do |workflow|
         next if workflow.version.to_i == 1
@@ -1485,7 +1451,7 @@
           next unless (workflow.contributor_type.to_s == restrict_contributor.class.to_s and workflow.contributor_id.to_i == restrict_contributor.id.to_i)
         end
         
-        rtn << [workflow.updated_at, "#{editor} edited the #{versioned_workflow_link(item.id, workflow.version, false)} Workflow."]
+        rtn << [workflow.updated_at, "#{editor} edited the #{versioned_resource_link(item, workflow.version, false)} Workflow."]
       end
     when "PictureSelection"
       return rtn if before and item.created_at > before
@@ -1596,16 +1562,16 @@
 
   #Selects layout for contributables/groups or uses site's default
   def configure_layout
-    contributable = (@workflow || @pack || @blog_post || @blob)
+    contributable = (@workflow || @pack || @blob)
     layout = nil
 
     if params["layout_preview"]
       layout = Conf.layouts[params["layout_preview"]]
-    elsif contributable && contributable.contribution
-      layout = Conf.layouts[contributable.contribution.layout]
+    elsif contributable && contributable.contribution && contributable.contribution.policy
+      layout = Conf.layouts[contributable.contribution.policy.layout]
       if layout.nil?
         logger.error("Missing layout for #{contributable.class.name} #{contributable.id}: "+
-                    "#{contributable.contribution.layout}")
+                    "#{contributable.contribution.policy.layout}")
       end
     elsif @network
       layout = @network.layout

Deleted: branches/wf4ever/app/helpers/blog_posts_helper.rb (3428 => 3429)


--- branches/wf4ever/app/helpers/blog_posts_helper.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/helpers/blog_posts_helper.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,7 +0,0 @@
-# myExperiment: app/helpers/blog_posts_helper.rb
-#
-# Copyright (c) 2007 University of Manchester and the University of Southampton.
-# See license.txt for details.
-
-module BlogPostsHelper
-end

Deleted: branches/wf4ever/app/helpers/blogs_helper.rb (3428 => 3429)


--- branches/wf4ever/app/helpers/blogs_helper.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/helpers/blogs_helper.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,7 +0,0 @@
-# myExperiment: app/helpers/blogs_helper.rb
-#
-# Copyright (c) 2007 University of Manchester and the University of Southampton.
-# See license.txt for details.
-
-module BlogsHelper
-end

Modified: branches/wf4ever/app/helpers/users_helper.rb (3428 => 3429)


--- branches/wf4ever/app/helpers/users_helper.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/helpers/users_helper.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -12,7 +12,6 @@
       when 'Blob'; url = ""
       when 'Workflow'; url = ""
       when 'Pack'; url = ""
-      when 'Blog'; url = ""
       else;        url = ""
     end
     

Modified: branches/wf4ever/app/models/blob.rb (3428 => 3429)


--- branches/wf4ever/app/models/blob.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/models/blob.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -32,8 +32,7 @@
 
     :mutable => [ :title, :body, :body_html ]
 
-  acts_as_solr(:fields => [:title, :local_name, :body, :kind, :contributor_name, :tag_list],
-               :boost => "rank",
+  acts_as_solr(:fields => [{:title => {:boost => 2.0}}, :local_name, :body, :kind, :contributor_name, :tag_list],
                :include => [ :comments ]) if Conf.solr_enable
 
   belongs_to :content_blob, :dependent => :destroy
@@ -44,6 +43,7 @@
   validates_presence_of :content_type
 
   validates_presence_of :title
+  validates_presence_of :local_name
 
   validates_each :content_blob do |record, attr, value|
     if value.data.size > Conf.max_upload_size

Deleted: branches/wf4ever/app/models/blog.rb (3428 => 3429)


--- branches/wf4ever/app/models/blog.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/models/blog.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,26 +0,0 @@
-# myExperiment: app/models/blog.rb
-#
-# Copyright (c) 2007 University of Manchester and the University of Southampton.
-# See license.txt for details.
-
-require 'acts_as_site_entity'
-require 'acts_as_contributable'
-
-class Blog < ActiveRecord::Base
-
-  acts_as_site_entity
-
-  acts_as_contributable
-  
-  acts_as_bookmarkable
-  acts_as_commentable
-  acts_as_rateable
-  acts_as_taggable
-
-  has_many :posts,
-           :class_name => "BlogPost",
-           :order => "blog_posts.created_at DESC",
-           :dependent => :destroy
-           
-  validates_presence_of :title
-end

Deleted: branches/wf4ever/app/models/blog_post.rb (3428 => 3429)


--- branches/wf4ever/app/models/blog_post.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/models/blog_post.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,12 +0,0 @@
-# myExperiment: app/models/blog_post.rb
-#
-# Copyright (c) 2007 University of Manchester and the University of Southampton.
-# See license.txt for details.
-
-class BlogPost < ActiveRecord::Base
-  belongs_to :blog
-  
-  format_attribute :body
-
-  validates_presence_of :title, :body
-end

Modified: branches/wf4ever/app/models/federation_source.rb (3428 => 3429)


--- branches/wf4ever/app/models/federation_source.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/models/federation_source.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -9,6 +9,5 @@
 class FederationSource < ActiveRecord::Base
   acts_as_site_entity
   acts_as_contributor
-  acts_as_structured_data
 end
 

Modified: branches/wf4ever/app/models/mailer.rb (3428 => 3429)


--- branches/wf4ever/app/models/mailer.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/models/mailer.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -2,10 +2,10 @@
 
   helper :application
 
-  def feedback(name, subject, content)
+  def feedback(name, subj, content)
     recipients Conf.feedback_email_address
     from Conf.notifications_email_address
-    subject "#{Conf.sitename} feedback from #{name}"
+    subject "#{Conf.sitename} feedback from #{name}: #{subj}"
     
     body :name => name, 
          :subject => subject, 

Modified: branches/wf4ever/app/models/network.rb (3428 => 3429)


--- branches/wf4ever/app/models/network.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/models/network.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -17,10 +17,10 @@
   acts_as_taggable
   
   has_many :blobs, :as => :contributor
-  has_many :blogs, :as => :contributor
   has_many :workflows, :as => :contributor
+  has_many :policies, :as => :contributor
   
-  acts_as_solr(:fields => [ :title, :unique_name, :owner_name, :description, :tag_list ],
+  acts_as_solr(:fields => [ {:title => {:boost => 2.0}}, :unique_name, :owner_name, :description, :tag_list ],
                :include => [ :comments ]) if Conf.solr_enable
 
   format_attribute :description

Modified: branches/wf4ever/app/models/pack.rb (3428 => 3429)


--- branches/wf4ever/app/models/pack.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/models/pack.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -130,23 +130,33 @@
 
   has_many :relationships, :dependent => :destroy, :as => :context
 
+  has_many :versions, :class_name => "PackVersion"
+
+  def find_version(version)
+    match = versions.find(:first, :conditions => ["version = ?", version])
+    return match if match
+
+    raise ActiveRecord::RecordNotFound.new("Couldn't find Pack with pack_id=#{id} and version=#{version}")
+  end
+
   validates_presence_of :title
   
   format_attribute :description
   
-  acts_as_solr(:fields => [ :title, :description, :contributor_name, :tag_list ],
-               :boost => "rank",
+  acts_as_solr(:fields => [ {:title => {:boost => 2.0}}, :description, :contributor_name, :tag_list ],
                :include => [ :comments ]) if Conf.solr_enable
   
 # has_many :contributable_entries,
 #          :class_name => "PackContributableEntry",
 #          :foreign_key => :pack_id,
+#          :conditions => "version IS NULL",
 #          :order => "created_at DESC",
 #          :dependent => :destroy
   
   has_many :remote_entries,
            :class_name => "PackRemoteEntry",
            :foreign_key => :pack_id,
+           :conditions => "version IS NULL",
            :order => "created_at DESC",
            :dependent => :destroy
   
@@ -155,7 +165,7 @@
   end
 
   def items_count
-    return contributable_entries.count + remote_entries.count
+    contributable_entries.count + remote_entries.count
   end
   
   # returns packs that have largest total number of items
@@ -741,6 +751,58 @@
     APIStatistics.statistics(self)
   end
  
+  def snapshot!
+  
+    self.current_version = self.current_version ? self.current_version + 1 : 1
+
+    inhibit_timestamps do
+ 
+      version = versions.build(
+          :version          => current_version,
+          :contributor      => contributor,
+          :title            => title,
+          :description      => description,
+          :description_html => description_html)
+
+      contributable_entries.each do |entry|
+
+        version.contributable_entries.build(
+            :pack => self,
+            :contributable_id => entry.contributable_id,
+            :contributable_type => entry.contributable_type,
+            :contributable_version => entry.contributable_version,
+            :comment => entry.comment,
+            :user_id => entry.user_id,
+            :version => current_version,
+            :created_at => entry.created_at,
+            :updated_at => entry.updated_at)
+      end
+
+      remote_entries.each do |entry|
+
+        tt = version.remote_entries.build(
+            :pack => self,
+            :title => entry.title,
+            :uri => entry.uri,
+            :alternate_uri => entry.alternate_uri,
+            :comment => entry.comment,
+            :user_id => entry.user_id,
+            :version => current_version,
+            :created_at => entry.created_at,
+            :updated_at => entry.updated_at)
+      end
+    end
+    
+    save
+  end
+
+  def describe_version(version_number)
+    return "" if versions.count < 2
+    return "(earliest)" if version_number == versions.first.version
+    return "(latest)" if version_number == versions.last.version
+    return ""
+  end
+
   def resolve_resource_uri(resource_uri)
     RDF::URI.parse(ro_uri).join(RDF::URI.parse(resource_uri))
   end

Modified: branches/wf4ever/app/models/pack_contributable_entry.rb (3428 => 3429)


--- branches/wf4ever/app/models/pack_contributable_entry.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/models/pack_contributable_entry.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -21,12 +21,26 @@
   after_destroy :touch_pack
 
   def check_unique
-    if self.contributable_version.blank?
-      i = PackContributableEntry.find(:first, :conditions => ["pack_id = ? AND contributable_type = ? AND contributable_id = ? AND contributable_version IS NULL", self.pack_id, self.contributable_type, self.contributable_id]) 
+
+    conditions = ["pack_id = ?", "version = ?", "contributable_type = ?", "contributable_id = ?"]
+    arguments = [self.pack_id, self.version, self.contributable_type, self.contributable_id]
+    
+    if self.contributable_version.nil?
+      conditions << "contributable_version IS NULL"
     else
-      i = PackContributableEntry.find(:first, :conditions => ["pack_id = ? AND contributable_type = ? AND contributable_id = ? AND contributable_version = ?", self.pack_id, self.contributable_type, self.contributable_id, self.contributable_version])
+      conditions << "contributable_version = ?"
+      arguments << self.contributable_version
     end
-    
+
+    if self.version.nil?
+      conditions << "version IS NULL"
+    else
+      conditions << "version = ?"
+      arguments << self.version
+    end
+
+    i = PackContributableEntry.find(:first, :conditions => [conditions.join(" AND ")] + arguments) 
+ 
     if i
       errors.add_to_base("This item already exists in the pack")
       return false

Modified: branches/wf4ever/app/models/pack_remote_entry.rb (3428 => 3429)


--- branches/wf4ever/app/models/pack_remote_entry.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/models/pack_remote_entry.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -19,7 +19,7 @@
   after_destroy :touch_pack
 
   def check_unique
-    if PackRemoteEntry.find(:first, :conditions => ["pack_id = ? AND uri = ?", self.pack_id, self.uri])
+    if PackRemoteEntry.find(:first, :conditions => ["pack_id = ? AND version = ? AND uri = ?", self.pack_id, self.version, self.uri])
       errors.add_to_base("This external link already exists in the pack")
       return false
     else

Copied: branches/wf4ever/app/models/pack_version.rb (from rev 3428, trunk/app/models/pack_version.rb) (0 => 3429)


--- branches/wf4ever/app/models/pack_version.rb	                        (rev 0)
+++ branches/wf4ever/app/models/pack_version.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,50 @@
+# myExperiment: app/models/pack_version.rb
+#
+# Copyright (c) 2012 University of Manchester and the University of Southampton.
+# See license.txt for details.
+
+class PackVersion < ActiveRecord::Base
+
+  validates_presence_of :title
+
+  belongs_to :pack
+  belongs_to :contributor, :polymorphic => true
+
+  format_attribute :description
+
+  has_many :contributable_entries,
+           :class_name => "PackContributableEntry",
+           :dependent => :destroy,
+           :finder_sql =>
+              'SELECT *
+               FROM pack_contributable_entries
+               WHERE pack_id = #{pack_id} AND version = #{version}
+               ORDER BY created_at DESC'
+  
+  has_many :remote_entries,
+           :class_name => "PackRemoteEntry",
+           :dependent => :destroy,
+           :finder_sql =>
+              'SELECT *
+               FROM pack_remote_entries
+               WHERE pack_id = #{pack_id} AND version = #{version}
+               ORDER BY created_at DESC'
+
+  def items_count
+    contributable_entries.count + remote_entries.count
+  end
+  
+  def versioned_resource
+    pack
+  end
+
+  def items_count
+    return contributable_entries.count + remote_entries.count
+  end
+
+  def contributables
+    contributable_entries.map do |e| e.contributable end
+  end
+  
+end
+

Modified: branches/wf4ever/app/models/policy.rb (3428 => 3429)


--- branches/wf4ever/app/models/policy.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/models/policy.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -61,4 +61,8 @@
       end
     end
   end
+
+  def group_policy?
+    contributor_type == "Network"
+  end
 end

Copied: branches/wf4ever/app/models/semantic_annotation.rb (from rev 3428, trunk/app/models/semantic_annotation.rb) (0 => 3429)


--- branches/wf4ever/app/models/semantic_annotation.rb	                        (rev 0)
+++ branches/wf4ever/app/models/semantic_annotation.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,3 @@
+class SemanticAnnotation < ActiveRecord::Base
+  belongs_to :subject, :polymorphic => true
+end

Modified: branches/wf4ever/app/models/taverna_enactor.rb (3428 => 3429)


--- branches/wf4ever/app/models/taverna_enactor.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/models/taverna_enactor.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -7,6 +7,7 @@
 require 'enactor/client'
 require 'document/data'
 require 'document/report'
+require 'encrypted_attributes'
 
 class TavernaEnactor < ActiveRecord::Base
   
@@ -16,11 +17,11 @@
   validates_presence_of :contributor
   
   validates_presence_of :username
-  validates_presence_of :crypted_password
+  validates_presence_of :password
   validates_presence_of :url
   validates_presence_of :title
   
-  encrypts :password, :mode => :symmetric, :key => Conf.sym_encryption_key
+  encrypts :password, :mode => :symmetric, :password => Conf.sym_encryption_key
   
   def label
     title
@@ -172,6 +173,6 @@
   
   # Lazy loading of enactor service client.
   def service_client
-    @client ||= Enactor::Client.new(self.url, self.username, self.crypted_password.decrypt)
+    @client ||= Enactor::Client.new(self.url, self.username, self.password.decrypt)
   end
 end

Modified: branches/wf4ever/app/models/user.rb (3428 => 3429)


--- branches/wf4ever/app/models/user.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/models/user.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -288,13 +288,12 @@
   acts_as_contributor
   
   has_many :blobs, :as => :contributor, :dependent => :destroy
-  has_many :blogs, :as => :contributor, :dependent => :destroy
   has_many :workflows, :as => :contributor, :dependent => :destroy
   has_many :packs, :as => :contributor, :dependent => :destroy
   
   acts_as_creditor
 
-  acts_as_solr(:fields => [ :name, :tag_list ], :include => [ :profile ], :if => "activated_at") if Conf.solr_enable
+  acts_as_solr(:fields => [ {:name => {:boost => 2.0}}, :tag_list ], :include => [ :profile ], :if => "activated_at") if Conf.solr_enable
 
   validates_presence_of :name
   

Modified: branches/wf4ever/app/models/workflow.rb (3428 => 3429)


--- branches/wf4ever/app/models/workflow.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/models/workflow.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -29,6 +29,8 @@
   belongs_to :license
 
   has_many :workflow_processors, :dependent => :destroy
+  has_many :workflow_ports, :dependent => :destroy
+  has_many :semantic_annotations, :as => :subject, :dependent => :destroy
 
   before_validation :check_unique_name
   before_validation :apply_extracted_metadata
@@ -49,8 +51,6 @@
   
   acts_as_reviewable
 
-  acts_as_structured_data
-
   has_previews
 
   has_versions :workflow_versions,
@@ -62,8 +62,7 @@
     :mutable => [ :contributor, :title, :unique_name, :body, :body_html,
                   :file_ext, :last_edited_by, :content_type_id, :image, :svg ]
 
-  acts_as_solr(:fields => [ :title, :body, :filename, :tag_list, :contributor_name, :kind, :get_all_search_terms ],
-               :boost => "rank",
+  acts_as_solr(:fields => [{:title => {:boost => 2.0}}, :body, :filename, :tag_list, :contributor_name, :kind, :get_all_search_terms ],
                :include => [ :comments ]) if Conf.solr_enable
 
   acts_as_runnable
@@ -321,6 +320,7 @@
   def delete_metadata
     if processor_class
       WorkflowProcessor.destroy_all(["workflow_id = ?", id])
+      WorkflowPort.destroy_all(["workflow_id = ?", id])
     end
   end
 
@@ -328,7 +328,7 @@
     if processor_class
       delete_metadata
       begin
-        processor_class.new(content_blob.data).extract_metadata(id)
+        processor_class.new(content_blob.data).extract_metadata(self)
       rescue
       end
     end

Copied: branches/wf4ever/app/models/workflow_port.rb (from rev 3428, trunk/app/models/workflow_port.rb) (0 => 3429)


--- branches/wf4ever/app/models/workflow_port.rb	                        (rev 0)
+++ branches/wf4ever/app/models/workflow_port.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,5 @@
+class WorkflowPort < ActiveRecord::Base
+  validates_inclusion_of :port_type, :in => ["input", "output"]
+  belongs_to :workflow
+  has_many :semantic_annotations, :as => :subject, :dependent => :destroy
+end

Modified: branches/wf4ever/app/models/workflow_processor.rb (3428 => 3429)


--- branches/wf4ever/app/models/workflow_processor.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/models/workflow_processor.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -5,5 +5,6 @@
 
 class WorkflowProcessor < ActiveRecord::Base
   belongs_to :workflow
+  has_many :semantic_annotations, :as => :subject, :dependent => :destroy
 end
 

Modified: branches/wf4ever/app/views/announcements/_form.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/announcements/_form.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/announcements/_form.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,4 +1,4 @@
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 
 <%= error_messages_for 'announcement' %>
 
@@ -7,6 +7,6 @@
 <%= form.text_field :title, :size => 70 %></p>
 
 <p><label for=""
-<%= fckeditor_textarea(:announcement, :body, :toolbarSet => 'Simple', :width => '700px', :height => '500px') %></p>
+<%= form.text_area(:body, :width => '700px', :height => '500px', :class => 'ckeditor') -%>
 <!--[eoform:announcement]-->
 

Modified: branches/wf4ever/app/views/blobs/_table.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/blobs/_table.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/blobs/_table.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,107 +1,112 @@
 <% query ||= false -%>
-<% odd_row = false -%>
-<% unless collection.empty? %>
 
-<table class="alt_table">
-	<% for blob in collection %>
-		<% # If only one item in collection, check if 'show' permission is available (eg: if this partial was called from contributions/table) -%>
-		<% if collection.size == 1 -%>
-			<% show ||= Authorization.check('view', blob, current_user) -%>
-		<% else -%>
-			<% show = Authorization.check('view', blob, current_user) -%>
-		<% end -%>
-	  <% if show -%>
-			<tr class="<%= (odd_row = !odd_row) ? "odd_row" : "even_row" %>">
-				<% cache(:controller => 'files_cache', :action ="" 'listing', :id => blob.id) do -%>
-					<td style="width: 100px;">
-						<p style="margin-top:0; padding-top:0; text-align: center;"><b>Uploader:</b></p>
-						<center><%= contributor(blob.contribution.contributor_id, blob.contribution.contributor_type, true, 60) %></center>
-					</td>
-					<td style="text-align: left;">
-						<a name="<%= blob.local_name.gsub(/ /, "_") %>"></a>
-						<p class="title">
-							<%= icon "blob", nil, nil, nil, '' %>
-							<% title = contributable_name(blob.id, 'Blob') %>
-							<%=link_to(query ? highlight_all(title, query) : title, blob_path(blob)) %>
-						</p>
-						
-						<p style="font-size: 85%; margin-top: 0; padding-top: 0;">
-							<b>Created:</b> <%=datetime blob.contribution.created_at, false %>
-							<% unless blob.contribution.created_at == blob.contribution.updated_at %>
-								|	<b>Last updated:</b> <%=datetime blob.contribution.updated_at, false %>
-							<% end %>
-						</p>
-						
-						<% unless (creditors = blob.creditors).empty? %>
-							<p style="font-size:85%;">
-							<b>Credits:</b>
-							<% creditors.each do |c| %>
-								<% if c.creditor_type == 'User' %>
-									<%= icon('user', nil, nil, nil, '') %> 
-								<% elsif c.creditor_type == 'Network' %>
-									<%= icon('network-member', nil, nil, nil, '') %>
-								<% end %>
-								<%= contributor(c.creditor_id, c.creditor_type) %>
-							<% end %>
-							</p>
-						<% end %>
-						<% unless (attributors = blob.attributors).empty? %>
-							<p style="font-size:85%;">
-							<b>Attributions:</b>
-							<% attributors.each do |a| %>
-								<% if Authorization.check("view", a.attributor, current_user) -%>
-									<% if a.attributor_type == 'Workflow' %>
-										<%= icon('workflow', nil, nil, nil, '') %> 
-									<% elsif a.attributor_type == 'Blob' %>
-										<%= icon('blob', nil, nil, nil, '') %>
-									<% end %>
-									<%= contributable(a.attributor_id, a.attributor_type) %>
-								<% end -%>
-							<% end %>
-							</p>
-						<% end %>
-						
-            <% if blob.license_id.nil? %>
-              <p style="font-size:85%;"><b>License: </b>No license</p>
-            <% else %>
-              <p style="font-size:85%;"><b>License: </b><% @license = License.find(blob.license_id) %><%= link_to h(@license.title), license_path(@license) %></p>
+<% collection.each do |blob| %>
+  <% # If only one item in collection, check if 'show' permission is available (eg: if this partial was called from contributions/table) -%>
+  <% if collection.size == 1 -%>
+    <% show ||= Authorization.check('view', blob, current_user) -%>
+  <% else -%>
+    <% show = Authorization.check('view', blob, current_user) -%>
+  <% end -%>
+  <% if show -%>
+
+    <div class="resource_list_item <%= blob.contribution.policy.layout -%>">
+
+      <div class="avatar_panel">
+        <span class="owner"><%= owner_text blob -%></span>
+        <%= contributor(blob.contribution.contributor_id, blob.contribution.contributor_type, true, 60) %>
+        <% if layout = blob.contribution.policy.layout %>
+          <% begin %>
+            <%= render :partial => "skins/branding/#{layout}" %>
+          <% rescue ActionView::MissingTemplate %>
+          <% end %>
+        <% end %>
+      </div>
+
+      <div class="main_panel">
+
+        <div class="actions">
+          <%= icon "show", blob_path(blob), nil, nil, "View" %>
+          <% if Authorization.check("download", blob, current_user) %><%= icon "download", download_blob_path(blob) %><% end %>
+          <% if mine?(blob) %><%= icon "manage", edit_blob_path(blob), nil, nil, "Manage" %><% end %>
+        </div>
+
+        <% cache(:controller => 'files_cache', :action ="" 'listing', :id => blob.id) do -%>
+          <a name="<%= blob.local_name.gsub(/ /, "_") %>"></a>
+          <p class="title">
+            <%= icon "blob", nil, nil, nil, '' %>
+            <% truncated_title = truncate(blob.title, :length => 55) %>
+            <%=link_to(query ? highlight_all(truncated_title, query) : truncated_title, blob_path(blob),
+                       :title => blob.title) %>
+          </p>
+
+          <p>
+            <b>Created:</b> <%=datetime blob.contribution.created_at, false %>
+            <% unless blob.contribution.created_at == blob.contribution.updated_at %>
+              |	<b>Last updated:</b> <%=datetime blob.contribution.updated_at, false %>
             <% end %>
-						
-						<div class="desc" style="font-size: 85%;">
-							<% if blob.body and blob.body.length > 0 %>
-					  		<% desc = truncate(strip_html(blob.body), :length => 500) %>
-					    	<%= query ? highlight_all(desc, query) : desc %>
-						  <% else -%>
-								<span class="none_text">No description</span>	
-							<% end %>
-						</div>
-						
-						<p style="font-size:85%;"><b>File type: </b><%= h blob.content_type.title %></p>
-						
-						<p style="font-size: 85%;">
-							<a href="" blob_path(blob) + '#ratings' -%>"><b>Rating: </b><%= number_with_precision(blob.rating, :precision => 1) %> / 5 (<%= pluralize blob.ratings.count, 'rating' %>)</a> |
-							<a href="" blob_path(blob) + '#comments' -%>"><b>Comments: </b><%= blob.comments.count %></a> |
-							<b>Viewed:</b> <%=pluralize blob.contribution.site_viewings_count, "time" %> |
-				      <b>Downloaded:</b> <%=pluralize blob.contribution.site_downloads_count, "time" %>
-						</p>
-						
-						<% unless (tags = blob.tags).empty? %>
-							<a href="" blob_path(blob) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags:</b></p></a>
-							<div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
-						<% else %>
-							<p style="font-size: 85%;"><i>This File has no tags!</i></p>
-						<% end %>	
-					</td>
-				<% end %>
-					
-					<td class="actions" style="width: 80px;">
-				    <%= icon "show", blob_path(blob), nil, nil, "View" %>
-					  <% if Authorization.check("download", blob, current_user) %><%= icon "download", download_blob_path(blob) %><% end %>
-				    <% if mine?(blob) %><%= icon "manage", edit_blob_path(blob), nil, nil, "Manage" %><% end %>
-				  </td>
-			</tr>
-		<% end %>
-	<% end %>
-</table>
+          </p>
 
+          <% unless (creditors = blob.creditors).empty? %>
+            <p>
+              <b>Credits:</b>
+              <% creditors.each do |c| %>
+                <% if c.creditor_type == 'User' %>
+                  <%= icon('user', nil, nil, nil, '') %>
+                <% elsif c.creditor_type == 'Network' %>
+                  <%= icon('network-member', nil, nil, nil, '') %>
+                <% end %>
+                <%= contributor(c.creditor_id, c.creditor_type) %>
+              <% end %>
+            </p>
+          <% end %>
+          <% unless (attributors = blob.attributors).empty? %>
+            <p>
+              <b>Attributions:</b>
+              <% attributors.each do |a| %>
+                <% if Authorization.check("view", a.attributor, current_user) -%>
+                  <% if a.attributor_type == 'Workflow' %>
+                    <%= icon('workflow', nil, nil, nil, '') %>
+                  <% elsif a.attributor_type == 'Blob' %>
+                    <%= icon('blob', nil, nil, nil, '') %>
+                  <% end %>
+                  <%= contributable(a.attributor_id, a.attributor_type) %>
+                <% end -%>
+              <% end %>
+            </p>
+          <% end %>
+
+          <% if blob.license_id.nil? %>
+            <p><b>License: </b>No license</p>
+          <% else %>
+            <p><b>License: </b><% @license = License.find(blob.license_id) %><%= link_to h(@license.title), license_path(@license) %></p>
+          <% end %>
+
+          <div class="desc">
+            <% if blob.body and blob.body.length > 0 %>
+              <% desc = truncate(strip_html(blob.body), :length => 500) %>
+              <%= query ? highlight_all(desc, query) : desc %>
+            <% else -%>
+              <span class="none_text">No description</span>
+            <% end %>
+          </div>
+
+          <p><b>File type: </b><%= h blob.content_type.title %></p>
+
+          <p>
+            <a href="" blob_path(blob) + '#ratings' -%>"><b>Rating: </b><%= number_with_precision(blob.rating, :precision => 1) %> / 5 (<%= pluralize blob.ratings.count, 'rating' %>)</a> |
+            <a href="" blob_path(blob) + '#comments' -%>"><b>Comments: </b><%= blob.comments.count %></a> |
+            <b>Viewed:</b> <%=pluralize blob.contribution.site_viewings_count, "time" %> |
+            <b>Downloaded:</b> <%=pluralize blob.contribution.site_downloads_count, "time" %>
+          </p>
+
+          <% unless (tags = blob.tags).empty? %>
+            <a href="" blob_path(blob) + '#tags' -%>"><p><b>Tags:</b></p></a>
+            <div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
+          <% else %>
+            <p><i>This File has no tags!</i></p>
+          <% end %>
+        <% end %>
+      </div>
+    </div>
+  <% end %>
 <% end %>

Modified: branches/wf4ever/app/views/blobs/edit.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/blobs/edit.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/blobs/edit.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,6 +1,6 @@
 <% t "Manage" -%>
 
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 <%= _javascript__include_tag "osp.js" %>
 
 <h1>Manage File: <%= contributable_name(@blob.id, 'Blob') %></h1>
@@ -31,7 +31,7 @@
   	<strong>Description: </strong>
 	</p>
 	<center>
-		<%= fckeditor_textarea(:blob, :body, :toolbarSet => 'Simple', :width => '600px', :height => '300px') %>
+		<%= f.text_area(:body, :width => '600px', :height => '300px', :class => 'ckeditor') %>
 	</center>
   
   <br/>

Modified: branches/wf4ever/app/views/blobs/new.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/blobs/new.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/blobs/new.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,6 +1,6 @@
 <% t "New" -%>
 
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 <%= _javascript__include_tag "osp.js" %>
 
 <h1>Upload File</h1>
@@ -28,7 +28,7 @@
   	<strong>Description: </strong>
 	</p>
 	<center>
-		<%= fckeditor_textarea(:blob, :body, :toolbarSet => 'Simple', :width => '600px', :height => '300px') %>
+		<%= text_area_tag('blob[body]', nil, :width => '600px', :height => '300px', :class => 'ckeditor') %>
 	</center>
 
   <br />

Modified: branches/wf4ever/app/views/blobs/suggestions.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/blobs/suggestions.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/blobs/suggestions.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,6 +1,6 @@
 <% t "#{contributable_name(@version.id, 'Blob')} (#{h @blob.contributor_name})" -%>
 
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 
 <h1>Suggestions</h1>
 
@@ -15,15 +15,7 @@
     its purpose.</em></p>
 
     <p>
-      <textarea id='description_editor' name='description'></textarea>
-      <script type="text/_javascript_">
-      //<![CDATA[
-      var oFCKeditor = new FCKeditor('description_editor', '600px', '300px', 'Simple');
-      oFCKeditor.BasePath = "/_javascript_s/fckeditor/"
-      oFCKeditor.Config['CustomConfigurationsPath'] = '/_javascript_s/fckcustom.js';
-      oFCKeditor.ReplaceTextarea();
-      //]]>
-      </script>
+      <%= text_area_tag(:description, nil, :width => '600px', :height => '300px', :class => 'ckeditor') -%>
     </p>
 
   <% end %>
@@ -37,15 +29,7 @@
     version.</p>
 
     <p>
-      <textarea id='revision_comments_editor' name='revision_comments'></textarea>
-      <script type="text/_javascript_">
-      //<![CDATA[
-      var oFCKeditor = new FCKeditor('revision_comments_editor', '600px', '300px', 'Simple');
-      oFCKeditor.BasePath = "/_javascript_s/fckeditor/"
-      oFCKeditor.Config['CustomConfigurationsPath'] = '/_javascript_s/fckcustom.js';
-      oFCKeditor.ReplaceTextarea();
-      //]]>
-      </script>
+      <%= text_area_tag(:revision_comments, nil, :width => '600px', :height => '200px', :class => 'ckeditor') -%>
     </p>
 
   <% end %>

Modified: branches/wf4ever/app/views/comments/_comments.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/comments/_comments.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/comments/_comments.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,4 +1,4 @@
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 
 <h2>
 	<%= icon "comments", nil, nil, { :style => "vertical-align: middle;" }, "" -%>
@@ -41,13 +41,13 @@
 			<% # Hack for FCKEditor: -%>
 			<% @comment = Comment.new; @comment.id = 0 -%>
 			
-			<% form_remote_tag(:url ="" rest_resource_uri(commentable) + "/comments",
-								 :before => fckeditor_before_js("comment", "comment"),
+			<% form_remote_tag(:url ="" polymorphic_path(commentable) + "/comments",
+								 :before => 'for (instance in CKEDITOR.instances) { CKEDITOR.instances[instance].updateElement() }',
 							   :update => 'commentsBox', 
 							   :loading => "Element.show('addcomment_indicator')",
-	               :complete => "Element.hide('addcomment_indicator'); new Effect.Highlight('comments', { duration: 1.5 }); $('comment').value = '';") do %>
+	               :complete => "Element.hide('addcomment_indicator'); new Effect.Highlight('comments', { duration: 1.5 }); $('comment').value = ''; CKEDITOR.replace('comment_comment')") do %>
 				
-				<%= fckeditor_textarea("comment", "comment", :ajax => true, :toolbarSet => 'Basic', :width => '99%', :height => '200px') %>
+				<%= text_area_tag("comment[comment]", nil, :width => '99%', :height => '200px', :class => 'ckeditor') %>
 				<% if false %><textarea id="comment" name="comment" rows="10" style="width: 99%;"></textarea><% end %>
 				<br/>
 				<%= submit_tag "Submit Comment" %>

Modified: branches/wf4ever/app/views/content_types/edit.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/content_types/edit.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/content_types/edit.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,6 +1,6 @@
 <% t "Manage" -%>
 
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 
 
 <h1>Manage Content Type: <%= h @content_type.title %></h1>
@@ -21,7 +21,7 @@
   	<strong>Description: </strong>
 	</p>
 	<center>
-		<%= fckeditor_textarea(:content_type, :description, :toolbarSet => 'Simple', :width => '600px', :height => '300px') %>
+    <%= f.text_area(:description, :width => '600px', :height => '300px', :class => 'ckeditor') -%>
 	</center>
   
   <br/>

Modified: branches/wf4ever/app/views/contributions/_sharing_form.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/contributions/_sharing_form.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/contributions/_sharing_form.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -6,6 +6,10 @@
 
 <% perms = [] %>
 <% perms = contributable.contribution.policy.permissions if edit %>
+<% applicable_networks = (current_user.networks + current_user.networks_owned) %>
+<% group_policies = applicable_networks.map {|n| n.policies}.flatten %>
+<% using_group_policy = edit && contributable.contribution.policy.group_policy? %>
+<% group_policies = group_policies | [contributable.contribution.policy] if using_group_policy %>
 
 <div class="fold">
 
@@ -22,29 +26,76 @@
   </div>
 
   <div class="foldContent" style="display: none;">
-
     <div class="box_infotext">
-    	<p>
-    		Here you can specify who can <b>view</b> and <b>download</b> this <%= c_type %> on <%= Conf.sitename %>.
-			</p>
-			
-			<% if update_perms -%>
-				<p>
-					You can also set <b>update</b> permissions for this <%= c_type %>.
-					<%= link_to_function "Click here" + expand_image, visual_effect(:toggle_blind, "update_perms_info", :duration => 0.3) %> for more information.
-				</p>
-				<div id="update_perms_info" class="box_simple" style="display: none; margin: 0.5em 0;">
-					<%= update_perms_info_text(contributable) -%>
-				</div>
-			<% end -%>
-			
-			<p>
-				You can also explicitly share this <%= c_type %> with your Groups.
-			</p>  
-		</div>
+      <p>
+        Here you can specify who can <b>view</b> and <b>download</b> this <%= c_type %> on <%= Conf.sitename %>.
+      </p>
 
+      <% if update_perms -%>
+        <p>
+          You can also set <b>update</b> permissions for this <%= c_type %>.
+          <%= link_to_function "Click here" + expand_image, visual_effect(:toggle_blind, "update_perms_info", :duration => 0.3) %> for more information.
+        </p>
+        <div id="update_perms_info" class="box_simple" style="display: none; margin: 0.5em 0;">
+          <%= update_perms_info_text(contributable) -%>
+        </div>
+      <% end -%>
+
+      <p>
+        You can also explicitly share this <%= c_type %> with your Groups.
+      </p>
+   </div>
+
+    <% if group_policies.size > 0 %>
+      <br/>
+      <div class="box_infotext">
+      	<p>
+      		One or more of your groups has a <strong>Group Policy</strong> defined.
+          A Group Policy is a pre-defined set of sharing rules that can be applied to this <%= c_type -%> instead of manually managing permissions.
+  			</p>
+        <p>
+          Select whether you wish you use a Group Policy or manually manage permissions below.
+        </p>
+  		</div>
+      <p><strong>How do you wish to manage the sharing rules for this <%= c_type -%>?</strong></p>
+      <div class="box_editing" style="padding-left: 1em; font-size: 93%;">
+        <p>
+          <input type="radio" name="policy_type" value="custom" id="policy_option_custom"
+                 <%= 'checked="checked"' if !using_group_policy -%> 
+          <label for="" permissions manually</label>
+        </p>
+
+        <p>
+          <input type="radio" name="policy_type" value="group" id="policy_option_group"
+                 <%= 'checked="checked"' if using_group_policy -%> 
+          <label for="" a Group Policy</label>
+        </p>
+      </div>
+    <% else %>
+      <input type="hidden" name="policy_type" value="custom"/>
+    <% end %>
+
 		<br/>
-		
+
+    <div id="group_policy" <%= 'style="display: none"' if !using_group_policy-%>>
+      <p><strong>Which Group Policy do you wish to apply to this <%= c_type -%>?</strong></p>
+      <div class="box_editing" style="padding-left: 1em; font-size: 93%;">
+        <select name="group_policy">
+          <% group_policies.group_by {|p| p.contributor.title}.each do |network, policies| %>
+            <% unless policies.empty? %>
+              <optgroup label="<%= h network -%>">
+                <% policies.each do |policy| %>
+                  <option value="<%= policy.id -%>"><%= policy.name -%></option>
+                <% end %>
+              </optgroup>
+            <% end %>
+          <% end %>
+        </select>
+      </div>
+    </div>
+
+    <div id="custom_policy" <%= 'style="display: none"' if using_group_policy-%>>
+
 		<!-- View/Download Permissions -->
     <p><strong>Who can view and download this <%= c_type %> on <%= Conf.sitename %>?</strong></p>
 
@@ -141,7 +192,7 @@
 		
 		<br/>
 
-    <% unless (applicable_networks = (current_user.networks + current_user.networks_owned)).empty? %>
+    <% unless applicable_networks.empty? %>
       <!-- Explicit Group Permissions -->
       <p><strong>Share with my Groups:</strong></p>
 
@@ -174,9 +225,9 @@
                 visiting the 'edit' page.
               </p>
             </div>
-            <% selected_option = (Conf.layouts[contributable.contribution.layout]["network_id"] unless
-                (contributable.contribution.nil? || contributable.contribution.layout.nil? ||
-                 Conf.layouts[contributable.contribution.layout].nil?)) %>
+            <% selected_option = (Conf.layouts[contributable.contribution.policy.layout]["network_id"] unless
+                (contributable.contribution.nil? || contributable.contribution.policy.nil? ||
+                 contributable.contribution.policy.layout.nil? || Conf.layouts[contributable.contribution.policy.layout].nil?)) %>
             <%= select_tag "layout", "<option value="">Default</option>" +
                 options_from_collection_for_select(applicable_networks.select {|n| n.layout_name if Conf.layouts[n.layout_name]},
                                                    'id','title', selected_option) %>
@@ -184,6 +235,8 @@
         <% end %>
       </div>
     <% end %>
+
+    </div>
   </div>
 </div>
 

Modified: branches/wf4ever/app/views/experiments/edit.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/experiments/edit.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/experiments/edit.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,4 +1,4 @@
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 
 <h1>Edit Experiment</h1>
 
@@ -11,7 +11,7 @@
 			<%= form.text_field :title, :size => 86 %>
 			
 			<p><b>Description</b></p>
-			<%= fckeditor_textarea(:experiment, :description, :toolbarSet => 'Simple', :width => '550px', :height => '300px') %>
+      <%= form.text_area(:description, :width => '550px', :height => '300px', :class => 'ckeditor') -%>
 			
 			<br/>
 			

Modified: branches/wf4ever/app/views/experiments/new.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/experiments/new.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/experiments/new.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,4 +1,4 @@
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 
 <h1>New Experiment</h1>
 
@@ -11,7 +11,7 @@
 			<%= form.text_field :title, :size => 86 %>
 			
 			<p><b>Description</b></p>
-			<%= fckeditor_textarea(:experiment, :description, :toolbarSet => 'Simple', :width => '550px', :height => '300px') %>
+      <%= form.text_area(:description, :width => '550px', :height => '300px', :class => 'ckeditor') -%>
 			
 			<br/>
 			

Modified: branches/wf4ever/app/views/feedback/index.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/feedback/index.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/feedback/index.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -43,7 +43,7 @@
     	<%= text_field_tag :email, (logged_in? && current_user.email) ? current_user.email : params[:email], :size => 30 %>
 			
 			<p><b>Subject</b></p>
-    	<%= text_field_tag :subject, params[:subject], :size => 60 %>
+    	<%= text_field_tag :subject, params[:subject], :style => "width: 400px" %>
 			
 			<p><b>Message</b></p>
 			<textarea id="feedback_content" name="content" rows="8" style="width: 400px;"><%= params[:content] %></textarea><br/>

Modified: branches/wf4ever/app/views/gadgets/_asset_manager.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/gadgets/_asset_manager.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/gadgets/_asset_manager.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -11,7 +11,7 @@
 				<%= link_to(pluralize(current_user.networks_owned.length + current_user.networks.length, "Group"), currentusers_things_url('groups')) %>
 				<% filter_contributables(current_user.contributions).each do |klass,contributables| %>
 					<span style="color:#999999;">|</span> 
-					<%= link_to(pluralize(contributables.length, controller_visible_name(klass.humanize.pluralize)), currentusers_things_url(controller_visible_name(klass.humanize.pluralize).downcase)) %>
+					<%= link_to(pluralize(contributables.length, controller_visible_name(klass.humanize.pluralize).singularize), currentusers_things_url(controller_visible_name(klass.humanize.pluralize).downcase)) %>
 				<% end %>
       </small>
      </p>

Modified: branches/wf4ever/app/views/group_announcements/_form.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/group_announcements/_form.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/group_announcements/_form.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,4 +1,4 @@
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 
 <%= error_messages_for 'announcement' %>
 
@@ -10,7 +10,7 @@
 
 <p>
 	<label for="" @announcement.nil? ? "" : @announcement.id -%>_body_editor"><b>Body</b></label><br/>
-  <center><%= fckeditor_textarea(:announcement, :body, :toolbarSet => 'Simple', :width => '535px', :height => '300px') %></center>
+  <center><%= form.text_area(:body, :width => '535px', :height => '300px', :class => 'ckeditor') -%></center>
 	<br/>
 	<label for=""
 		<%= check_box "announcement", "public", :style => "margin-right: 0.3em;" -%>Make this announcement public

Modified: branches/wf4ever/app/views/jobs/new.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/jobs/new.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/jobs/new.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,4 +1,4 @@
-<%= _javascript__include_tag "fckeditor/fckeditor.js" -%>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 
 <h1>New Job</h1>
 
@@ -54,7 +54,7 @@
 			<%= form.text_field :title, :size => 86 %>
 			
 			<p><b>Description</b></p>
-			<%= fckeditor_textarea(:job, :description, :toolbarSet => 'Simple', :width => '550px', :height => '300px') %>
+      <%= form.text_area(:description, :width => '550px', :height => '300px', :class => 'ckeditor') -%>
 			
 			<br/>
 			

Deleted: branches/wf4ever/app/views/layouts/_biovel.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/layouts/_biovel.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/layouts/_biovel.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,26 +0,0 @@
-<% @logo_link_url  = "http://biovel.eu/" # The URL that the logo links to when clicked
-   @logo_image_url = "/images/biovel.png" # The logo image %>
-
-<% content_for :site_info_links do %>
-
-<% end %>
-
-<% content_for :logo do %>
-  <div style="float: left; margin-bottom: 0.5em">
-    <%= link_to image_tag(@logo_image_url), @logo_link_url, :style => "float: left" -%>
-    <div style="float: left; margin-top: 1em; margin-left: 1em">
-      <div style="font-weight: bold; vertical-align: middle">
-        <a href="" @logo_link_url -%>" class="biovel_logo_link">
-          <span style="font-size: 280%"><span style="color:black;">B</span>io<span style="color:black">V</span>e<span style="color:black">L</span></span><br/>
-          <span style="font-size: 100%">Biodiversity Virtual e-Laboratory</span>
-        </a>
-      </div>
-      <div style="margin: 0.5em 0 0 1em; color: black;">
-        on <%= link_to image_tag("/images/logo_tiny.png", :style=>"-moz-border-radius: 2px; border-radius: 2px; vertical-align: middle;border: 1px solid #ccc"), "/" -%>
-      </div>
-    </div>
-  </div>
-  <br class="clearer"/>
-<% end %>
-
-<%= render :partial => "layouts/myexperiment" %>

Deleted: branches/wf4ever/app/views/layouts/_elico.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/layouts/_elico.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/layouts/_elico.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,49 +0,0 @@
-<%# Defines a new header, then calls main myExperiment layout %>
-
-<% content_for :header do %>
-</div>
-
-<div id="elico_header">
-  <div class="logo">
-    <div style="float: left; margin-bottom: 0.5em">
-      <img src="" style="float: left; vertical-align: middle; width: 60px; height: 60px"/>
-      <div style="float: left; margin-top: 1em; margin-left: 1em">
-        <div style="font-size: 220%; font-weight: bold; vertical-align: middle">Data Mining Portal</div>
-        <div style="margin: 0.5em 0 0 1em">
-          on <%= link_to image_tag("/images/logo_tiny.png", :style=>"-moz-border-radius: 2px; border-radius: 2px; vertical-align: middle;border: 1px solid white"), "/" -%>
-        </div>
-      </div>
-    </div>
-    <div style="float: right; font-size: 120%; margin-top: 1.5em">
-      e-Laboratory for Interdisciplinary Collaborative Data Mining
-    </div>
-    <br class="clearer"/>
-  </div>
-  <div id="elico_links_bar">
-    <div id="inner">
-      <div style="float: left;" class="links">
-        <%= link_to "About", "http://www.e-lico.eu/?q=node/4", :target => '_blank' %> |
-        <%= link_to "Mailing List", "http://lists.e-lico.eu/mailman/listinfo/dm-myexperiment", :target => '_blank' %> |
-        <%= link_to "Publications", "http://www.e-lico.eu/?q=publications", :target => '_blank' %>
-      </div>
-      <div style="float: right;" class="links">
-        <%= render :partial => 'layouts/user_links' %>
-      </div>
-      <br class="clearer"/>
-    </div>
-  </div>
-</div>
-
-<div id="doc2" class="yui-t4" style="*overflow: visible; *height: auto">
-  <div id="hd">
-    <div id="myexp_tabs">
-      <%= render :partial => 'layouts/tab_bar' %>
-    </div>
-    <div id="myexp_searchbar">
-      <%= render :partial => "layouts/search" %>
-    </div>
-  </div>
-<% end %>
-
-<%# TODO: In rails 2, this can possibly be removed, and the layout specified when rendering the partial in application.rhtml %>
-<%= render :partial => "layouts/myexperiment" %>

Modified: branches/wf4ever/app/views/layouts/_myexperiment.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/layouts/_myexperiment.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/layouts/_myexperiment.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -8,12 +8,12 @@
   <% if @lod_rdf %><link rel="alternate" href="" @lod_rdf -%>" type="application/rdf+xml" title="RDF+XML" /><% end %>
   <% 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', 'webfonts', 'gadgets', 
+  <%= stylesheet_link_tag 'reset-fonts-grids', 'base-min', 'acts_as_taggable_stylesheet',
+    'star_rating', 'webfonts', 'gadgets', 'misc_skinning',
     'yui/datatable', 'yui/datatable-skin', 'yui/tabview', 'yui/treeview-base', 'yui/treeview-folders', 'yui/yui_override',
-    address@hidden"stylesheets"] %>  
+    address@hidden"stylesheets"] %>
   <%= _javascript__include_tag :defaults, "boxover.js", "yui/yahoo-dom-event.js", "yui/connection.js", "yui/datasource.js", 
-    "yui/datatable.js", "yui/element.js", "yui/tabview.js", "yui/treeview.js" %>  
+    "yui/datatable.js", "yui/element.js", "yui/tabview.js", "yui/treeview.js" %>
 
   <% if controller.action_name.downcase == "timeline" %>
     <script src="" type="text/_javascript_"></script>

Deleted: branches/wf4ever/app/views/layouts/_scape.html.erb (3428 => 3429)


--- branches/wf4ever/app/views/layouts/_scape.html.erb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/layouts/_scape.html.erb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,9 +0,0 @@
-<% @logo_link_url  = "http://www.scape-project.eu/" # The URL that the logo links to when clicked
-   @logo_image_url = "/images/scape_logo.png" # The logo image %>
-
-<% content_for :site_info_links do %>
-  <a target="_blank" href="" SCAPE</a> |
-  <a target="_blank" href="" Wiki</a>
-<% end %>
-
-<%= render :partial => "layouts/skin_template" %>

Copied: branches/wf4ever/app/views/layouts/integrations/_statjr.html.erb (from rev 3428, trunk/app/views/layouts/integrations/_statjr.html.erb) ( => )


Modified: branches/wf4ever/app/views/licenses/_form.rhtml
===================================================================
--- branches/wf4ever/app/views/licenses/_form.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/licenses/_form.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,4 +1,4 @@
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 <%= _javascript__include_tag 'license_attributes' %>
 
 <!--[form:license]-->
@@ -15,7 +15,7 @@
 <%= render :partial => "license_attributes/attributes_form", :locals => { :edit => true, :license => @license } %>
 
 <h2><label for=""
-<%= fckeditor_textarea(:license, :description, :toolbarSet => 'Simple', :width => '700px', :height => '300px') %></p>
+<%= form.text_area :description, :width => '700px', :height => '300px', :class => 'ckeditor'  -%></p>
 <br/><br/>
 
 <!--[eoform:license]-->

Modified: branches/wf4ever/app/views/networks/_form.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/networks/_form.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/networks/_form.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,4 +1,4 @@
-  <%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+  <%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 	
 	<p>
     <b>Owner</b><br />
@@ -43,6 +43,6 @@
 	<p>
   	<strong>Description: </strong>
 	</p>
-	<%= fckeditor_textarea(:network, :description, :toolbarSet => 'Simple', :width => '700px', :height => '300px') %>
+	<%= form.text_area(:description, :width => '700px', :height => '300px', :class => 'ckeditor') %>
 
  

Modified: branches/wf4ever/app/views/networks/_table.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/networks/_table.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/networks/_table.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,89 +1,91 @@
 <% query ||= false -%>
-<% odd_row = false -%>
-<% unless collection.empty? -%>
-	<table class="alt_table">
-		<% for network in collection -%>
-			<tr class="<%= (odd_row = !odd_row) ? "odd_row" : "even_row" %>">
-					<td style="width: 120px;">
-						<p style="margin-top:0; padding-top:0; text-align: center;"><b>Owner:</b></p>
-						<center><%= contributor(network.user_id, "User", true, 80) %></center>
-					</td>
-					<td style="text-align: left;">
-						<p class="title">
-							<% if (current_user != 0) && (network.user_id == current_user.id) %>
-								<%= icon "network-owned", nil, nil, nil, '' %>
-							<% else %>
-								<%= icon "network-member", nil, nil, nil, '' %>
-							<% end %>
-							<%=link_to(query ? highlight_all(h(network.title), query) : h(network.title), network_path(network)) %>
-						</p>
-				<% cache(:controller => 'groups_cache', :action ="" 'listing', :id => network.id) do -%>
-						<p style="font-size: 85%;">
-							<% if network.unique_name and network.unique_name.length > 0 %>
-								<b>Unique name: </b><%=h network.unique_name -%>
-							<% end %>
-							<b>Created: </b><%=datetime network.created_at, true -%>
-						</p>
-						
-						<div class="desc">
-							<div style="font-size: 85%;">
-							<% if network.description and network.description.length > 0 -%>
-								<% desc = truncate(strip_html(network.description), :length => 400) -%>
-								<%= query ? highlight_all(desc, query) : desc -%>
-							<% else -%>
-								<span class="none_text">No description</span>
-							<% end -%>
-							</div>
-						</div>
-						
-						<p class="standout" style="margin-top: 0.4em;">
-							<%= pluralize network.shared_contributions.length, "shared item" -%>
-							&nbsp;&nbsp;|&nbsp;&nbsp;
-							<% # both private & public announcements -%>
-							<%= pluralize network.announcements.length, "announcements" -%>
-						</p>
-						
-						<% unless network.members.empty? -%>
-							<div class="desc" style="margin-top: 0.4em;">
-								<p style="font-size: 85%;"><b>Members (<%= network.members.length %>):</b></p>
-								<div style="font-size: 77%;"><%= render :partial => "networks/members", :locals => { :collection => network.members(true), :size => 40, :limit => 6 } %></div>
-							</div>
-						<% end -%>
-						
-						<% unless (tags = network.tags).empty? -%>
-							<a href="" network_path(network) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags:</b></p></a>
-							<div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
-					  <% else -%>
-							<p style="font-size: 85%;"><i>This Group has not been tagged yet!</i></p>
-					  <% end -%>
-				<% end -%>
-						<% latest_announcement = network.announcements_for_user(current_user).first -%>
-						<% unless latest_announcement.nil? -%>
-						  <p style="font-size: 85%; margin-top: 0.7em;">
-							  <b>Latest announcement:</b>:
-								<%= link_to latest_announcement.title, group_announcement_path(network, latest_announcement) -%>
-							</p>
-						<% end -%>
-					</td>
-					<td class="actions">
-						<%= icon "show", network_path(network), nil, nil, "View" %>
-						<% if mine? network -%>
-							<%= icon "manage", edit_network_path(network) %>
-						<% elsif logged_in? %> <!-- admins can't leave the group or request membership! -->
-						  <% if network.member?(current_user.id) %>
-							  <!-- user is not an admin, but a member already -->
-								<% cur_membership = Membership.find(:first, :conditions => ["network_id = ? AND user_id = ?", network.id, current_user.id] ) %>
-			          <% if cur_membership %>
-			            <%= icon('network-leave', user_membership_path(cur_membership.user_id, cur_membership) + "?return_to=" + networks_path, nil, { :confirm => "Are you sure want to leave this group?", :method => :delete }, 'Leave Group') %>
-			          <% end %>
-							<% elsif !current_user.membership_pending?(network.id) && !network.invitation_only? %>
-							  <!-- not an admin, not a member yet and hasn't got pending request -->
-								<%= request_membership_link(current_user.id, network.id) %>
-							<% end %>
-						<% end -%>
-					</td>
-			</tr>
-		<% end -%>
-	</table>
-	<br/>
-<% end -%>
+
+<% collection.each do |network| -%>
+
+  <div class="resource_list_item">
+
+    <div class="avatar_panel" style="width: 7em">
+      <span class="owner">Owner</span>
+      <%= contributor(network.user_id, "User", true, 80) %>
+    </div>
+
+    <div class="main_panel" style="margin-left: 7.5em">
+
+      <div class="actions">
+        <%= icon "show", network_path(network), nil, nil, "View" %>
+        <% if mine? network -%>
+          <%= icon "manage", edit_network_path(network) %>
+        <% elsif logged_in? %> <!-- admins can't leave the group or request membership! -->
+          <% if network.member?(current_user.id) %>
+            <!-- user is not an admin, but a member already -->
+            <% cur_membership = Membership.find(:first, :conditions => ["network_id = ? AND user_id = ?", network.id, current_user.id] ) %>
+            <% if cur_membership %>
+              <%= icon('network-leave', user_membership_path(cur_membership.user_id, cur_membership) + "?return_to=" + networks_path, nil, { :confirm => "Are you sure want to leave this group?", :method => :delete }, 'Leave Group') %>
+            <% end %>
+          <% elsif !current_user.membership_pending?(network.id) && !network.invitation_only? %>
+            <!-- not an admin, not a member yet and hasn't got pending request -->
+            <%= request_membership_link(current_user.id, network.id) %>
+          <% end %>
+        <% end -%>
+      </div>
+
+      <p class="title">
+        <% if (current_user != 0) && (network.user_id == current_user.id) %>
+          <%= icon "network-owned", nil, nil, nil, '' %>
+        <% else %>
+          <%= icon "network-member", nil, nil, nil, '' %>
+        <% end %>
+        <% truncated_title = truncate(network.title, :length => 45) %>
+        <%=link_to(query ? highlight_all(truncated_title, query) : truncated_title, network_path(network),
+                   :title => network.title) %>
+      </p>
+
+      <% cache(:controller => 'groups_cache', :action ="" 'listing', :id => network.id) do -%>
+        <p>
+          <% if network.unique_name and network.unique_name.length > 0 %>
+            <b>Unique name: </b><%=h network.unique_name -%>
+          <% end %>
+          <br/>
+          <b>Created: </b><%=datetime network.created_at, true -%>
+        </p>
+
+        <div class="desc">
+          <% if network.description and network.description.length > 0 -%>
+            <% desc = truncate(strip_html(network.description), :length => 400) -%>
+            <%= query ? highlight_all(desc, query) : desc -%>
+          <% else -%>
+            <span class="none_text">No description</span>
+          <% end -%>
+        </div>
+
+        <p class="standout">
+          <%= pluralize network.shared_contributions.length, "shared item" -%>
+          &nbsp;&nbsp;|&nbsp;&nbsp;
+          <% # both private & public announcements -%>
+          <%= pluralize network.announcements.length, "announcements" -%>
+        </p>
+
+        <% unless network.members.empty? -%>
+          <div class="desc">
+            <p><b>Members (<%= network.members.length %>):</b></p>
+            <div style="font-size: 77%;"><%= render :partial => "networks/members", :locals => { :collection => network.members(true), :size => 40, :limit => 6 } %></div>
+          </div>
+        <% end -%>
+
+        <% unless (tags = network.tags).empty? -%>
+          <a href="" network_path(network) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags:</b></p></a>
+          <div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
+        <% else -%>
+          <p><i>This Group has not been tagged yet!</i></p>
+        <% end -%>
+      <% end -%>
+      <% latest_announcement = network.announcements_for_user(current_user).first -%>
+      <% unless latest_announcement.nil? -%>
+        <p style="margin-top: 0.7em;">
+          <b>Latest announcement:</b>:
+          <%= link_to latest_announcement.title, group_announcement_path(network, latest_announcement) -%>
+        </p>
+      <% end -%>
+    </div>
+  </div>
+<% end %>

Modified: branches/wf4ever/app/views/networks/show.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/networks/show.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/networks/show.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -15,7 +15,7 @@
     <% unless mine? @network %>
 		  <% if @network.member? current_user.id  %>
 			  <% cur_membership = Membership.find(:first, :conditions => ["network_id = ? AND user_id = ?", @network.id, current_user.id] ) %>
-			  <% if cur_membership %>
+			  <% if false %>
 			    <li><%= icon('network-leave', user_membership_path(cur_membership.user_id, cur_membership), nil, { :confirm => "Are you sure want to leave this group?", :method => :delete }, 'Leave Group') %></li>
 			  <% end %>
 			<% elsif !current_user.membership_pending?(@network.id) && address@hidden %>
@@ -26,9 +26,12 @@
     <% if @network.administrator?(current_user.id) %>
       <li><%= icon('announcement', new_group_announcement_path(@network), 'Make a new Group Announcement', nil, 'Make a Group Announcement') -%></li>
 			<li><%= icon('network-invite', invite_network_path(@network), 'Invite People', nil, 'Invite People') -%></li>
+      <li><%= icon('policy', network_policies_path(@network), 'Group Policies', nil, 'Group Policies') -%></li>
     <% end %>
     <% if mine? @network %>
 			<li><%= icon('edit', edit_network_path(@network), 'Edit', nil, 'Edit Group') %></li>
+    <% end %>
+    <% if mine?(@network) || current_user.admin? %>
       <li><%= icon('destroy', network_path(@network), 'Delete Group', { :confirm => 'Are you sure?', :method => :delete }, 'Delete Group') %></li>
     <% end %>
   <% end %>

Modified: branches/wf4ever/app/views/packs/_items.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/packs/_items.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/packs/_items.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -38,8 +38,7 @@
                     
                       <b><%= visible_name(e.contributable_type) -%>:</b>
                       <% unless e.contributable_version.blank? -%>
-                        <% # HACK: only workflows are versioned at the moment -%>
-                        <%= versioned_workflow_link e.contributable_id, e.contributable_version, false -%>
+											  <%= versioned_resource_link e.contributable, e.contributable_version, false -%>
                         <% if false %><span style="color: #666666;">(version <%= e.contributable_version -%>)</span><% end %>
                       <% else -%>
                         <%= contributable(e.contributable_id, e.contributable_type) %>

Modified: branches/wf4ever/app/views/packs/_table.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/packs/_table.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/packs/_table.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,74 +1,80 @@
 <% query ||= false -%>
-<% odd_row = false -%>
-<% unless collection.empty? %>
 
-<table class="alt_table">
-	<% for pack in collection %>
-		<% # If only one item in collection, check if 'show' permission is available (eg: if this partial was called from contributions/table) -%>
-		<% if collection.size == 1 -%>
-			<% show ||= Authorization.check("view", pack, current_user) -%>
-		<% else -%>
-			<% show = Authorization.check("view", pack, current_user) -%>
-		<% end -%>
-	  <% if show -%>
-			<% cache(:controller => 'packs_cache', :action ="" 'listing', :id => pack.id) do -%>
-				<tr class="<%= (odd_row = !odd_row) ? "odd_row" : "even_row" %>">
-					<td style="width: 100px;">
-						<p style="margin-top:0; padding-top:0; text-align: center;"><b><%= owner_text pack -%>:</b></p>
-						<center><%= contributor(pack.contribution.contributor_id, pack.contribution.contributor_type, true, 60) %></center>
-					</td>
-					<td style="text-align: left;">
-						<a name="<%= pack.title.gsub(/ /, "_") %>"></a>
-						<p class="title">
-							<%= icon "pack", nil, nil, nil, '' %>
-							<% title = contributable_name(pack.id, 'Pack') %>
-							<%=link_to(query ? highlight_all(title, query) : title, pack_path(pack)) %>
-						</p>
-						
-						<p style="font-size: 85%; margin-top: 0; padding-top: 0;">
-							<b>Created:</b> <%=datetime pack.contribution.created_at, false %>
-							<% unless pack.contribution.created_at == pack.contribution.updated_at %>
-								|	<b>Last updated:</b> <%=datetime pack.contribution.updated_at, false %>
-							<% end %>
-						</p>
-						
-						<div class="desc" style="font-size: 85%;">
-							<% unless pack.description.blank? %>
-					  		<% desc = truncate(strip_html(pack.description), :length => 500) %>
-					    	<%= query ? highlight_all(desc, query) : desc %>
-						  <% else -%>
-								<span class="none_text">No description</span>
-							<% end %>
-						</div>
-						
-						<p class="standout" style="margin-top: 0.4em;">
-							<%= pluralize pack.items_count, "item" -%> in this pack
-						</p>
-						
-						<p style="font-size: 85%;">
-							<a href="" pack_path(pack) + '#comments' -%>"><b>Comments: </b><%= pack.comments.count %></a> |
-							<b>Viewed:</b> <%=pluralize pack.contribution.site_viewings_count, "time" %> |
-				      <b>Downloaded:</b> <%=pluralize pack.contribution.site_downloads_count, "time" %>
-						</p>
-						
-						<% unless (tags = pack.tags).empty? %>
-							<a href="" pack_path(pack) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags:</b></p></a>
-							<div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
-						<% else %>
-							<p style="font-size: 85%;"><i>This Pack has no tags!</i></p>
-						<% end %>	
-					</td>
-					
-					<td class="actions" style="width: 80px;">
-				    <%= icon "show", pack_path(pack), nil, nil, "View" %>
-						<% if Authorization.check("download", pack, current_user) -%><%= icon('download', download_pack_path(pack), nil, nil, 'Download') -%><% end -%>
-				    <% if mine?(pack) %><%= icon "manage", edit_pack_path(pack), nil, nil, "Manage" %><% end %>
-						<% if Authorization.check("edit", pack, current_user) -%><%= icon('new', new_item_pack_path(pack), nil, nil, 'Add New Item') -%><% end -%>
-				  </td>
-				</tr>
-			<% end %>
-		<% end %>
-	<% end %>
-</table>
+<% collection.each do |pack| %>
+  <% # If only one item in collection, check if 'show' permission is available (eg: if this partial was called from contributions/table) -%>
+  <% if collection.size == 1 -%>
+    <% show ||= Authorization.check("view", pack, current_user) -%>
+  <% else -%>
+    <% show = Authorization.check("view", pack, current_user) -%>
+  <% end -%>
+  <% if show -%>
 
+    <div class="resource_list_item <%= pack.contribution.policy.layout -%>">
+
+      <div class="avatar_panel">
+        <span class="owner"><%= owner_text pack -%></span>
+        <%= contributor(pack.contribution.contributor_id, pack.contribution.contributor_type, true, 60) %>
+        <% if layout = pack.contribution.policy.layout %>
+          <% begin %>
+            <%= render :partial => "skins/branding/#{layout}" %>
+          <% rescue ActionView::MissingTemplate %>
+          <% end %>
+        <% end %>
+      </div>
+
+      <div class="main_panel">
+
+        <div class="actions">
+          <%= icon "show", pack_path(pack), nil, nil, "View" %>
+          <% if Authorization.check("download", pack, current_user) -%><%= icon('download', download_pack_path(pack), nil, nil, 'Download') -%><% end -%>
+          <% if mine?(pack) %><%= icon "manage", edit_pack_path(pack), nil, nil, "Manage" %><% end %>
+          <% if Authorization.check("edit", pack, current_user) -%><%= icon('new', new_item_pack_path(pack), nil, nil, 'Add New Item') -%><% end -%>
+        </div>
+
+        <% cache(:controller => 'packs_cache', :action ="" 'listing', :id => pack.id) do -%>
+          <a name="<%= pack.title.gsub(/ /, "_") %>"></a>
+          <p class="title">
+            <%= icon "pack", nil, nil, nil, '' %>
+            <% truncated_title = truncate(pack.title, :length => 55) %>
+            <%=link_to(query ? highlight_all(truncated_title, query) : truncated_title, pack_path(pack),
+                       :title => pack.title) %>
+          </p>
+
+          <br/>
+          <p>
+            <b>Created:</b> <%=datetime pack.contribution.created_at, false %>
+            <% unless pack.contribution.created_at == pack.contribution.updated_at %>
+              |	<b>Last updated:</b> <%=datetime pack.contribution.updated_at, false %>
+            <% end %>
+          </p>
+
+          <div class="desc">
+            <% unless pack.description.blank? %>
+              <% desc = truncate(strip_html(pack.description), :length => 500) %>
+              <%= query ? highlight_all(desc, query) : desc %>
+            <% else -%>
+              <span class="none_text">No description</span>
+            <% end %>
+          </div>
+
+          <p class="standout">
+            <%= pluralize pack.items_count, "item" -%> in this pack
+          </p>
+
+          <p>
+            <a href="" pack_path(pack) + '#comments' -%>"><b>Comments: </b><%= pack.comments.count %></a> |
+            <b>Viewed:</b> <%=pluralize pack.contribution.site_viewings_count, "time" %> |
+            <b>Downloaded:</b> <%=pluralize pack.contribution.site_downloads_count, "time" %>
+          </p>
+
+          <% unless (tags = pack.tags).empty? %>
+            <a href="" pack_path(pack) + '#tags' -%>"><p><b>Tags:</b></p></a>
+            <div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
+          <% else %>
+            <p><i>This Pack has no tags!</i></p>
+          <% end %>
+        <% end %>
+      </div>
+    </div>
+  <% end %>
 <% end %>

Copied: branches/wf4ever/app/views/packs/_version_selector.rhtml (from rev 3428, trunk/app/views/packs/_version_selector.rhtml) (0 => 3429)


--- branches/wf4ever/app/views/packs/_version_selector.rhtml	                        (rev 0)
+++ branches/wf4ever/app/views/packs/_version_selector.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,82 @@
+<script type="text/_javascript_">
+  function showVersion(form) {
+    var url = ""
+		location.href = ""
+		form.submit
+  }
+</script>
+
+<div class="contribution_version_selector_box">
+
+  <table>
+    <tbody>
+      <tr>
+        <td class="heading" style="vertical-align: top;">
+          <% if version %>
+            <%= info_icon_with_tooltip("This box shows version #{version.version.to_s} for this entry") -%>
+            <span><%= "Version #{version.version.to_s} #{resource.describe_version(version.version)}" -%></span>
+            <span class="count_text">(of <%= resource.versions.length -%>)</span>
+          <% else %>
+            <%= info_icon_with_tooltip("This box shows the live version for this entry") -%>
+            <span>Live view</span>
+            <% if resource.versions.length > 0 %>
+              <span class="count_text">(<%= resource.versions.length -%> versions available)</span>
+            <% end %>
+          <% end %>
+          <a name="versions"></a>
+        </td>
+        <td>
+          <% if resource.versions.length > 0 %>
+             <form  return false;" style="text-align: right;">
+              <b>View version: </b>
+              <select id="resource_versions" 
+                <option value="<%= polymorphic_path(resource) %>" <%= "selected" if version.nil? -%>>Live view</option>
+                <% resource.versions.reverse.each do |v| %>
+                  <option value="<%= send(path, resource, v.version.to_s) %>" <%= "selected" if !version.nil? && v.version == version.version -%>>
+                      <%= "#{v.version.to_s} #{resource.describe_version(v.version)}" %>
+                  </option>
+                <% end %>
+              </select>
+            </form>
+          <% end %>
+        </td>
+      </tr>
+    </tbody>
+  </table>
+      
+  <% if version %>
+    <div id="version_info_box" style="color: #666666;  font-size: 85%; margin: 0.6em 0.5em 0.2em 0.5em; border-top: 1px solid #DDDDDD; padding-top: 0.4em;">
+      <p style="text-align: center;">
+        <b>Version created on:</b>
+        <span><%= datetime version.created_at, false %></span>
+        <% if version.respond_to?(:contributor_id) && version.respond_to?(:contributor_type) %>
+          <b>by:</b>
+          <span><%= contributor(version.contributor_id, version.contributor_type) %></span>
+        <% end %>
+        <% if !version.revision_comments.blank? %>
+          <span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
+          <span><%= link_to_function "Revision comment " + expand_image, visual_effect(:toggle_blind, "version_info_box_comments", :duration => 0.3) %></span>
+        <% end %>
+      </p>
+      
+      <% unless version.created_at == version.updated_at %>
+        <p style="text-align: center;">
+          <b>Last edited on:</b>
+          <span><%= datetime version.updated_at, false %></span>
+          <% if version.respond_to?(:last_edited_by) %>
+            <b>by:</b>
+            <span><%= contributor(version.last_edited_by, "User") %></span>
+          <% end %>
+        </p>
+      <% end %>
+    </div>
+  <% end %>
+  
+  <% if version && !version.revision_comments.blank? -%>
+    <div id="version_info_box_comments" style="display: none; border: 1px dotted #CCCCCC; padding: 0.3em 0.5em;">
+      <%= white_list version.revision_comments %>
+    </div>
+  <% end %>
+
+</div>
+

Modified: branches/wf4ever/app/views/packs/edit.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/packs/edit.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/packs/edit.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,6 +1,6 @@
 <% t "Manage" -%>
 
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 <%= _javascript__include_tag "osp.js" %>
 
 <h1>Manage Pack: <%= contributable_name(@pack.id, 'Pack') %></h1>
@@ -23,7 +23,7 @@
 			<%= f.text_field :title, :size => 86 %>
 			
 		  <p><b>Description: </b></p>
-			<%= fckeditor_textarea(:pack, :description, :toolbarSet => 'Simple', :width => '550px', :height => '300px') %>
+			<%= f.text_area(:description, :width => '550px', :height => '300px', :class => 'ckeditor') %>
 		</div>
 	</center>
   

Modified: branches/wf4ever/app/views/packs/new.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/packs/new.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/packs/new.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,6 +1,6 @@
 <% t "New" -%>
 
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 <%= _javascript__include_tag "osp.js" %>
 
 <h1>New Pack</h1>
@@ -17,7 +17,7 @@
 			<%= text_field_tag "pack[title]", nil, :size => 86 %>
 			
 		  <p><b>Description: </b></p>
-			<%= fckeditor_textarea(:pack, :description, :toolbarSet => 'Simple', :width => '550px', :height => '300px') %>
+      <%= text_area_tag 'pack[description]', nil, :width => '550px', :height => '300px', :class => 'ckeditor' -%>
 		</div>
 	</center>
 

Modified: branches/wf4ever/app/views/packs/show.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/packs/show.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/packs/show.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,5 +1,9 @@
 <% t "#{contributable_name(@pack.id, 'Pack')} (#{h @pack.contributor_name})" -%>
 
+<% items_count = @version ? @version.items_count : @pack.items_count %>
+<% contributable_entries = @version ? @version.contributable_entries : @pack.contributable_entries %>
+<% remote_entries        = @version ? @version.remote_entries        : @pack.remote_entries        %>
+
 <% @title = @annotations.query([RDF::URI.parse(@pack.ro_uri), RDF::DC.title, nil]).objects.first if @pack.ro_uri; @title = @title.to_s if @title; @title ||= @pack.title %>
 <% @description_html = @annotations.query([RDF::URI.parse(@pack.ro_uri), RDF::DC.description, nil]).objects.first if @pack.ro_uri; @description_html = h(@description_html) if @description_html; @description_html ||= @pack.description_html %>
 
@@ -11,6 +15,9 @@
     <% if Authorization.check("edit", @pack, current_user) && @pack.ro_uri %>
       <li><%= icon('edit', edit_annotations_pack_path(@pack), nil, nil, "Edit Annotations") %></li>
     <% end %>
+    <% 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 -%>	
 		<% 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 %>
@@ -43,6 +50,9 @@
 
 <div class="contribution_left_box">
 	<div class="contribution_version_box">
+
+    <%= render(:partial => "packs/version_selector", :locals => { :resource => @pack, :version => @version, :path => :pack_version_path }) %>
+
 		<div class="contribution_version_inner_box">
 			<p>
 		    <b>Title:</b>
@@ -80,7 +90,7 @@
       <%= render :partial => "research_objects/credits", :locals => { :contributable => @pack } -%>
 
 		</div>
-  </div>
+	</div>
 	
 <% if false %>
       <%= render :partial => "research_objects/title", :locals => { :contributable => @pack } -%>      
@@ -100,11 +110,11 @@
 				<% end %>
 				
 				<%= info_icon_with_tooltip("This section shows all the items that are pointed to in this pack. This can be a combination of internal and external items.") -%>
-				Items <span class="count_text">(<%= @pack.items_count -%>)</span>
+				Items <span class="count_text">(<%= items_count -%>)</span>
 			</h4>
 			
       <div id="pack_items">
-        <%= render :partial => "items", :locals => { :pack => @pack, :authorised_to_edit => @authorised_to_edit } -%>
+        <%= render :partial => "items", :locals => { :pack => @pack, :contributable_entries => contributable_entries, :remote_entries => remote_entries, :authorised_to_edit => @authorised_to_edit } -%>
       </div>
       <% # FIXME diagram should not have to be rendered after items %>
       <%= render :partial => "research_objects/diagram", :locals => { :contributable => @pack } -%>  

Modified: branches/wf4ever/app/views/profiles/_form.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/profiles/_form.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/profiles/_form.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,4 +1,4 @@
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 
 <p style="color: #666666; font-weight: bold;">
 	Note: information you enter on this page will be visible to everyone (ie: will be public), but all fields are optional.
@@ -107,7 +107,7 @@
 	</span>
 </p>
 
-<%= fckeditor_textarea(:profile, :body, :toolbarSet => 'Simple', :width => '700px', :height => '300px') %>
+<%= form.text_area(:body, :width => '700px', :height => '300px', :class => 'ckeditor') -%>
 
 <br/>
 <br/>

Modified: branches/wf4ever/app/views/reviews/_form.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/reviews/_form.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/reviews/_form.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,4 +1,4 @@
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 
 <%= error_messages_for 'review' %>
 
@@ -25,4 +25,4 @@
 </div>
 
 <p><b>Your review</b></p>
-<%= fckeditor_textarea(:review, :review, :toolbarSet => 'Basic', :width => '455px', :height => '400px') %>
+<%= form.text_area(:review, :width => '455px', :height => '400px', :class => 'ckeditor') -%>

Modified: branches/wf4ever/app/views/reviews/_reviews.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/reviews/_reviews.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/reviews/_reviews.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,5 +1,3 @@
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
-
 <h2>
 	<%= icon "review", nil, "Reviews", { :style => "vertical-align: middle;" }, "" -%>
 	<span style="vertical-align: middle;"><%= link_to "Reviews", workflow_reviews_path(reviewable) %></span>

Modified: branches/wf4ever/app/views/runners/edit.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/runners/edit.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/runners/edit.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -25,7 +25,7 @@
 				<%= text_field_tag "runner[username]", @runner.username, :size => 30 %>
 				
 				<p><b>Password</b> (will be encrypted)</p>
-				<%= text_field_tag "runner[password]", @runner.crypted_password.decrypt, :size => 30 %>
+				<%= text_field_tag "runner[password]", @runner.password.decrypt, :size => 30 %>
 			</fieldset>
 			
 			<br/>
@@ -55,4 +55,4 @@
 			<center><%= submit_tag "Update", :disable_with => "Updating..." %></center>
 		<% end -%>
 	</div>
-</center>
\ No newline at end of file
+</center>

Modified: branches/wf4ever/app/views/users/_avatar.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/users/_avatar.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/users/_avatar.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,7 +1,7 @@
 <% size ||= 100 -%>
 <% you_string ||= "" -%>
 <% if user.kind_of? Fixnum then user = User.find(user) end -%>
-<div style="text-align:center; width: <%= size+6 %>px; line-height: 1.2em; padding: 0.2em 0;">
+<div class="avatar" style="width: <%= size+6 %>px">
 	<%= avatar(user, size) %>
 	<span style="display:block;margin-top:2px;text-align:center;">
 		<% if size > 59 %>

Modified: branches/wf4ever/app/views/users/_listing.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/users/_listing.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/users/_listing.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,5 +1,5 @@
   <td style="width: 100px"><div style="text-align: center; font-weight: bold">Member</div><br /><br /><center><%= contributor(user.id, 'User', true, 60) %></center></td>
-  <td class="mid" style="text-align: left;">
+  <td class="mid" style="text-align: left; max-width: 370px;">
 
     <p style="margin-top:0; padding-top:0; font-weight:bold; font-size: 108%;">
       <%= icon "user", nil, nil, nil, '' %>

Modified: branches/wf4ever/app/views/users/show.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/users/show.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/users/show.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -409,13 +409,6 @@
     <% contributables = (@user.contributions.select do |c| c.contributable_type == 'Pack' end).map do |c| c.contributable end  %>
     <%= render :partial => "packs/table", :locals => { :collection => contributables } %>
 
-  <% when "Blogs" %>
-		
-		<%= view_privileges_notice %>
-		<br/>
-    <% contributables = (@user.contributions.select do |c| c.contributable_type == 'Blog' end).map do |c| c.contributable end  %>
-    <%= render :partial => "blogs/table", :locals => { :collection => contributables } %>
-
   <% when "Credits" %>
 
     <% unless (creditations = @user.creditations).empty? %>

Modified: branches/wf4ever/app/views/workflows/_main_metadata_form.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/workflows/_main_metadata_form.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/workflows/_main_metadata_form.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -71,7 +71,7 @@
 				
 				<!-- Description -->
 				<p><b>Description</b></p>
-				<%= fckeditor_textarea(:new_workflow, :body, :toolbarSet => 'Simple', :width => '500px', :height => '300px') %>
+        <%= text_area_tag("new_workflow[body]", nil, :width => '500px', :height => '300px', :class => 'ckeditor') -%>
 		
 		</div>
 	

Modified: branches/wf4ever/app/views/workflows/_table.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/workflows/_table.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/workflows/_table.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,139 +1,135 @@
 <% query ||= false -%>
-<% odd_row = false -%>
 
-<% unless collection.empty? %>
+<% collection.each do |workflow| %>
+  <% # If only one item in collection, check if 'show' permission is available (eg: if this partial was called from contributions/table) -%>
+  <% if collection.size == 1 -%>
+    <% show ||= Authorization.check("view", workflow, current_user) -%>
+  <% else -%>
+    <% show = Authorization.check("view", workflow, current_user) -%>
+  <% end -%>
+  <% if show -%>
 
-<table class="alt_table">	
-	<% for workflow in collection %>
-		<% # If only one item in collection, check if 'show' permission is available (eg: if this partial was called from contributions/table) -%>
-		<% if collection.size == 1 -%>
-			<% show ||= Authorization.check("view", workflow, current_user) -%>
-		<% else -%>
-			<% show = Authorization.check("view", workflow, current_user) -%>
-		<% end -%>
-	  <% if show -%>
-		<tr class="<%= (odd_row = !odd_row) ? "odd_row" : "even_row" %>">
-			<% cache(:controller => 'workflows_cache', :action ="" 'listing', :id => workflow.id) do -%>
-			    <td style="width: 100px;">
-						<div class="workflow_type_box" style="width: auto; margin-bottom: 2em;">
-              <%= link_to(h(workflow.content_type.title), content_type_path(workflow.content_type)) %>
-						</div>
-			    	<p style="margin-top:0; padding-top:0; text-align: center;"><b><%= owner_text workflow -%></b></p>
-						<center><%= contributor(workflow.contribution.contributor_id, workflow.contribution.contributor_type, true, 60) %></center>
-					</td>
-			    <td style="text-align: left; width: 587px">
-			      <a name="<%= workflow.title.gsub(/ /, "_") %>"></a>
-			      <p class="title">
-					  	<%= icon "workflow", nil, nil, nil, '' %>
-							<% title = contributable_name(workflow.id, 'Workflow') %>
-							<%=link_to(query ? highlight_all(title, query) : title, workflow_path(workflow)) %>
-							<span style="font-weight:normal;">
-								(v<%= workflow.current_version %>)
-							</span>
-					  </p>
-					
-						<p style="font-size: 85%; margin-top: 0; padding-top: 0;">
-							<b>Created:</b> <%=datetime workflow.contribution.created_at, false -%>
-							<% unless workflow.contribution.created_at == workflow.contribution.updated_at %>
-								|	<b>Last updated:</b> <%=datetime workflow.contribution.updated_at, false -%>
-							<% end %>
-						</p>
-						
-					  <% unless (creditors = workflow.creditors).empty? %>
-					  	<p style="font-size:85%;">
-							<b>Credits:</b>
-							<% creditors.each do |c| %>
-								<% if c.creditor_type == 'User' %>
-									<%= icon('user', nil, nil, nil, '') %> 
-								<% elsif c.creditor_type == 'Network' %>
-									<%= icon('network-member', nil, nil, nil, '') %>
-								<% end %>
-								<%= contributor(c.creditor_id, c.creditor_type) %>
-							<% end %>
-					  	</p>
-					  <% end %>
-					  <% unless (attributors = workflow.attributors).empty? %>
-					  	<p style="font-size:85%;">
-							<b>Attributions:</b>
-							<% attributors.each do |a| %>
-								<% if Authorization.check("view", a.attributor, current_user) -%>
-									<% if a.attributor_type == 'Workflow' %>
-										<%= icon('workflow', nil, nil, nil, '') %> 
-									<% elsif a.attributor_type == 'Blob' %>
-										<%= icon('blob', nil, nil, nil, '') %>
-									<% end %>
-									<%= contributable(a.attributor_id, a.attributor_type) %>
-								<% end %>
-							<% end %>
-					  	</p>
-					  <% end %>
-						
-            <% if workflow.license_id.nil? %>
-              <p style="font-size:85%;"><b>License: </b>No license</p>
-            <% else %>
-              <p style="font-size:85%;"><b>License: </b><% @license = License.find(workflow.license_id) %><%= link_to h(@license.title), license_path(@license) %></p>
+    <div class="resource_list_item <%= workflow.contribution.policy.layout -%>">
+
+      <div class="avatar_panel">
+        <div class="workflow_type_box">
+          <%= link_to(h(workflow.content_type.title), content_type_path(workflow.content_type)) %>
+        </div>
+        <span class="owner"><%= owner_text workflow -%></span>
+        <%= contributor(workflow.contribution.contributor_id, workflow.contribution.contributor_type, true, 60) %>
+        <% if layout = workflow.contribution.policy.layout %>
+          <% begin %>
+            <%= render :partial => "skins/branding/#{layout}" %>
+          <% rescue ActionView::MissingTemplate %>
+          <% end %>
+        <% end %>
+      </div>
+
+      <div class="main_panel">
+
+        <div class="actions">
+          <%= icon "show", workflow_path(workflow), nil, nil, "View" %>
+          <% if Authorization.check("download", workflow, current_user) -%>
+            <%= icon "download", download_workflow_path(workflow), nil, nil, "Download (v#{workflow.versions.count})" %>
+            <% if ( session[:callback] && (session[:callback][:types].include?(workflow.content_type_id))) -%>
+              <%= icon "download", callback_url(workflow).to_s, nil, {:rel => 'nofollow'}, session[:callback][:label] -%>
             <% end %>
-					  
-            <% desc_style = "font-size: 85%;" %>
+          <% end %>
+          <% if mine?(workflow) %>
+            <%= icon "manage", edit_workflow_path(workflow), nil, nil, "Manage" %>
+          <% end %>
+        </div>
+        <% cache(:controller => 'workflows_cache', :action ="" 'listing', :id => workflow.id) do -%>
+          <a name="<%= workflow.title.gsub(/ /, "_") %>"></a>
 
-            <% unless workflow.image.nil? && workflow.svg.nil? -%>
-              <p style="margin: 0; border: 0; width: 101px; float: left">
-                <%= link_to image_tag(workflow_preview_path(workflow, 'thumb'), :class => 'framed_nospace'), workflow_path(workflow) %>
-              </p>
+          <p class="title">
+            <%= icon "workflow", nil, nil, nil, '' %>
+            <% truncated_title = 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;">
+              (<%= workflow.current_version %>)
+            </span>
+          </p>
 
-              <% desc_style << " margin-left: 110px; width: 250px;" %>
-            <% end -%>
+          <p>
+            <b>Created:</b> <%=datetime workflow.contribution.created_at, false -%>
+            <% unless workflow.contribution.created_at == workflow.contribution.updated_at %>
+              |	<b>Last updated:</b> <%=datetime workflow.contribution.updated_at, false -%>
+            <% end %>
+          </p>
 
-            <p style="margin: 0; padding: 0; border: 0;">
-              <div class="desc" style="<%= desc_style -%>">
-                <% if workflow.body and workflow.body.length > 0 -%>
-                  <% desc = truncate(strip_html(workflow.body), :length => 500) -%>
-                  <%= query ? highlight_all(desc, query) : desc %>
-                <% else -%>
-                  <span class="none_text">No description</span>                      
-                <% end -%>
-              </div>
+          <% unless (creditors = workflow.creditors).empty? %>
+            <p>
+              <b>Credits:</b>
+              <% creditors.each do |c| %>
+                <% if c.creditor_type == 'User' %>
+                  <%= icon('user', nil, nil, nil, '') %>
+                <% elsif c.creditor_type == 'Network' %>
+                  <%= icon('network-member', nil, nil, nil, '') %>
+                <% end %>
+                <%= contributor(c.creditor_id, c.creditor_type) %>
+              <% end %>
             </p>
-					  
-            <div style="clear: both"></div>
+          <% end %>
 
-					  <p style="font-size: 85%;">
-							<a href="" workflow_path(workflow) + '#ratings' -%>"><b>Rating: </b><%= number_with_precision(workflow.rating, :precision => 1) %> / 5 (<%= pluralize workflow.ratings.count, 'rating' %>)</a> |
-							<a href="" workflow_path(workflow) + '#versions' -%>"><b>Versions: </b><%= workflow.versions.count %></a> |
-							<a href="" workflow_path(workflow) + '#reviews' -%>"><b>Reviews: </b><%= workflow.reviews.count %></a> |
-							<a href="" workflow_path(workflow) + '#comments' -%>"><b>Comments: </b><%= workflow.comments.count %></a> |
-							<a href="" workflow_path(workflow) + '#citations' -%>"><b>Citations: </b><%= workflow.citations.count %></a>
-					  </p>
-						
-						<p style="font-size: 85%;">
-							<b>Viewed:</b> <%=pluralize workflow.contribution.site_viewings_count, "time" %> |
-				      <b>Downloaded:</b> <%=pluralize workflow.contribution.site_downloads_count, "time" %>
-						</p>
-					  
-					  <% unless (tags = workflow.tags).empty? %>
-							<a href="" workflow_path(workflow) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags</b> (<%=tags.count-%>):</p></a>
-							<div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
-					  <% else %>
-							<p style="font-size: 85%;"><i>This Workflow has no tags!</i></p>
-					  <% end %>	
-			    </td>
-			<% end -%>
-			    <td class="actions" style="width: 120px;">
-			      <%= icon "show", workflow_path(workflow), nil, nil, "View" %>
-				  	<% if Authorization.check("download", workflow, current_user) -%>
-						<%= icon "download", download_workflow_path(workflow), nil, nil, "Download (v#{workflow.versions.count})" %>
-						<% if ( session[:callback] && (session[:callback][:types].include?(workflow.content_type_id))) -%>
-							<%= icon "download", callback_url(workflow).to_s, nil, {:rel => 'nofollow'}, session[:callback][:label] -%>
-						<% end %>
-					<% end %>
-			      <% if mine?(workflow) %><%= icon "manage", edit_workflow_path(workflow), nil, nil, "Manage" %><% end %>
-						<br/><br/>
-						
-			    </td>
-		</tr>
-  	<% end -%>
-	<% end -%>
+          <% unless (attributors = workflow.attributors).empty? %>
+            <p>
+              <b>Attributions:</b>
+              <% attributors.each do |a| %>
+                <% if Authorization.check("view", a.attributor, current_user) -%>
+                  <% if a.attributor_type == 'Workflow' %>
+                    <%= icon('workflow', nil, nil, nil, '') %>
+                  <% elsif a.attributor_type == 'Blob' %>
+                    <%= icon('blob', nil, nil, nil, '') %>
+                  <% end %>
+                  <%= contributable(a.attributor_id, a.attributor_type) %>
+                <% end %>
+              <% end %>
+            </p>
+          <% end %>
 
-</table>
+          <% if workflow.license_id.nil? %>
+            <p><b>License: </b>No license</p>
+          <% else %>
+            <p><b>License: </b><% @license = License.find(workflow.license_id) %><%= link_to h(@license.title), license_path(@license) %></p>
+          <% end %>
 
+          <div class="desc">
+            <% unless workflow.image.nil? && workflow.svg.nil? -%>
+              <div class="preview">
+                <%= link_to image_tag(workflow_preview_path(workflow, 'thumb'), :class => 'framed_nospace'), workflow_path(workflow) %>
+              </div>
+            <% end -%>
+            <% if workflow.body and workflow.body.length > 0 -%>
+              <% desc = truncate(strip_html(workflow.body), :length => 500) -%>
+              <%= query ? highlight_all(desc, query) : desc %>
+            <% else -%>
+              <span class="none_text">No description</span>
+            <% end -%>
+          </div>
+
+          <p>
+            <a href="" workflow_path(workflow) + '#ratings' -%>"><b>Rating: </b><%= number_with_precision(workflow.rating, :precision => 1) %> / 5 (<%= pluralize workflow.ratings.count, 'rating' %>)</a> |
+            <a href="" workflow_path(workflow) + '#versions' -%>"><b>Versions: </b><%= workflow.versions.count %></a> |
+            <a href="" workflow_path(workflow) + '#reviews' -%>"><b>Reviews: </b><%= workflow.reviews.count %></a> |
+            <a href="" workflow_path(workflow) + '#comments' -%>"><b>Comments: </b><%= workflow.comments.count %></a> |
+            <a href="" workflow_path(workflow) + '#citations' -%>"><b>Citations: </b><%= workflow.citations.count %></a>
+          </p>
+
+          <p>
+            <b>Viewed:</b> <%=pluralize workflow.contribution.site_viewings_count, "time" %> |
+            <b>Downloaded:</b> <%=pluralize workflow.contribution.site_downloads_count, "time" %>
+          </p>
+
+          <% unless (tags = workflow.tags).empty? %>
+            <a href="" workflow_path(workflow) + '#tags' -%>"><p><b>Tags</b> (<%=tags.count-%>):</p></a>
+            <div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
+          <% else %>
+            <p><i>This Workflow has no tags!</i></p>
+          <% end %>
+        <% end -%>
+      </div>
+    </div>
+  <% end -%>
 <% end %>

Modified: branches/wf4ever/app/views/workflows/edit_version.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/workflows/edit_version.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/workflows/edit_version.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -6,7 +6,7 @@
 
 <% can_edit_anything = title_edit || preview_edit || description_edit %>
 
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 
 <h1>
 	Edit Version <%= @viewing_version_number.to_s %>
@@ -61,7 +61,7 @@
 			<!-- Description -->
 			<p><b>Description</b></p>
       <% if description_edit %>
-        <%= fckeditor_textarea(:workflow, :body, :toolbarSet => 'Simple', :width => '500px', :height => '500px') %>
+        <%= text_area_tag('workflow[body]', @viewing_version.body, :width => '500px', :height => '500px', :class => 'ckeditor') -%>
     
         <br />
       <% else %>

Modified: branches/wf4ever/app/views/workflows/new.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/workflows/new.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/workflows/new.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,6 +1,6 @@
 <% t "New" -%>
 
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 <%= _javascript__include_tag "osp.js" %>
 
 <h1>Upload Workflow</h1>

Modified: branches/wf4ever/app/views/workflows/new_version.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/workflows/new_version.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/workflows/new_version.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,6 +1,6 @@
 <% t "Upload New Version" -%>
 
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 
 <h1>
 	Upload New Version
@@ -60,7 +60,7 @@
 	
 	<center>
 	  <div class="box_form" style="width: 600px; text-align: center;">
-			<%= fckeditor_textarea(:new_workflow, "rev_comments", :toolbarSet => 'Basic', :width => '580px', :height => '300px') %>
+      <%= text_area_tag("new_workflow[rev_comments]", nil, :width => '580px', :height => '300px', :class => 'ckeditor') -%>
 		</div>
 	</center>
 	

Modified: branches/wf4ever/app/views/workflows/tag_suggestions.rhtml (3428 => 3429)


--- branches/wf4ever/app/views/workflows/tag_suggestions.rhtml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/app/views/workflows/tag_suggestions.rhtml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,4 +1,4 @@
-<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
+<%= _javascript__include_tag "ckeditor/ckeditor.js" %>
 <%= _javascript__include_tag "tag_suggestions.js" %>
 
 <h1>Extra workflow metadata</h1>
@@ -18,7 +18,7 @@
       <!-- Description -->
       <p><b>Description</b></p>
 
-    <%= fckeditor_textarea(:workflow, :body, :toolbarSet => 'Simple', :width => '500px', :height => '300px') %>
+    <%= text_area_tag("workflow[body]", nil, :width => '500px', :height => '300px', :class => 'ckeditor') -%>
 
   <% end %>
 

Deleted: branches/wf4ever/config/base_schema.xml (3428 => 3429)


--- branches/wf4ever/config/base_schema.xml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/config/base_schema.xml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,98 +0,0 @@
-<?xml version="1.0"?>
-<schema>
-
-  <table name="contributions">
-
-    <column type="integer"  name="contributor_id"/>
-    <column type="string"   name="contributor_type"/>
-    <column type="integer"  name="contributable_id"/>
-    <column type="string"   name="contributable_type"/>
-    <column type="integer"  name="policy_id"/>
-    <column type="datetime" name="created_at"/>
-    <column type="datetime" name="updated_at"/>
-    <column type="integer"  name="downloads_count"      default="0"/>
-    <column type="integer"  name="viewings_count"       default="0"/>
-    <column type="integer"  name="site_downloads_count" default="0"/>
-    <column type="integer"  name="site_viewings_count"  default="0"/>
-    <column type="float"    name="rating"/>
-    <column type="float"    name="rank"/>
-    <column type="string"   name="label"/>
-    <column type="integer"  name="content_type_id"/>
-    <column type="integer"  name="license_id"/>
-    <column type="string"   name="layout"/>
-
-    <index>
-      <column name="contributable_id"/>
-      <column name="contributable_type"/>
-    </index>
-
-    <index>
-      <column name="contributor_id"/>
-      <column name="contributor_type"/>
-    </index>
-
-  </table>
-
-  <table name="policies">
-   
-    <column type="integer"  name="contributor_id"/>
-    <column type="string"   name="contributor_type"/>
-    <column type="string"   name="name"/>
-    <column type="datetime" name="created_at"/>
-    <column type="datetime" name="updated_at"/>
-    <column type="integer"  name="share_mode"/>
-    <column type="integer"  name="update_mode"/>
-    <column type="boolean"  name="public_view"     default="false"/>
-    <column type="boolean"  name="public_download" default="false"/>
-
-  </table>
-
-  <table name="downloads">
-
-    <column type="integer"  name="contribution_id"/>
-    <column type="integer"  name="user_id"/>
-    <column type="datetime" name="created_at"/>
-    <column type="string"   name="user_agent"/>
-    <column type="boolean"  name="accessed_from_site" default="false"/>
-    <column type="string"   name="kind"/>
-
-    <index>
-      <column name="contribution_id"/>
-    </index>
-
-  </table>
-
-  <table name="content_types">
-
-    <column type="integer"  name="user_id"/>
-    <column type="string"   name="title"/>
-    <column type="text"     name="description"/>
-    <column type="text"     name="description_html"/>
-    <column type="string"   name="category"/>
-    <column type="string"   name="mime_type"/>
-    <column type="datetime" name="created_at"/>
-    <column type="datetime" name="updated_at"/>
-
-  </table>
-
-  <table name="user_reports">
-
-    <column type="integer"  name="user_id"/>
-    <column type="string"   name="subject_type"/>
-    <column type="integer"  name="subject_id"/>
-    <column type="text"     name="content"/>
-    <column type="text"     name="report"/>
-    <column type="datetime" name="created_at"/>
-
-  </table>
-
-  <table name="previews">
-
-    <column type="integer"  name="image_blob_id"/>
-    <column type="integer"  name="svg_blob_id"/>
-    <column type="datetime" name="created_at"/>
-
-  </table>
-
-</schema>
-

Modified: branches/wf4ever/config/default_settings.yml (3428 => 3429)


--- branches/wf4ever/config/default_settings.yml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/config/default_settings.yml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -41,7 +41,7 @@
 # contributable_models - These are the models for the things that myExperiment
 #                        contributors can contribute.
 
-contributable_models: [Workflow, Blob, Pack, Blog, ResearchObject]
+contributable_models: [Workflow, Blob, Pack, ResearchObject]
 
 # page_template - This is the page template for all the pages except for
 #                 the front page of the web site.
@@ -161,10 +161,6 @@
     link:       /packs
     controller: packs
 
-  - label:      Services
-    link:       /services
-    controller: services
-
 # new_menu - Set "new_menu" with the details of each kind of thing to appear in
 #            the New/Upload gadget.
 #
@@ -540,6 +536,7 @@
     topic_workflow_map: INNER JOIN topic_workflow_map ON contributions.id = topic_workflow_map.workflow_id
     users: INNER JOIN users ON contributions.contributor_type = 'User' AND contributions.contributor_id = users.id
     licences: LEFT OUTER JOIN licenses ON contributions.license_id = licenses.id
+    component_profiles: LEFT OUTER JOIN workflows ON RESULT_TYPE = 'Workflow' AND workflows.id = RESULT_ID LEFT OUTER JOIN component_profiles ON workflows.component_profile_id = component_profiles.id
 
   order:
 
@@ -663,8 +660,23 @@
     label_column: services.monitor_label
     joins: [services]
 
+  - query_option: COMPONENT_PROFILE_ID
+    title: component profile
+    id_column: component_profiles.id
+    label_column: component_profiles.name
+    joins: [component_profiles]
+
   num_options: ["10", "20", "25", "50", "100"]
 
+# Shortcut keywords
+#   These are special keywords that, when typed into the search box (when 'All' is selected) will instantly jump to a
+#   specified page instead of returning a list of search results.
+#
+# Example (when 'biovel' is searched for, it will jump to the group's page):
+#
+# shortcut_keywords:
+#   biovel: /groups/643
+
 research_object_endpoints:
 
   - http://sandbox.wf4ever-project.org/rodl/sparql
@@ -719,3 +731,4 @@
 checklist:
     minim: "http://sandbox.wf4ever-project.org/rodl/ROs/Y2Demo-test/workflow-experiment-checklist.rdf"
     minim_purpose: "ready-to-release"
+

Modified: branches/wf4ever/config/environment.rb (3428 => 3429)


--- branches/wf4ever/config/environment.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/config/environment.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,7 +1,7 @@
 # Be sure to restart your server when you modify this file
 
 # Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.3.14' unless defined? RAILS_GEM_VERSION
+RAILS_GEM_VERSION = '2.3.17' unless defined? RAILS_GEM_VERSION
 
 # Bootstrap the Rails environment, frameworks, and default configuration
 require File.join(File.dirname(__FILE__), 'boot')
@@ -26,7 +26,6 @@
   # :all can be used as a placeholder for all plugins not explicitly named
   # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
   config.plugins = [
-    :encrypted_strings,
     :widgets,
     :country_select,
     :white_list,
@@ -37,17 +36,12 @@
     :acts_as_solr,
     :acts_as_taggable_redux,
     :auto_complete,
-    :encrypted_attributes,
-    :fckeditor,
     :headliner,
     :oauth,
     :oauth_plugin,
     :open_id_authentication,
     :paginating_find,
-    :query_stats,
-    :recaptcha,
     :simile_timeline,
-    :structured_data,
     :validates_email_veracity_of,
     :versioning,
   ]

Modified: branches/wf4ever/config/environments/development.rb (3428 => 3429)


--- branches/wf4ever/config/environments/development.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/config/environments/development.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -14,4 +14,6 @@
 config.action_controller.perform_caching             = false
 
 # Don't care if the mailer can't send
-config.action_mailer.raise_delivery_errors = false
\ No newline at end of file
+config.action_mailer.raise_delivery_errors = false
+
+config.log_level = :warn

Modified: branches/wf4ever/config/environments/production.rb (3428 => 3429)


--- branches/wf4ever/config/environments/production.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/config/environments/production.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -4,7 +4,7 @@
 # Code is not reloaded between requests
 config.cache_classes = true
 
-config.log_path="log/production.#{Time.new().strftime(fmt='%Y%m%d')}.#{Process.pid}.log"
+config.log_path="log/production.#{Time.new().strftime(fmt='%Y%m%d')}.log"
 
 # Full error reports are disabled and caching is turned on
 config.action_controller.consider_all_requests_local = false

Deleted: branches/wf4ever/config/initializers/mongrel.rb (3428 => 3429)


--- branches/wf4ever/config/initializers/mongrel.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/config/initializers/mongrel.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,84 +0,0 @@
-# from https://gist.github.com/826692
-
-if ['2.3.8', '2.3.9', '2.3.10', '2.3.11', '2.3.14'].include?(Rails.version) && Gem.available?('mongrel', '~>1.1.5') && self.class.const_defined?(:Mongrel)
-  
-  # Pulled right from latest rack. Old looked like this in 1.1.0 version.
-  # 
-  # def [](k)
-  #   super(@names[k] ||= @names[k.downcase])
-  # end
-  # 
-  module Rack
-    module Utils
-      class HeaderHash < Hash
-        def [](k)
-          super(@names[k]) if @names[k]
-          super(@names[k.downcase])
-        end
-      end
-    end
-  end
-  
-  # Code pulled from the ticket above.
-  # 
-  class Mongrel::CGIWrapper
-    def header_with_rails_fix(options = 'text/html')
-      @head['cookie'] = options.delete('cookie').flatten.map { |v| v.sub(/^\n/,'') } if options.class != String and options['cookie']
-      header_without_rails_fix(options)
-    end
-    alias_method_chain :header, :rails_fix
-  end
-  
-  # Pulled right from 2.3.8 ActionPack. Simple diff was
-  # 
-  # if headers.include?('Set-Cookie')
-  #   headers['cookie'] = headers.delete('Set-Cookie').split("\n")
-  # end
-  # 
-  # to 
-  # 
-  # if headers['Set-Cookie']
-  #   headers['cookie'] = headers.delete('Set-Cookie').split("\n")
-  # end
-  #       
-  module ActionController
-    class CGIHandler
-      def self.dispatch_cgi(app, cgi, out = $stdout)
-        env = cgi.__send__(:env_table)
-        env.delete "HTTP_CONTENT_LENGTH"
-        cgi.stdinput.extend ProperStream
-        env["SCRIPT_NAME"] = "" if env["SCRIPT_NAME"] == "/"
-        env.update({
-          "rack.version" => [0,1],
-          "rack.input" => cgi.stdinput,
-          "rack.errors" => $stderr,
-          "rack.multithread" => false,
-          "rack.multiprocess" => true,
-          "rack.run_once" => false,
-          "rack.url_scheme" => ["yes", "on", "1"].include?(env["HTTPS"]) ? "https" : "http"
-        })
-        env["QUERY_STRING"] ||= ""
-        env["HTTP_VERSION"] ||= env["SERVER_PROTOCOL"]
-        env["REQUEST_PATH"] ||= "/"
-        env.delete "PATH_INFO" if env["PATH_INFO"] == ""
-        status, headers, body = app.call(env)
-        begin
-          out.binmode if out.respond_to?(:binmode)
-          out.sync = false if out.respond_to?(:sync=)
-          headers['Status'] = status.to_s
-          if headers['Set-Cookie']
-            headers['cookie'] = headers.delete('Set-Cookie').split("\n")
-          end
-          out.write(cgi.header(headers))
-          body.each { |part|
-            out.write part
-            out.flush if out.respond_to?(:flush)
-          }
-        ensure
-          body.close if body.respond_to?(:close)
-        end
-      end
-    end
-  end
-  
-end

Modified: branches/wf4ever/config/initializers/rosrs_patch.rb (3428 => 3429)


--- branches/wf4ever/config/initializers/rosrs_patch.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/config/initializers/rosrs_patch.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,4 +1,6 @@
 
+require 'wf4ever/rosrs_client'
+
 class ROSRS::RDFGraph
   attr_accessor :graph
 end

Modified: branches/wf4ever/config/initializers/web_cache.rb (3428 => 3429)


--- branches/wf4ever/config/initializers/web_cache.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/config/initializers/web_cache.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -34,7 +34,7 @@
       # class so that we can tell if we've read the manifest already whilst
       # serving this request.
 
-      return false if uri.ends_with?("manifest.rdf") && Thread.current.read_manifest == false
+#     return false if uri.ends_with?("manifest.rdf") && Thread.current.read_manifest == false
 
       File.exist?(cache_file_name(uri))
     end

Modified: branches/wf4ever/config/routes.rb (3428 => 3429)


--- branches/wf4ever/config/routes.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/config/routes.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -5,42 +5,6 @@
   # rest routes
   rest_routes(map)
 
-  # LoD routes
-  if Conf.rdfgen_enable
-
-    map.connect '/:contributable_type/:contributable_id/attributions/:attribution_id.:format',
-      :controller => 'linked_data', :action ="" 'attributions', :conditions => { :method => :get }
-
-    map.connect '/:contributable_type/:contributable_id/citations/:citation_id.:format',
-      :controller => 'linked_data', :action ="" 'citations', :conditions => { :method => :get }
-
-    map.connect '/:contributable_type/:contributable_id/comments/:comment_id.:format',
-      :controller => 'linked_data', :action ="" 'comments', :conditions => { :method => :get }
-
-    map.connect '/:contributable_type/:contributable_id/credits/:credit_id.:format',
-      :controller => 'linked_data', :action ="" 'credits', :conditions => { :method => :get }
-
-    map.connect '/users/:user_id/favourites/:favourite_id.:format',
-      :controller => 'linked_data', :action ="" 'favourites', :conditions => { :method => :get }
-
-    map.connect '/packs/:contributable_id/local_pack_entries/:local_pack_entry_id.:format',
-      :controller => 'linked_data', :action ="" 'local_pack_entries',
-      :contributable_type => 'packs', :conditions => { :method => :get }
-
-    map.connect '/packs/:contributable_id/remote_pack_entries/:remote_pack_entry_id.:format',
-      :controller => 'linked_data', :action ="" 'remote_pack_entries',
-      :contributable_type => 'packs', :conditions => { :method => :get }
-
-    map.connect '/:contributable_type/:contributable_id/policies/:policy_id.:format',
-      :controller => 'linked_data', :action ="" 'policies', :conditions => { :method => :get }
-
-    map.connect '/:contributable_type/:contributable_id/ratings/:rating_id.:format',
-      :controller => 'linked_data', :action ="" 'ratings', :conditions => { :method => :get }
-
-    map.connect '/tags/:tag_id/taggings/:tagging_id.:format',
-      :controller => 'linked_data', :action ="" 'taggings', :conditions => { :method => :get }
-  end
-
   map.content '/content', :controller => 'content', :action ="" 'index', :conditions => { :method => :get }
   map.formatted_content '/content.:format', :controller => 'content', :action ="" 'index', :conditions => { :method => :get }
 
@@ -68,7 +32,7 @@
   map.resources :predicates
 
   # mashup
-  map.resource :mashup
+  map.resource :mashup, :controller => 'mashup'
   
   # search
   map.resource :search,
@@ -99,6 +63,7 @@
                  :download => :get,
                  :quick_add => :post,
                  :resolve_link => :post,
+                 :snapshot => :post,
                  :edit_annotations => :get,
                  :update_annotations => :post,
                  :create_resource => :post,
@@ -156,6 +121,10 @@
   map.blob_version           '/files/:id/versions/:version',         :conditions => { :method => :get }, :controller => 'blobs', :action ="" 'show'
   map.formatted_blob_version '/files/:id/versions/:version.:format', :conditions => { :method => :get }, :controller => 'blobs', :action ="" 'show'
 
+  # pack redirect for linked data model
+  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.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'
 
@@ -200,12 +169,6 @@
     blob.resources :comments, :collection => { :timeline => :get }
   end
 
-  # blogs
-  map.resources :blogs do |blog|
-    # blogs have nested posts
-    blog.resources :blog_posts
-  end
-
   # services
   map.resources :services, :collection => { :search => :get }
   
@@ -241,7 +204,7 @@
   map.connect 'users/forgot_password', :controller => "users", :action ="" "forgot_password"
   map.connect 'users/reset_password/:reset_code', :controller => "users", :action ="" "reset_password"
   
-  [ 'news', 'friends', 'groups', 'workflows', 'files', 'packs', 'forums', 'blogs', 'credits', 'tags', 'favourites' ].each do |tab|
+  [ 'news', 'friends', 'groups', 'workflows', 'files', 'packs', 'forums', 'credits', 'tags', 'favourites' ].each do |tab|
     map.connect "users/:id/#{tab}", :controller => 'users', :action ="" tab
   end
   
@@ -284,6 +247,7 @@
                  :tag => :post } do |network|
     network.resources :group_announcements, :as => :announcements, :name_prefix => nil
     network.resources :comments, :collection => { :timeline => :get }
+    network.resources :policies, :controller => 'group_policies'
   end
   
   # The priority is based upon order of creation: first created -> highest priority.
@@ -331,6 +295,42 @@
 
   map.connect 'clear_external_site_session_info', :controller => 'application', :action ="" 'clear_external_site_session_info'
 
+  # LoD routes
+  if Conf.rdfgen_enable
+
+    map.connect '/:contributable_type/:contributable_id/attributions/:attribution_id.:format',
+      :controller => 'linked_data', :action ="" 'attributions', :conditions => { :method => :get }
+
+    map.connect '/:contributable_type/:contributable_id/citations/:citation_id.:format',
+      :controller => 'linked_data', :action ="" 'citations', :conditions => { :method => :get }
+
+    map.connect '/:contributable_type/:contributable_id/comments/:comment_id.:format',
+      :controller => 'linked_data', :action ="" 'comments', :conditions => { :method => :get }
+
+    map.connect '/:contributable_type/:contributable_id/credits/:credit_id.:format',
+      :controller => 'linked_data', :action ="" 'credits', :conditions => { :method => :get }
+
+    map.connect '/users/:user_id/favourites/:favourite_id.:format',
+      :controller => 'linked_data', :action ="" 'favourites', :conditions => { :method => :get }
+
+    map.connect '/packs/:contributable_id/local_pack_entries/:local_pack_entry_id.:format',
+      :controller => 'linked_data', :action ="" 'local_pack_entries',
+      :contributable_type => 'packs', :conditions => { :method => :get }
+
+    map.connect '/packs/:contributable_id/remote_pack_entries/:remote_pack_entry_id.:format',
+      :controller => 'linked_data', :action ="" 'remote_pack_entries',
+      :contributable_type => 'packs', :conditions => { :method => :get }
+
+    map.connect '/:contributable_type/:contributable_id/policies/:policy_id.:format',
+      :controller => 'linked_data', :action ="" 'policies', :conditions => { :method => :get }
+
+    map.connect '/:contributable_type/:contributable_id/ratings/:rating_id.:format',
+      :controller => 'linked_data', :action ="" 'ratings', :conditions => { :method => :get }
+
+    map.connect '/tags/:tag_id/taggings/:tagging_id.:format',
+      :controller => 'linked_data', :action ="" 'taggings', :conditions => { :method => :get }
+  end
+
   # Install the default route as the lowest priority.
   map.connect ':controller/:action/:id'
 end

Modified: branches/wf4ever/config/tables.xml


(Binary files differ)

Copied: branches/wf4ever/db/migrate/000_removal_of_structured_data.rb (from rev 3428, trunk/db/migrate/000_removal_of_structured_data.rb) (0 => 3429)


--- branches/wf4ever/db/migrate/000_removal_of_structured_data.rb	                        (rev 0)
+++ branches/wf4ever/db/migrate/000_removal_of_structured_data.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,310 @@
+class RemovalOfStructuredData < ActiveRecord::Migration
+  def self.up
+
+    # Don't create these tables in if the (now removed) structured_data plugin
+    # has already created them.
+
+    return if ActiveRecord::Base.connection.tables.include?("contributions")
+
+    create_table "concept_relations" do |t|
+      t.integer "subject_concept_id"
+      t.string  "relation_type"
+      t.integer "object_concept_id"
+    end
+
+    create_table "concepts" do |t|
+      t.datetime "updated_at"
+      t.text     "description_html"
+      t.string   "phrase"
+      t.text     "description"
+      t.integer  "vocabulary_id"
+      t.datetime "created_at"
+    end
+
+    create_table "content_types" do |t|
+      t.integer  "user_id"
+      t.string   "title"
+      t.text     "description"
+      t.text     "description_html"
+      t.string   "mime_type"
+      t.datetime "created_at"
+      t.datetime "updated_at"
+      t.string   "category"
+    end
+
+    create_table "contributions" do |t|
+      t.integer  "contributor_id"
+      t.string   "contributor_type"
+      t.integer  "contributable_id"
+      t.string   "contributable_type"
+      t.integer  "policy_id"
+      t.datetime "created_at"
+      t.datetime "updated_at"
+      t.integer  "downloads_count",      :default => 0
+      t.integer  "viewings_count",       :default => 0
+      t.float    "rating"
+      t.float    "rank"
+      t.integer  "content_type_id"
+      t.integer  "license_id"
+      t.integer  "site_downloads_count", :default => 0
+      t.integer  "site_viewings_count",  :default => 0
+      t.string   "label"
+      t.string   "layout"
+    end
+
+    add_index "contributions",     ["contributable_id", "contributable_type"]
+    add_index "contributions",     ["contributor_id", "contributor_type"]
+
+    create_table "downloads" do |t|
+      t.integer  "contribution_id"
+      t.integer  "user_id"
+      t.datetime "created_at"
+      t.string   "user_agent"
+      t.boolean  "accessed_from_site", :default => false
+      t.string   "kind"
+    end
+
+    add_index :downloads, ["contribution_id"]
+
+    create_table "federation_sources" do |t|
+      t.string "name"
+    end
+
+    create_table "labels" do |t|
+      t.integer "concept_id"
+      t.string  "language"
+      t.string  "text"
+      t.integer "vocabulary_id"
+      t.string  "label_type"
+    end
+
+    create_table "ontologies" do |t|
+      t.string   "prefix"
+      t.datetime "updated_at"
+      t.string   "uri"
+      t.string   "title"
+      t.text     "description_html"
+      t.text     "description"
+      t.integer  "user_id"
+      t.datetime "created_at"
+    end
+
+    create_table "pack_contributable_entries" do |t|
+      t.integer  "pack_id",               :null => false
+      t.integer  "contributable_id",      :null => false
+      t.integer  "contributable_version"
+      t.string   "contributable_type"
+      t.text     "comment"
+      t.integer  "user_id",               :null => false
+      t.datetime "created_at"
+      t.datetime "updated_at"
+    end
+
+    create_table "pack_remote_entries" do |t|
+      t.integer  "pack_id",       :null => false
+      t.string   "title"
+      t.string   "uri"
+      t.string   "alternate_uri"
+      t.text     "comment"
+      t.integer  "user_id",       :null => false
+      t.datetime "created_at"
+      t.datetime "updated_at"
+    end
+
+    create_table "packs" do |t|
+      t.integer  "contributor_id"
+      t.string   "contributor_type"
+      t.string   "title"
+      t.text     "description"
+      t.text     "description_html"
+      t.datetime "created_at"
+      t.datetime "updated_at"
+    end
+
+    create_table "policies" do |t|
+      t.integer  "contributor_id"
+      t.string   "contributor_type"
+      t.string   "name"
+      t.datetime "created_at"
+      t.datetime "updated_at"
+      t.integer  "share_mode"
+      t.integer  "update_mode"
+      t.boolean  "public_download",  :default => false
+      t.boolean  "public_view",      :default => false
+    end
+
+    create_table "predicates" do |t|
+      t.datetime "updated_at"
+      t.string   "title"
+      t.text     "description_html"
+      t.string   "phrase"
+      t.integer  "ontology_id"
+      t.text     "description"
+      t.text     "equivalent_to"
+      t.datetime "created_at"
+    end
+
+    create_table "previews" do |t|
+      t.integer  "svg_blob_id"
+      t.integer  "image_blob_id"
+      t.datetime "created_at"
+    end
+
+    create_table "relationships" do |t|
+      t.string   "objekt_type"
+      t.integer  "objekt_id"
+      t.string   "subject_type"
+      t.integer  "subject_id"
+      t.integer  "user_id"
+      t.datetime "created_at"
+      t.integer  "context_id"
+      t.integer  "predicate_id"
+      t.string   "context_type"
+    end
+
+    create_table "service_categories" do |t|
+      t.string   "uri"
+      t.datetime "updated_at"
+      t.integer  "service_id"
+      t.string   "label"
+      t.datetime "retrieved_at"
+      t.datetime "created_at"
+    end
+
+    create_table "service_deployments" do |t|
+      t.string   "iso3166_country_code"
+      t.string   "city"
+      t.string   "submitter_label"
+      t.string   "uri"
+      t.datetime "updated_at"
+      t.string   "submitter_uri"
+      t.string   "country"
+      t.integer  "service_id"
+      t.datetime "created"
+      t.integer  "service_provider_id"
+      t.string   "flag_url"
+      t.string   "endpoint"
+      t.datetime "retrieved_at"
+      t.datetime "created_at"
+    end
+
+    create_table "service_providers" do |t|
+      t.string   "name"
+      t.string   "uri"
+      t.datetime "updated_at"
+      t.text     "description"
+      t.datetime "created"
+      t.datetime "retrieved_at"
+      t.datetime "created_at"
+    end
+
+    create_table "service_tags" do |t|
+      t.string   "uri"
+      t.datetime "updated_at"
+      t.integer  "service_id"
+      t.string   "label"
+      t.datetime "retrieved_at"
+      t.datetime "created_at"
+    end
+
+    create_table "service_types" do |t|
+      t.datetime "updated_at"
+      t.integer  "service_id"
+      t.string   "label"
+      t.datetime "retrieved_at"
+      t.datetime "created_at"
+    end
+
+    create_table "services" do |t|
+      t.string   "documentation_uri"
+      t.string   "iso3166_country_code"
+      t.string   "city"
+      t.string   "name"
+      t.string   "provider_uri"
+      t.string   "submitter_label"
+      t.string   "uri"
+      t.datetime "updated_at"
+      t.string   "monitor_symbol_url"
+      t.datetime "monitor_last_checked"
+      t.string   "monitor_label"
+      t.string   "country"
+      t.string   "submitter_uri"
+      t.string   "monitor_small_symbol_url"
+      t.text     "monitor_message"
+      t.text     "description"
+      t.string   "wsdl"
+      t.datetime "created"
+      t.string   "contributor_type"
+      t.integer  "contributor_id"
+      t.string   "flag_url"
+      t.string   "endpoint"
+      t.string   "provider_label"
+      t.datetime "retrieved_at"
+      t.datetime "created_at"
+    end
+
+    create_table "topic_feedbacks" do |t|
+      t.integer  "score"
+      t.integer  "topic_id"
+      t.datetime "submit_dt"
+      t.integer  "user_id"
+    end
+
+    create_table "topic_runs" do |t|
+      t.datetime "runtime"
+      t.string   "description"
+    end
+
+    create_table "topic_tag_map" do |t|
+      t.integer "topic_id"
+      t.boolean "display_flag"
+      t.integer "tag_id"
+      t.float   "probability"
+    end
+
+    create_table "topic_workflow_map" do |t|
+      t.integer "topic_id"
+      t.boolean "display_flag"
+      t.integer "workflow_id"
+      t.float   "probability"
+    end
+
+    create_table "topics" do |t|
+      t.string  "name"
+      t.integer "orig_run_id"
+      t.integer "run_id"
+    end
+
+    create_table "user_reports" do |t|
+      t.string   "subject_type"
+      t.text     "content"
+      t.integer  "subject_id"
+      t.integer  "user_id"
+      t.text     "report"
+      t.datetime "created_at"
+    end
+
+    create_table "vocabularies" do |t|
+      t.integer  "user_id"
+      t.string   "title"
+      t.text     "description"
+      t.text     "description_html"
+      t.datetime "created_at"
+      t.datetime "updated_at"
+      t.string   "prefix"
+      t.string   "uri"
+    end
+
+    create_table "workflow_processors" do |t|
+      t.string  "name"
+      t.string  "wsdl_operation"
+      t.string  "wsdl"
+      t.integer "workflow_id"
+    end
+  end
+
+  def self.down
+    raise ActiveRecord::IrreversibleMigration 
+  end
+end
+

Modified: branches/wf4ever/db/migrate/075_add_indexes_to_frequently_used_tables.rb (3428 => 3429)


--- branches/wf4ever/db/migrate/075_add_indexes_to_frequently_used_tables.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/db/migrate/075_add_indexes_to_frequently_used_tables.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -5,8 +5,8 @@
 
     add_index :workflow_versions, ["workflow_id"], :name => "workflow_versions_workflow_id_index"
 
-    add_index :contributions, ["contributable_id", "contributable_type"], :name => "contributions_contributable_index"
-    add_index :contributions, ["contributor_id",   "contributor_type"],   :name => "contributions_contributor_index"
+#   add_index :contributions, ["contributable_id", "contributable_type"], :name => "contributions_contributable_index"
+#   add_index :contributions, ["contributor_id",   "contributor_type"],   :name => "contributions_contributor_index"
 
     add_index :memberships, ["user_id"],    :name => "memberships_user_id_index"
     add_index :memberships, ["network_id"], :name => "memberships_network_id_index"
@@ -25,8 +25,8 @@
 
     remove_index :workflow_versions, :name => "workflow_versions_workflow_id_index"
 
-    remove_index :contributions, :name => "contributions_contributable_index"
-    remove_index :contributions, :name => "contributions_contributor_index"
+#   remove_index :contributions, :name => "contributions_contributable_index"
+#   remove_index :contributions, :name => "contributions_contributor_index"
 
     remove_index :memberships, :name => "memberships_user_id_index"
     remove_index :memberships, :name => "memberships_network_id_index"

Modified: branches/wf4ever/db/migrate/086_rename_indexes_to_automatic_names.rb (3428 => 3429)


--- branches/wf4ever/db/migrate/086_rename_indexes_to_automatic_names.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/db/migrate/086_rename_indexes_to_automatic_names.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -7,8 +7,8 @@
   def self.up
     remove_index "bookmarks",         :name => "fk_bookmarks_user"
     remove_index "comments",          :name => "fk_comments_user"
-    remove_index "contributions",     :name => "contributions_contributable_index"
-    remove_index "contributions",     :name => "contributions_contributor_index"
+#   remove_index "contributions",     :name => "contributions_contributable_index"
+#   remove_index "contributions",     :name => "contributions_contributor_index"
     remove_index "friendships",       :name => "friendships_friend_id_index"
     remove_index "friendships",       :name => "friendships_user_id_index"
     remove_index "memberships",       :name => "memberships_network_id_index"

Copied: branches/wf4ever/db/migrate/098_create_pack_versions.rb (from rev 3428, trunk/db/migrate/098_create_pack_versions.rb) (0 => 3429)


--- branches/wf4ever/db/migrate/098_create_pack_versions.rb	                        (rev 0)
+++ branches/wf4ever/db/migrate/098_create_pack_versions.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,33 @@
+# myExperiment: db/migrate/097_create_pack_versions.rb
+#
+# Copyright (c) 2012 University of Manchester and the University of Southampton.
+# See license.txt for details.
+
+class CreatePackVersions < ActiveRecord::Migration
+
+  def self.up
+    create_table :pack_versions do |t|
+      t.integer  "pack_id"
+      t.integer  "version"
+      t.text     "revision_comments"
+      t.string   "title"
+      t.text     "description"
+      t.text     "description_html"
+      t.datetime "created_at"
+      t.datetime "updated_at"
+    end
+
+    add_column :packs, :current_version, :integer
+    add_column :pack_contributable_entries, :version, :integer
+    add_column :pack_remote_entries, :version, :integer
+  end
+
+  def self.down
+    remove_column :packs, :current_version
+    remove_column :pack_contributable_entries, :version
+    remove_column :pack_remote_entries, :version
+
+    drop_table :pack_versions
+  end
+end
+

Copied: branches/wf4ever/db/migrate/20121126093655_create_semantic_annotations.rb (from rev 3428, trunk/db/migrate/20121126093655_create_semantic_annotations.rb) (0 => 3429)


--- branches/wf4ever/db/migrate/20121126093655_create_semantic_annotations.rb	                        (rev 0)
+++ branches/wf4ever/db/migrate/20121126093655_create_semantic_annotations.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,14 @@
+class CreateSemanticAnnotations < ActiveRecord::Migration
+  def self.up
+    create_table :semantic_annotations do |t|
+      t.integer :subject_id
+      t.string :subject_type
+      t.string :predicate
+      t.string :object
+    end
+  end
+
+  def self.down
+    drop_table :semantic_annotations
+  end
+end

Copied: branches/wf4ever/db/migrate/20121126095828_create_workflow_ports.rb (from rev 3428, trunk/db/migrate/20121126095828_create_workflow_ports.rb) (0 => 3429)


--- branches/wf4ever/db/migrate/20121126095828_create_workflow_ports.rb	                        (rev 0)
+++ branches/wf4ever/db/migrate/20121126095828_create_workflow_ports.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,13 @@
+class CreateWorkflowPorts < ActiveRecord::Migration
+  def self.up
+    create_table :workflow_ports do |t|
+      t.string :name
+      t.string :port_type
+      t.integer :workflow_id
+    end
+  end
+
+  def self.down
+    drop_table :workflow_ports
+  end
+end

Copied: branches/wf4ever/db/migrate/20130114091326_move_layout_to_policy.rb (from rev 3428, trunk/db/migrate/20130114091326_move_layout_to_policy.rb) (0 => 3429)


--- branches/wf4ever/db/migrate/20130114091326_move_layout_to_policy.rb	                        (rev 0)
+++ branches/wf4ever/db/migrate/20130114091326_move_layout_to_policy.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,20 @@
+class MoveLayoutToPolicy < ActiveRecord::Migration
+  def self.up
+    # Add column to policies
+    add_column :policies, :layout, :string
+    # Copy values
+    ActiveRecord::Base.record_timestamps = false
+    execute 'UPDATE policies,contributions SET policies.layout = contributions.layout WHERE policies.id = contributions.policy_id'
+    ActiveRecord::Base.record_timestamps = true
+    # Remove column from contributions
+    remove_column :contributions, :layout
+  end
+
+  def self.down
+    add_column :contributions, :layout, :string
+    ActiveRecord::Base.record_timestamps = false
+    execute 'UPDATE policies,contributions SET contributions.layout = policies.layout WHERE policies.id = contributions.policy_id'
+    ActiveRecord::Base.record_timestamps = true
+    remove_column :policies, :layout
+  end
+end

Copied: branches/wf4ever/db/migrate/20130124144906_remove_blogs.rb (from rev 3428, trunk/db/migrate/20130124144906_remove_blogs.rb) (0 => 3429)


--- branches/wf4ever/db/migrate/20130124144906_remove_blogs.rb	                        (rev 0)
+++ branches/wf4ever/db/migrate/20130124144906_remove_blogs.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,15 @@
+class RemoveBlogs < ActiveRecord::Migration
+  def self.up
+    drop_table :blogs
+  end
+
+  def self.down
+    create_table :blogs do |t|
+      t.column :contributor_id, :integer
+      t.column :contributor_type, :string
+      t.column :title, :string
+      t.column :created_at, :datetime
+      t.column :updated_at, :datetime
+    end
+  end
+end

Copied: branches/wf4ever/db/migrate/20130124144917_remove_blog_posts.rb (from rev 3428, trunk/db/migrate/20130124144917_remove_blog_posts.rb) (0 => 3429)


--- branches/wf4ever/db/migrate/20130124144917_remove_blog_posts.rb	                        (rev 0)
+++ branches/wf4ever/db/migrate/20130124144917_remove_blog_posts.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,16 @@
+class RemoveBlogPosts < ActiveRecord::Migration
+  def self.up
+    drop_table :blog_posts
+  end
+
+  def self.down
+    create_table :blog_posts do |t|
+      t.column :blog_id, :integer
+      t.column :title, :string
+      t.column :body, :text
+      t.column :created_at, :datetime
+      t.column :updated_at, :datetime
+      t.column :body_html, :text
+    end
+  end
+end

Copied: branches/wf4ever/db/migrate/20130215162325_change_runner_passwords.rb (from rev 3428, trunk/db/migrate/20130215162325_change_runner_passwords.rb) (0 => 3429)


--- branches/wf4ever/db/migrate/20130215162325_change_runner_passwords.rb	                        (rev 0)
+++ branches/wf4ever/db/migrate/20130215162325_change_runner_passwords.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,16 @@
+# myExperiment: db/migrate/20130215162325_change_runner_passwords.rb
+#
+# Copyright (c) 2013 University of Manchester and the University of Southampton.
+# See license.txt for details.
+
+class ChangeRunnerPasswords < ActiveRecord::Migration
+  def self.up
+    remove_column :taverna_enactors, :crypted_password
+    add_column    :taverna_enactors, :password, :string
+  end
+
+  def self.down
+    add_column    :taverna_enactors, :crypted_password, :string
+    remove_column :taverna_enactors, :password
+  end
+end

Modified: branches/wf4ever/db/schema.rb (3428 => 3429)


--- branches/wf4ever/db/schema.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/db/schema.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -9,7 +9,7 @@
 #
 # It's strongly recommended to check this file into your version control system.
 
-ActiveRecord::Schema.define(:version => 20130121162244) do
+ActiveRecord::Schema.define(:version => 20130215162325) do
 
   create_table "activity_limits", :force => true do |t|
     t.string   "contributor_type", :null => false
@@ -60,38 +60,21 @@
   end
 
   create_table "blobs", :force => true do |t|
-    t.integer  "contributor_id"
-    t.string   "contributor_type"
-    t.string   "local_name"
-    t.datetime "created_at"
     t.datetime "updated_at"
     t.string   "title"
+    t.integer  "content_blob_id"
+    t.string   "local_name"
     t.text     "body"
+    t.integer  "content_type_id"
+    t.integer  "contributor_id"
+    t.datetime "created_at"
     t.text     "body_html"
-    t.integer  "content_blob_id"
-    t.integer  "content_type_id"
+    t.string   "contributor_type"
     t.integer  "license_id"
     t.integer  "current_version"
     t.text     "ro_uri"
   end
 
-  create_table "blog_posts", :force => true do |t|
-    t.integer  "blog_id"
-    t.string   "title"
-    t.text     "body"
-    t.datetime "created_at"
-    t.datetime "updated_at"
-    t.text     "body_html"
-  end
-
-  create_table "blogs", :force => true do |t|
-    t.integer  "contributor_id"
-    t.string   "contributor_type"
-    t.string   "title"
-    t.datetime "created_at"
-    t.datetime "updated_at"
-  end
-
   create_table "bookmarks", :force => true do |t|
     t.string   "title",             :limit => 50, :default => ""
     t.datetime "created_at",                                      :null => false
@@ -151,11 +134,11 @@
   end
 
   create_table "concepts", :force => true do |t|
+    t.datetime "updated_at"
     t.text     "description_html"
+    t.text     "description"
     t.string   "phrase"
-    t.datetime "updated_at"
     t.datetime "created_at"
-    t.text     "description"
     t.integer  "vocabulary_id"
   end
 
@@ -165,38 +148,34 @@
     t.string "sha1", :limit => 40
   end
 
-  add_index "content_blobs", ["md5"], :name => "index_content_blobs_on_md5"
-  add_index "content_blobs", ["sha1"], :name => "index_content_blobs_on_sha1"
-
   create_table "content_types", :force => true do |t|
-    t.string   "mime_type"
+    t.datetime "updated_at"
     t.text     "description_html"
-    t.datetime "updated_at"
-    t.integer  "user_id"
-    t.datetime "created_at"
     t.text     "description"
     t.string   "title"
+    t.datetime "created_at"
+    t.string   "mime_type"
+    t.integer  "user_id"
     t.string   "category"
   end
 
   create_table "contributions", :force => true do |t|
+    t.datetime "updated_at"
+    t.string   "contributable_type"
+    t.string   "label"
+    t.float    "rating"
+    t.integer  "policy_id"
     t.integer  "viewings_count",       :default => 0
+    t.integer  "site_downloads_count", :default => 0
+    t.integer  "content_type_id"
+    t.integer  "contributor_id"
+    t.integer  "contributable_id"
+    t.float    "rank"
     t.integer  "site_viewings_count",  :default => 0
-    t.integer  "site_downloads_count", :default => 0
     t.integer  "downloads_count",      :default => 0
+    t.datetime "created_at"
     t.string   "contributor_type"
     t.integer  "license_id"
-    t.integer  "content_type_id"
-    t.float    "rank"
-    t.integer  "policy_id"
-    t.string   "layout"
-    t.datetime "updated_at"
-    t.integer  "contributable_id"
-    t.string   "label"
-    t.datetime "created_at"
-    t.float    "rating"
-    t.string   "contributable_type"
-    t.integer  "contributor_id"
   end
 
   add_index "contributions", ["contributable_id", "contributable_type"], :name => "index_contributions_on_contributable_id_and_contributable_type"
@@ -230,11 +209,11 @@
 
   create_table "downloads", :force => true do |t|
     t.string   "kind"
-    t.boolean  "accessed_from_site", :default => false
+    t.string   "user_agent"
     t.integer  "contribution_id"
+    t.datetime "created_at"
     t.integer  "user_id"
-    t.datetime "created_at"
-    t.string   "user_agent"
+    t.boolean  "accessed_from_site", :default => false
   end
 
   add_index "downloads", ["contribution_id"], :name => "index_downloads_on_contribution_id"
@@ -307,11 +286,11 @@
   end
 
   create_table "labels", :force => true do |t|
+    t.integer "concept_id"
     t.string  "label_type"
     t.string  "text"
+    t.integer "vocabulary_id"
     t.string  "language"
-    t.integer "concept_id"
-    t.integer "vocabulary_id"
   end
 
   create_table "license_attributes", :force => true do |t|
@@ -401,52 +380,69 @@
     t.datetime "invalidated_at"
     t.datetime "created_at"
     t.datetime "updated_at"
+    t.string   "callback_url"
+    t.string   "verifier",              :limit => 20
+    t.string   "scope"
   end
 
   add_index "oauth_tokens", ["token"], :name => "index_oauth_tokens_on_token", :unique => true
 
   create_table "ontologies", :force => true do |t|
+    t.datetime "updated_at"
     t.text     "description_html"
-    t.datetime "updated_at"
-    t.string   "prefix"
-    t.integer  "user_id"
-    t.datetime "created_at"
     t.text     "description"
     t.string   "title"
     t.string   "uri"
+    t.string   "prefix"
+    t.datetime "created_at"
+    t.integer  "user_id"
   end
 
   create_table "pack_contributable_entries", :force => true do |t|
-    t.text     "comment"
+    t.datetime "updated_at"
+    t.string   "contributable_type"
+    t.integer  "contributable_version"
     t.integer  "pack_id",               :null => false
-    t.datetime "updated_at"
     t.integer  "contributable_id",      :null => false
-    t.integer  "contributable_version"
+    t.datetime "created_at"
     t.integer  "user_id",               :null => false
-    t.datetime "created_at"
-    t.string   "contributable_type"
+    t.text     "comment"
+    t.integer  "version"
   end
 
   create_table "pack_remote_entries", :force => true do |t|
-    t.text     "comment"
+    t.datetime "updated_at"
+    t.string   "uri"
+    t.string   "title"
     t.integer  "pack_id",       :null => false
     t.string   "alternate_uri"
-    t.datetime "updated_at"
+    t.datetime "created_at"
     t.integer  "user_id",       :null => false
+    t.text     "comment"
+    t.integer  "version"
+  end
+
+  create_table "pack_versions", :force => true do |t|
+    t.integer  "pack_id"
+    t.integer  "version"
+    t.text     "revision_comments"
+    t.string   "title"
+    t.text     "description"
+    t.text     "description_html"
     t.datetime "created_at"
-    t.string   "title"
-    t.string   "uri"
+    t.datetime "updated_at"
   end
 
   create_table "packs", :force => true do |t|
+    t.datetime "updated_at"
     t.text     "description_html"
-    t.string   "contributor_type"
-    t.datetime "updated_at"
-    t.datetime "created_at"
     t.text     "description"
     t.string   "title"
     t.integer  "contributor_id"
+    t.datetime "created_at"
+    t.string   "contributor_type"
     t.text     "ro_uri"
+    t.integer  "current_version"
   end
 
   create_table "pending_invitations", :force => true do |t|
@@ -484,32 +480,33 @@
   end
 
   create_table "policies", :force => true do |t|
+    t.datetime "updated_at"
+    t.boolean  "public_download",  :default => false
     t.integer  "update_mode"
+    t.integer  "share_mode"
+    t.integer  "contributor_id"
     t.string   "name"
-    t.string   "contributor_type"
-    t.boolean  "public_download",  :default => false
-    t.datetime "updated_at"
     t.boolean  "public_view",      :default => false
-    t.integer  "share_mode"
     t.datetime "created_at"
-    t.integer  "contributor_id"
+    t.string   "contributor_type"
+    t.string   "layout"
   end
 
   create_table "predicates", :force => true do |t|
+    t.datetime "updated_at"
     t.text     "description_html"
+    t.text     "description"
     t.string   "phrase"
-    t.datetime "updated_at"
+    t.string   "title"
     t.text     "equivalent_to"
     t.datetime "created_at"
-    t.text     "description"
-    t.string   "title"
     t.integer  "ontology_id"
   end
 
   create_table "previews", :force => true do |t|
-    t.integer  "image_blob_id"
     t.integer  "svg_blob_id"
     t.datetime "created_at"
+    t.integer  "image_blob_id"
   end
 
   create_table "profiles", :force => true do |t|
@@ -543,15 +540,15 @@
   add_index "ratings", ["user_id"], :name => "index_ratings_on_user_id"
 
   create_table "relationships", :force => true do |t|
-    t.integer  "predicate_id"
     t.string   "context_type"
     t.string   "subject_type"
-    t.integer  "objekt_id"
     t.string   "objekt_type"
+    t.integer  "subject_id"
     t.integer  "context_id"
-    t.integer  "subject_id"
+    t.datetime "created_at"
+    t.integer  "predicate_id"
     t.integer  "user_id"
-    t.datetime "created_at"
+    t.integer  "objekt_id"
   end
 
   create_table "remote_workflows", :force => true do |t|
@@ -573,85 +570,92 @@
 
   add_index "reviews", ["user_id"], :name => "index_reviews_on_user_id"
 
+  create_table "semantic_annotations", :force => true do |t|
+    t.integer "subject_id"
+    t.string  "subject_type"
+    t.string  "predicate"
+    t.string  "object"
+  end
+
   create_table "service_categories", :force => true do |t|
-    t.integer  "service_id"
-    t.datetime "retrieved_at"
     t.datetime "updated_at"
     t.string   "label"
+    t.string   "uri"
+    t.datetime "retrieved_at"
+    t.integer  "service_id"
     t.datetime "created_at"
-    t.string   "uri"
   end
 
   create_table "service_deployments", :force => true do |t|
-    t.integer  "service_id"
-    t.string   "submitter_label"
-    t.datetime "retrieved_at"
-    t.string   "submitter_uri"
-    t.string   "endpoint"
     t.string   "iso3166_country_code"
     t.datetime "updated_at"
-    t.string   "country"
     t.datetime "created"
     t.string   "flag_url"
+    t.string   "uri"
+    t.datetime "retrieved_at"
+    t.integer  "service_provider_id"
+    t.string   "endpoint"
+    t.integer  "service_id"
+    t.string   "submitter_label"
+    t.string   "country"
+    t.string   "submitter_uri"
+    t.datetime "created_at"
     t.string   "city"
-    t.datetime "created_at"
-    t.integer  "service_provider_id"
-    t.string   "uri"
   end
 
   create_table "service_providers", :force => true do |t|
+    t.text     "description"
+    t.datetime "updated_at"
+    t.datetime "created"
+    t.string   "uri"
     t.datetime "retrieved_at"
     t.string   "name"
-    t.datetime "updated_at"
-    t.datetime "created"
-    t.text     "description"
     t.datetime "created_at"
-    t.string   "uri"
   end
 
   create_table "service_tags", :force => true do |t|
-    t.integer  "service_id"
-    t.datetime "retrieved_at"
     t.datetime "updated_at"
     t.string   "label"
+    t.string   "uri"
+    t.datetime "retrieved_at"
+    t.integer  "service_id"
     t.datetime "created_at"
-    t.string   "uri"
   end
 
   create_table "service_types", :force => true do |t|
-    t.integer  "service_id"
-    t.datetime "retrieved_at"
     t.datetime "updated_at"
     t.string   "label"
+    t.datetime "retrieved_at"
+    t.integer  "service_id"
     t.datetime "created_at"
   end
 
   create_table "services", :force => true do |t|
-    t.string   "submitter_label"
+    t.text     "description"
+    t.string   "documentation_uri"
+    t.string   "iso3166_country_code"
+    t.datetime "updated_at"
+    t.string   "flag_url"
+    t.string   "provider_label"
+    t.datetime "created"
+    t.string   "uri"
+    t.text     "monitor_message"
+    t.datetime "monitor_last_checked"
+    t.string   "monitor_symbol_url"
     t.datetime "retrieved_at"
-    t.string   "monitor_symbol_url"
+    t.integer  "contributor_id"
     t.string   "endpoint"
-    t.string   "provider_label"
-    t.string   "provider_uri"
     t.string   "name"
+    t.string   "country"
+    t.string   "submitter_label"
     t.string   "submitter_uri"
-    t.string   "documentation_uri"
-    t.string   "iso3166_country_code"
+    t.datetime "created_at"
+    t.string   "wsdl"
     t.string   "contributor_type"
+    t.string   "city"
+    t.string   "monitor_small_symbol_url"
     t.string   "monitor_label"
-    t.string   "wsdl"
-    t.datetime "updated_at"
-    t.string   "country"
-    t.datetime "monitor_last_checked"
-    t.string   "monitor_small_symbol_url"
-    t.datetime "created"
-    t.text     "description"
-    t.string   "flag_url"
-    t.string   "city"
-    t.datetime "created_at"
-    t.text     "monitor_message"
-    t.string   "uri"
-    t.integer  "contributor_id"
+    t.string   "provider_uri"
   end
 
   create_table "sessions", :force => true do |t|
@@ -665,14 +669,12 @@
 
   create_table "statements", :force => true do |t|
     t.integer  "research_object_id"
-    t.string   "resource"
-    t.integer  "version"
-    t.text     "context_uri"
     t.string   "subject_text"
     t.string   "predicate_text"
     t.string   "objekt_text"
     t.datetime "created_at"
     t.datetime "updated_at"
+    t.text     "context_uri"
   end
 
   create_table "taggings", :force => true do |t|
@@ -708,50 +710,50 @@
     t.string   "contributor_type"
     t.string   "url"
     t.string   "username"
-    t.string   "crypted_password"
     t.datetime "created_at"
     t.datetime "updated_at"
+    t.string   "password"
   end
 
   create_table "topic_feedbacks", :force => true do |t|
+    t.integer  "score"
     t.integer  "topic_id"
-    t.integer  "score"
     t.datetime "submit_dt"
     t.integer  "user_id"
   end
 
   create_table "topic_runs", :force => true do |t|
+    t.string   "description"
     t.datetime "runtime"
-    t.string   "description"
   end
 
   create_table "topic_tag_map", :force => true do |t|
+    t.boolean "display_flag"
+    t.float   "probability"
     t.integer "tag_id"
     t.integer "topic_id"
-    t.float   "probability"
-    t.boolean "display_flag"
   end
 
   create_table "topic_workflow_map", :force => true do |t|
-    t.integer "topic_id"
+    t.boolean "display_flag"
     t.float   "probability"
-    t.boolean "display_flag"
     t.integer "workflow_id"
+    t.integer "topic_id"
   end
 
   create_table "topics", :force => true do |t|
+    t.integer "orig_run_id"
+    t.integer "run_id"
     t.string  "name"
-    t.integer "run_id"
-    t.integer "orig_run_id"
   end
 
   create_table "user_reports", :force => true do |t|
+    t.text     "content"
     t.string   "subject_type"
-    t.text     "content"
+    t.text     "report"
     t.integer  "subject_id"
-    t.text     "report"
+    t.datetime "created_at"
     t.integer  "user_id"
-    t.datetime "created_at"
   end
 
   create_table "users", :force => true do |t|
@@ -789,21 +791,27 @@
   add_index "viewings", ["contribution_id"], :name => "index_viewings_on_contribution_id"
 
   create_table "vocabularies", :force => true do |t|
+    t.datetime "updated_at"
     t.text     "description_html"
-    t.datetime "updated_at"
-    t.string   "prefix"
-    t.integer  "user_id"
-    t.datetime "created_at"
     t.text     "description"
     t.string   "title"
     t.string   "uri"
+    t.string   "prefix"
+    t.datetime "created_at"
+    t.integer  "user_id"
   end
 
+  create_table "workflow_ports", :force => true do |t|
+    t.string  "name"
+    t.string  "port_type"
+    t.integer "workflow_id"
+  end
+
   create_table "workflow_processors", :force => true do |t|
+    t.string  "name"
     t.string  "wsdl_operation"
-    t.string  "name"
+    t.integer "workflow_id"
     t.string  "wsdl"
-    t.integer "workflow_id"
   end
 
   create_table "workflow_versions", :force => true do |t|
@@ -817,8 +825,6 @@
     t.text     "body_html"
     t.datetime "created_at"
     t.datetime "updated_at"
-    t.string   "license"
-    t.integer  "preview_id"
     t.string   "image"
     t.string   "svg"
     t.text     "revision_comments"
@@ -826,27 +832,29 @@
     t.string   "file_ext"
     t.string   "last_edited_by"
     t.integer  "content_type_id"
+    t.string   "license"
+    t.integer  "preview_id"
   end
 
   add_index "workflow_versions", ["workflow_id"], :name => "index_workflow_versions_on_workflow_id"
 
   create_table "workflows", :force => true do |t|
-    t.integer  "contributor_id"
-    t.string   "contributor_type"
+    t.datetime "updated_at"
+    t.string   "unique_name"
     t.string   "image"
-    t.string   "svg"
     t.string   "title"
-    t.string   "unique_name"
+    t.integer  "content_blob_id"
     t.text     "body"
-    t.text     "body_html"
+    t.integer  "content_type_id"
     t.integer  "current_version"
+    t.integer  "contributor_id"
     t.integer  "preview_id"
+    t.string   "svg"
+    t.string   "file_ext"
     t.datetime "created_at"
-    t.datetime "updated_at"
-    t.integer  "content_blob_id"
-    t.string   "file_ext"
+    t.text     "body_html"
+    t.string   "contributor_type"
     t.string   "last_edited_by"
-    t.integer  "content_type_id"
     t.integer  "license_id"
     t.text     "ro_uri"
   end

Modified: branches/wf4ever/lib/account_management.rb (3428 => 3429)


--- branches/wf4ever/lib/account_management.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/lib/account_management.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -12,8 +12,6 @@
     :announcements              => { :owner => :user_id },
     :attributions               => { :owner => :derived },
     :blobs                      => { :owner => :contributor },
-    :blogs                      => { :owner => :contributor },
-    :blog_posts                 => { :owner => :derived },
     :bookmarks                  => { :owner => :user_id },
     :citations                  => { :owner => :user_id },
     :client_applications        => { :owner => :user_id },

Modified: branches/wf4ever/lib/authorization.rb (3428 => 3429)


--- branches/wf4ever/lib/authorization.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/lib/authorization.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -52,7 +52,7 @@
 
     case object_type
 
-      when "Workflow", "Blog", "Blob", "Pack", "Service", "Contribution"
+      when "Workflow", "Blob", "Pack", "Service", "Contribution"
 
         # workflows can only be created by authenticated users
         if (action == "create") && [Workflow, Blob, Pack].include?(object)
@@ -85,6 +85,24 @@
             return true
         end
       
+      when "PackVersion"
+        case action
+          when "create"
+
+            # If a user can edit a pack, they can create a version of it.
+            is_authorized = Authorization.check('edit', context, user)
+
+          when "view"
+
+            # If a user can view a pack, they can view versions of it.
+            is_authorized = Authorization.check('view', context, user)
+
+          else
+            
+            # Editing or deleting versions of a pack is not allowed.
+            is_authorized = false
+        end
+
       when "Comment"
         case action
           when "create"

Modified: branches/wf4ever/lib/conf.rb (3428 => 3429)


--- branches/wf4ever/lib/conf.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/lib/conf.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -283,6 +283,10 @@
     self.model_alias_convert(self.model_aliases.invert, str)
   end
 
+  def self.shortcut_keywords
+    self.fetch_entry('shortcut_keywords') || {}
+  end
+
 private
 
   def self.model_alias_convert(map, str)

Modified: branches/wf4ever/lib/maintenance/backup.rb (3428 => 3429)


--- branches/wf4ever/lib/maintenance/backup.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/lib/maintenance/backup.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -119,8 +119,6 @@
       table(:model => Attribution,            :filter  => true, :auth_object => "attributable")
       table(:name  => "auto_tables")
       table(:model => Blob,                   :filter  => true)
-      table(:model => Blog,                   :no_data => true)
-      table(:model => BlogPost,               :no_data => true)
       table(:model => Bookmark)
       table(:model => Citation,               :filter  => true, :auth_object => "workflow")
       table(:model => ClientApplication,      :no_data => true)

Copied: branches/wf4ever/lib/pivoting.rb (from rev 3428, trunk/lib/pivoting.rb) (0 => 3429)


--- branches/wf4ever/lib/pivoting.rb	                        (rev 0)
+++ branches/wf4ever/lib/pivoting.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,603 @@
+# Pivot code
+
+TOKEN_UNKNOWN         = 0x0000
+TOKEN_AND             = 0x0001
+TOKEN_OR              = 0x0002
+TOKEN_WORD            = 0x0003
+TOKEN_OPEN            = 0x0004
+TOKEN_CLOSE           = 0x0005
+TOKEN_STRING          = 0x0006
+TOKEN_EOS             = 0x00ff
+
+NUM_TOKENS            = 6
+
+STATE_INITIAL         = 0x0000
+STATE_EXPECT_OPEN     = 0x0100
+STATE_EXPECT_STR      = 0x0200
+STATE_EXPECT_EXPR_END = 0x0300
+STATE_EXPECT_END      = 0x0400
+STATE_COMPLETE        = 0x0500
+
+def calculate_pivot(opts = {})
+
+  begin
+    expr = parse_filter_expression(opts[:params]["filter"], opts[:pivot_options], :active_filters => opts[:active_filters])
+  rescue Exception => ex
+    problem = "Problem with query _expression_: #{ex}"
+  end
+
+  pivot = contributions_list(opts[:params], opts[:user], opts[:pivot_options],
+                             :model            => opts[:model],
+                             :auth_type        => opts[:auth_type],
+                             :auth_id          => opts[:auth_id],
+                             :group_by         => opts[:group_by],
+                             :active_filters   => opts[:active_filters],
+                             :lock_filter      => opts[:locked_filters],
+                             :search_models    => opts[:search_models],
+                             :search_limit     => opts[:search_limit],
+                             :no_pagination    => opts[:no_pagination],
+                             :filters          => expr)
+
+  [pivot, problem]
+end
+
+def parse_filter_expression(expr, pivot_options, opts = {})
+
+  def unescape_string(str)
+    str.match(/^"(.*)"$/)[1].gsub(/\\"/, '"')
+  end
+
+  return nil if expr.nil?
+
+  state  = STATE_INITIAL
+  data   = ""
+
+  begin
+
+    tokens = expr.match(/^
+
+          \s* (\sAND\s)         | # AND operator
+          \s* (\sOR\s)          | # OR operator
+          \s* (\w+)             | # a non-keyword word
+          \s* (\()              | # an open paranthesis
+          \s* (\))              | # a close paranthesis
+          \s* ("(\\.|[^\\"])*")   # double quoted string with backslash escapes
+
+          /ix)
+
+    if tokens.nil?
+      token = TOKEN_UNKNOWN
+    else
+      (1..NUM_TOKENS).each do |i|
+        token = i if tokens[i]
+      end
+    end
+
+    if token == TOKEN_UNKNOWN
+      token = TOKEN_EOS if expr.strip.empty?
+    end
+
+    case state | token
+      when STATE_INITIAL         | TOKEN_WORD   : state = STATE_EXPECT_OPEN     ; data << { :name => tokens[0], :expr => [] }
+      when STATE_EXPECT_OPEN     | TOKEN_OPEN   : state = STATE_EXPECT_STR
+      when STATE_EXPECT_STR      | TOKEN_STRING : state = STATE_EXPECT_EXPR_END ; data.last[:expr] << tokens[0]
+      when STATE_EXPECT_EXPR_END | TOKEN_AND    : state = STATE_EXPECT_STR      ; data.last[:expr] << :and
+      when STATE_EXPECT_EXPR_END | TOKEN_OR     : state = STATE_EXPECT_STR      ; data.last[:expr] << :or
+      when STATE_EXPECT_EXPR_END | TOKEN_CLOSE  : state = STATE_EXPECT_END
+      when STATE_EXPECT_END      | TOKEN_AND    : state = STATE_INITIAL         ; data << :and
+      when STATE_EXPECT_END      | TOKEN_OR     : state = STATE_INITIAL         ; data << :or
+      when STATE_EXPECT_END      | TOKEN_EOS    : state = STATE_COMPLETE
+
+      else raise "Error parsing query _expression_"
+    end
+
+    expr = tokens.post_match unless state == STATE_COMPLETE
+
+  end while state != STATE_COMPLETE
+
+  # validate and reduce expressions to current capabilities
+
+  valid_filters = pivot_options["filters"].map do |f| f["query_option"] end
+  valid_filters = valid_filters.select do |f| opts[:active_filters].include?(f) end
+
+  data.each do |category|
+    case category
+      when :or
+        raise "Unsupported query _expression_"
+      when :and
+        # Fine
+      else
+        raise "Unknown filter category" unless valid_filters.include?(category[:name])
+
+        counts = { :and => 0, :or => 0 }
+
+        category[:expr].each do |bit|
+          counts[bit] = counts[bit] + 1 if bit.class == Symbol
+        end
+
+        raise "Unsupported query _expression_" if counts[:and] > 0 && counts[:or] > 0
+
+        # haven't implemented 'and' within a particular filter yet
+        raise "Unsupported query _expression_" if counts[:and] > 0
+
+        if category[:expr].length == 1
+          category[:expr] = { :terms => [unescape_string(category[:expr].first)] }
+        else
+          category[:expr] = {
+              :operator => category[:expr][1],
+              :terms    => category[:expr].select do |t|
+                t.class == String
+              end.map do |t|
+                unescape_string(t)
+              end
+          }
+        end
+    end
+  end
+
+  data
+end
+
+def contributions_list(params = nil, user = nil, pivot_options = nil, opts = {})
+
+  def escape_sql(str)
+    str.gsub(/\\/, '\&\&').gsub(/'/, "''")
+  end
+
+  def build_url(params, opts, expr, parts, pivot_options, extra = {})
+
+    query = {}
+
+    if parts.include?(:filter)
+      bits = []
+      pivot_options["filters"].each do |filter|
+        if !opts[:lock_filter] || opts[:lock_filter][filter["query_option"]].nil?
+          if find_filter(expr, filter["query_option"])
+            bits << filter["query_option"] + "(\"" + find_filter(expr, filter["query_option"])[:expr][:terms].map do |t| t.gsub(/"/, '\"') end.join("\" OR \"") + "\")"
+          end
+        end
+      end
+
+      if bits.length > 0
+        query["filter"] = bits.join(" AND ")
+      end
+    end
+
+    query["query"]        = params[:query]        if params[:query]
+    query["order"]        = params[:order]        if parts.include?(:order)
+    query["filter_query"] = params[:filter_query] if parts.include?(:filter_query)
+
+    query.merge!(extra)
+
+    query
+  end
+
+  def comparison(lhs, rhs)
+    if rhs.length == 1
+      "#{lhs} = '#{escape_sql(rhs.first)}'"
+    else
+      "#{lhs} IN ('#{rhs.map do |bit| escape_sql(bit) end.join("', '")}')"
+    end
+  end
+
+  def create_search_results_table(search_query, opts)
+
+    begin
+      solr_results = opts[:search_models].first.multi_solr_search(search_query,
+                                                                  :models         => opts[:search_models],
+                                                                  :limit          => opts[:search_limit],
+                                                                  :results_format => :ids)
+    rescue
+      return false
+    end
+
+    conn = ActiveRecord::Base.connection
+
+    conn.execute("CREATE TEMPORARY TABLE search_results (id INT AUTO_INCREMENT UNIQUE KEY, result_type VARCHAR(255), result_id INT)")
+
+    # This next part converts the search results to SQL values
+    #
+    # from:  { "id" => "Workflow:4" }, { "id" => "Pack:6" }, ...
+    # to:    "(NULL, 'Workflow', '4'), (NULL, 'Pack', '6'), ..."
+
+    if solr_results.results.length > 0
+      insert_part = solr_results.results.map do |result|
+        "(NULL, " + result["id"].split(":").map do |bit|
+          "'#{bit}'"
+        end.join(", ") + ")"
+      end.join(", ")
+
+      conn.execute("INSERT INTO search_results VALUES #{insert_part}")
+    end
+
+    true
+  end
+
+  def drop_search_results_table
+    ActiveRecord::Base.connection.execute("DROP TABLE IF EXISTS search_results")
+  end
+
+  def column(column, opts)
+    if column == :auth_type
+      opts[:auth_type]
+    else
+      column
+    end
+  end
+
+  def calculate_filter(collection, params, filter, pivot_options, user, opts = {})
+
+    # apply all the joins and conditions except for the current filter
+
+    joins      = []
+    conditions = []
+
+    pivot_options["filters"].each do |other_filter|
+      if filter_list = find_filter(opts[:filters], other_filter["query_option"])
+        unless opts[:inhibit_other_conditions]
+          conditions << comparison(column(other_filter["id_column"], opts), filter_list[:expr][:terms]) unless other_filter == filter
+        end
+        joins += other_filter["joins"] if other_filter["joins"]
+      end
+    end
+
+    filter_id_column    = column(filter["id_column"],    opts)
+    filter_label_column = column(filter["label_column"], opts)
+
+    joins += filter["joins"] if filter["joins"]
+    conditions << "#{filter_id_column} IS NOT NULL" if filter["not_null"]
+
+    unless opts[:inhibit_filter_query]
+      if params[:filter_query]
+        conditions << "(#{filter_label_column} LIKE '%#{escape_sql(params[:filter_query])}%')"
+      end
+    end
+
+    current = find_filter(opts[:filters], filter["query_option"]) ? find_filter(opts[:filters], filter["query_option"])[:expr][:terms] : []
+
+    if opts[:ids].nil?
+      limit = 10
+    else
+      conditions << "(#{filter_id_column} IN ('#{opts[:ids].map do |id| escape_sql(id) end.join("','")}'))"
+      limit = nil
+    end
+
+    conditions = conditions.length.zero? ? nil : conditions.join(" AND ")
+
+    count_expr = "COUNT(DISTINCT #{opts[:auth_type]}, #{opts[:auth_id]})"
+
+    objects = collection.find(
+        :all,
+        :select => "#{filter_id_column} AS filter_id, #{filter_label_column} AS filter_label, #{count_expr} AS filter_count",
+        :joins => merge_joins(joins, pivot_options, collection.permission_conditions, :auth_type => opts[:auth_type], :auth_id => opts[:auth_id]),
+        :conditions => conditions,
+        :group => "#{filter_id_column}",
+        :limit => limit,
+        :order => "#{count_expr} DESC, #{filter_label_column}")
+
+    objects = objects.select do |x| !x[:filter_id].nil? end
+
+    objects = objects.map do |object|
+
+      value = object.filter_id.to_s
+      selected = current.include?(value)
+
+      label_expr = deep_clone(opts[:filters])
+      label_expr -= [find_filter(label_expr, filter["query_option"])] if find_filter(label_expr, filter["query_option"])
+
+      unless selected && current.length == 1
+        label_expr << { :name => filter["query_option"], :expr => { :terms => [value] } }
+      end
+
+      checkbox_expr = deep_clone(opts[:filters])
+
+      if expr_filter = find_filter(checkbox_expr, filter["query_option"])
+
+        if selected
+          expr_filter[:expr][:terms] -= [value]
+        else
+          expr_filter[:expr][:terms] += [value]
+        end
+
+        checkbox_expr -= [expr_filter] if expr_filter[:expr][:terms].empty?
+
+      else
+        checkbox_expr << { :name => filter["query_option"], :expr => { :terms => [value] } }
+      end
+
+      label_uri = build_url(params, opts, label_expr, [:filter, :order], pivot_options, "page" => nil)
+
+      checkbox_uri = build_url(params, opts, checkbox_expr, [:filter, :order], pivot_options, "page" => nil)
+
+      label = object.filter_label.clone
+      label = visible_name(label) if filter["visible_name"]
+      label = label.capitalize    if filter["capitalize"]
+
+      plain_label = object.filter_label
+
+      if params[:filter_query]
+        label.sub!(Regexp.new("(#{params[:filter_query]})", Regexp::IGNORECASE), '<b>\1</b>')
+      end
+
+      {
+          :object       => object,
+          :value        => value,
+          :label        => label,
+          :plain_label  => plain_label,
+          :count        => object.filter_count,
+          :checkbox_uri => checkbox_uri,
+          :label_uri    => label_uri,
+          :selected     => selected
+      }
+    end
+
+    [current, objects]
+  end
+
+  def calculate_filters(collection, params, opts, pivot_options, user)
+
+    # produce the filter list
+
+    filters = deep_clone(pivot_options["filters"])
+    cancel_filter_query_url = nil
+
+    filters.each do |filter|
+
+      # calculate the top n items of the list
+
+      filter[:current], filter[:objects] = calculate_filter(collection, params, filter, pivot_options, user, opts)
+
+      # calculate which active filters are missing (because they weren't in the
+      # top part of the list or have a count of zero)
+
+      missing_filter_ids = filter[:current] - filter[:objects].map do |ob| ob[:value] end
+
+      if missing_filter_ids.length > 0
+        filter[:objects] += calculate_filter(collection, params, filter, pivot_options, user, opts.merge(:ids => missing_filter_ids))[1]
+      end
+
+      # calculate which active filters are still missing (because they have a
+      # count of zero)
+
+      missing_filter_ids = filter[:current] - filter[:objects].map do |ob| ob[:value] end
+
+      if missing_filter_ids.length > 0
+        zero_list = calculate_filter(collection, params, filter, pivot_options, user, opts.merge(:ids => missing_filter_ids, :inhibit_other_conditions => true))[1]
+
+        zero_list.each do |x| x[:count] = 0 end
+
+        zero_list.sort! do |a, b| a[:label] <=> b[:label] end
+
+        filter[:objects] += zero_list
+      end
+    end
+
+    [filters, cancel_filter_query_url]
+  end
+
+  def find_filter(filters, name)
+    filters.find do |f|
+      f[:name] == name
+    end
+  end
+
+  def merge_joins(joins, pivot_options, permission_conditions, opts = {})
+    if joins.length.zero?
+      nil
+    else
+      joins.uniq.map do |j|
+        text = pivot_options["joins"][j].clone
+        text.gsub!(/RESULT_TYPE/,         opts[:auth_type])
+        text.gsub!(/RESULT_ID/,           opts[:auth_id])
+        text.gsub!(/VIEW_CONDITIONS/,     permission_conditions[:view_conditions])
+        text.gsub!(/DOWNLOAD_CONDITIONS/, permission_conditions[:download_conditions])
+        text.gsub!(/EDIT_CONDITIONS/,     permission_conditions[:edit_conditions])
+        text
+      end.join(" ")
+    end
+  end
+
+  pivot_options["filters"] = pivot_options["filters"].select do |f|
+    opts[:active_filters].include?(f["query_option"])
+  end
+
+  joins      = []
+  conditions = []
+
+  # parse the filter _expression_ if provided.  convert filter _expression_ to
+  # the old format.  this will need to be replaced eventually
+
+  opts[:filters] ||= []
+
+  include_reset_url = opts[:filters].length > 0
+
+  # filter out top level logic operators for now
+
+  opts[:filters] = opts[:filters].select do |bit|
+    bit.class == Hash
+  end
+
+  # apply locked filters
+
+  if opts[:lock_filter]
+    opts[:lock_filter].each do |filter, value|
+      opts[:filters] << { :name => filter, :expr => { :terms => [value] } }
+    end
+  end
+
+  # perform search if requested
+
+  query_problem = false
+
+  if params["query"]
+    drop_search_results_table
+    if !create_search_results_table(params["query"], opts)
+      params["query"] = nil
+      query_problem = true
+    end
+  end
+
+  if params[:query]
+    klass     = SearchResult
+    auth_type = "search_results.result_type"
+    auth_id   = "search_results.result_id"
+    group_by  = "search_results.result_type, search_results.result_id"
+  else
+    klass     = opts[:model]     || Contribution
+    auth_type = opts[:auth_type] || "contributions.contributable_type"
+    auth_id   = opts[:auth_id]   || "contributions.contributable_id"
+    group_by  = opts[:group_by]  || "contributions.contributable_type, contributions.contributable_id"
+  end
+
+  # determine joins, conditions and order for the main results
+
+  pivot_options["filters"].each do |filter|
+    if filter_list = find_filter(opts[:filters], filter["query_option"])
+      conditions << comparison(column(filter["id_column"], opts.merge( { :auth_type => auth_type, :auth_id => auth_id } )), filter_list[:expr][:terms])
+      joins += filter["joins"] if filter["joins"]
+    end
+  end
+
+  order_options = pivot_options["order"].find do |x|
+    x["option"] == params[:order]
+  end
+
+  order_options ||= pivot_options["order"].first
+
+  joins += order_options["joins"] if order_options["joins"]
+
+  having_bits = []
+
+#   pivot_options["filters"].each do |filter|
+#     if params["and_#{filter["query_option"]}"]
+#       having_bits << "GROUP_CONCAT(DISTINCT #{filter["id_column"]} ORDER BY #{filter["id_column"]}) = \"#{escape_sql(opts[:filters][filter["query_option"]])}\""
+#     end
+#   end
+
+  having_clause = ""
+
+  if having_bits.length > 0
+    having_clause = "HAVING #{having_bits.join(' AND ')}"
+  end
+
+  # perform the results query
+
+  collection = Authorization.scoped(klass,
+                                    :authorised_user => user,
+                                    :include_permissions => true,
+                                    :auth_type => auth_type,
+                                    :auth_id => auth_id)
+
+  result_options = {:joins => merge_joins(joins, pivot_options, collection.permission_conditions, :auth_type => auth_type, :auth_id => auth_id),
+                    :conditions => conditions.length.zero? ? nil : conditions.join(" AND "),
+                    :group => "#{group_by} #{having_clause}",
+                    :order => order_options["order"]}
+
+  unless opts[:no_pagination]
+    result_options[:page] = { :size => params["num"] ? params["num"].to_i : nil, :current => params["page"] }
+  end
+
+  results = collection.find(:all, result_options)
+
+  # produce a query hash to match the current filters
+
+  opts[:filter_params] = {}
+
+  pivot_options["filters"].each do |filter|
+    if params[filter["query_option"]]
+      next if opts[:lock_filter] && opts[:lock_filter][filter["query_option"]]
+      opts[:filter_params][filter["query_option"]] = params[filter["query_option"]]
+    end
+  end
+
+  # produce the filter list
+
+  opts_for_filter_query = opts.merge( { :auth_type => auth_type,
+                                        :auth_id => auth_id, :group_by => group_by } )
+
+  filters, cancel_filter_query_url = calculate_filters(collection, params, opts_for_filter_query, pivot_options, user)
+
+  # produce the summary.  If a filter query is specified, then we need to
+  # recalculate the filters without the query to get all of them.
+
+  if params[:filter_query]
+    filters2 = calculate_filters(collection, params, opts_for_filter_query.merge( { :inhibit_filter_query => true } ), pivot_options, user)[0]
+  else
+    filters2 = filters
+  end
+
+  summary = ""
+
+  filters2.select do |filter|
+
+    next if opts[:lock_filter] && opts[:lock_filter][filter["query_option"]]
+
+    selected = filter[:objects].select do |x| x[:selected] end
+    current  = selected.map do |x| x[:value] end
+
+    if selected.length > 0
+      selected_labels = selected.map do |x|
+
+        expr = deep_clone(opts[:filters])
+
+        f = find_filter(expr, filter["query_option"])
+
+        expr -= f[:expr][:terms] -= [x[:value]]
+        expr -= [f] if f[:expr][:terms].empty?
+
+        x[:plain_label] + ' <a href="" + url_for(build_url(params, opts, expr,
+                                                           [:filter, :filter_query, :order], pivot_options)) +
+            '">' + " <img src='' /></a>"
+
+      end
+
+      bits = selected_labels.map do |label| label end.join(" <i>or</i> ")
+
+      summary << '<span class="filter-in-use"><b>' + filter["title"].capitalize + "</b>: " + bits + "</span> "
+    end
+  end
+
+  if params[:filter_query]
+    cancel_filter_query_url = build_url(params, opts, opts[:filters], [:filter, :order], pivot_options)
+  end
+
+  if include_reset_url
+    reset_filters_url = build_url(params, opts, opts[:filters], [:order], pivot_options)
+  end
+
+  # remove filters that do not help in narrowing down the result set
+
+  filters = filters.select do |filter|
+    if filter[:objects].empty?
+      false
+    elsif opts[:lock_filter] && opts[:lock_filter][filter["query_option"]]
+      false
+    else
+      true
+    end
+  end
+
+  {
+      :results                 => results,
+      :filters                 => filters,
+      :reset_filters_url       => reset_filters_url,
+      :cancel_filter_query_url => cancel_filter_query_url,
+      :filter_query_url        => build_url(params, opts, opts[:filters], [:filter], pivot_options),
+      :summary                 => summary,
+      :pivot_options           => pivot_options,
+      :query_problem           => query_problem
+  }
+end
+
+def visible_name(entity)
+  name = entity.class.name
+
+  if Conf.model_aliases.value?(name)
+    Conf.model_aliases.each do |al, model|
+      name = al if name == model
+    end
+  end
+
+  name
+end
+

Modified: branches/wf4ever/lib/rest.rb (3428 => 3429)


--- branches/wf4ever/lib/rest.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/lib/rest.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -7,6 +7,7 @@
 require 'lib/excel_xml'
 require 'xml/libxml'
 require 'uri'
+require 'pivoting'
 
 include LibXML
 
@@ -36,7 +37,7 @@
     rules.map do |method, rules|
       next unless rules["Method"]       == "GET"
       next unless rules["Type"]         == "crud"
-      
+
       result[rules["Model Entity"]] = rules["REST Entity"]
     end
   end
@@ -190,7 +191,11 @@
           list_element[key] = value
         end
 
-        collection = eval("ob.#{model_data['Accessor'][i]}")
+        if query['version'] and model_data['Versioned'][i] == 'yes'
+          collection = eval(sprintf("ob.find_version(%d).%s", query['version'], model_data['Accessor'][i]))
+        else
+          collection = eval("ob.#{model_data['Accessor'][i]}")
+        end
 
         collection = [collection] if model_data['Encoding'][i] == 'item as list'
 
@@ -341,7 +346,7 @@
 end
 
 def find_entity_name_from_object(ob)
-  ob = ob.versioned_resource if ob.respond_to?(:version)
+  ob = ob.versioned_resource if ob.respond_to?(:versioned_resource)
   OBJECT_CLASS_TO_ENTITY_NAME[ob.class.name.underscore]
 end
 
@@ -383,6 +388,7 @@
   if query['version']
     return rest_response(400, :reason => "Object does not support versioning") unless ob.respond_to?('versions')
     return rest_response(404, :reason => "Specified version does not exist") if query['version'].to_i < 1
+    return rest_response(404, :reason => "Specified version does not exist") if query['version'].to_i > ob.versions.last.version
   end
 
   # Work out which elements to include in the response.
@@ -663,8 +669,6 @@
     when 'Review';                 return workflow_review_url(ob.reviewable, ob)
     when 'Comment';                return "#{rest_resource_uri(ob.commentable)}/comments/#{ob.id}"
     when 'Bookmark';               return nil
-    when 'Blog';                   return blog_url(ob)
-    when 'BlogPost';               return blog_blog_post_url(ob.blog, ob)
     when 'Rating';                 return "#{rest_resource_uri(ob.rateable)}/ratings/#{ob.id}"
     when 'Tag';                    return tag_url(ob)
     when 'Picture';                return user_picture_url(ob.owner, ob)
@@ -675,7 +679,7 @@
     when 'Experiment';             return experiment_url(ob)
     when 'TavernaEnactor';         return runner_url(ob)
     when 'Job';                    return experiment_job_url(ob.experiment, ob)
-    when 'PackContributableEntry'; return ob.contributable ? rest_resource_uri(ob.contributable) : nil
+    when 'PackContributableEntry'; return ob.contributable ? rest_resource_uri(ob.get_contributable_version) : nil
     when 'PackRemoteEntry';        return ob.uri
     when 'ContentType';            return content_type_url(ob)
     when 'License';                return license_url(ob)
@@ -683,12 +687,14 @@
     when 'Ontology';               return ontology_url(ob)
     when 'Predicate';              return predicate_url(ob)
     when 'Relationship';           return nil
+    when 'PackVersion';            return pack_version_url(ob, ob.version)
 
     when 'Creditation';     return nil
     when 'Attribution';     return nil
     when 'Tagging';         return nil
 
     when 'WorkflowVersion'; return "#{rest_resource_uri(ob.workflow)}?version=#{ob.version}"
+    when 'BlobVersion'; return "#{rest_resource_uri(ob.blob)}?version=#{ob.version}"
   end
 
   raise "Class not processed in rest_resource_uri: #{ob.class.to_s}"
@@ -706,8 +712,6 @@
     when 'Review';                 return "#{base}/review.xml?id=#{ob.id}"
     when 'Comment';                return "#{base}/comment.xml?id=#{ob.id}"
     when 'Bookmark';               return "#{base}/favourite.xml?id=#{ob.id}"
-    when 'Blog';                   return "#{base}/blog.xml?id=#{ob.id}"
-    when 'BlogPost';               return "#{base}/blog-post.xml?id=#{ob.id}"
     when 'Rating';                 return "#{base}/rating.xml?id=#{ob.id}"
     when 'Tag';                    return "#{base}/tag.xml?id=#{ob.id}"
     when 'Picture';                return "#{base}/picture.xml?id=#{ob.id}"
@@ -733,6 +737,7 @@
     when 'Attribution';     return nil
 
     when 'WorkflowVersion'; return "#{base}/workflow.xml?id=#{ob.workflow.id}&version=#{ob.version}"
+    when 'PackVersion';     return "#{base}/pack.xml?id=#{ob.pack.id}&version=#{ob.version}"
   end
 
   raise "Class not processed in rest_access_uri: #{ob.class.to_s}"
@@ -831,8 +836,6 @@
   return [User, $1, is_local]           if uri.path =~ /^\/users\/([\d]+)$/
   return [Review, $1, is_local]         if uri.path =~ /^\/[^\/]+\/[\d]+\/reviews\/([\d]+)$/
   return [Comment, $1, is_local]        if uri.path =~ /^\/[^\/]+\/[\d]+\/comments\/([\d]+)$/
-  return [Blog, $1, is_local]           if uri.path =~ /^\/blogs\/([\d]+)$/
-  return [BlogPost, $1, is_local]       if uri.path =~ /^\/blogs\/[\d]+\/blog_posts\/([\d]+)$/
   return [Tag, $1, is_local]            if uri.path =~ /^\/tags\/([\d]+)$/
   return [Picture, $1, is_local]        if uri.path =~ /^\/users\/[\d]+\/pictures\/([\d]+)$/
   return [Message, $1, is_local]        if uri.path =~ /^\/messages\/([\d]+)$/
@@ -955,21 +958,43 @@
 
       # handle public privileges
 
-      if permission.find_first('category/text()').to_s == 'public'
+      case permission.find_first('category/text()').to_s
+        when 'public'
+          privileges = {}
 
-        privileges = {}
+          permission.find('privilege').each do |el|
+            privileges[el['type']] = true
+          end
 
-        permission.find('privilege').each do |el|
-          privileges[el['type']] = true
-        end
+          if privileges["view"] && privileges["download"]
+            share_mode = 0
+          elsif privileges["view"]
+            share_mode = 2
+          else
+            share_mode = 7
+          end
+        when 'group'
+          id = permission.find_first('id/text()').to_s.to_i
+          privileges = {}
 
-        if privileges["view"] && privileges["download"]
-          share_mode = 0
-        elsif privileges["view"]
-          share_mode = 2
-        else
-          share_mode = 7
-        end
+          permission.find('privilege').each do |el|
+            privileges[el['type']] = true
+          end
+
+          network = Network.find_by_id(id)
+          if network.nil?
+            ob.errors.add_to_base("Couldn't share with group #{id} - Not found")
+            raise
+          else
+            Permission.create(:contributor => network,
+                              :policy => ob.contribution.policy,
+                              :view => privileges["view"],
+                              :download => privileges["download"],
+                              :edit => privileges["edit"])
+            unless (use_layout = permission.find_first('use-layout/text()')).nil?
+              ob.contribution.policy.layout = network.layout_name if use_layout.to_s == 'true'
+            end
+          end
       end
     end
 
@@ -1189,6 +1214,7 @@
     description      = parse_element(data, :text,   '/file/description')
     license_type     = parse_element(data, :text,   '/file/license-type')
     type             = parse_element(data, :text,   '/file/type')
+    filename         = parse_element(data, :text,   '/file/filename')
     content_type     = parse_element(data, :text,   '/file/content-type')
     content          = parse_element(data, :binary, '/file/content')
     revision_comment = parse_element(data, :text,   '/file/revision-comment')
@@ -1212,6 +1238,17 @@
         end
       end
     end
+
+    # file name
+
+    if filename && !filename.blank?
+      ob.local_name = filename
+    else
+      if ob.local_name.blank?
+        ob.errors.add("Filename", "missing")
+        return rest_response(400, :object => ob)
+      end
+    end
    
     # handle type
 
@@ -1290,7 +1327,22 @@
   case action
     when 'create':
       return rest_response(401, :reason => "Not authorised to create a pack") unless Authorization.check('create', Pack, opts[:user], nil)
-      ob = Pack.new(:contributor => opts[:user])
+      if id = opts[:query]['id']
+        ob = Pack.find_by_id(id)
+        if ob.nil?
+          return rest_response(404, :reason => "Couldn't find a Pack with id #{id}")
+        else
+          if Authorization.check('edit', ob, opts[:user])
+            ob.snapshot!
+            return rest_get_request(ob, opts[:user], { "id" => ob.id.to_s })
+          else
+            return rest_response(401, :reason => "Not authorised to snapshot pack #{id}")
+          end
+        end
+      else
+        ob = Pack.new(:contributor => opts[:user])
+      end
+
     when 'view', 'edit', 'destroy':
       ob, error = obtain_rest_resource('Pack', opts[:query]['id'], opts[:query]['version'], opts[:user], action)
     else
@@ -1427,6 +1479,9 @@
     pack          = parse_element(data, :resource, '/internal-pack-item/pack')
     item          = parse_element(data, :resource, '/internal-pack-item/item')
     comment       = parse_element(data, :text,     '/internal-pack-item/comment')
+
+    version_node  = data.find_first('/internal-pack-item/item/@version')
+    version       = version_node ? version_node.value.to_i : nil
   end
 
   # Obtain object
@@ -1440,7 +1495,8 @@
       ob = PackContributableEntry.new(:user => opts[:user],
           :pack          => pack,
           :contributable => item,
-          :comment       => comment)
+          :comment       => comment,
+          :contributable_version => version)
 
     when 'view', 'edit', 'destroy':
 
@@ -2289,7 +2345,129 @@
   begin
     send(opts[:rules]['Function'], opts)
   rescue
-    return rest_response(500)
+    if Rails.env == "production"
+      return rest_response(500)
+    else
+      raise
+    end
   end
 end
 
+
+# Component Querying
+def get_components(opts)
+  query = opts[:query]
+
+  annotations = query['annotations']  # annotations on workflow itself
+  # annotations on workflow features
+  inputs = query["input"]
+  outputs = query["output"]
+  processors = query["processor"]
+
+  # Filter workflow set
+  pivot, problem = calculate_pivot(
+      :pivot_options  => Conf.pivot_options,
+      :params         => query,
+      :user           => opts[:user],
+      :search_models  => [Workflow],
+      :no_pagination  => true,
+      :locked_filters => { 'CATEGORY' => 'Workflow' },
+      :active_filters => ["CATEGORY", "TYPE_ID", "TAG_ID", "USER_ID",
+                          "LICENSE_ID", "GROUP_ID", "WSDL_ENDPOINT",
+                          "CURATION_EVENT", "SERVICE_PROVIDER",
+                          "SERVICE_COUNTRY", "SERVICE_STATUS"])
+
+  workflow_ids = pivot[:results].map {|r| r.is_a?(SearchResult) ? r.result_id : r.contributable_id }
+
+  begin
+    matches = filter_by_semantic_annotations(workflow_ids, inputs, outputs, processors, annotations)
+  rescue RuntimeError => e
+    if e.message == "Bad Syntax"
+      return rest_response(400)
+    else
+      raise e
+    end
+  end
+
+  # Render
+  produce_rest_list(opts[:uri], opts[:rules], query, matches, "workflows", [], opts[:user])
+end
+
+
+private
+
+# Here be dragons!
+def filter_by_semantic_annotations(workflow_ids, inputs, outputs, processors, annotations)
+
+  # This method returns an array of workflow ids for workflows that possess all of the specified features.
+  def get_workflow_feature_matches(workflow_ids, features, model, query_conditions, query_conditions_excluding)
+    # "features" is an array of sets of annotations to be queried, in the form [ '"<ann1>","<ann2>"' , '"<ann3>"' ]
+    # Where "<ann1>" etc. is in the form "pred1 obj1", where pred1 and obj1 are the predicate and object parts of an RDF triple, respectively..
+    # The above example states that the workflow must have a <feature> that has annotations "pred1 obj1" and "pred2 obj2", AND
+    # another, different <feature> with "pred3 obj3".
+
+    selected = []
+    feature_matches = features.collect do |key,set|
+      raise "Bad Syntax" unless set =~ /^("[^ ]+ [^"]+")(,"[^ ]+ [^"]+")*$/
+
+      feature_annotations = set.split('","').collect {|a| a.gsub('"','')}
+      # "<ann1>", "<ann2>" (example)
+      matching_features = feature_annotations.collect { |a|
+        # Find all <features> with semantic annotation "<predicate> <object>" (example)
+        predicate, object = a.split(" ", 2)
+        unless selected.empty?
+          model.find(:all, :include => :semantic_annotations,
+                           :conditions => [query_conditions, workflow_ids, predicate, object, selected])
+        else
+          model.find(:all, :include => :semantic_annotations,
+                           :conditions => [query_conditions_excluding, workflow_ids, predicate, object])
+        end
+
+      }.inject {|f, matches| matches & f} # Get the intersection of <features> that have each annotation.
+                                          #   ie. the set of <features> that have ALL the required annotations
+      selected += matching_features
+      matching_features.collect {|wp| wp.workflow_id} # Get the workflows that those features belong to
+    end
+
+    feature_matches.inject {|matches, matches_all| matches_all & matches}
+  end
+
+
+  # Filter for workflows that have the required inputs
+  if inputs
+    workflow_ids = workflow_ids & get_workflow_feature_matches(workflow_ids, inputs, WorkflowPort,
+                                    "workflow_id IN (?) AND semantic_annotations.predicate = ? AND semantic_annotations.object = ? AND port_type = 'input' AND workflow_ports.id NOT IN (?)",
+                                    "workflow_id IN (?) AND semantic_annotations.predicate = ? AND semantic_annotations.object = ? AND port_type = 'input'")
+  end
+
+  # Filter for workflows that have the required outputs
+  if outputs
+    workflow_ids = workflow_ids & get_workflow_feature_matches(workflow_ids, outputs, WorkflowPort,
+                                    "workflow_id IN (?) AND semantic_annotations.predicate = ? AND semantic_annotations.object = ? AND port_type = 'output' AND workflow_ports.id NOT IN (?)",
+                                    "workflow_id IN (?) AND semantic_annotations.predicate = ? AND semantic_annotations.object = ? AND port_type = 'output'")
+  end
+
+  # Filter for workflows that have the required processors
+  if processors
+    workflow_ids = workflow_ids & get_workflow_feature_matches(workflow_ids, processors, WorkflowProcessor,
+                                    "workflow_id IN (?) AND semantic_annotations.predicate = ? AND semantic_annotations.object = ? AND workflow_processors.id NOT IN (?)",
+                                    "workflow_id IN (?) AND semantic_annotations.predicate = ? AND semantic_annotations.object = ?")
+  end
+
+  # Filter for workflows that have the required semantic annotations
+  unless annotations.blank?
+    raise "Bad Syntax" unless annotations =~ /^("[^ ]+ [^"]+")(,"[^ ]+ [^"]+")*$/
+
+    annotations = annotations.split('","').collect {|a| a.gsub('"','')}
+
+    matches_semantic_annotation_requirements = annotations.collect { |a|
+      predicate, object = a.split(" ", 2)
+      SemanticAnnotation.find_all_by_predicate_and_object_and_subject_type(predicate, object, "Workflow").map {|a| a.subject_id}
+    }
+
+    workflow_ids = workflow_ids & matches_semantic_annotation_requirements.inject {|matches, matches_all| matches_all & matches}
+  end
+
+  # Workflows that match ALL the requirements - the intersection of all the sub arrays.
+  Workflow.find_all_by_id(workflow_ids)
+end

Modified: branches/wf4ever/lib/sanity_test.rb (3428 => 3429)


--- branches/wf4ever/lib/sanity_test.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/lib/sanity_test.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -54,13 +54,12 @@
 
   users         = User.find(:all)
   workflows     = Workflow.find(:all)
-  blogs         = Blog.find(:all)
   blobs         = Blob.find(:all)
   packs         = Pack.find(:all)
   services      = Service.find(:all)
   contributions = Contribution.find(:all)
 
-  known_contributables = workflows + blobs + blogs + packs + services
+  known_contributables = workflows + blobs + packs + services
 
   should_be_empty("All users must have a name",
       users.select do |u| u.name == nil or u.name.length == 0 end)
@@ -76,9 +75,6 @@
   should_be_empty("All files must have a contribution record",
       blobs.select do |b| b.contribution.nil? end)
 
-  should_be_empty("All blogs must have a contribution record",
-      blogs.select do |b| b.contribution.nil? end)
-
   should_be_empty("All packs must have a contribution record",
       packs.select do |f| f.contribution.nil? end)
 

Deleted: branches/wf4ever/lib/tasks/fckeditor_tasks.rake (3428 => 3429)


--- branches/wf4ever/lib/tasks/fckeditor_tasks.rake	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/lib/tasks/fckeditor_tasks.rake	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,97 +0,0 @@
-# desc "Explaining what the task does"
-# task :fckeditor do
-#   # Task goes here
-# end
-
-namespace :fckeditor do
-  def setup 
-    require "config/environment"
-    require 'fileutils'
-    
-    directory = File.join(RAILS_ROOT, '/vendor/plugins/fckeditor/')
-    require "#{directory}lib/fckeditor"
-    require "#{directory}lib/fckeditor_version"
-    require "#{directory}lib/fckeditor_file_utils"
-  end
-  
-  desc 'Install the FCKEditor components'
-  task :install do
-    setup
-    puts "** Installing FCKEditor Plugin version #{FckeditorVersion.current}..."           
-
-    FckeditorFileUtils.destroy_and_install 
-         
-    puts "** Successfully installed FCKEditor Plugin version #{FckeditorVersion.current}"
-  end
-  
-  def fetch(path)
-    response = Net::HTTP.get_response(URI.parse(path))
-    case response
-    when Net::HTTPSuccess     then 
-      response
-    when Net::HTTPRedirection then 
-      puts "** Redirected to #{response['location']}"
-      fetch(response['location'])
-    else
-      response.error!
-    end
-  end
-  
-  desc "Update the FCKEditor code to the latest nightly build"    
-  task :download do
-    require 'net/http'
-    require 'zip/zipfilesystem'
-
-    setup
-    version = ENV['VERSION'] || "Nightly"
-    installed_version = "2.4.2"
-
-    puts "** Current FCKEditor version: #{installed_version}..."   
-    puts "** Downloading #{version} (1.2mb - please be patient)..."
-
-    rails_tmp_path = File.join(RAILS_ROOT, "/tmp/")
-    tmp_zip_path = File.join(rails_tmp_path, "fckeditor_#{version}.zip")
-    
-    # Creating tmp dir if it doesn't exist
-    Dir.mkdir(rails_tmp_path) unless File.exists? rails_tmp_path    
-
-    # Download nightly build (http://www.fckeditor.net/nightly/FCKeditor_N.zip)
-    # Releases (http://downloads.sourgefourge.net/fckeditor/FCKEditor_[2.4.3, 2.5b, 2.4.2].zip)    
-    nightly = version=='Nightly' ? true : false
-    domain = nightly ? "http://www.fckeditor.net" : "http://downloads.sourceforge.net"
-    path = nightly ? "/nightly/FCKeditor_N.zip" : "/fckeditor/FCKeditor_#{version}.zip"
-    
-    puts "** Download from #{domain}#{path}"
-    #Net::HTTP.start(domain) { |http|
-      response = fetch("#{domain}#{path}")
-      
-      open(tmp_zip_path, "wb") { |file|
-        file.write(response.body)
-      }
-    #}
-    puts "** Download successful"
-    
-    puts "** Extracting FCKeditor"
-    Zip::ZipFile.open(tmp_zip_path) do |zipfile|
-      zipfile.each do |entry|
-        filename = File.join(rails_tmp_path, entry.name)
-        FileUtils.rm_f(filename)
-        FileUtils.mkdir_p(File.dirname(filename))
-        entry.extract(filename)
-      end
-    end
-    
-    puts "** Backing up existing FCKEditor install to /public/_javascript_s/fckeditor_bck"
-    FckeditorFileUtils.backup_existing
-
-    puts "** Shifting files to /public/_javascript_s/fckeditor"
-    FileUtils.cp_r File.join(RAILS_ROOT, "/tmp/fckeditor/"), File.join(RAILS_ROOT, "/public/_javascript_s/")
-    
-    puts "** Clean up"
-    FileUtils.remove_file(tmp_zip_path, true)
-    FileUtils.remove_entry(File.join(rails_tmp_path, "fckeditor/"), true)
-    
-    puts "** Successfully updated to FCKEditor version: #{version}..."  
-  end
-end
-

Deleted: branches/wf4ever/lib/tasks/structured_data_tasks.rake (3428 => 3429)


--- branches/wf4ever/lib/tasks/structured_data_tasks.rake	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/lib/tasks/structured_data_tasks.rake	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,4 +0,0 @@
-# desc "Explaining what the task does"
-# task :structured_data do
-#   # Task goes here
-# end

Modified: branches/wf4ever/lib/workflow_processors/interface.rb (3428 => 3429)


--- branches/wf4ever/lib/workflow_processors/interface.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/lib/workflow_processors/interface.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -117,7 +117,7 @@
       XML::Node.new("components")
     end
 
-    def extract_metadata(workflow_id)
+    def extract_metadata(workflow)
     end
 
     # End Instance Methods

Copied: branches/wf4ever/lib/workflow_processors/statjr_ebook.rb (from rev 3428, trunk/lib/workflow_processors/statjr_ebook.rb) (0 => 3429)


--- branches/wf4ever/lib/workflow_processors/statjr_ebook.rb	                        (rev 0)
+++ branches/wf4ever/lib/workflow_processors/statjr_ebook.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,190 @@
+# myExperiment: lib/workflow_processors/bioextract_processosr.rb
+#
+# Copyright (c) 2008 University of Manchester and the University of Southampton.
+# See license.txt for details.
+
+module WorkflowProcessors
+
+  class StatjrEbook < WorkflowProcessors::Interface
+
+    # Begin Class Methods
+
+    # These:
+    # - provide information about the Workflow Type supported by this processor,
+
+    # MUST be unique across all processors
+    def self.display_name
+      "StatJR eBook"
+    end
+
+    def self.display_data_format
+      "ZIP"
+    end
+
+    def self.mime_type
+      "application/zip"
+    end
+
+    # All the file extensions supported by this workflow processor.
+    # Must be all in lowercase.
+    def self.file_extensions_supported
+      [ "zip" ]
+    end
+
+    def self.can_determine_type_from_file?
+      true
+    end
+
+    def self.recognised?(file)
+      begin
+        file.rewind
+        deep_model = WorkflowProcessors::StatjrEbookLib::Parser.parse(file.read)
+        file.rewind
+#        Rails.logger.info "deep model: #{deep_model.title}" 
+        return !deep_model.nil?
+      rescue
+        Rails.logger.info $!
+        return false
+      end
+    end
+
+    def self.can_infer_metadata?
+      ##return true
+      return false
+    end
+
+    def self.can_generate_preview_image?
+      false
+    end
+
+    def self.can_generate_preview_svg?
+      false
+    end
+
+    # End Class Methods
+
+
+    # Begin Object Initializer
+
+    def initialize(workflow_definition)
+      super(workflow_definition)
+      @deep_model = WorkflowProcessors::StatjrEbookLib::Parser.parse(workflow_definition)
+    end
+
+    # End Object Initializer
+
+
+    # Begin Instance Methods
+
+    # These provide more specific functionality for a given workflow definition, such as parsing for metadata and image generation.
+
+    def get_title
+      return nil if @deep_model.nil?
+      return (@deep_model.title.blank? ? "[untitled]" : @deep_model.title)
+    end
+
+    def get_description
+      return nil if @deep_model.nil?
+      return @deep_model.description
+    end
+
+    def get_workflow_model_object
+      return @deep_model
+    end
+    
+    def get_preview_image
+      nil
+    end
+
+    def get_preview_svg
+      nil
+    end
+
+    def get_workflow_model_input_ports
+
+    end
+
+    def get_search_terms
+      ""
+    end
+
+    def get_components
+    end
+
+    # End Instance Methods
+  end
+
+
+  module StatjrEbookLib
+
+    class Model
+      # The author of the workflow.
+      attr_accessor :author
+
+      # The name/title of the workflow.
+      attr_accessor :title
+
+      # A small piece of descriptive text for the workflow.
+      attr_accessor :description
+
+    end
+
+    module Parser
+
+      require "zip/zip"
+      ##require 'rdf'
+      ##require 'rdf/raptor'
+
+      def self.parse(stream)
+        begin
+          Tempfile.open("deep", "tmp") do |zip_file|
+            zip_file.write(stream)
+            zip_file.close
+
+            Zip::ZipFile.open(zip_file.path) do |zip|
+              ebookdef = zip.read("ebookdef.ttl")
+              ##graph = RDF::Graph.new()
+              ##reader = RDF::Reader.for(:turtle).new(ebookdef)
+              ##graph << reader
+              ##ns_ebook = RDF::Vocabulary.new("http://purl.org/net/deep/ns#")
+              ##ns_dcterms = RDF::Vocabulary.new("http://purl.org/dc/terms/")
+              ##query = RDF::Query.new do
+              ##  pattern [:ebook, RDF.type, ns_ebook.EbookFile]
+              ##  pattern [:ebook, ns_dcterms.title, :title]
+              ##end
+              ebook = nil
+              title = nil
+              desc = nil
+              ##query.execute(graph).each do |solution|
+              ##  ebook = solution.ebook
+              ##  title = solution.title.to_s
+              ##end
+
+              ##return nil unless ebook
+
+              ##query = RDF::Query.new do
+              ##  pattern [ebook, ns_dcterms.description, :desc]
+              ##end
+              ##query.execute(graph).each do |solution|
+              ##  desc = solution.desc.to_s
+              ##end
+              return create_model(ebook, title, desc)
+            end
+          end
+        rescue
+          Rails.logger.info $!
+          nil
+        end
+      end
+      def self.create_model(ebook, title, description) # :nodoc:
+        model = StatjrEbookLib::Model.new
+        model.title = title
+        model.description = description
+        return model
+      end
+
+    end
+
+  end
+
+end

Modified: branches/wf4ever/lib/workflow_processors/taverna2.rb (3428 => 3429)


--- branches/wf4ever/lib/workflow_processors/taverna2.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/lib/workflow_processors/taverna2.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -9,6 +9,8 @@
   require 't2flow/parser'
   require 't2flow/dot'
   require 'libxml'
+  require 'rdf'
+  require 'rdf/n3'
   
   require 'file_upload'
 
@@ -243,6 +245,15 @@
           node
         end
 
+        def build_semantic_annotation_element(object)
+          build('semantic_annotation') do |semantic_annotation_element|
+            if object.semantic_annotation
+              semantic_annotation_element << build('type', object.semantic_annotation.type)
+              semantic_annotation_element << build('content', object.semantic_annotation.content)
+            end
+          end
+        end
+
         build(tag) do |components|
 
           components << build('dataflows') do |dataflows_element|
@@ -281,6 +292,8 @@
                           end
                         end
                       end
+
+                      source_element << build_semantic_annotation_element(source) if source.semantic_annotation
                     end
                   end
                 end
@@ -297,7 +310,6 @@
 
                         if sink.descriptions
                           sink.descriptions.each do |sink_description|
-
                             sink_descriptions_element << build('description', sink_description)
                           end
                         end
@@ -312,6 +324,7 @@
                           end
                         end
                       end
+                      sink_element << build_semantic_annotation_element(sink) if sink.semantic_annotation
                     end
                   end
                 end
@@ -335,6 +348,7 @@
                       processor_element << build('biomoby-service-name',   processor.biomoby_service_name)   if processor.biomoby_service_name
                       processor_element << build('biomoby-category',       processor.biomoby_category)       if processor.biomoby_category
                       processor_element << build('value',                  processor.value)                  if processor.value
+                      processor_element << build_semantic_annotation_element(processor)                      if processor.semantic_annotation
 
                       if processor.dataflow_id
                         nested_dataflow = base_model.dataflow(processor.dataflow_id)
@@ -364,6 +378,8 @@
                     end
                   end
                 end
+
+                dataflow_element << build_semantic_annotation_element(dataflow.annotations) if dataflow.annotations.semantic_annotation
               end
             end
           end
@@ -373,16 +389,49 @@
       aux(@t2flow_model, @t2flow_model, 'components')
     end
     
-    def extract_metadata(workflow_id)
+    def extract_metadata(workflow)
 
       @t2flow_model.all_processors.each do |processor|
-        WorkflowProcessor.create(:workflow_id => workflow_id,
+        workflow_processor = WorkflowProcessor.create(:workflow => workflow,
             :name           => processor.name,
             :wsdl           => processor.wsdl,
             :wsdl_operation => processor.wsdl)
+        create_semantic_annotations(workflow_processor, processor.semantic_annotation)
       end
+
+      @t2flow_model.sources.each do |source|
+        port = WorkflowPort.create(:workflow => workflow,
+                            :port_type => "input",
+                            :name => source.name)
+        create_semantic_annotations(port, source.semantic_annotation)
+      end
+
+      @t2flow_model.sinks.each do |sink|
+        port = WorkflowPort.create(:workflow => workflow,
+                            :port_type => "output",
+                            :name => sink.name)
+        create_semantic_annotations(port, sink.semantic_annotation)
+      end
+
+      create_semantic_annotations(workflow, @t2flow_model.main.annotations.semantic_annotation)
+
     end
 
+    def create_semantic_annotations(subject, semantic_annotations)
+      if semantic_annotations.type == "text/rdf+n3"
+        g = RDF::Graph.new
+        g << RDF::Reader.for(:n3).new(semantic_annotations.content)
+
+        g.each_statement do |statement|
+          predicate = statement.predicate.to_s
+          object = statement.object.to_s
+          SemanticAnnotation.create(:subject => subject, :predicate => predicate, :object => object)
+        end
+      else
+        raise "Unsupported annotation content type (#{semantic_annotations.type}) for #{subject}."
+      end
+    end
+
     # End Instance Methods
   end
 end

Modified: branches/wf4ever/lib/workflow_processors/taverna_scufl.rb (3428 => 3429)


--- branches/wf4ever/lib/workflow_processors/taverna_scufl.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/lib/workflow_processors/taverna_scufl.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -289,10 +289,10 @@
       aux(@scufl_model, 'components')
     end
 
-    def extract_metadata(workflow_id)
+    def extract_metadata(workflow)
 
       @scufl_model.all_processors.each do |processor|
-        WorkflowProcessor.create(:workflow_id => workflow_id,
+        WorkflowProcessor.create(:workflow => workflow,
             :name           => processor.name,
             :wsdl           => processor.wsdl,
             :wsdl_operation => processor.wsdl_operation)

Modified: branches/wf4ever/lib/workflow_types_handler.rb (3428 => 3429)


--- branches/wf4ever/lib/workflow_types_handler.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/lib/workflow_types_handler.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -131,7 +131,7 @@
 # so that they are then accessible via the ObjectSpace.
 # We assume (and this is a rails convention for anything in the /lib/ directory), 
 # that filenames for example "my_class.rb" correspond to class names for example MyClass.
-Dir.chdir(File.join(RAILS_ROOT, "lib/workflow_processors")) do
+Dir.chdir(File.join(Rails.root, "lib/workflow_processors")) do
   Dir.glob("*.rb").each do |f|
     ("workflow_processors/" + f.gsub(/.rb/, '')).camelize.constantize
   end

Deleted: branches/wf4ever/migrate.sh (3428 => 3429)


--- branches/wf4ever/migrate.sh	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/migrate.sh	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,61 +0,0 @@
-#!/bin/bash
-
-export RAILS_ENV=production
-
-RAILS_ROOT=/var/www/m2
-DB_USER=root
-DB=m2_${RAILS_ENV}
-DUMP_SRC=~/myexperiment/backup/myexperiment_production.sql
-WORKFLOW_SRC=~/myexperiment/backup/workflow
-SCUFL_SRC=${WORKFLOW_SRC}/scufl
-
-if [ ! -e $DUMP_SRC ]; then
-  echo SQL dump not found: $DUMP_SRC
-  exit
-fi
-
-if [ ! -e $WORKFLOW_SRC ]; then
-  echo Workflow directory not found: $WORKFLOW_SRC
-  exit
-fi
-
-cd ${RAILS_ROOT}
-
-rm -rf index carlin
-mkdir carlin
-
-cd carlin
-
-rm -rf public/pictures
-rm -rf public/workflow
-cp ${DUMP_SRC} myexperiment_production.sql
-cp -r ${SCUFL_SRC} scufl
-
-grep 'INSERT INTO `pictures`'       < ${DUMP_SRC} >  import.sql
-grep 'INSERT INTO `posts`'          < ${DUMP_SRC} >> import.sql
-grep 'INSERT INTO `topics`'         < ${DUMP_SRC} >> import.sql
-
-grep -v 'INSERT INTO `boards`' < myexperiment_production.sql > temp2.sql
-grep -v 'INSERT INTO `channelmessages`'    < temp2.sql > temp3.sql
-grep -v 'INSERT INTO `channels`'    < temp3.sql > temp4.sql
-grep -v 'INSERT INTO `channels_users`'    < temp4.sql > temp5.sql
-grep -v 'INSERT INTO `channel_topics`'    < temp5.sql > temp6.sql
-grep -v 'INSERT INTO `experiments`'    < temp6.sql > temp7.sql
-grep -v 'INSERT INTO `lists`'    < temp7.sql > temp8.sql
-grep -v 'INSERT INTO `plugin_schema_info`'    < temp8.sql > temp9.sql
-grep -v 'INSERT INTO `pictures`'    < temp9.sql > temp10.sql
-grep -v 'INSERT INTO `posts`'    < temp10.sql > temp11.sql
-grep -v 'INSERT INTO `replies`'    < temp11.sql > temp12.sql
-grep -v 'INSERT INTO `schema_info`'    < temp12.sql > temp13.sql
-grep -v 'INSERT INTO `todos`'    < temp13.sql > temp14.sql
-grep -v 'INSERT INTO `topics`'    < temp14.sql > myexperiment_production.sql
-
-mysql --user=${DB_USER} -e "drop database ${DB}"
-mysql --user=${DB_USER} -e "create database ${DB}"
-rake db:migrate
-mysql --user=${DB_USER} ${DB} < import.sql
-
-cd ${RAILS_ROOT}
-
-echo 'include Squirrel; Squirrel.go false, true' | ruby script/console
-

Deleted: branches/wf4ever/public/_javascript_s/fckcustom.js (3428 => 3429)


--- branches/wf4ever/public/_javascript_s/fckcustom.js	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/public/_javascript_s/fckcustom.js	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,33 +0,0 @@
-// CHANGE FOR APPS HOSTED IN SUBDIRECTORY
-FCKRelativePath = '';
-
-// DON'T CHANGE THESE
-FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector='+FCKRelativePath+'/fckeditor/command';
-FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector='+FCKRelativePath+'/fckeditor/command';
-FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector='+FCKRelativePath+'/fckeditor/command';
-
-FCKConfig.LinkUploadURL = FCKRelativePath+'/fckeditor/upload';
-FCKConfig.ImageUploadURL = FCKRelativePath+'/fckeditor/upload?Type=Image';
-FCKConfig.FlashUploadURL = FCKRelativePath+'/fckeditor/upload?Type=Flash';
-FCKConfig.SpellerPagesServerScript = FCKRelativePath+'/fckeditor/check_spelling';
-FCKConfig.AllowQueryStringDebug = false;
-FCKConfig.SpellChecker = 'SpellerPages';
-
-// ONLY CHANGE BELOW HERE
-FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/silver/';
-
-FCKConfig.ToolbarSets["Simple"] = [
-	['Source','-','-','Templates'],
-	['Cut','Copy','Paste','PasteWord','-','Print','SpellCheck'],
-	['Undo','Redo','-','Find','Replace','-','SelectAll'],
-	'/',
-	['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
-	['OrderedList','UnorderedList','-','Outdent','Indent'],
-	['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
-	['Link','Unlink'],
-	'/',
-	['Image','Table','Rule','Smiley'],
-	['FontName','FontSize'],
-	['TextColor','BGColor'],
-	['-','About']
-] ;

Copied: branches/wf4ever/public/stylesheets/misc_skinning.css (from rev 3428, trunk/public/stylesheets/misc_skinning.css) (0 => 3429)


--- branches/wf4ever/public/stylesheets/misc_skinning.css	                        (rev 0)
+++ branches/wf4ever/public/stylesheets/misc_skinning.css	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,7 @@
+table.alt_table tr.odd_row.biovel td, table.alt_table tr.even_row.biovel td, .resource_list_item.biovel {
+  background-color: #EEFFCC;
+}
+
+table.alt_table.biovel, .resource_list_item.biovel {
+  border-color: #99cc33;
+}

Modified: branches/wf4ever/public/stylesheets/styles.css (3428 => 3429)


--- branches/wf4ever/public/stylesheets/styles.css	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/public/stylesheets/styles.css	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,2629 +1,2687 @@
-/* 
-   This stylesheet relies on base stylesheets from the
-   Yahoo UI library (http://developer.yahoo.com/yui/),
-   licensed under the BSD License 
-   
-   Note that for font-size, only use %ages according to: 
-   http://developer.yahoo.com/yui/fonts/#fontsize
-*/
-
-body {
-	background: #8e8e8e;
-	font-family: arial, sans-serif;
-	line-height: 1.0;
-}
-
-p {
-	padding: 0.3em 0;
-	line-height: 1.4;
-	text-align: left;
-	margin-bottom: 0em;
-}
-
-hr {
-	margin: 1em 0;
-}
-
-h1,h2,h3,h4,h5,h6 {
-	line-height: 1.0;
-	color: #333333;
-}
-
-h1 {
-	text-align: center;
-	font-size: 123.1%;
-	color: #000033;
-	margin: 1em 0;
-	line-height: 1.4;
-}
-
-h2 {
-	background-image: url('/images/header-bg.png');
-	background-position: top;
-	background-repeat: repeat-x;
-	background-color: #EEEEEE;
-	padding: 0.5em 0.6em;
-	border: 1px solid #CCCCCC;
-	font-size: 100%;
-}
-
-h3 {
-	background-color: transparent;
-	font-size: 108%;
-	font-weight: bold;
-	border: none;
-	padding: 0 0 0.3em 0;
-	margin: 1em 0 0.8em 0;
-	border-bottom: 1px dotted #999999;
-}
-
-h4 {
-	background-color: transparent;
-	font-size: 108%;
-	font-weight: bold;
-	border: none;
-	padding: 0.3em 0;
-	margin-top: 0;
-	margin-bottom: 0.6em;
-}
-
-table {
-	margin: 0;
-	border-collapse: separate;
-}
-
-th,td {
-	text-align: center;
-	border: none;
-	/*border: 1px solid #CCCCCC;*/
-}
-
-pre {
-	background-color: #EEEEEE;
-	padding: 1em;
-	font-size: 85%;
-}
-
-a {
-	color: #000099;
-	text-decoration: none;
-}
-
-a:hover {
-	color: red;
-	text-decoration: underline;
-}
-
-small {
-	line-height: 1.3;
-}
-
-fieldset {
-	border: 1px solid #CCCCCC;
-	padding: 0 1em 1em 1em;
-	margin: 1em 0;
-}
-
-legend {
-	font-weight: bold;
-	margin: 0 0.5em 0.5em 0.5em;
-}
-
-li {
-	line-height: 1.4;
-}
-
-.clearer {
-	padding: 0;
-	margin: 0;
-	clear: both;
-}
-
-#doc2 {
-	background-color: #FFFFFF;
-  width: 950px;
-  padding-left: 12px;
-  padding-right: 12px;
-  box-shadow: 0 0 16px 4px #666666;
-}
-
-#myexp_header {
-  padding-top: 1em;
-	margin: 0 0.5em 0 0.5em;
-}
-
-.logo {
-	float: left;
-	width: 300px;
-}
-
-.links {
-	color: #999999;
-  font-weight: bold;
-}
-
-#myexp_links
-{
-	float: right;
-	width: 600px;
-	font-size: 93%;
-}
-
-#site_info_links {
-}
-/*  margin: 0.5em 0; */
-
-#user_links {
-  float: right;
-}
-
-#myexp_searchbar {
-
-  background-image: -moz-linear-gradient(top, #317EFF 0%, #456AAA 100%);
-  background-image: -o-linear-gradient(top, #317EFF 0%, #456AAA 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #317EFF), color-stop(1, #456AAA));
-  background-image: -webkit-linear-gradient(top, #317EFF 0%, #456AAA 100%);
-  background-image: linear-gradient(to bottom, #317EFF 0%, #456AAA 100%);
-
-  background-color: #456AAA;
-
-	height: 20px;
-	text-align: center;
-	padding: 10px 0;
-
-  -moz-border-radius: 22px 22px 0px 0px;
-  -webkit-border-top-left-radius: 6px;
-  -webkit-border-top-right-radius: 6px;
-  border-radius: 22px 22px 0px 0px;
-}
-
-#myexp_searchbar * {
-	vertical-align: middle;
-}
-
-#myexp_content {
-	padding-right: 1em;
-	padding-left: 0.5em;
-	margin-top: 1em;
-	margin-bottom: 3em;
-}
-
-#myexp_sidebar {
-	padding: 0 6px 0 6px;
-	background-color: #456AAA;
-  width: 180px;
-}
-
-/* Begin Footer styles */
-
-#ft {
-	margin-top: 2em;
-	border: 0px dotted #999999;
-	border-width: 1px 0 1px 0;
-	color: #333333;
-	background-image: url('/images/footer-bg.png');
-	background-position: top;
-	background-repeat: repeat-x;
-	background-color: #EEEEEE;
-}
-
-#ft .copyright {
-	text-align: center;
-	font-weight: bold;
-	font-size: 93%;
-	padding: 0.5em;
-}
-
-#ft table {
-	width: 100%;
-	border-top: 1px dotted #999999;
-	border-spacing: 0;
-	margin: 0;
-}
-
-#ft td {
-	padding: 0.8em 2em;
-	vertical-align: top;
-}
-
-#ft table p {
-	padding: 0.3em 0;
-	line-height: 1;
-}
-
-#ft .left {
-	width: 251px; 
-	text-align: left;
-	font-size: 93%;
-}
-
-#ft .middle {
-	width: 251px; 
-	text-align: left;
-	font-size: 93%;
-	border-left: 1px dotted #999999;
-}
-
-#ft .right {
-	width: 194px; 
-	text-align: center;
-	font-size: 77%; 
-	border-left: 1px dotted #999999;
-}
-
-#ft .right p {
-	text-align: center;
-}
-
-/* End Footer styles */
-
-#tag_clouds {
-	text-align: center;
-}
-
-#openid_url {
-	background: url(/images/openid.gif) no-repeat;
-	background-color: #FFFFFF;
-	padding-left: 16px;
-}
-
-#hlist {
-	margin: 0;
-	padding-left: 1em;
-  padding-right: 1em;
-}
-
-#hlist ul {
-	margin: 0;
-}
-
-#hlist li {
-	list-style: none;
-	margin: 0.2em;
-	display: -moz-inline-box; /* firefox pre v3 */
-	display: inline-block;
-	vertical-align: top;
-	margin-left: 0.5em;
-}
-
-#hlist li {
-	#display: inline; /* ie7 */
-	_display: inline; /* ie4 ie5 ie6 */
-}
-
-.framed {
-	border: 1px solid #CCCCCC;
-	padding: 2px;
-	background-color: #FFFFFF;
-}
-
-.framed_nospace {
-	border: 1px solid #CCCCCC;
-}
-
-/* begin css tabs nav */
-.tabnav {
-	text-align: center;
-	font-weight: bolder;
-	font-size: 108%;
-	margin: 0;
-}
-
-.tabnav li {
-	list-style: none;
-	margin: 0;
-	display: inline;
-}
-
-.tabnav li a {
-	padding: 2px 12px;
-	margin-left: 3px;
-	text-decoration: none;
-	background-color: #E0E0E0;
-	display: inline-block;
-}
-
-.tabnav li a:link {
-	color: #333333;
-}
-
-.tabnav li a:visited {
-	color: #333333;
-}
-
-.tabnav li a:hover, .tabnav li#selected_tabnav a {
-
-  background-image: -moz-linear-gradient(top, #317EFF 0%, #317EFF 100%);
-  background-image: -o-linear-gradient(top, #317EFF 0%, #317EFF 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #317EFF), color-stop(1, #317EFF));
-  background-image: -webkit-linear-gradient(top, #317EFF 0%, #317EFF 100%);
-  background-image: linear-gradient(to bottom, #317EFF 0%, #317EFF 100%);
-
-	background-color: #456AAA;
-	color: #FFFFFF;
-}
-
-
-/* end css tabs nav */ 
-
-/* begin css breadcrumbs */
-#myexp_breadcrumbs_bar {
-	font-weight: bold !important;
-	font-size: 85%;
-	text-decoration: none;
-	padding: 0.4em 0.5em;
-	background-color: #E0E0E0;
-}
-
-#myexp_breadcrumbs_bar table {
-	width: 100%;
-	padding: 0;
-	margin: 0;
-}
-
-#myexp_breadcrumbs_bar td {
-	text-align: left;
-	margin: 0;
-	padding: 0;
-}
-
-ul.breadcrumb_list {
-	margin: 0;
-	padding: 0;
-}
-
-ul.breadcrumb_list li {
-	display: inline;
-	color: #666666;
-}
-
-ul.breadcrumb_list a {
-	color: #000033;
-}
-
-UL.breadcrumb_list LI + LI:before {
-  content: " > ";
-}
-
-/* end css breadcrumbs */ 
-
-/* begin css tooltips/boxovers */
-
-.boxoverTooltipHeader {
-	display: none;
-	border: 0;
-	height: 0;
-}
-
-.boxoverTooltipBody {
-	border: solid 1px Gray;
-	color: #000000;
-	background-color: #FFFF66;
-	font-size: 93%;
-	font-weight: normal;
-	padding: 0.2em 0.6em;
-	max-width: 500px;
-	text-align: left;
-	line-height: 1.4em;
-}
-
-.boxoverInfoHeader {
-	display: none;
-	border: 0;
-	height: 0;
-}
-
-.boxoverInfoBody {
-	border: solid 1px Gray;
-	color: #333333;
-	padding: 0.4em;
-	background-color: #ebf3ff;
-	font-size: 93%;
-	text-align: left;
-	max-width: 400px;
-	line-height: 1.4em;
-}
-
-/* end css tooltips/boxovers */
-
-/* begin home styles */
-
-#home_container {
-}
-
-#home_container .stats {
-	background-color: #FFFFCC;
-	margin: 0;
-	margin-bottom: 1em;
-	padding: 0.6em 1.2em;
-	border: 1px solid #EED799;
-	font-weight: bold; 
-	font-size: 100%; 
-	color: #333333; 
-	text-align: center; 
-}
-
-#home_container .left {
-	float: left;
-	width: 28%;
-}
-
-#home_container .right {
-	float: right;
-	width: 70%;
-}
-
-#home_container .box {
-	margin-bottom: 1em;
-	overflow: hidden;
-}
-
-#home_container .box p {
-	padding: 0.2em 0;
-}
-
-#home_container .box .title {
-	font-size: 100%;
-	line-height: 1.0;
-	font-weight: bold;
-	color: #222222;
-	padding: 0.1em 1em 0.4em 1em;
-	text-align: center;
-	background-image: url('/images/header-bg2.png');
-	background-position: top;
-	background-repeat: repeat-x;
-	background-color: #CFDFEF;
-	border: #CCCCCC 0px solid;
-	border-width: 0 1px 1px 1px;
-}
-
-#home_container .box .content {
-	padding: 0.3em 0.8em;
-	border-top: none;
-	border-right: #CCCCCC 1px solid;
-	border-bottom: none;
-	border-left: #CCCCCC 1px solid;
-	background-color: #F7F7F7;
-}
-
-#home_container li.seperator {
-	height: 1px;
-	border-bottom: 1px dotted #999999;
-	padding: 0;
-}
-
-#home_container .announcements {
-	margin: 0;
-	list-style: none;
-}
-
-#home_container .announcements li {
-	list-style-type: none;
-	margin: 1em 0;
-}
-
-#home_container .list {
-	margin: 0;
-	list-style: none;
-	font-size: 93%;
-}
-
-#home_container .list li {
-	list-style-type: none;
-	margin: 1.2em 0;
-	line-height: 1.5;
-}
-
-/* begin css rounded corners - based on "Snazzy Corners" */
-
-#home_container .xtop, 
-#home_container .xbottom {
-	display: block;
-	background: transparent;
-	font-size: 1px;
-}
-
-#home_container .xb1, 
-#home_container .xb2, 
-#home_container .xb3, 
-#home_container .xb4,
-#home_container .xb5, 
-#home_container .xb6, 
-#home_container .xb7 {
-	display: block;
-	overflow: hidden;
-}
-
-#home_container .xb1, 
-#home_container .xb2, 
-#home_container .xb3, 
-#home_container .xb6, 
-#home_container .xb7 {
-	height: 1px;
-}
-
-#home_container .xb2, 
-#home_container .xb3, 
-#home_container .xb4 {
-	background: #ACCCED;
-	border-left: 1px solid #CCCCCC;
-	border-right: 1px solid #CCCCCC;
-}
-
-#home_container .xb5, 
-#home_container .xb6, 
-#home_container .xb7 {
-	background: #F7F7F7;
-	border-left: 1px solid #CCCCCC;
-	border-right: 1px solid #CCCCCC;
-}
-
-#home_container .xb1 {
-	margin: 0 5px;
-	background: #CCCCCC;
-}
-
-#home_container .xb2, 
-#home_container .xb7 {
-	margin: 0 3px;
-	border-width: 0 2px;
-}
-
-#home_container .xb3, 
-#home_container .xb6 {
-	margin: 0 2px;
-}
-
-#home_container .xb4, 
-#home_container .xb5 {
-	height: 2px;
-	margin: 0 1px;
-}
-
-/* end css rounded corners - based on "Snazzy Corners" */
-
-/* end home styles */
-
-/* begin css folds */
-
-.fold {
-	margin-bottom: 1.5em;
-}
-
-.foldTitle {
-	background-image: url('/images/header-bg.png');
-	background-position: top;
-	background-repeat: repeat-x;
-	background-color: #EEEEEE;
-	color: #333333;
-	border: 1px solid #999999;
-	border-bottom: 2px solid #aaa;
-	pointer: pointer;
-	cursor: pointer;
-	width: 100%;
-}
-
-.foldTitle p {
-	padding: 0.1em 0;
-	line-height: 1.0;
-	vertical-align: middle;
-}
-
-.foldTitle p * {
-	vertical-align: top;
-}
-
-.foldTitle hr {
-	margin: 0.4em 0;
-	*margin: 0;
-	line-height: 1.0;
-}
-
-.foldTitle small {
-	font-size: 85%;
-	font-weight: normal;
-	line-height: 1.2;
-}
-
-.foldText {
-	font-weight: bold;
-	text-align: left;
-	padding: 0.5em;
-	*padding: 0.3em;
-	vertical-align: middle;
-	
-}
-
-.foldText * {
-	vertical-align: middle;
-}
-
-.foldPlaintext {
-	font-weight: normal;
-	font-size: 85%;
-	line-height: 1.2;
-	padding: 0.1em 0;
-}
-
-.foldImage {
-	text-align: center;
-	padding: 0 0.5em;
-	vertical-align: middle;
-	width: 20px;
-}
-
-.foldContent {
-	border: 1px solid #aaa;
-	border-top: 1px solid transparent;
-	padding: 1em;
-}
-
-/* end css folds */ /* begin css tabs */
-.tabsContainer {
-	padding: 0;
-	margin: 0;
-	border: 0;
-	position: relative;
-	top: 1px;
-}
-
-.tabsContainer IMG {
-	border: 0;
-	margin: 0;
-	padding: 0;
-	vertical-align: middle;
-}
-
-.tabsContainer TABLE {
-	height: 24px;
-	border-spacing: 0;
-}
-
-.tabsContainer TABLE TR TD {
-	padding: 0;
-	vertical-align: middle;
-}
-
-.tabSeparator {
-  width: 1px;
-}
-
-.tabSelected {
-	border-top: 1px solid #909090;
-	border-bottom: 1px solid white;
-	padding: 0;
-	padding-left: 0.5em;
-	padding-right: 0.5em;
-	vertical-align: middle;
-	white-space: nowrap;
-	pointer: pointer;
-	cursor: pointer;
-}
-
-.tabUnselected {
-	border-top: 1px solid #909090;
-	border-bottom: 1px solid #909090;
-	color: #333333;
-	background: #d8d8d8;
-	padding: 0;
-	padding-left: 0.5em;
-	padding-right: 0.5em;
-	vertical-align: middle;
-	white-space: nowrap;
-	pointer: pointer;
-	cursor: pointer;
-}
-
-.tabSelIMG {
-	border-bottom: 1px solid white;
-  width: 6px;
-}
-
-.tabUnselIMG {
-	border-bottom: 1px solid #909090;
-  width: 6px;
-}
-
-.tabTitle {
-	background: #f5f5f5;
-	border: 1px solid #999999;
-	color: #333333;
-	padding: 0.5em;
-}
-
-.tabContent {
-	border: 1px solid #999999;
-	padding: 0.5em;
-	margin-bottom: 1.0em;
-	background: white;
-}
-
-/* end css tabs */ 
-
-/* begin css newsfeed */
-
-.news_feed_div p.news_feed_day_title {
-	font-weight: bold;
-	width: 100%;
-	text-align: left;
-	border-bottom: 1px dotted #999999;
-}
-
-.news_feed_div ul.news_feed_day {
-	padding-left: 0.8em;
-	list-style-type: none;
-	margin-top: 0.4em;
-	margin-left: 0.5em;
-	margin-bottom: 0.5em;
-	line-height: 1.4;
-}
-
-.news_feed_div ul.news_feed_day li.news_feed_item {
-	list-style: none;
-	font-size: 93%;
-}
-
-/* end css newsfeed */
-
-.fieldWithErrors {
-	padding: 2px;
-	background-color: red;
-	display: table;
-}
-
-#errorExplanation {
-	width: 400px;
-	border: 2px solid #c00;
-	padding: 0.5em;
-	margin-bottom: 1.5em;
-	background-color: #F5F5F5;
-  margin: 0 auto 1.5em auto;
-}
-
-#errorExplanation h2 {
-	text-align: left;
-	font-weight: bold;
-	padding: 5px 5px 5px 15px;
-	font-size: 93%;
-	margin: 0;
-	background-image: none;
-	background-color: #c00;
-	border: none;
-	color: #fff;
-}
-
-#errorExplanation p {
-	font-size: 93%;
-	color: #333;
-	margin-bottom: 0;
-	margin-top: 0.5em;
-	padding: 5px;
-}
-
-#errorExplanation ul li {
-	font-size: 93%;
-	list-style: square;
-}
-
-div.uploadStatus {
-	margin: 5px;
-}
-
-div.progressBar {
-	margin: 5px;
-}
-
-div.progressBar div.border {
-	background-color: #fff;
-	border: 1px solid gray;
-	width: 100%;
-}
-
-div.progressBar div.background {
-	background-color: #333;
-	height: 18px;
-	width: 0%;
-}
-
-table.alt_table {
-	border-collapse: collapse;
-}
-
-table.alt_table td {
-	border-top: 1px solid #BBBBBB;
-	border-bottom: 1px solid #BBBBBB;
-	margin-bottom: 0.5em;
-	padding: 1em 0.5em;
-	vertical-align: top;
-  width: 737px;
-}
-
-table.alt_table tr.odd_row td {
-	background-color: #F5F5F5;
-}
-
-table.alt_table tr.even_row td {
-	background-color: #EEEEEE;
-}
-
-table.alt_table hr {
-	height: 1px;
-	border-bottom: 1px dotted #999999;
-	margin: 0;
-}
-
-table.alt_table .mid {
-	text-align: left;
-  width: 390px;
-}
-
-table.alt_table tr td.actions { /*width: 135px;*/
-	text-align: left;
-}
-
-table.alt_table tr td.actions a {
-	display: block;
-	border-bottom: 0px solid #999999;
-	margin-bottom: 0.3em;
-	font-size: 85%;
-	font-weight: normal;
-}
-
-table.alt_table p.title {
-	margin-top: 0;
-	padding-top: 0;
-	margin-bottom: 0.2em;
-	font-weight: bold;
-	font-size: 108%;
-}
-
-table.alt_table .desc {
-	border: 1px dotted #999999;
-	margin: 0.2em 0;
-	padding: 0.4em 0.6em;
-	background-color: #FFFFCC;
-	text-align: left;
-	line-height: 1.3;
-	overflow: hidden;
-  word-wrap: break-word;
-  width: 360px;
-}
-
-table.alt_table .standout {
-	border: 1px dotted #999999;
-	margin: 0.2em 0;
-	padding: 0.4em 0.6em;
-	background-color: #FFFFCC;
-	text-align: left;
-	line-height: 1;
-	font-size: 93%;
-	font-weight: bold;
-	color: #333333;
-	width: 360px;
-}
-
-table.alt_table tr td.contributable {
-	margin: 0.5em 0;
-	padding: 1em;
-}
-
-table.alt_table tr.even_row td.contributable table.contributable:hover,table.alt_table tr.odd_row td.contributable table.contributable:hover
-	{
-	border: 1px dotted #999999;
-}
-
-table.contributable {
-	border: 1px dotted #999999;
-	padding: 1em;
-	margin-left: 5px;
-	margin-bottom: 10px;
-}
-
-table.contributable:hover {
-	border: 1px dotted #999999;
-}
-
-/* http://www.mis-algoritmos.com/wp-content/uploads/pagstyle.php?q=manu */
-.pagination {
-	padding: 3px;
-	margin: 3px;
-	text-align: center;
-}
-
-.pagination ul {
-	list-style-type: none;
-}
-
-.pagination ul li {
-	display: inline;
-}
-
-.pagination a {
-	padding: 2px 5px 2px 5px;
-	margin: 2px;
-	border: 1px solid #317eff;
-	text-decoration: none; /* no underline */
-	color: #179032;
-}
-
-.pagination a:hover,.pagination a:active {
-	border: 1px solid #CE0434;
-	color: #179032;
-}
-
-.pagination .currentpage {
-	padding: 2px 5px 2px 5px;
-	margin: 2px;
-	border: 1px solid #179032;
-	font-weight: bold;
-	background-color: #179032;
-	color: #FFF;
-}
-
-.pagination .disabledpage {
-	padding: 2px 5px 2px 5px;
-	margin: 2px;
-	border: 1px solid #EEE;
-	color: #DDD;
-}
-
-.network_banner { /*width: 640px;*/
-	padding-left: 10px;
-	padding-right: 10px;
-	border: 1px solid transparent;
-}
-
-.network_banner:hover { /*border: 1px solid black;*/
-	
-}
-
-.sectionIcons {
-	margin: 0.5em 0 1em 0;
-	font-size: 85%;
-	font-weight: bold;
-	text-align: center;
-}
-
-.sectionIcons * {
-	vertical-align: middle;
-}
-
-.sectionIcons li {
-	display: inline;
-	vertical-align: middle;
-	margin: 0;
-	margin-left: 8px;
-	/*border: 2px solid #F5F5F5;*/ 
-}
-
-.sectionIcons li:first {
-	margin-left: 0;
-}
-
-.sectionIcons li:hover {
-}
-
-.sectionIcons li * {
-	vertical-align: middle;
-}
-
-.sectionIcons li a {
-	width: 100%;
-	padding: 0.5em 0.5em;
-	*padding: 0.2em 0.5em;
-	line-height: 1.0;
-	text-decoration: none;
-	border: 1px solid #BBBBBB;
-	background-color: #EEF6FF;
-}
-
-.sectionIcons li a:hover {
-	background-color: #0099FF;
-	color: #F5F5F5;
-}
-
-.sectionIcons li a * {
-	vertical-align: middle;
-}
-
-a.button_slim {
-	padding: 0.2em 0.4em 0.5em 0.4em;
-	*padding: 0.2em 0.4em;
-	line-height: 1;
-	text-decoration: none;
-	border: 1px solid #BBBBBB;
-	background-color: #EEF6FF;
-	vertical-align: middle;
-}
-
-a.button_slim:hover {
-	background-color: #0099FF;
-	color: #F5F5F5;
-}
-
-a.button_slim * {
-	vertical-align: middle;
-}
-
-.icon {
-	vertical-align: middle;
-}
-
-.icon * {
-	vertical-align: middle;
-}
-
-.icon A {
-	white-space: nowrap;
-	padding-right: 2px;
-	vertical-align: middle;
-}
-
-.icon IMG {
-	padding: 2px;
-	vertical-align: middle;
-}
-
-.contribution_title {
-	margin-bottom: 0.6em;
-}
-
-.contribution_aftertitle {
-	color: #666666; 
-	font-size: 85%; 
-	text-align: center; 
-	margin-bottom: 0.6em;
-}
-
-.contribution_mini_nav {
-	color: #999999;
-	font-size: 85%; 
-	text-align: center; 
-	margin-bottom: 1em;
-	line-height: 1.5;
-}
-
-.contribution_left_box {
-	float: left;
-	width: 73.5%;
-}
-
-.contribution_description {
-	text-align: left;
-	background-color: #FFFFFF;
-	border: 1px solid #CCCCCC;
-	padding: 0.3em 1em;
-}
-
-.contribution_preview img {
-	background-color: #FFFFFF;
-	border: 1px solid #DDDDDD;
-	padding: 0.5em;
-}
-
-.contribution_right_box {
-	float: right;
-	width: 25%;
-}
-
-.contribution_section_box {
-	background-image: url('/images/box-bg1.png');
-	background-position: top;
-	background-repeat: repeat-x;
-	background-color: #FFFFCC;
-	padding: 0.3em 0.3em;
-	border: 1px dotted #999999;
-	text-align: center;
-	margin-bottom: 0.6em;
-}
-
-.contribution_section_box ul.items {
-	margin: 0 0 0.8em 1em;
-	text-align: left;
-}
-
-.contribution_section_box ul.items li {
-	list-style-type: none;
-	margin: 0.6em 0;
-	padding-left: 0.8em;
-	line-height: 1.1;
-	border-left: 3px solid #DDDDBB;
-}
-
-.contribution_section_box ul.items li * {
-	vertical-align: middle;
-}
-
-.contribution_section_box p {
-	text-align: center;
-	padding: 0.2em;
-}
-
-.contribution_section_box .stats_box p {
-	font-size: 93%;
-	text-align: centre;
-	line-height: 1.3;
-	padding: 0;
-}
-
-.contribution_section_box hr {
-	margin: 0.5em 0;
-	*margin: 0;
-	height: 1px;
-	border-bottom: 1px dotted #999999;
-}
-
-.contribution_section_box .heading {
-	font-size: 100%;
-	font-weight: bold;
-	line-height: 1.0;
-	margin-top: 0.2em;
-}
-
-.contribution_section_box .hTagcloud {
-	margin-top: 0.3em;
-	margin-bottom: 0.5em;
-}
-
-.contribution_section_box .fold {
-	margin-bottom: 0;
-	margin-top: 0.6em;
-	font-size: 85%;
-}
-
-.contribution_section_box .foldTitle {
-	background-image: none;
-	background-color: #EEF6FF;
-	color: #333333;
-	border: 1px solid #BBBBBB;
-	border-bottom: 2px solid #CCCCCC;
-}
-
-.contribution_section_box .foldText {
-	padding: 0.4em; *
-	padding: 0.2em;
-}
-
-.contribution_section_box .foldContent {
-	padding: 0.2em;
-	background-color: #F5F5F5;
-	border: 1px solid #BBBBBB;
-	border-top: 1px solid transparent;
-}
-
-.contribution_section_box .foldContent ul {
-	list-style: none;
-	padding: 0;
-	padding-left: 1em;
-	margin: 0;
-}
-
-.contribution_section_box .foldContent ul li {
-	list-style: none;
-	padding: 0;
-	margin: 0;
-}
-
-.contribution_version_box {
-	border: 1px dotted #999999;
-	margin-bottom: 1em;
-	background-color: #F7F7F7;
-}
-
-.contribution_version_box .title {
-	font-size: 108%; 
-	font-weight: bold; 
-	color: #660000;
-}
-
-.contribution_version_selector_box {
-	padding: 0.6em 0.5em 0.4em 0.5em;
-	border: 0px dotted #999999;
-	border-width: 0 0 1px 0;
-	background-image: url('/images/box-bg1.png');
-	background-position: top;
-	background-repeat: repeat-x;
-	background-color: #FFFFCC;
-	color: #333333;
-}
-
-.contribution_version_selector_box * {
-	vertical-align: middle;
-}
-
-.contribution_version_selector_box table {
-	width: 100%;
-	margin: 0;
-	padding: 0;
-	border-collapse: collapse;
-}
-
-.contribution_version_selector_box table td {
-	padding: 0em 0.5em;
-}
-
-.contribution_version_selector_box .heading {
-	text-align: left; 
-	font-size: 108%; 
-	font-weight: bold; 
-	color: #333333;
-}
-
-.contribution_version_inner_box {
-	padding: 0.6em 0.7em;
-}
-
-.contribution_version_inner_box h4 {
-	text-align: center;
-}
-
-.contribution_version_inner_box .option_box {
-	padding: 0.2em 0.6em; 
-	border: 1px solid #CCCCCC;
-}
-
-.contribution_currentlicense {
-	padding: 0 0 0.5em 0;
-}
-
-.contribution_currentlicense p {
-	text-align: center;
-	font-size: 85%;
-	font-weight: bold;
-	color: #666666;
-	line-height: 1.3;
-}
-
-/* Begin Comments styles */
-
-.commentsBox {
-	padding-left: 2em;
-}
-
-ul.comments {
-	list-style: none;
-	margin: 0;
-	padding: 0;
-}
-
-ul.comments li {
-	margin-top: 1.5em;
-	list-style: none;
-}
-
-table.comment {
-	width: 100%;
-	border: 1px dotted #999999;
-	border-collapse: collapse;
-	border-spacing: 0;
-}
-
-table.comment p {
-	padding: 0;
-}
-
-table.comment td {
-	padding: 0.2em;
-	vertical-align: top;
-}
-
-table.comment td.avatar {
-	width: 70px;
-	padding: 0.2em 0.6em;
-	text-align: center;
-	background-color: #EEEEEE;
-}
-
-table.comment td.header {
-	font-size: 85%;
-	height: 1.2em;
-	vertical-align: middle;
-	text-align: left;
-	background-color: #EEEEEE;
-	color: #333333;
-	padding: 0.2em 0.8em;
-}
-
-table.comment td.content {
-	padding: 0.8em 1em;
-	text-align: left;
-}
-
-table.comment td.content p {
-	margin-bottom: 1em;
-}
-
-.addCommentBox {
-	margin-top: 3em;
-	padding: 1em;
-	width: 500px;
-	background-color: #EEEEEE;
-	border: 1px dotted #999999;
-}
-
-/* End Comments styles */
-
-/* Begin Reviews styles */
-
-.reviewsBox {
-	padding-left: 2em;
-}
-
-/* End Reviews styles */
-
-a.tagsSelectorOff,
-a.tagsSelectorOn {
-	margin: 0 0.2em;
-	padding: 0.1em 0.4em;
-	border: 1px solid #BBBBBB;
-	font-weight: bold;
-	font-size: 85%;
-}
-
-a.tagsSelectorOff {
-	background-color: #EEF6FF;
-	color: #000099;
-}
-
-a.tagsSelectorOff:hover,
-a.tagsSelectorOn:hover {
-	color: #F5F5F5;
-	background-color: #0099FF;
-	text-decoration: none;
-}
-
-a.tagsSelectorOn {
-	color: #F5F5F5;
-	background-color: #0099FF;
-}
-
-.message_box {
-	padding: 1.5em 2em;
-	border: 1px dotted #999999;
-	background-color: #F5F5F5;
-	margin: 0 0.5em;
-}
-
-.message_box .subject {
-	font-size: 108%; 
-	background-color: #FFFFCC; 
-	border: 1px dotted #999999; 
-	padding: 0.2em 0.5em; 
-	margin-bottom: 1em;
-}
-
-.message_box .message {
-	padding: 0.6em 1em;
-	border: 1px dotted #999999;
-	background-color: #FFFFFF;
-}
-
-.badge {
-	padding: 0;
-	margin: 0;
-	margin-left: 0.2em;
-	vertical-align: middle;
-}
-
-/* begin autocomplete styles */
-/* From the book: "Agile Web Development with Rails, 2nd ed" p.548 */
-
-div.auto_complete {
-	background: #fff;
-	width: 99%;
-	z-index: 10;
-}
-
-div.auto_complete ul {
-	border: 1px solid #888;
-	margin: 0;
-	padding: 0;
-	width: 100%;
-	list-style-type: none;
-	font-weight: bold;
-	font-size: 94%;
-}
-
-div.auto_complete ul li {
-	margin: 0;
-	padding: 3px;
-	text-align: left;
-	list-style-type: none;
-}
-
-div.auto_complete ul li.selected {
-	background-color: #ffb;
-}
-
-div.auto_complete ul strong.highlight {
-	color: #800;
-	margin: 0;
-	padding: 0;
-}
-
-/* end autocomplete styles */
-
-.box_simple {
-	padding: 0.5em 0.8em;
-	border: 1px dotted #999999;
-}
-
-.box_form {
-	background-color: #EEEEEE;
-	border: 1px dotted #999999;
-	padding: 0.8em 1.4em;
-}
-
-.box_form p {
-	margin-top: 0.4em;
-}
-
-.box_standout {
-	padding: 0.5em 0.8em; 
-	border: 1px dotted #999999;
-	background-color: #FFFFCC;
-}
-
-.box_important {
-	padding: 0.5em 0.8em; 
-	border: 2px solid #993333;
-	background-color: #FFCCCC;
-}
-
-.box_currentuser_specific {
-	padding: 0.5em 0.8em;
-	border: 1px solid #99CCFF;
-	background-color: #EEF6FF;
-}
-
-.box_currentuser_specific * {
-	vertical-align: middle;
-}
-
-.box_dynamic_help {
-	padding: 0.4em 0.8em; 
-	border: 1px dotted #999999;
-	background-color: #FFFFCC;
-	font-size: 85%;
-	margin-bottom: 0.4em;
-}
-
-.box_inplace {
-	padding: 0.8em; 
-	border-top: 1px dotted #999999; 
-	border-bottom: 1px dotted #999999;
-}
-
-.box_editing {
-	padding: 0.5em; 
-	background-color: #FFFFFF;
-	border-left: 5px solid #0066CC;
-	padding-left: 0.8em;
-	margin-left: 0.8em;
-}
-
-.box_editing_inner {
-	padding: 0.5em;
-	background-color: #DDEEFF;
-}
-
-.box_editing_inner2 {
-	background-color: #EEEEEE;
-	padding: 0.5em 0.8em;
-	border: 1px dotted #999999;
-}
-
-.box_infotext {
-	font-size: 93%;
-	background-color: #FFFFCC;
-	margin: 0; 
-	padding: 0.5em 0.8em;
-	border: 1px solid #EED799;
-	line-height: 1.4;
-}
-
-.derived_annotation_notice,
-.none_text {
-	font-style: italic;
-	color: #666666;
-}
-
-.denied_text {
-	font-style: italic;
-	color: #990000;
-}
-
-.count_text {
-	color: #666666;
-}
-
-.error_text {
-	color: red;
-	font-weight: bold;
-}
-
-.step_text {
-	color: #660000;
-	font-weight: bold;
-	margin: 0.5em 0 0.6em 0;
-	text-align: center;
-}
-
-.note_text {
-	font-size: 93%;
-	font-weight: bold;
-	color: #900000;
-}
-
-.sub-heading {
-	text-align: center; 
-	font-size: 108%; 
-	margin-bottom: 0.5em;
-}
-
-.rest_table TABLE {
-  border: 1px solid black;
-  margin: 1px;
-}
-
-.rest_table TABLE THEAD {
-  background: #e0e0ff
-}
-
-.rest_table TABLE THEAD TR TD {
-  text-align: left;
-  vertical-align: top;
-}
-
-.rest_table TABLE TBODY {
-  background: white
-}
-
-.rest_table TABLE TBODY TR TD {
-  text-align: left;
-  vertical-align: top;
-}
-
-.try_it_out_box TEXTAREA {
-  font-family: monospace;
-  font-size: 10pt;
-}
-
-.inputs_list {
-	list-style: none;
-	margin: 0;
-	margin-bottom: 0.5em;
-}
-
-.inputs_list li {
-	list-style: none;
-}
-
-table.job_report {
-	border-collapse: collapse;
-	font-size: 93%;
-	margin-top: 0.3em;
-}
-
-table.job_report th,
-table.job_report td {
-	border: 1px solid #CCCCCC;
-	padding: 0.3em 0.6em;
-}
-
-table.job_report th {
-	background-color: #EEEEEE;
-	font-weight: bold;
-}
-
-/* Begin new tabs styles */
-
-.tabnav2 {
-	border-bottom: 1px solid #999999;
-	font-size: 100%;
-	padding-left: 0px;
-	z-index: 1;
-}
-
-.tabnav2 ul {
-	margin: 0;
-	padding: 2px 0;
-	*padding: 3px 0;
-}
-
-.tabnav2 li {
-	display: inline;
-	list-style-type: none;
-	overflow: hidden;
-  color: black;
-  position: relative;
-  top: -1px;
-}
-
-.tabnav2 li a {
-	padding: 3px 6px 4px 6px;
-	border: 1px solid #999999;
-	text-decoration: none;
-	background-color: #D8D8D8;
-	color: #404040;
-
-  -moz-border-radius: 6px 6px 0px 0px;
-  -webkit-border-top-left-radius: 6px;
-  -webkit-border-top-right-radius: 6px;
-}
-
-.tabnav2 li a:hover {
-	background-color: #E8E8E8;
-}
-
-.tabnav2 li.active a {
-  color: black;
-	border-bottom: 1px solid #FFFFFF;
-	background-color: #FFFFFF;
-}
-
-.tabnav2_content {
-	border: 0px solid #999999;
-	border-width: 0 1px 1px 1px;
-	padding: 0.5em;
-	z-index: 2;
-    background: white;
-}
-
-/* End new tabs styles */
-
-/* Begin outputs table styles */
-
-table.outputs_viewer {
-	border: 1px solid #CCCCCC;
-	border-collapse: collapse;
-}
-
-table.outputs_viewer th,
-table.outputs_viewer td {
-	border: 1px solid #CCCCCC;
-	background-color: #FFFFFF;
-}
-
-table.outputs_viewer th {
-	background-color: #EEEEEE;
-	font-weight: bold;
-	padding: 0.7em 0.6em;
-	font-size: 100%;
-}
-
-table.outputs_viewer .nav {
-	width: 140px;
-	overflow: auto;
-	font-size: 93%;
-	vertical-align: top;
-	background-color: #F5F5F5;
-	padding: 0;
-}
-
-table.outputs_viewer .content {
-	vertical-align: top;
-	padding: 0;
-}
-
-table.outputs_viewer .content #output_content_box {
-	padding: 1em;
-	overflow: auto;
-	text-align: left;
-	width: 500px;
-	max-width: 500px;
-	height: inherit;
-	max-height: 1000px;
-}
-
-table.outputs_viewer .nav a {
-	display: block;
-	width: 140px;
-	padding: 0.6em;
-	border-bottom: 1px solid #DDDDDD;
-	background-color: #FFFFFF;
-	line-height: 1.2;
-	overflow: hidden;
-}
-
-table.outputs_viewer .nav a:hover,
-table.outputs_viewer .nav a.selected {
-	background-color: #EEF6FF;
-}
-
-/* End outputs table styles */
-
-/* Begin outputs content list styles */
-
-ol.outputs_list {
-	width: auto;
-	text-align: left;
-	margin-left: 2em;
-}
-
-ol.outputs_list, 
-ol.outputs_list ol {
-	padding-left: 0;
-	list-style-position: outside;
-	list-style-type: decimal;
-}
-
-ol.outputs_list ol {
-	margin: 0 0 0.5em 1em;
-}
-
-ol.outputs_list li {
-	display: list-item;
-	width: auto;
-	padding: 0.4em 0.1em;
-	list-style-position: outside;
-	list-style-type: decimal;
-}
-
-ol.outputs_list ol li {
-	list-style-position: outside;
-}
-
-/* End outputs content list styles */
-
-
-.default_timeline { 
-	width: 100%; 
-	height: 600px; 
-}
-
-table.simple {
-	border-collapse: collapse;
-	font-size: 93%;
-	margin-top: 0.3em;
-}
-
-table.simple th,
-table.simple td {
-	border: 1px solid #CCCCCC;
-}
-
-table.simple th {
-	background-color: #EEEEEE;
-	font-weight: bold;
-	padding: 0.5em 0.8em;
-}
-
-table.simple td {
-	background-color: #FFFFFF;
-	text-align: left;
-	vertical-align: top;
-	line-height: 1.3;
-	padding: 0.3em 0.6em;
-}
-
-#packItems ul {
-	margin: 0;
-	list-style: none;
-	border-top: 1px solid #CCCCCC;
-}
-
-#packItems ul li {
-	list-style-type: none;
-	margin: 0;
-	line-height: 1.4;
-	padding: 0.2em 0.5em;
-	border-bottom: 1px solid #CCCCCC;
-	background-color: #FFFFFF;
-	font-size: 93%;
-}
-
-#packItems table {
-	margin: 0;
-	width: 100%;
-	border-collapse: collapse;
-}
-
-#packItems p {
-	padding: 0.1em 0;
-}
-
-#packItems td {
-	vertical-align: top;
-	text-align: left;
-	padding: 0.4em 0.6em;
-}
-
-#packItems td.icon {
-	width: 16px;
-	text-align: center;
-}
-
-#packItems td.remote {
-	width: 470px;
-	max-width: 470px;
-}
-
-#packItems td.remote p.longurl {
-	word-wrap: break-word;
-}
-
-#packItems .inner {
-	color: #333333;
-	margin: 0.3em 0 0 0.3em;
-	padding: 0.2em 0 0.3em 0.7em;
-	border-left: 3px solid #EEEEEE; 
-}
-
-#packItems .comment {
-	font-style: italic;
-	background-color: #F7F7F7;
-	padding: 0.4em 0.6em;
-}
-
-#packItems .user {
-}
-
-.deletedPackItem {
-  color: gray;
-}
-
-table.quick_add {
-	border-collapse: collapse; 
-	width: 99%;
-	color: #333333;
-}
-
-table.quick_add td {
-	vertical-align: middle;
-}
-
-table.quick_add td * {
-	vertical-align: middle;
-}
-
-table.quick_add td.label {
-	text-align: left;
-	line-height: 1.0;
-	width: 11em;
-}
-
-table.quick_add td.label .inner {
-	font-size: 77%;
-	text-align: center;
-	color: #990000;
-	font-weight: bold;
-}
-	
-
-table.quick_add td.submit {
-	text-align: left; 
-	width: 4em;
-}
-
-.group_announcements {
-	margin-top: 0.8em;
-	padding: 0 0.5em;
-}
-
-.group_announcements ul {
-	margin: 0;
-}
-
-.group_announcements li {
-	list-style-type: none;
-	margin: 0 0 0.9em 0;
-}
-
-.group_announcements .announcement_box {
-	border: 1px dotted #999999;
-	margin: 0.1em 0;
-	padding: 0.2em 0.5em; 
-	background-color: #F9F9F9;
-	font-size: 85%;
-	font-weight: bold;
-	text-align: left;
-}
-
-.required {
-	color: red;
-	font-weight: bold;
-}
-
-.workflow_type_box {
-	border: 1px solid #DDDDDD; 
-	background-color: #FFFFCC; 
-	margin: 0; 
-	padding: 0.4em 0.5em; 
-	font-size: 77%; 
-	color: #990000; 
-	font-weight: bold; 
-	text-align: center;
-}
-
-#version_info_box p {
-	line-height: 1.2;
-	padding: 0.3em 0;
-	margin: 0;
-}
-
-#version_info_box p * {
-	vertical-align: middle;
-}
-
-.tag_suggestion_box {
-	padding: 0.5em 0.8em;
-	border: 1px dotted #999999;
-  font-size: 93%;
-  text-align: left;
-  margin: 2em;
-  line-height: 20px;
-}
-
-.unselected_tag_suggestion {
-  border: 1px SOLID white;
-  padding-left: 4px;
-  padding-right: 4px;
-}
-
-.unselected_tag_suggestion:hover {
-  border: 1px SOLID #d0d0f0;
-  background-color: white;
-  padding-left: 4px;
-  padding-right: 4px;
-  color: #000099;
-  text-decoration: none;
-}
-
-.selected_tag_suggestion {
-  border: 1px SOLID #a0a0c0;
-  background-color: #d0d0f0;
-  padding-left: 4px;
-  padding-right: 4px;
-}
-
-.selected_tag_suggestion:hover {
-  border: 1px SOLID #a0a0c0;
-  background-color: #d0d0f0;
-  padding-left: 4px;
-  padding-right: 4px;
-  color: #000099;
-  text-decoration: none;
-}
-
-.quote_level_0 {
-}
-
-.quote_level_1 {
-  color: gray;
-}
-
-.quoted_section {
-  border-left: 2px solid gray;
-  padding-left: 8px;
-}
-
-.nowrap {
-  white-space: nowrap;
-}
-
-.classification {
-  border: 1px SOLID gray;
-  padding: 3px;
-  padding-left: 6px;
-  padding-right: 6px;
-  background: #ffffd0;
-}
-
-.quality {
-  width: 157px;
-  background: #EEA;
-  border: 1px solid #CCCCAA;
-  margin: 4px;
-  padding: 4px;
-  text-align: center;
-}
-
-.dependencies UL LI {
-	list-style: none;
-}
-
-.curation_events UL LI {
-  list-style: none;
-  padding-top: 1em;
-}
-
-/* Styles Related to topics */
-
-table.topic {
-  border-collapse:collapse;
-  border: 1px solid black;
-  width: 40%;
-}
-
-table.topic th{
-  border: 1px solid black;
-  text-align:center;
-  width: 100%;
-  background-color: #FFFFCC; 
-}
-
-.topic_feedback{
-  float: right;
-  text-align:center;
-  margin-top:7px;
-}
-
-table.topic td.tag{
-  text-align:left;
-  width: 60%;
-}
-
-table.topic div.topic_feedback a:link{
-  text-decoration:underline;
-}
-
-table.topic td.tag_vote{
-  text-align:center;
-  width: 40%;
-}
-
-#topic_container .hTagcloud {
-/*  width: 225px; */
-}
-
-#topic_container LI {
-}
-
-
-/* End syles related to topics */
-
-/* pivot */
-
-.pivot {
-  width: 737px;
-  margin: 0;
-}
-
-.pivot .left {
-  width: 150px;
-  float: left;
-  padding-right: 10px;
-}
-
-.pivot .left > DIV {
-  margin-bottom: 0.5em;
-}
-
-.pivot .main {
-  margin-left: 160px;
-}
-
-.pivot .main > DIV {
-  margin-bottom: 0.5em;
-}
-
-.pivot .summary {
-  clear: right;
-  background: #f0f0f0;
-  border: 1px solid #d8d8d8;
-  padding: 6px;
-}
-
-
-.pivot .summary DIV+DIV {
-  padding-top: 0.4em;
-}
-
-.pivot .sort {
-  float: right;
-}
-
-.pivot .filter {
-  margin-bottom: 1em;
-  padding: 2px;
-}
-
-.pivot .category {
-  padding: 0.2em;
-  font-size: 110%;
-  margin-bottom: 0.2em;
-}
-
-.pivot .toggle_filter_query {
-  float: right;
-  vertical-align: middle;
-  position: relative;
-  top: 2px;
-}
-
-.pivot .options > DIV {
-  border: 1px solid transparent;
-  padding: 0.2em;
-  font-size: 90%;
-  padding-left: 0.2em;
-}
-
-.pivot .options > DIV:hover {
-  background: #d0d0f0;
-}
-
-.pivot .options > DIV.selected {
-  background: #ffe0c0;
-}
-
-.pivot .checkbox {
-  display: inline;
-  padding-top: 0;
-  padding-bottom: 0;
-}
-
-.pivot .label {
-  width: 90px;
-  overflow: hidden;
-  display: inline-block;
-}
-
-.pivot .count {
-  float: right;
-}
-
-.pivot .crumbs {
-  margin-top: 0.5em;
-}
-
-.pivot .filter-in-use {
-  background: #d8d8d8;
-  padding: 2px;
-	line-height: 200%;
-}
-
-.pivot .filter-in-use A {
-  padding-left: 0px;
-  padding-right: 4px;
-  text-decoration: none; /* no underline */
-}
-
-.pivot .filter-in-use A IMG {
-  vertical-align: middle;
-  position: relative;
-  top: -2px;
-}
-
-.pivot .filter-in-use:hover {
-/*  background: #f0d0d0; */
-}
-
-.pivot .pagination {
-	padding: 0px;
-	margin: 0px;
-	text-align: left;
-}
-
-.pivot .filter_search_box {
-  border: 1px solid gray;
-}
-
-.pivot .filter_search_box INPUT.query {
-  width: 123px;
-  padding: 2px;
-  border: none;
-  outline: none;
-}
-
-.pivot .filter_search_box INPUT.submit {
-  vertical-align: middle;
-  position: relative;
-  top: -1px;
-}
-
-.pivot .filter_search_box IMG {
-  vertical-align: middle;
-  position: relative;
-  top: -1px;
-}
-
-.pivot .search_query_problem {
-  color: red;
-	font-style: italic;
-}
-
-.truncate {
-  white-space: nowrap;
-}
-
-.no-filter-query-results {
-  padding-top: 1em;
-	font-style: italic;
-}
-
-.pivot .no-results {
-  padding-top: 2em;
-  padding-bottom: 2em;
-	font-style: italic;
-}
-
-.pivot .search_box .query {
-  padding: 2px;
-  width: 450px;
-}
-
-.edit_relationships {
-  margin: 20px;
-}
-
-.edit_relationships > * {
-  display: block;
-  margin-bottom: 10px;
-}
-
-.relationship_sentences * {
-  vertical-align: middle;
-}
-
-#error_flash {
-  color: red;
-  font-weight: bold;
-  margin-bottom: 1.5em;
-  line-height: 1.4;
-}
-
-#notice_flash {
-  color: green;
-  font-weight: bold;
-  margin-bottom: 1.5em;
-  line-height: 1.4;
-}
-
-.user-check-buttons {
-	border: 1px solid #CCCCCC;
-  padding: 4px;
-  margin-left: 8px;
-  float: right;
-}
-
-#user-check-list TD {
-  background: #f0f0f0;
-}
-
-#user-check-list TD.ident {
-	font-weight: bold;
-}
-
-#user-check-submit,
-#user-check-range {
-  margin: 24px;
-  text-align: center;
-}
-
-#selected-user-check-element .table-div TABLE {
-  border: 2px solid black;
-}
-
-#user-check-list > DIV {
-  padding: 4px;
-}
-
-#user-check-list .whitelist TD {
-	border: 1px solid #80c080;
-  background: #c0ffc0;
-}
-
-#user-check-list .sleep TD {
-	border: 1px solid #c0e0c0;
-  background: #e0ffe0;
-}
-
-#user-check-list .suspect TD {
-	border: 1px solid #e0c0c0;
-  background: #ffe0e0;
-}
-
-#user-check-list .delete TD {
-	border: 1px solid #c08080;
-  background: #ffc0c0;
-}
-
-div.credit_selection_box, div.credit_selection_box {
-  margin-top: 0.5em;
-  padding: 0.5em;
-  background-color: #eee;
-  overflow: auto;
-}
-
-div.credit_selection_box button {
-  float: right;
-  margin-left: 0.5em;
-}
-
-div.credit_selection_box input,
-div.credit_selection_box select {
-  width: 20em;
-  min-height: 19px;
-}
-
-.auto_complete_spinner {
-  margin-left: -24px;
-}
-
-input.auto_complete_field {
-  min-height: 20px;
-}
-
-input.auto_complete_field.accepted {
-  background-color: transparent;
-  border: none;
-  color: #4dbf00;
-}
-
-input.auto_complete_field.error {
-  background-color: #FFCCCC;
-}
-
-.version_history .title {
-  font-size: 16px;
-}
-
-.version_history .metadata {
-  margin-left: 12px;
-  margin-top: 6px;
-  margin-bottom: 6px;
-}
-
-.version_history .comment {
-	padding: 6px;
-	border: 1px dotted #999999;
-	background-color: #FFFFCC;
-	color: #333333;
-	line-height: 1.2;
-	font-size: 85%;
-}
-
-.new-session-sign-in {
-  width: 190px;
-  border: 1px solid #CCCCCC;
-  border-radius: 6px 6px 6px 6px;
-  -moz-border-radius: 6px 6px 6px 6px;
-  -webkit-border-bottom-left-radius: 6px;
-  -webkit-border-bottom-right-radius: 6px;
-}
-
-div.deprecation_event {
-  border: 1px solid #e24a3e;
-  background-color: #ffcccc;
-  padding: 0.5em;
-  border-radius: 3px;
-  margin-bottom: 1em;
-}
-
-#statement_list TABLE {
-  border-collapse: collapse;
-  margin-bottom: 16px;
-  width: 100%;
-}
-
-#statement_list DIV {
-  box-shadow: 5px 5px 8px #AAA;
-}
-
-#statement_list TD {
-  border: 1px solid gray;
-  background: white;
-  text-align: left;
-}
-
-.recommender-link {
-  margin: 10px;
-  text-align: center;
-}
-
-.research_object_browser LI {
-  list-style-image: url('/images/famfamfam_silk/page.png');
-}
-
-DIV.tag_list {
-  margin-top: 16px;
-  margin-bottom: 16px;
-}
-
-DIV.tag_list UL {
-  margin: 0;
-}
-
-DIV.tag_list LI {
-	display: inline-block;
-	list-style: none;
-  border-bottom: 1px SOLID #a0a0c0;
-  background-color: #d0d0f0;
-  padding-left: 4px;
-  padding-right: 4px;
-}
-
-div.ro_uri_edit_box {
-  text-align: center;
-  background: #EEEEEE;
-  background-image: url('/images/header-bg.png');
-  background-position: top;
-  background-repeat: repeat-x;
-  border: 1px solid #999999;
-  border-bottom: 2px solid #999999;
-  width: 550px;
-  padding: 8px;
-  margin: 16px auto;
-}
-
-div.ro_uri_edit_box input {
-  width: 546px;
-}
-
-.links {
+/* 
+   This stylesheet relies on base stylesheets from the
+   Yahoo UI library (http://developer.yahoo.com/yui/),
+   licensed under the BSD License 
+   
+   Note that for font-size, only use %ages according to: 
+   http://developer.yahoo.com/yui/fonts/#fontsize
+*/
+
+body {
+	background: #8e8e8e;
+	font-family: arial, sans-serif;
+	line-height: 1.0;
+}
+
+p {
+	padding: 0.3em 0;
+	line-height: 1.4;
+	text-align: left;
+	margin-bottom: 0em;
+}
+
+hr {
+	margin: 1em 0;
+}
+
+h1,h2,h3,h4,h5,h6 {
+	line-height: 1.0;
+	color: #333333;
+}
+
+h1 {
+	text-align: center;
+	font-size: 123.1%;
+	color: #000033;
+	margin: 1em 0;
+	line-height: 1.4;
+}
+
+h2 {
+	background-image: url('/images/header-bg.png');
+	background-position: top;
+	background-repeat: repeat-x;
+	background-color: #EEEEEE;
+	padding: 0.5em 0.6em;
+	border: 1px solid #CCCCCC;
+	font-size: 100%;
+}
+
+h3 {
+	background-color: transparent;
+	font-size: 108%;
+	font-weight: bold;
+	border: none;
+	padding: 0 0 0.3em 0;
+	margin: 1em 0 0.8em 0;
+	border-bottom: 1px dotted #999999;
+}
+
+h4 {
+	background-color: transparent;
+	font-size: 108%;
+	font-weight: bold;
+	border: none;
+	padding: 0.3em 0;
+	margin-top: 0;
+	margin-bottom: 0.6em;
+}
+
+table {
+	margin: 0;
+	border-collapse: separate;
+}
+
+th,td {
+	text-align: center;
+	border: none;
+	/*border: 1px solid #CCCCCC;*/
+}
+
+pre {
+	background-color: #EEEEEE;
+	padding: 1em;
+	font-size: 85%;
+}
+
+a {
+	color: #000099;
+	text-decoration: none;
+}
+
+a:hover {
+	color: red;
+	text-decoration: underline;
+}
+
+small {
+	line-height: 1.3;
+}
+
+fieldset {
+	border: 1px solid #CCCCCC;
+	padding: 0 1em 1em 1em;
+	margin: 1em 0;
+}
+
+legend {
+	font-weight: bold;
+	margin: 0 0.5em 0.5em 0.5em;
+}
+
+li {
+	line-height: 1.4;
+}
+
+.clearer {
+	padding: 0;
+	margin: 0;
+	clear: both;
+}
+
+#doc2 {
+	background-color: #FFFFFF;
+  width: 950px;
+  padding-left: 12px;
+  padding-right: 12px;
+  box-shadow: 0 0 16px 4px #666666;
+}
+
+#myexp_header {
+  padding-top: 1em;
+	margin: 0 0.5em 0 0.5em;
+}
+
+.logo {
+	float: left;
+	width: 300px;
+}
+
+.links {
+	color: #999999;
+  font-weight: bold;
+}
+
+#myexp_links
+{
+	float: right;
+	width: 600px;
+	font-size: 93%;
+}
+
+#site_info_links {
+}
+/*  margin: 0.5em 0; */
+
+#user_links {
+  float: right;
+}
+
+#myexp_searchbar {
+
+  background-image: -moz-linear-gradient(top, #317EFF 0%, #456AAA 100%);
+  background-image: -o-linear-gradient(top, #317EFF 0%, #456AAA 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #317EFF), color-stop(1, #456AAA));
+  background-image: -webkit-linear-gradient(top, #317EFF 0%, #456AAA 100%);
+  background-image: linear-gradient(to bottom, #317EFF 0%, #456AAA 100%);
+
+  background-color: #456AAA;
+
+	height: 20px;
+	text-align: center;
+	padding: 10px 0;
+
+  -moz-border-radius: 22px 22px 0px 0px;
+  -webkit-border-top-left-radius: 6px;
+  -webkit-border-top-right-radius: 6px;
+  border-radius: 22px 22px 0px 0px;
+}
+
+#myexp_searchbar * {
+	vertical-align: middle;
+}
+
+#myexp_content {
+	padding-right: 1em;
+	padding-left: 0.5em;
+	margin-top: 1em;
+	margin-bottom: 3em;
+}
+
+#myexp_sidebar {
+	padding: 0 6px 0 6px;
+	background-color: #456AAA;
+  width: 180px;
+}
+
+/* Begin Footer styles */
+
+#ft {
+	margin-top: 2em;
+	border: 0px dotted #999999;
+	border-width: 1px 0 1px 0;
+	color: #333333;
+	background-image: url('/images/footer-bg.png');
+	background-position: top;
+	background-repeat: repeat-x;
+	background-color: #EEEEEE;
+}
+
+#ft .copyright {
+	text-align: center;
+	font-weight: bold;
+	font-size: 93%;
+	padding: 0.5em;
+}
+
+#ft table {
+	width: 100%;
+	border-top: 1px dotted #999999;
+	border-spacing: 0;
+	margin: 0;
+}
+
+#ft td {
+	padding: 0.8em 2em;
+	vertical-align: top;
+}
+
+#ft table p {
+	padding: 0.3em 0;
+	line-height: 1;
+}
+
+#ft .left {
+	width: 251px; 
+	text-align: left;
+	font-size: 93%;
+}
+
+#ft .middle {
+	width: 251px; 
+	text-align: left;
+	font-size: 93%;
+	border-left: 1px dotted #999999;
+}
+
+#ft .right {
+	width: 194px; 
+	text-align: center;
+	font-size: 77%; 
+	border-left: 1px dotted #999999;
+}
+
+#ft .right p {
+	text-align: center;
+}
+
+/* End Footer styles */
+
+#tag_clouds {
+	text-align: center;
+}
+
+#openid_url {
+	background: url(/images/openid.gif) no-repeat;
+	background-color: #FFFFFF;
+	padding-left: 16px;
+}
+
+#hlist {
+	margin: 0;
+	padding-left: 1em;
+  padding-right: 1em;
+}
+
+#hlist ul {
+	margin: 0;
+}
+
+#hlist li {
+	list-style: none;
+	margin: 0.2em;
+	display: -moz-inline-box; /* firefox pre v3 */
+	display: inline-block;
+	vertical-align: top;
+	margin-left: 0.5em;
+}
+
+#hlist li {
+	#display: inline; /* ie7 */
+	_display: inline; /* ie4 ie5 ie6 */
+}
+
+.framed {
+	border: 1px solid #CCCCCC;
+	padding: 2px;
+	background-color: #FFFFFF;
+}
+
+.framed_nospace {
+	border: 1px solid #CCCCCC;
+}
+
+/* begin css tabs nav */
+.tabnav {
+	text-align: center;
+	font-weight: bolder;
+	font-size: 108%;
+	margin: 0;
+}
+
+.tabnav li {
+	list-style: none;
+	margin: 0;
+	display: inline;
+}
+
+.tabnav li a {
+	padding: 2px 12px;
+	margin-left: 3px;
+	text-decoration: none;
+	background-color: #E0E0E0;
+	display: inline-block;
+}
+
+.tabnav li a:link {
+	color: #333333;
+}
+
+.tabnav li a:visited {
+	color: #333333;
+}
+
+.tabnav li a:hover, .tabnav li#selected_tabnav a {
+
+  background-image: -moz-linear-gradient(top, #317EFF 0%, #317EFF 100%);
+  background-image: -o-linear-gradient(top, #317EFF 0%, #317EFF 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #317EFF), color-stop(1, #317EFF));
+  background-image: -webkit-linear-gradient(top, #317EFF 0%, #317EFF 100%);
+  background-image: linear-gradient(to bottom, #317EFF 0%, #317EFF 100%);
+
+	background-color: #456AAA;
+	color: #FFFFFF;
+}
+
+
+/* end css tabs nav */ 
+
+/* begin css breadcrumbs */
+#myexp_breadcrumbs_bar {
+	font-weight: bold !important;
+	font-size: 85%;
+	text-decoration: none;
+	padding: 0.4em 0.5em;
+	background-color: #E0E0E0;
+}
+
+#myexp_breadcrumbs_bar table {
+	width: 100%;
+	padding: 0;
+	margin: 0;
+}
+
+#myexp_breadcrumbs_bar td {
+	text-align: left;
+	margin: 0;
+	padding: 0;
+}
+
+ul.breadcrumb_list {
+	margin: 0;
+	padding: 0;
+}
+
+ul.breadcrumb_list li {
+	display: inline;
+	color: #666666;
+}
+
+ul.breadcrumb_list a {
+	color: #000033;
+}
+
+UL.breadcrumb_list LI + LI:before {
+  content: " > ";
+}
+
+/* end css breadcrumbs */ 
+
+/* begin css tooltips/boxovers */
+
+.boxoverTooltipHeader {
+	display: none;
+	border: 0;
+	height: 0;
+}
+
+.boxoverTooltipBody {
+	border: solid 1px Gray;
+	color: #000000;
+	background-color: #FFFF66;
+	font-size: 93%;
+	font-weight: normal;
+	padding: 0.2em 0.6em;
+	max-width: 500px;
+	text-align: left;
+	line-height: 1.4em;
+}
+
+.boxoverInfoHeader {
+	display: none;
+	border: 0;
+	height: 0;
+}
+
+.boxoverInfoBody {
+	border: solid 1px Gray;
+	color: #333333;
+	padding: 0.4em;
+	background-color: #ebf3ff;
+	font-size: 93%;
+	text-align: left;
+	max-width: 400px;
+	line-height: 1.4em;
+}
+
+/* end css tooltips/boxovers */
+
+/* begin home styles */
+
+#home_container {
+}
+
+#home_container .stats {
+	background-color: #FFFFCC;
+	margin: 0;
+	margin-bottom: 1em;
+	padding: 0.6em 1.2em;
+	border: 1px solid #EED799;
+	font-weight: bold; 
+	font-size: 100%; 
+	color: #333333; 
+	text-align: center; 
+}
+
+#home_container .left {
+	float: left;
+	width: 28%;
+}
+
+#home_container .right {
+	float: right;
+	width: 70%;
+}
+
+#home_container .box {
+	margin-bottom: 1em;
+	overflow: hidden;
+}
+
+#home_container .box p {
+	padding: 0.2em 0;
+}
+
+#home_container .box .title {
+	font-size: 100%;
+	line-height: 1.0;
+	font-weight: bold;
+	color: #222222;
+	padding: 0.1em 1em 0.4em 1em;
+	text-align: center;
+	background-image: url('/images/header-bg2.png');
+	background-position: top;
+	background-repeat: repeat-x;
+	background-color: #CFDFEF;
+	border: #CCCCCC 0px solid;
+	border-width: 0 1px 1px 1px;
+}
+
+#home_container .box .content {
+	padding: 0.3em 0.8em;
+	border-top: none;
+	border-right: #CCCCCC 1px solid;
+	border-bottom: none;
+	border-left: #CCCCCC 1px solid;
+	background-color: #F7F7F7;
+}
+
+#home_container li.seperator {
+	height: 1px;
+	border-bottom: 1px dotted #999999;
+	padding: 0;
+}
+
+#home_container .announcements {
+	margin: 0;
+	list-style: none;
+}
+
+#home_container .announcements li {
+	list-style-type: none;
+	margin: 1em 0;
+}
+
+#home_container .list {
+	margin: 0;
+	list-style: none;
+	font-size: 93%;
+}
+
+#home_container .list li {
+	list-style-type: none;
+	margin: 1.2em 0;
+	line-height: 1.5;
+}
+
+/* begin css rounded corners - based on "Snazzy Corners" */
+
+#home_container .xtop, 
+#home_container .xbottom {
+	display: block;
+	background: transparent;
+	font-size: 1px;
+}
+
+#home_container .xb1, 
+#home_container .xb2, 
+#home_container .xb3, 
+#home_container .xb4,
+#home_container .xb5, 
+#home_container .xb6, 
+#home_container .xb7 {
+	display: block;
+	overflow: hidden;
+}
+
+#home_container .xb1, 
+#home_container .xb2, 
+#home_container .xb3, 
+#home_container .xb6, 
+#home_container .xb7 {
+	height: 1px;
+}
+
+#home_container .xb2, 
+#home_container .xb3, 
+#home_container .xb4 {
+	background: #ACCCED;
+	border-left: 1px solid #CCCCCC;
+	border-right: 1px solid #CCCCCC;
+}
+
+#home_container .xb5, 
+#home_container .xb6, 
+#home_container .xb7 {
+	background: #F7F7F7;
+	border-left: 1px solid #CCCCCC;
+	border-right: 1px solid #CCCCCC;
+}
+
+#home_container .xb1 {
+	margin: 0 5px;
+	background: #CCCCCC;
+}
+
+#home_container .xb2, 
+#home_container .xb7 {
+	margin: 0 3px;
+	border-width: 0 2px;
+}
+
+#home_container .xb3, 
+#home_container .xb6 {
+	margin: 0 2px;
+}
+
+#home_container .xb4, 
+#home_container .xb5 {
+	height: 2px;
+	margin: 0 1px;
+}
+
+/* end css rounded corners - based on "Snazzy Corners" */
+
+/* end home styles */
+
+/* begin css folds */
+
+.fold {
+	margin-bottom: 1.5em;
+}
+
+.foldTitle {
+	background-image: url('/images/header-bg.png');
+	background-position: top;
+	background-repeat: repeat-x;
+	background-color: #EEEEEE;
+	color: #333333;
+	border: 1px solid #999999;
+	border-bottom: 2px solid #aaa;
+	pointer: pointer;
+	cursor: pointer;
+	width: 100%;
+}
+
+.foldTitle p {
+	padding: 0.1em 0;
+	line-height: 1.0;
+	vertical-align: middle;
+}
+
+.foldTitle p * {
+	vertical-align: top;
+}
+
+.foldTitle hr {
+	margin: 0.4em 0;
+	*margin: 0;
+	line-height: 1.0;
+}
+
+.foldTitle small {
+	font-size: 85%;
+	font-weight: normal;
+	line-height: 1.2;
+}
+
+.foldText {
+	font-weight: bold;
+	text-align: left;
+	padding: 0.5em;
+	*padding: 0.3em;
+	vertical-align: middle;
+	
+}
+
+.foldText * {
+	vertical-align: middle;
+}
+
+.foldPlaintext {
+	font-weight: normal;
+	font-size: 85%;
+	line-height: 1.2;
+	padding: 0.1em 0;
+}
+
+.foldImage {
+	text-align: center;
+	padding: 0 0.5em;
+	vertical-align: middle;
+	width: 20px;
+}
+
+.foldContent {
+	border: 1px solid #aaa;
+	border-top: 1px solid transparent;
+	padding: 1em;
+}
+
+/* end css folds */ /* begin css tabs */
+.tabsContainer {
+	padding: 0;
+	margin: 0;
+	border: 0;
+	position: relative;
+	top: 1px;
+}
+
+.tabsContainer IMG {
+	border: 0;
+	margin: 0;
+	padding: 0;
+	vertical-align: middle;
+}
+
+.tabsContainer TABLE {
+	height: 24px;
+	border-spacing: 0;
+}
+
+.tabsContainer TABLE TR TD {
+	padding: 0;
+	vertical-align: middle;
+}
+
+.tabSeparator {
+  width: 1px;
+}
+
+.tabSelected {
+	border-top: 1px solid #909090;
+	border-bottom: 1px solid white;
+	padding: 0;
+	padding-left: 0.5em;
+	padding-right: 0.5em;
+	vertical-align: middle;
+	white-space: nowrap;
+	pointer: pointer;
+	cursor: pointer;
+}
+
+.tabUnselected {
+	border-top: 1px solid #909090;
+	border-bottom: 1px solid #909090;
+	color: #333333;
+	background: #d8d8d8;
+	padding: 0;
+	padding-left: 0.5em;
+	padding-right: 0.5em;
+	vertical-align: middle;
+	white-space: nowrap;
+	pointer: pointer;
+	cursor: pointer;
+}
+
+.tabSelIMG {
+	border-bottom: 1px solid white;
+  width: 6px;
+}
+
+.tabUnselIMG {
+	border-bottom: 1px solid #909090;
+  width: 6px;
+}
+
+.tabTitle {
+	background: #f5f5f5;
+	border: 1px solid #999999;
+	color: #333333;
+	padding: 0.5em;
+}
+
+.tabContent {
+	border: 1px solid #999999;
+	padding: 0.5em;
+	margin-bottom: 1.0em;
+	background: white;
+}
+
+/* end css tabs */ 
+
+/* begin css newsfeed */
+
+.news_feed_div p.news_feed_day_title {
+	font-weight: bold;
+	width: 100%;
+	text-align: left;
+	border-bottom: 1px dotted #999999;
+}
+
+.news_feed_div ul.news_feed_day {
+	padding-left: 0.8em;
+	list-style-type: none;
+	margin-top: 0.4em;
+	margin-left: 0.5em;
+	margin-bottom: 0.5em;
+	line-height: 1.4;
+}
+
+.news_feed_div ul.news_feed_day li.news_feed_item {
+	list-style: none;
+	font-size: 93%;
+}
+
+/* end css newsfeed */
+
+.fieldWithErrors {
+	padding: 2px;
+	background-color: red;
+	display: table;
+}
+
+#errorExplanation {
+	width: 400px;
+	border: 2px solid #c00;
+	padding: 0.5em;
+	margin-bottom: 1.5em;
+	background-color: #F5F5F5;
+  margin: 0 auto 1.5em auto;
+}
+
+#errorExplanation h2 {
+	text-align: left;
+	font-weight: bold;
+	padding: 5px 5px 5px 15px;
+	font-size: 93%;
+	margin: 0;
+	background-image: none;
+	background-color: #c00;
+	border: none;
+	color: #fff;
+}
+
+#errorExplanation p {
+	font-size: 93%;
+	color: #333;
+	margin-bottom: 0;
+	margin-top: 0.5em;
+	padding: 5px;
+}
+
+#errorExplanation ul li {
+	font-size: 93%;
+	list-style: square;
+}
+
+div.uploadStatus {
+	margin: 5px;
+}
+
+div.progressBar {
+	margin: 5px;
+}
+
+div.progressBar div.border {
+	background-color: #fff;
+	border: 1px solid gray;
+	width: 100%;
+}
+
+div.progressBar div.background {
+	background-color: #333;
+	height: 18px;
+	width: 0%;
+}
+
+table.alt_table {
+	border-collapse: collapse;
+  border: 1px solid #ccc;
+  margin-bottom: 0.5em;
+}
+
+table.alt_table td {
+	margin-bottom: 0.5em;
+	padding: 0.5em;
+	vertical-align: top;
+  width: 737px;
+}
+
+table.alt_table tr.odd_row td {
+	background-color: #F5F5F5;
+}
+
+table.alt_table tr.even_row td {
+	background-color: #EEEEEE;
+}
+
+table.alt_table hr {
+	height: 1px;
+	border-bottom: 1px dotted #999999;
+	margin: 0;
+}
+
+table.alt_table .mid {
+	text-align: left;
+  width: 390px;
+}
+
+table.alt_table tr td.actions { /*width: 135px;*/
+	text-align: left;
+}
+
+table.alt_table tr td.actions a {
+	display: block;
+	border-bottom: 0px solid #999999;
+	margin-bottom: 0.3em;
+	font-size: 85%;
+	font-weight: normal;
+}
+
+p.title {
+	margin-top: 0;
+	padding-top: 0;
+	margin-bottom: 0.2em;
+	font-weight: bold;
+  font-size: 120%;
+}
+
+table.alt_table .desc {
+	border: 1px dotted #999999;
+	margin: 0.2em 0;
+	padding: 0.4em 0.6em;
+	background-color: #FFFFCC;
+	text-align: left;
+	line-height: 1.3;
+	overflow: hidden;
+  word-wrap: break-word;
+  width: 360px;
+}
+
+table.alt_table tr td.contributable {
+	margin: 0.5em 0;
+	padding: 1em;
+}
+
+table.alt_table tr.even_row td.contributable table.contributable:hover,table.alt_table tr.odd_row td.contributable table.contributable:hover
+	{
+	border: 1px dotted #999999;
+}
+
+table.contributable {
+	border: 1px dotted #999999;
+	padding: 1em;
+	margin-left: 5px;
+	margin-bottom: 10px;
+}
+
+table.contributable:hover {
+	border: 1px dotted #999999;
+}
+
+/* http://www.mis-algoritmos.com/wp-content/uploads/pagstyle.php?q=manu */
+.pagination {
+	padding: 3px;
+	margin: 3px;
+	text-align: center;
+}
+
+.pagination ul {
+	list-style-type: none;
+}
+
+.pagination ul li {
+	display: inline;
+}
+
+.pagination a {
+	padding: 2px 5px 2px 5px;
+	margin: 2px;
+	border: 1px solid #317eff;
+	text-decoration: none; /* no underline */
+	color: #179032;
+}
+
+.pagination a:hover,.pagination a:active {
+	border: 1px solid #CE0434;
+	color: #179032;
+}
+
+.pagination .currentpage {
+	padding: 2px 5px 2px 5px;
+	margin: 2px;
+	border: 1px solid #179032;
+	font-weight: bold;
+	background-color: #179032;
+	color: #FFF;
+}
+
+.pagination .disabledpage {
+	padding: 2px 5px 2px 5px;
+	margin: 2px;
+	border: 1px solid #EEE;
+	color: #DDD;
+}
+
+.network_banner { /*width: 640px;*/
+	padding-left: 10px;
+	padding-right: 10px;
+	border: 1px solid transparent;
+}
+
+.network_banner:hover { /*border: 1px solid black;*/
+	
+}
+
+.sectionIcons {
+	margin: 0.5em 0 1em 0;
+	font-size: 85%;
+	font-weight: bold;
+	text-align: center;
+}
+
+.sectionIcons * {
+	vertical-align: middle;
+}
+
+.sectionIcons li {
+	display: inline-block;
+	vertical-align: middle;
+	margin: 0;
+	margin-left: 8px;
+	/*border: 2px solid #F5F5F5;*/ 
+}
+
+.sectionIcons li:hover {
+}
+
+.sectionIcons li * {
+	vertical-align: middle;
+}
+
+.sectionIcons li a {
+	width: 100%;
+	padding: 0.5em 0.5em;
+	*padding: 0.2em 0.5em;
+	line-height: 2.5;
+	text-decoration: none;
+	border: 1px solid #BBBBBB;
+	background-color: #EEF6FF;
+}
+
+.sectionIcons li a:hover {
+	background-color: #0099FF;
+	color: #F5F5F5;
+}
+
+.sectionIcons li a * {
+	vertical-align: middle;
+}
+
+a.button_slim {
+	padding: 0.2em 0.4em 0.5em 0.4em;
+	*padding: 0.2em 0.4em;
+	line-height: 1;
+	text-decoration: none;
+	border: 1px solid #BBBBBB;
+	background-color: #EEF6FF;
+	vertical-align: middle;
+}
+
+a.button_slim:hover {
+	background-color: #0099FF;
+	color: #F5F5F5;
+}
+
+a.button_slim * {
+	vertical-align: middle;
+}
+
+.icon {
+	vertical-align: middle;
+}
+
+.icon * {
+	vertical-align: middle;
+}
+
+.icon a {
+	padding-right: 2px;
+	vertical-align: middle;
+}
+
+.icon img {
+	padding: 2px;
+	vertical-align: middle;
+}
+
+.contribution_title {
+	margin-bottom: 0.6em;
+}
+
+.contribution_aftertitle {
+	color: #666666; 
+	font-size: 85%; 
+	text-align: center; 
+	margin-bottom: 0.6em;
+}
+
+.contribution_mini_nav {
+	color: #999999;
+	font-size: 85%; 
+	text-align: center; 
+	margin-bottom: 1em;
+	line-height: 1.5;
+}
+
+.contribution_left_box {
+	float: left;
+	width: 73.5%;
+}
+
+.contribution_description {
+	text-align: left;
+	background-color: #FFFFFF;
+	border: 1px solid #CCCCCC;
+	padding: 0.3em 1em;
+}
+
+.contribution_preview img {
+	background-color: #FFFFFF;
+	border: 1px solid #DDDDDD;
+	padding: 0.5em;
+}
+
+.contribution_right_box {
+	float: right;
+	width: 25%;
+}
+
+.contribution_section_box {
+	background-image: url('/images/box-bg1.png');
+	background-position: top;
+	background-repeat: repeat-x;
+	background-color: #FFFFCC;
+	padding: 0.3em 0.3em;
+	border: 1px dotted #999999;
+	text-align: center;
+	margin-bottom: 0.6em;
+}
+
+.contribution_section_box ul.items {
+	margin: 0 0 0.8em 1em;
+	text-align: left;
+}
+
+.contribution_section_box ul.items li {
+	list-style-type: none;
+	margin: 0.6em 0;
+	padding-left: 0.8em;
+	line-height: 1.1;
+	border-left: 3px solid #DDDDBB;
+}
+
+.contribution_section_box ul.items li * {
+	vertical-align: middle;
+}
+
+.contribution_section_box p {
+	text-align: center;
+	padding: 0.2em;
+}
+
+.contribution_section_box .stats_box p {
+	font-size: 93%;
+	text-align: center;
+	line-height: 1.3;
+	padding: 0;
+}
+
+.contribution_section_box hr {
+	margin: 0.5em 0;
+	*margin: 0;
+	height: 1px;
+	border-bottom: 1px dotted #999999;
+}
+
+.contribution_section_box .heading {
+	font-size: 100%;
+	font-weight: bold;
+	line-height: 1.0;
+	margin-top: 0.2em;
+}
+
+.contribution_section_box .hTagcloud {
+	margin-top: 0.3em;
+	margin-bottom: 0.5em;
+}
+
+.contribution_section_box .fold {
+	margin-bottom: 0;
+	margin-top: 0.6em;
+	font-size: 85%;
+}
+
+.contribution_section_box .foldTitle {
+	background-image: none;
+	background-color: #EEF6FF;
+	color: #333333;
+	border: 1px solid #BBBBBB;
+	border-bottom: 2px solid #CCCCCC;
+}
+
+.contribution_section_box .foldText {
+	padding: 0.4em; *
+	padding: 0.2em;
+}
+
+.contribution_section_box .foldContent {
+	padding: 0.2em;
+	background-color: #F5F5F5;
+	border: 1px solid #BBBBBB;
+	border-top: 1px solid transparent;
+}
+
+.contribution_section_box .foldContent ul {
+	list-style: none;
+	padding: 0;
+	padding-left: 1em;
+	margin: 0;
+}
+
+.contribution_section_box .foldContent ul li {
+	list-style: none;
+	padding: 0;
+	margin: 0;
+}
+
+.contribution_version_box {
+	border: 1px dotted #999999;
+	margin-bottom: 1em;
+	background-color: #F7F7F7;
+}
+
+.contribution_version_box .title {
+	font-size: 108%; 
+	font-weight: bold; 
+	color: #660000;
+}
+
+.contribution_version_selector_box {
+	padding: 0.6em 0.5em 0.4em 0.5em;
+	border: 0px dotted #999999;
+	border-width: 0 0 1px 0;
+	background-image: url('/images/box-bg1.png');
+	background-position: top;
+	background-repeat: repeat-x;
+	background-color: #FFFFCC;
+	color: #333333;
+}
+
+.contribution_version_selector_box * {
+	vertical-align: middle;
+}
+
+.contribution_version_selector_box table {
+	width: 100%;
+	margin: 0;
+	padding: 0;
+	border-collapse: collapse;
+}
+
+.contribution_version_selector_box table td {
+	padding: 0em 0.5em;
+}
+
+.contribution_version_selector_box .heading {
+	text-align: left; 
+	font-size: 108%; 
+	font-weight: bold; 
+	color: #333333;
+}
+
+.contribution_version_inner_box {
+	padding: 0.6em 0.7em;
+}
+
+.contribution_version_inner_box h4 {
+	text-align: center;
+}
+
+.contribution_version_inner_box .option_box {
+	padding: 0.2em 0.6em; 
+	border: 1px solid #CCCCCC;
+}
+
+.contribution_currentlicense {
+	padding: 0 0 0.5em 0;
+}
+
+.contribution_currentlicense p {
+	text-align: center;
+	font-size: 85%;
+	font-weight: bold;
+	color: #666666;
+	line-height: 1.3;
+}
+
+/* Begin Comments styles */
+
+.commentsBox {
+	padding-left: 2em;
+}
+
+ul.comments {
+	list-style: none;
+	margin: 0;
+	padding: 0;
+}
+
+ul.comments li {
+	margin-top: 1.5em;
+	list-style: none;
+}
+
+table.comment {
+	width: 100%;
+	border: 1px dotted #999999;
+	border-collapse: collapse;
+	border-spacing: 0;
+}
+
+table.comment p {
+	padding: 0;
+}
+
+table.comment td {
+	padding: 0.2em;
+	vertical-align: top;
+}
+
+table.comment td.avatar {
+	width: 70px;
+	padding: 0.2em 0.6em;
+	text-align: center;
+	background-color: #EEEEEE;
+}
+
+table.comment td.header {
+	font-size: 85%;
+	height: 1.2em;
+	vertical-align: middle;
+	text-align: left;
+	background-color: #EEEEEE;
+	color: #333333;
+	padding: 0.2em 0.8em;
+}
+
+table.comment td.content {
+	padding: 0.8em 1em;
+	text-align: left;
+}
+
+table.comment td.content p {
+	margin-bottom: 1em;
+}
+
+.addCommentBox {
+	margin-top: 3em;
+	padding: 1em;
+	width: 500px;
+	background-color: #EEEEEE;
+	border: 1px dotted #999999;
+}
+
+/* End Comments styles */
+
+/* Begin Reviews styles */
+
+.reviewsBox {
+	padding-left: 2em;
+}
+
+/* End Reviews styles */
+
+a.tagsSelectorOff,
+a.tagsSelectorOn {
+	margin: 0 0.2em;
+	padding: 0.1em 0.4em;
+	border: 1px solid #BBBBBB;
+	font-weight: bold;
+	font-size: 85%;
+}
+
+a.tagsSelectorOff {
+	background-color: #EEF6FF;
+	color: #000099;
+}
+
+a.tagsSelectorOff:hover,
+a.tagsSelectorOn:hover {
+	color: #F5F5F5;
+	background-color: #0099FF;
+	text-decoration: none;
+}
+
+a.tagsSelectorOn {
+	color: #F5F5F5;
+	background-color: #0099FF;
+}
+
+.message_box {
+	padding: 1.5em 2em;
+	border: 1px dotted #999999;
+	background-color: #F5F5F5;
+	margin: 0 0.5em;
+}
+
+.message_box .subject {
+	font-size: 108%; 
+	background-color: #FFFFCC; 
+	border: 1px dotted #999999; 
+	padding: 0.2em 0.5em; 
+	margin-bottom: 1em;
+}
+
+.message_box .message {
+	padding: 0.6em 1em;
+	border: 1px dotted #999999;
+	background-color: #FFFFFF;
+}
+
+.badge {
+	padding: 0;
+	margin: 0;
+	margin-left: 0.2em;
+	vertical-align: middle;
+}
+
+/* begin autocomplete styles */
+/* From the book: "Agile Web Development with Rails, 2nd ed" p.548 */
+
+div.auto_complete {
+	background: #fff;
+	width: 99%;
+	z-index: 10;
+}
+
+div.auto_complete ul {
+	border: 1px solid #888;
+	margin: 0;
+	padding: 0;
+	width: 100%;
+	list-style-type: none;
+	font-weight: bold;
+	font-size: 94%;
+}
+
+div.auto_complete ul li {
+	margin: 0;
+	padding: 3px;
+	text-align: left;
+	list-style-type: none;
+}
+
+div.auto_complete ul li.selected {
+	background-color: #ffb;
+}
+
+div.auto_complete ul strong.highlight {
+	color: #800;
+	margin: 0;
+	padding: 0;
+}
+
+/* end autocomplete styles */
+
+.box_simple {
+	padding: 0.5em 0.8em;
+	border: 1px dotted #999999;
+}
+
+.box_form {
+	background-color: #EEEEEE;
+	border: 1px dotted #999999;
+	padding: 0.8em 1.4em;
+}
+
+.box_form p {
+	margin-top: 0.4em;
+}
+
+.box_standout {
+	padding: 0.5em 0.8em; 
+	border: 1px dotted #999999;
+	background-color: #FFFFCC;
+}
+
+.box_important {
+	padding: 0.5em 0.8em; 
+	border: 2px solid #993333;
+	background-color: #FFCCCC;
+}
+
+.box_currentuser_specific {
+	padding: 0.5em 0.8em;
+	border: 1px solid #99CCFF;
+	background-color: #EEF6FF;
+}
+
+.box_currentuser_specific * {
+	vertical-align: middle;
+}
+
+.box_dynamic_help {
+	padding: 0.4em 0.8em; 
+	border: 1px dotted #999999;
+	background-color: #FFFFCC;
+	font-size: 85%;
+	margin-bottom: 0.4em;
+}
+
+.box_inplace {
+	padding: 0.8em; 
+	border-top: 1px dotted #999999; 
+	border-bottom: 1px dotted #999999;
+}
+
+.box_editing {
+	padding: 0.5em; 
+	background-color: #FFFFFF;
+	border-left: 5px solid #0066CC;
+	padding-left: 0.8em;
+	margin-left: 0.8em;
+}
+
+.box_editing_inner {
+	padding: 0.5em;
+	background-color: #DDEEFF;
+}
+
+.box_editing_inner2 {
+	background-color: #EEEEEE;
+	padding: 0.5em 0.8em;
+	border: 1px dotted #999999;
+}
+
+.box_infotext {
+	font-size: 93%;
+	background-color: #FFFFCC;
+	margin: 0; 
+	padding: 0.5em 0.8em;
+	border: 1px solid #EED799;
+	line-height: 1.4;
+}
+
+.derived_annotation_notice,
+.none_text {
+	font-style: italic;
+	color: #666666;
+}
+
+.denied_text {
+	font-style: italic;
+	color: #990000;
+}
+
+.count_text {
+	color: #666666;
+}
+
+.error_text {
+	color: red;
+	font-weight: bold;
+}
+
+.step_text {
+	color: #660000;
+	font-weight: bold;
+	margin: 0.5em 0 0.6em 0;
+	text-align: center;
+}
+
+.note_text {
+	font-size: 93%;
+	font-weight: bold;
+	color: #900000;
+}
+
+.sub-heading {
+	text-align: center; 
+	font-size: 108%; 
+	margin-bottom: 0.5em;
+}
+
+.rest_table TABLE {
+  border: 1px solid black;
+  margin: 1px;
+}
+
+.rest_table TABLE THEAD {
+  background: #e0e0ff
+}
+
+.rest_table TABLE THEAD TR TD {
   text-align: left;
-}
-
-.annotation {
+  vertical-align: top;
+}
+
+.rest_table TABLE TBODY {
+  background: white
+}
+
+.rest_table TABLE TBODY TR TD {
+  text-align: left;
+  vertical-align: top;
+}
+
+.try_it_out_box TEXTAREA {
+  font-family: monospace;
+  font-size: 10pt;
+}
+
+.inputs_list {
+	list-style: none;
+	margin: 0;
+	margin-bottom: 0.5em;
+}
+
+.inputs_list li {
+	list-style: none;
+}
+
+table.job_report {
+	border-collapse: collapse;
+	font-size: 93%;
+	margin-top: 0.3em;
+}
+
+table.job_report th,
+table.job_report td {
+	border: 1px solid #CCCCCC;
+	padding: 0.3em 0.6em;
+}
+
+table.job_report th {
+	background-color: #EEEEEE;
+	font-weight: bold;
+}
+
+/* Begin new tabs styles */
+
+.tabnav2 {
+	border-bottom: 1px solid #999999;
+	font-size: 100%;
+	padding-left: 0px;
+	z-index: 1;
+}
+
+.tabnav2 ul {
+	margin: 0;
+	padding: 2px 0;
+	*padding: 3px 0;
+}
+
+.tabnav2 li {
+	display: inline;
+	list-style-type: none;
+	overflow: hidden;
+  color: black;
+  position: relative;
+  top: -1px;
+}
+
+.tabnav2 li a {
+	padding: 3px 6px 4px 6px;
+	border: 1px solid #999999;
+	text-decoration: none;
+	background-color: #D8D8D8;
+	color: #404040;
+
+  -moz-border-radius: 6px 6px 0px 0px;
+  -webkit-border-top-left-radius: 6px;
+  -webkit-border-top-right-radius: 6px;
+}
+
+.tabnav2 li a:hover {
+	background-color: #E8E8E8;
+}
+
+.tabnav2 li.active a {
+  color: black;
+	border-bottom: 1px solid #FFFFFF;
+	background-color: #FFFFFF;
+}
+
+.tabnav2_content {
+	border: 0px solid #999999;
+	border-width: 0 1px 1px 1px;
+	padding: 0.5em;
+	z-index: 2;
+    background: white;
+}
+
+/* End new tabs styles */
+
+/* Begin outputs table styles */
+
+table.outputs_viewer {
+	border: 1px solid #CCCCCC;
+	border-collapse: collapse;
+}
+
+table.outputs_viewer th,
+table.outputs_viewer td {
+	border: 1px solid #CCCCCC;
+	background-color: #FFFFFF;
+}
+
+table.outputs_viewer th {
+	background-color: #EEEEEE;
+	font-weight: bold;
+	padding: 0.7em 0.6em;
+	font-size: 100%;
+}
+
+table.outputs_viewer .nav {
+	width: 140px;
+	overflow: auto;
+	font-size: 93%;
+	vertical-align: top;
+	background-color: #F5F5F5;
+	padding: 0;
+}
+
+table.outputs_viewer .content {
+	vertical-align: top;
+	padding: 0;
+}
+
+table.outputs_viewer .content #output_content_box {
+	padding: 1em;
+	overflow: auto;
+	text-align: left;
+	width: 500px;
+	max-width: 500px;
+	height: inherit;
+	max-height: 1000px;
+}
+
+table.outputs_viewer .nav a {
+	display: block;
+	width: 140px;
+	padding: 0.6em;
+	border-bottom: 1px solid #DDDDDD;
+	background-color: #FFFFFF;
+	line-height: 1.2;
+	overflow: hidden;
+}
+
+table.outputs_viewer .nav a:hover,
+table.outputs_viewer .nav a.selected {
+	background-color: #EEF6FF;
+}
+
+/* End outputs table styles */
+
+/* Begin outputs content list styles */
+
+ol.outputs_list {
+	width: auto;
+	text-align: left;
+	margin-left: 2em;
+}
+
+ol.outputs_list, 
+ol.outputs_list ol {
+	padding-left: 0;
+	list-style-position: outside;
+	list-style-type: decimal;
+}
+
+ol.outputs_list ol {
+	margin: 0 0 0.5em 1em;
+}
+
+ol.outputs_list li {
+	display: list-item;
+	width: auto;
+	padding: 0.4em 0.1em;
+	list-style-position: outside;
+	list-style-type: decimal;
+}
+
+ol.outputs_list ol li {
+	list-style-position: outside;
+}
+
+/* End outputs content list styles */
+
+
+.default_timeline { 
+	width: 100%; 
+	height: 600px; 
+}
+
+table.simple {
+	border-collapse: collapse;
+	font-size: 93%;
+	margin-top: 0.3em;
+}
+
+table.simple th,
+table.simple td {
+	border: 1px solid #CCCCCC;
+}
+
+table.simple th {
+	background-color: #EEEEEE;
+	font-weight: bold;
+	padding: 0.5em 0.8em;
+}
+
+table.simple td {
+	background-color: #FFFFFF;
+	text-align: left;
+	vertical-align: top;
+	line-height: 1.3;
+	padding: 0.3em 0.6em;
+}
+
+#packItems ul {
+	margin: 0;
+	list-style: none;
+	border-top: 1px solid #CCCCCC;
+}
+
+#packItems ul li {
+	list-style-type: none;
+	margin: 0;
+	line-height: 1.4;
+	padding: 0.2em 0.5em;
+	border-bottom: 1px solid #CCCCCC;
+	background-color: #FFFFFF;
+	font-size: 93%;
+}
+
+#packItems table {
+	margin: 0;
+	width: 100%;
+	border-collapse: collapse;
+}
+
+#packItems p {
+	padding: 0.1em 0;
+}
+
+#packItems td {
+	vertical-align: top;
+	text-align: left;
+	padding: 0.4em 0.6em;
+}
+
+#packItems td.icon {
+	width: 16px;
+	text-align: center;
+}
+
+#packItems td.remote {
+	width: 470px;
+	max-width: 470px;
+}
+
+#packItems td.remote p.longurl {
+	word-wrap: break-word;
+}
+
+#packItems .inner {
+	color: #333333;
+	margin: 0.3em 0 0 0.3em;
+	padding: 0.2em 0 0.3em 0.7em;
+	border-left: 3px solid #EEEEEE; 
+}
+
+#packItems .comment {
+	font-style: italic;
+	background-color: #F7F7F7;
+	padding: 0.4em 0.6em;
+}
+
+#packItems .user {
+}
+
+.deletedPackItem {
+  color: gray;
+}
+
+table.quick_add {
+	border-collapse: collapse; 
+	width: 99%;
+	color: #333333;
+}
+
+table.quick_add td {
+	vertical-align: middle;
+}
+
+table.quick_add td * {
+	vertical-align: middle;
+}
+
+table.quick_add td.label {
+	text-align: left;
+	line-height: 1.0;
+	width: 11em;
+}
+
+table.quick_add td.label .inner {
+	font-size: 77%;
+	text-align: center;
+	color: #990000;
+	font-weight: bold;
+}
+	
+
+table.quick_add td.submit {
+	text-align: left; 
+	width: 4em;
+}
+
+.group_announcements {
+	margin-top: 0.8em;
+	padding: 0 0.5em;
+}
+
+.group_announcements ul {
+	margin: 0;
+}
+
+.group_announcements li {
+	list-style-type: none;
+	margin: 0 0 0.9em 0;
+}
+
+.group_announcements .announcement_box {
+	border: 1px dotted #999999;
+	margin: 0.1em 0;
+	padding: 0.2em 0.5em; 
+	background-color: #F9F9F9;
+	font-size: 85%;
+	font-weight: bold;
+	text-align: left;
+}
+
+.required {
+	color: red;
+	font-weight: bold;
+}
+
+.workflow_type_box {
+	border: 1px solid #DDDDDD; 
+	background-color: #FFFFCC; 
+	margin: 0 0 0.5em 0;
+	padding: 0.4em 0.5em; 
+	font-size: 77%; 
+	color: #990000; 
+	font-weight: bold; 
+	text-align: center;
+}
+
+#version_info_box p {
+	line-height: 1.2;
+	padding: 0.3em 0;
+	margin: 0;
+}
+
+#version_info_box p * {
+	vertical-align: middle;
+}
+
+.tag_suggestion_box {
+	padding: 0.5em 0.8em;
+	border: 1px dotted #999999;
+  font-size: 93%;
+  text-align: left;
+  margin: 2em;
+  line-height: 20px;
+}
+
+.unselected_tag_suggestion {
+  border: 1px solid white;
+  padding-left: 4px;
+  padding-right: 4px;
+}
+
+.unselected_tag_suggestion:hover {
+  border: 1px solid #d0d0f0;
+  background-color: white;
+  padding-left: 4px;
+  padding-right: 4px;
+  color: #000099;
+  text-decoration: none;
+}
+
+.selected_tag_suggestion {
+  border: 1px solid #a0a0c0;
+  background-color: #d0d0f0;
+  padding-left: 4px;
+  padding-right: 4px;
+}
+
+.selected_tag_suggestion:hover {
+  border: 1px solid #a0a0c0;
+  background-color: #d0d0f0;
+  padding-left: 4px;
+  padding-right: 4px;
+  color: #000099;
+  text-decoration: none;
+}
+
+.quote_level_0 {
+}
+
+.quote_level_1 {
+  color: gray;
+}
+
+.quoted_section {
+  border-left: 2px solid gray;
+  padding-left: 8px;
+}
+
+.nowrap {
+  white-space: nowrap;
+}
+
+.classification {
+  border: 1px solid gray;
+  padding: 3px;
+  padding-left: 6px;
+  padding-right: 6px;
+  background: #ffffd0;
+}
+
+.quality {
+  width: 157px;
+  background: #EEA;
+  border: 1px solid #CCCCAA;
+  margin: 4px;
+  padding: 4px;
+  text-align: center;
+}
+
+.dependencies UL LI {
+	list-style: none;
+}
+
+.curation_events UL LI {
+  list-style: none;
+  padding-top: 1em;
+}
+
+/* Styles Related to topics */
+
+table.topic {
+  border-collapse:collapse;
+  border: 1px solid black;
+  width: 40%;
+}
+
+table.topic th{
+  border: 1px solid black;
+  text-align:center;
+  width: 100%;
+  background-color: #FFFFCC; 
+}
+
+.topic_feedback{
+  float: right;
+  text-align:center;
+  margin-top:7px;
+}
+
+table.topic td.tag{
+  text-align:left;
+  width: 60%;
+}
+
+table.topic div.topic_feedback a:link{
+  text-decoration:underline;
+}
+
+table.topic td.tag_vote{
+  text-align:center;
+  width: 40%;
+}
+
+#topic_container .hTagcloud {
+/*  width: 225px; */
+}
+
+#topic_container LI {
+}
+
+
+/* End syles related to topics */
+
+/* pivot */
+
+.pivot {
+  width: 737px;
+  margin: 0;
+}
+
+.pivot .left {
+  width: 150px;
+  float: left;
+  padding-right: 10px;
+}
+
+.pivot .left > DIV {
+  margin-bottom: 0.5em;
+}
+
+.pivot .main {
+  margin-left: 160px;
+}
+
+.pivot .main > DIV {
+  margin-bottom: 0.5em;
+}
+
+.pivot .summary {
+  clear: right;
+  background: #f0f0f0;
+  border: 1px solid #d8d8d8;
+  padding: 6px;
+}
+
+.pivot .summary DIV+DIV {
+  padding-top: 0.4em;
+}
+
+.pivot .sort {
+  float: right;
+}
+
+.pivot .filter {
+  margin-bottom: 1em;
+  padding: 2px;
+}
+
+.pivot .category {
+  padding: 0.2em;
+  font-size: 110%;
+  margin-bottom: 0.2em;
+}
+
+.pivot .toggle_filter_query {
+  float: right;
+  vertical-align: middle;
+  position: relative;
+  top: 2px;
+}
+
+.pivot .options > DIV {
+  border: 1px solid transparent;
+  padding: 0.2em;
+  font-size: 90%;
+  padding-left: 0.2em;
+}
+
+.pivot .options > DIV:hover {
+  background: #d0d0f0;
+}
+
+.pivot .options > DIV.selected {
+  background: #ffe0c0;
+}
+
+.pivot .checkbox {
+  display: inline;
+  padding-top: 0;
+  padding-bottom: 0;
+}
+
+.pivot .label {
+  width: 90px;
+  overflow: hidden;
+  display: inline-block;
+}
+
+.pivot .count {
+  float: right;
+}
+
+.pivot .crumbs {
+  margin-top: 0.5em;
+}
+
+.pivot .filter-in-use {
+  background: #d8d8d8;
+  padding: 2px;
+	line-height: 200%;
+}
+
+.pivot .filter-in-use A {
+  padding-left: 0px;
+  padding-right: 4px;
+  text-decoration: none; /* no underline */
+}
+
+.pivot .filter-in-use A IMG {
+  vertical-align: middle;
+  position: relative;
+  top: -2px;
+}
+
+.pivot .filter-in-use:hover {
+/*  background: #f0d0d0; */
+}
+
+.pivot .pagination {
+	padding: 0px;
+	margin: 0px;
+	text-align: left;
+}
+
+.pivot .filter_search_box {
+  border: 1px solid gray;
+}
+
+.pivot .filter_search_box INPUT.query {
+  width: 123px;
+  padding: 2px;
+  border: none;
+  outline: none;
+}
+
+.pivot .filter_search_box INPUT.submit {
+  vertical-align: middle;
+  position: relative;
+  top: -1px;
+}
+
+.pivot .filter_search_box IMG {
+  vertical-align: middle;
+  position: relative;
+  top: -1px;
+}
+
+.pivot .search_query_problem {
+  color: red;
+	font-style: italic;
+}
+
+.truncate {
+  white-space: nowrap;
+}
+
+.no-filter-query-results {
+  padding-top: 1em;
+	font-style: italic;
+}
+
+.pivot .no-results {
+  padding-top: 2em;
+  padding-bottom: 2em;
+	font-style: italic;
+}
+
+.pivot .search_box .query {
+  padding: 2px;
+  width: 450px;
+}
+
+.edit_relationships {
+  margin: 20px;
+}
+
+.edit_relationships > * {
+  display: block;
+  margin-bottom: 10px;
+}
+
+.relationship_sentences * {
+  vertical-align: middle;
+}
+
+#error_flash {
+  color: red;
+  font-weight: bold;
+  margin-bottom: 1.5em;
+  line-height: 1.4;
+}
+
+#notice_flash {
+  color: green;
+  font-weight: bold;
+  margin-bottom: 1.5em;
+  line-height: 1.4;
+}
+
+.user-check-buttons {
+	border: 1px solid #CCCCCC;
+  padding: 4px;
+  margin-left: 8px;
+  float: right;
+}
+
+#user-check-list TD {
+  background: #f0f0f0;
+}
+
+#user-check-list TD.ident {
+	font-weight: bold;
+}
+
+#user-check-submit,
+#user-check-range {
+  margin: 24px;
+  text-align: center;
+}
+
+#selected-user-check-element .table-div TABLE {
+  border: 2px solid black;
+}
+
+#user-check-list > DIV {
+  padding: 4px;
+}
+
+#user-check-list .whitelist TD {
+	border: 1px solid #80c080;
+  background: #c0ffc0;
+}
+
+#user-check-list .sleep TD {
+	border: 1px solid #c0e0c0;
+  background: #e0ffe0;
+}
+
+#user-check-list .suspect TD {
+	border: 1px solid #e0c0c0;
+  background: #ffe0e0;
+}
+
+#user-check-list .delete TD {
+	border: 1px solid #c08080;
+  background: #ffc0c0;
+}
+
+div.credit_selection_box, div.credit_selection_box {
+  margin-top: 0.5em;
+  padding: 0.5em;
+  background-color: #eee;
+  overflow: auto;
+}
+
+div.credit_selection_box button {
+  float: right;
+  margin-left: 0.5em;
+}
+
+div.credit_selection_box input,
+div.credit_selection_box select {
+  width: 20em;
+  min-height: 19px;
+}
+
+.auto_complete_spinner {
+  margin-left: -24px;
+}
+
+input.auto_complete_field {
+  min-height: 20px;
+}
+
+input.auto_complete_field.accepted {
+  background-color: transparent;
+  border: none;
+  color: #4dbf00;
+}
+
+input.auto_complete_field.error {
+  background-color: #FFCCCC;
+}
+
+.version_history .title {
+  font-size: 16px;
+}
+
+.version_history .metadata {
+  margin-left: 12px;
+  margin-top: 6px;
+  margin-bottom: 6px;
+}
+
+.version_history .comment {
+	padding: 6px;
+	border: 1px dotted #999999;
+	background-color: #FFFFCC;
+	color: #333333;
+	line-height: 1.2;
+	font-size: 85%;
+}
+
+.new-session-sign-in {
+  width: 190px;
+  border: 1px solid #CCCCCC;
+  border-radius: 6px 6px 6px 6px;
+  -moz-border-radius: 6px 6px 6px 6px;
+  -webkit-border-bottom-left-radius: 6px;
+  -webkit-border-bottom-right-radius: 6px;
+}
+
+div.deprecation_event {
+  border: 1px solid #e24a3e;
+  background-color: #ffcccc;
+  padding: 0.5em;
+  border-radius: 3px;
+  margin-bottom: 1em;
+}
+
+input[type="radio"], input[type="checkbox"] {
+  vertical-align: top;
+}
+
+.resource_list_item {
+  border: 1px solid #ccc;
+  background-color: #F5F5F5;
+  padding: 0.5em;
+  margin-bottom: 0.5em;
+}
+
+.resource_list_item p {
+  font-size: 85%;
+}
+
+.resource_list_item p.title {
+  font-size: 100%;
+}
+
+.resource_list_item .avatar_panel {
+  width: 6em;
+  float: left;
+  text-align: center;
+}
+.resource_list_item .main_panel {
+  margin-left: 6.5em;
+}
+
+.resource_list_item .main_panel .preview {
+  float: left;
+  margin: 0 0.5em 0.2em 0;
+}
+
+.resource_list_item .main_panel .desc {
+  border: 1px dotted #999999;
+  margin: 0.5em 0;
+  padding: 0.4em 0.6em;
+  background-color: #FFFFCC;
+  text-align: left;
+  line-height: 1.3;
+  overflow: hidden;
+  word-wrap: break-word;
+}
+
+.resource_list_item .actions {
+  float: right;
+  text-align: left;
+  border: 1px solid #ccc;
+  background-color: #fff;
+  padding: 0.5em 0.25em 0.25em 0.25em;
+  margin: 0 0 0.5em 0.5em;
+  min-width: 6em;
+}
+.resource_list_item .actions a {
+  display: block;
+  border-bottom: 0px solid #999999;
+  margin-bottom: 0.3em;
+  font-size: 85%;
+  font-weight: normal;
+}
+
+span.owner {
+  font-weight: bold;
+}
+
+div.avatar {
+  text-align:center;
+  padding: 0.2em 0;
+  margin: 0 auto;
+}
+
+.resource_list_item  p.standout {
+	font-weight: bold;
+	color: #333333;
+  font-size: 100%;
+}
+
+#statement_list TABLE {
+  border-collapse: collapse;
+  margin-bottom: 16px;
+  width: 100%;
+}
+
+#statement_list DIV {
+  box-shadow: 5px 5px 8px #AAA;
+}
+
+#statement_list TD {
+  border: 1px solid gray;
+  background: white;
+  text-align: left;
+}
+
+.recommender-link {
+  margin: 10px;
+  text-align: center;
+}
+
+.research_object_browser LI {
+  list-style-image: url('/images/famfamfam_silk/page.png');
+}
+
+DIV.tag_list {
+  margin-top: 16px;
+  margin-bottom: 16px;
+}
+
+DIV.tag_list UL {
+  margin: 0;
+}
+
+DIV.tag_list LI {
+	display: inline-block;
+	list-style: none;
+  border-bottom: 1px SOLID #a0a0c0;
+  background-color: #d0d0f0;
+  padding-left: 4px;
+  padding-right: 4px;
+}
+
+div.ro_uri_edit_box {
+  text-align: center;
+  background: #EEEEEE;
+  background-image: url('/images/header-bg.png');
+  background-position: top;
+  background-repeat: repeat-x;
+  border: 1px solid #999999;
+  border-bottom: 2px solid #999999;
+  width: 550px;
+  padding: 8px;
+  margin: 16px auto;
+}
+
+div.ro_uri_edit_box input {
+  width: 546px;
+}
+
+.links {
+  text-align: left;
+}
+
+.annotation {
   font-size: 97%;
-}
-
-.annotation .body {
-}
-
-.annotation .provenance {
-  text-align: right;
+}
+
+.annotation .body {
+}
+
+.annotation .provenance {
+  text-align: right;
   font-style: italic;
   color: #abc;
-}
-
-.annotation .provenance .authoredBy {
-
-}
-
-.uploaders .createdOn, .contributors .contributedOn, .authors .authoredOn {
-  font-size: 97%;
+}
+
+.annotation .provenance .authoredBy {
+
+}
+
+.uploaders .createdOn, .contributors .contributedOn, .authors .authoredOn {
+  font-size: 97%;
   color: #999;
-}
-
-.todo:before {
-  content: "TODO: ";
+}
+
+.todo:before {
+  content: "TODO: ";
   font-weight: bold;
-}
-.todo {
+}
+.todo {
   background-color: #fba;
-}
-.evolution .title {
-  font-size: 100%;
-}
-
-
-.status {
-  font-size: 300%;
+}
+.evolution .title {
+  font-size: 100%;
+}
+
+
+.status {
+  font-size: 300%;
   font-weight: bold;
-}
-.live {
-  font-family: "Nunito", Consolas, Inconsolata, cursive;
-  text-transform: lowercase;
-}
-
-.error { 
+}
+.live {
+  font-family: "Nunito", Consolas, Inconsolata, cursive;
+  text-transform: lowercase;
+}
+
+.error { 
   color: #c44; 
-}
-.contribution_section_box .stats {
+}
+.contribution_section_box .stats {
   text-align: left;
-}
-table.values td,  table.values th {
-  text-align: left;
+}
+table.values td,  table.values th {
+  text-align: left;
   vertical-align: top;
-}
-.values .more {
+}
+.values .more {
   font-size: smaller;
-}
-
-.collapsed .summary:before, .expanded .summary:before {
-  border: #555 1px solid;
-  color: black;
-  text-align: center;
-  padding-left: 0.2em;
+}
+
+.collapsed .summary:before, .expanded .summary:before {
+  border: #555 1px solid;
+  color: black;
+  text-align: center;
+  padding-left: 0.2em;
   padding-right: 0.2em;
-}
-
-.collapsed .summary:before {
-  content: "+";
-}
-
-.expanded  .summary:before {
-  content: "–";
-}
-
-pre, code, .md5 {
+}
+
+.collapsed .summary:before {
+  content: "+";
+}
+
+.expanded  .summary:before {
+  content: "–";
+}
+
+pre, code, .md5 {
   font-family: Consolas, "Inconsolata", monospace;
-}
-
-
-.process {
-  background: #ddd;
-  margin: 0.5em;
+}
+
+
+.process {
+  background: #ddd;
+  margin: 0.5em;
   padding: 0.1em;
-}
-.runs {
- padding-left: 2em; 
-}
-
-.run {
-  background: #eee;
-  margin: 0.5em;
+}
+.runs {
+ padding-left: 2em; 
+}
+
+.run {
+  background: #eee;
+  margin: 0.5em;
   padding: 0.1em;
   
-}
-
-.download {
-  text-align: left;
-}
-
-.download .sectionIcons {
+}
+
+.download {
+  text-align: left;
+}
+
+.download .sectionIcons {
   margin-top: 2em;
-}
-
-.details h2 {
-  /* Undo generan h2 styling */
-  background: none;
-  padding: none;
-  font-size: 100%;
-  border: none;
+}
+
+.details h2 {
+  /* Undo generan h2 styling */
+  background: none;
+  padding: none;
+  font-size: 100%;
+  border: none;
   margin: none;
-}
-.more {
-  font-style: italic;
-  font-size: 95%;
+}
+.more {
+  font-style: italic;
+  font-size: 95%;
   color: #555;
-}
-
-/*font-family: "Margarine", "Comic Sans MS", "Comic Sans", fantasy; */
-.mockup {
-  border: #ccc 2px dashed;
-  margin-top: 1em;
-  margin-bottom: 1em;
-  padding-left: 0.5em;
+}
+
+/*font-family: "Margarine", "Comic Sans MS", "Comic Sans", fantasy; */
+.mockup {
+  border: #ccc 2px dashed;
+  margin-top: 1em;
+  margin-bottom: 1em;
+  padding-left: 0.5em;
   padding-right: 0.5em;
-}
-.mockup .mockup {
+}
+.mockup .mockup {
   border: none;
-}
-
-.checksum {
-  font-size: smaller; 
+}
+
+.checksum {
+  font-size: smaller; 
   text-align: center;
-}
-.runcomment {
-  border: #cde 1px dotted;
-  background: #ffd;
-  padding: 1em;
-  margin: 0.4em;
+}
+.runcomment {
+  border: #cde 1px dotted;
+  background: #ffd;
+  padding: 1em;
+  margin: 0.4em;
   font-style: italic;
-}
-
-.add_item_ro {
-  margin-bottom: 0.5em; 
-  padding: 0.1em;
-  padding-right: 0;
-}
-
-.add_item_ro label {
-  display: inline-block;
-  width: 8em;
-  font-weight: bold;
-  text-align: right;  
-}
-
-.add_item_ro .example {
-  margin-top: 0;
-  margin-bottom: 0;
+}
+
+.add_item_ro {
+  margin-bottom: 0.5em; 
+  padding: 0.1em;
+  padding-right: 0;
+}
+
+.add_item_ro label {
+  display: inline-block;
+  width: 8em;
+  font-weight: bold;
+  text-align: right;  
+}
+
+.add_item_ro .example {
+  margin-top: 0;
+  margin-bottom: 0;
   padding-left: 8em;
-}
-/* Trickery inner span to avoid smaller font-size changing padding */
-.add_item_ro .example span {
-  font-size: smaller;
-}
-
-.add_item_ro > div {
-  margin-top: 0.4em;
+}
+/* Trickery inner span to avoid smaller font-size changing padding */
+.add_item_ro .example span {
+  font-size: smaller;
+}
+
+.add_item_ro > div {
+  margin-top: 0.4em;
   margin-bottom: 0.4em;
-}
-.add_item_ro .or {
-  padding-left: 4em;
+}
+.add_item_ro .or {
+  padding-left: 4em;
   color: #335;
 }
 

Modified: branches/wf4ever/test/fixtures/blob_versions.yml (3428 => 3429)


--- branches/wf4ever/test/fixtures/blob_versions.yml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/fixtures/blob_versions.yml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -72,3 +72,27 @@
   content_type_id: 1
   content_blob_id: 1
 
+group_file_one_v1:
+  id: 7
+  blob_id: 7
+  version: 1
+  revision_comments: some revision comment
+  local_name: file_picture.png
+  title: for protected policy
+  body: some text
+  created_at: 2008-04-22 15:32:01
+  content_type_id: 1
+  content_blob_id: 1
+
+group_file_two_v1:
+  id: 8
+  blob_id: 8
+  version: 1
+  revision_comments: some revision comment
+  local_name: file_picture.png
+  title: for protected policy
+  body: some text
+  created_at: 2008-04-22 15:32:01
+  content_type_id: 1
+  content_blob_id: 1
+

Modified: branches/wf4ever/test/fixtures/blobs.yml (3428 => 3429)


--- branches/wf4ever/test/fixtures/blobs.yml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/fixtures/blobs.yml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -78,3 +78,29 @@
   content_type_id: 1
   content_blob_id: 1
 
+group_file_one:
+  id: 7
+  current_version: 1
+  contributor_id: 1
+  contributor_type: User
+  local_name: file_picture.png
+  title: A file with a Group Policy
+  body: some text
+  created_at: 2008-04-22 15:32:01
+  license_id: 2
+  content_type_id: 1
+  content_blob_id: 1
+
+group_file_two:
+  id: 8
+  current_version: 1
+  contributor_id: 1
+  contributor_type: User
+  local_name: file_picture.png
+  title: Another file with a Group Policy
+  body: some text
+  created_at: 2008-04-22 15:32:01
+  license_id: 2
+  content_type_id: 1
+  content_blob_id: 1
+

Deleted: branches/wf4ever/test/fixtures/blog_posts.yml (3428 => 3429)


--- branches/wf4ever/test/fixtures/blog_posts.yml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/fixtures/blog_posts.yml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,15 +0,0 @@
-# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
-one:
-  id: 1
-  blog_id: 1
-  title: MyString
-  body: MyText
-  created_at: 2007-08-16 11:22:32
-  updated_at: 2007-08-16 11:22:32
-two:
-  id: 2
-  blog_id: 1
-  title: MyString
-  body: MyText
-  created_at: 2007-08-16 11:22:32
-  updated_at: 2007-08-16 11:22:32

Deleted: branches/wf4ever/test/fixtures/blogs.yml (3428 => 3429)


--- branches/wf4ever/test/fixtures/blogs.yml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/fixtures/blogs.yml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,11 +0,0 @@
-# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
-one:
-  id: 1
-  contributor_id: 1
-  contributor_type: MyString
-  title: MyString
-two:
-  id: 2
-  contributor_id: 1
-  contributor_type: MyString
-  title: MyString

Modified: branches/wf4ever/test/fixtures/content_blobs.yml (3428 => 3429)


--- branches/wf4ever/test/fixtures/content_blobs.yml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/fixtures/content_blobs.yml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -2,7 +2,7 @@
 # or http://www.realityforge.org/articles/2006/04/06/loading-binary-data-into-rails-fixtures
 <%
   def load_blob_data(name)
-    filename = "#{RAILS_ROOT}/test/fixtures/files/#{name}"
+    filename = "#{Rails.root}/test/fixtures/files/#{name}"
     data = ""
     "!binary | #{[data].pack('m').gsub(/\n/,"\n    ")}\n"
   end
@@ -24,3 +24,6 @@
   id: 4
   data: <%= load_blob_data('workflow_branch_choice.xml') %>
 
+component_workflow_blob:
+  id: 5
+  data: <%= load_blob_data('image_to_tiff_migration.t2flow') %>

Modified: branches/wf4ever/test/fixtures/contributions.yml (3428 => 3429)


--- branches/wf4ever/test/fixtures/contributions.yml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/fixtures/contributions.yml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -111,11 +111,47 @@
   id: 10
   contributor_id: 1
   contributor_type: User
-  contributable_id: 6
+  contributable_id: 7
   contributable_type: Blob
-  policy_id: 6
+  policy_id: 7
   created_at: 2007-08-07 23:53:46
   updated_at: 2007-08-07 23:53:46
   downloads_count: 1
   viewings_count: 1
 
+contribution_for_group_file_one:
+  id: 11
+  contributor_id: 1
+  contributor_type: User
+  contributable_id: 8
+  contributable_type: Blob
+  policy_id: 7
+  created_at: 2007-08-07 23:53:46
+  updated_at: 2007-08-07 23:53:46
+  downloads_count: 1
+  viewings_count: 1
+
+contribution_for_component_workflow:
+  id: 12
+  contributor_id: 1
+  contributor_type: User
+  contributable_id: 3
+  contributable_type: Workflow
+  policy_id: 9
+  created_at: 2008-08-07 23:53:46
+  updated_at: 2008-08-07 23:53:46
+  downloads_count: 1
+  viewings_count: 1
+
+contribution_for_component_workflow2:
+  id: 13
+  contributor_id: 2
+  contributor_type: User
+  contributable_id: 4
+  contributable_type: Workflow
+  policy_id: 10
+  created_at: 2008-08-07 23:53:46
+  updated_at: 2008-08-07 23:53:46
+  downloads_count: 1
+  viewings_count: 1
+

Copied: branches/wf4ever/test/fixtures/files/image_to_tiff_migration.t2flow (from rev 3428, trunk/test/fixtures/files/image_to_tiff_migration.t2flow) (0 => 3429)


--- branches/wf4ever/test/fixtures/files/image_to_tiff_migration.t2flow	                        (rev 0)
+++ branches/wf4ever/test/fixtures/files/image_to_tiff_migration.t2flow	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,278 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.4.0"><dataflow id="16841f82-e1fe-4527-b7ef-411c4c59493b" role="top"><name>Image_to_tiff_migrat</name><inputPorts><port><name>from_uri</name><depth>0</depth><granularDepth>0</granularDepth><annotations><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.FreeTextDescription">
+        <text>description</text>
+      </annotationBean>
+      <date>2012-11-16 16:22:56.977 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.ExampleValue">
+        <text>example</text>
+      </annotationBean>
+      <date>2012-11-16 16:22:43.712 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.SemanticAnnotation">
+        <mimeType>text/rdf+n3</mimeType>
+        <content>[]    &lt;http://scape-project.eu/pc/vocab/profiles#hasPortType&gt;
+              &lt;http://scape-project.eu/pc/vocab/profiles#FromURIPort&gt; .
+</content>
+      </annotationBean>
+      <date>2012-11-19 15:53:49.250 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></port><port><name>to_uri</name><depth>0</depth><granularDepth>0</granularDepth><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.SemanticAnnotation">
+        <mimeType>text/rdf+n3</mimeType>
+        <content>[]    &lt;http://scape-project.eu/pc/vocab/profiles#hasPortType&gt;
+              &lt;http://scape-project.eu/pc/vocab/profiles#ToURIPort&gt; .
+</content>
+      </annotationBean>
+      <date>2012-11-20 12:09:41.928 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></port></inputPorts><outputPorts /><processors><processor><name>Tool</name><inputPorts><port><name>to_uri</name><depth>0</depth></port><port><name>from_uri</name><depth>0</depth></port></inputPorts><outputPorts /><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.SemanticAnnotation">
+        <mimeType>text/rdf+n3</mimeType>
+        <content>[]    &lt;http://scape-project.eu/pc/vocab/profiles#hasDependency&gt;
+              &lt;http://scape-project.eu/pc/vocab/profiles#imagemagick-image2tiff&gt; .
+</content>
+      </annotationBean>
+      <date>2012-11-20 12:17:37.420 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>external-tool-activity</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.activities.externaltool.ExternalToolActivity</class><inputMap><map from="to_uri" to="to_uri" /><map from="from_uri" to="from_uri" /></inputMap><outputMap /><configBean encoding="xstream"><net.sf.taverna.t2.activities.externaltool.ExternalToolActivityConfigurationBean xmlns="">
+  <mechanismType>789663B8-DA91-428A-9F7D-B3F3DA185FD4</mechanismType>
+  <mechanismName>default local</mechanismName>
+  <mechanismXML>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&#xD;
+&lt;localInvocation&gt;&lt;shellPrefix&gt;/bin/sh -c&lt;/shellPrefix&gt;&lt;linkCommand&gt;/bin/ln -s %%PATH_TO_ORIGINAL%% %%TARGET_NAME%%&lt;/linkCommand&gt;&lt;/localInvocation&gt;&#xD;
+</mechanismXML>
+  <externaltoolid>1c6b3cec-667d-4364-8a77-315a3b3c71f8</externaltoolid>
+  <useCaseDescription>
+    <usecaseid />
+    <description />
+    <command>convert %%from_uri%% tiff:%%to_uri%%</command>
+    <preparingTimeoutInSeconds>1200</preparingTimeoutInSeconds>
+    <executionTimeoutInSeconds>1800</executionTimeoutInSeconds>
+    <tags>
+      <string>from_uri</string>
+      <string>to_uri</string>
+    </tags>
+    <REs />
+    <queue__preferred />
+    <queue__deny />
+    <static__inputs />
+    <inputs>
+      <entry>
+        <string>to_uri</string>
+        <de.uni__luebeck.inb.knowarc.usecases.ScriptInputUser>
+          <tag>to_uri</tag>
+          <file>false</file>
+          <tempFile>false</tempFile>
+          <binary>false</binary>
+          <charsetName>MacRoman</charsetName>
+          <forceCopy>false</forceCopy>
+          <list>false</list>
+          <concatenate>false</concatenate>
+          <mime />
+        </de.uni__luebeck.inb.knowarc.usecases.ScriptInputUser>
+      </entry>
+      <entry>
+        <string>from_uri</string>
+        <de.uni__luebeck.inb.knowarc.usecases.ScriptInputUser>
+          <tag>from_uri</tag>
+          <file>false</file>
+          <tempFile>false</tempFile>
+          <binary>false</binary>
+          <charsetName>MacRoman</charsetName>
+          <forceCopy>false</forceCopy>
+          <list>false</list>
+          <concatenate>false</concatenate>
+          <mime />
+        </de.uni__luebeck.inb.knowarc.usecases.ScriptInputUser>
+      </entry>
+    </inputs>
+    <outputs />
+    <includeStdIn>false</includeStdIn>
+    <includeStdOut>true</includeStdOut>
+    <includeStdErr>true</includeStdErr>
+    <validReturnCodes>
+      <int>0</int>
+    </validReturnCodes>
+  </useCaseDescription>
+  <edited>false</edited>
+</net.sf.taverna.t2.activities.externaltool.ExternalToolActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="to_uri" depth="0" /><port name="from_uri" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>Tool</processor><port>to_uri</port></sink><source type="dataflow"><port>to_uri</port></source></datalink><datalink><sink type="processor"><processor>Tool</processor><port>from_uri</port></sink><source type="dataflow"><port>from_uri</port></source></datalink></datalinks><annotations><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.FreeTextDescription">
+        <text>SCAPE Migration Components that converts any ImageMagick supported image format to TIFF</text>
+      </annotationBean>
+      <date>2012-11-15 13:07:59.763 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>fd401dac-c521-4d94-8014-8efeba355d7a</identification>
+      </annotationBean>
+      <date>2012-11-19 15:55:14.145 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>22bc577f-9a74-4981-8725-c3b4ac28d88b</identification>
+      </annotationBean>
+      <date>2012-11-20 12:10:07.110 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>052219d1-09ed-4c6b-a5a4-2bad004a10ed</identification>
+      </annotationBean>
+      <date>2012-11-19 16:17:25.295 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>5abab48b-a3f0-4f14-9894-e824a2fa5966</identification>
+      </annotationBean>
+      <date>2012-11-16 16:39:00.691 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.Author">
+        <text>David Withers</text>
+      </annotationBean>
+      <date>2012-11-15 12:25:42.359 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>b5361a0e-6abd-4070-8655-5dd7b4237576</identification>
+      </annotationBean>
+      <date>2012-11-15 13:36:38.115 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>2bec9695-c132-4728-988c-c3a03ddcc78d</identification>
+      </annotationBean>
+      <date>2012-11-15 13:08:31.374 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>0d60174b-0d75-481d-8b4d-194c6109bc96</identification>
+      </annotationBean>
+      <date>2012-11-20 12:17:54.280 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.SemanticAnnotation">
+        <mimeType>text/rdf+n3</mimeType>
+        <content>[]    &lt;http://scape-project.eu/pc/vocab/profiles#hasMigrationPath&gt;
+              &lt;http://scape-project.eu/pc/vocab/profiles#jpegToTiff&gt; .
+</content>
+      </annotationBean>
+      <date>2012-11-20 12:17:49.904 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>16841f82-e1fe-4527-b7ef-411c4c59493b</identification>
+      </annotationBean>
+      <date>2012-11-21 11:00:56.248 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>a5aee4f0-01d8-4ae3-96f0-c992b8d40af2</identification>
+      </annotationBean>
+      <date>2012-11-15 13:14:14.243 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.DescriptiveTitle">
+        <text>Image to tiff migration action</text>
+      </annotationBean>
+      <date>2012-11-21 11:00:54.84 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain></annotations></dataflow></workflow>
\ No newline at end of file

Modified: branches/wf4ever/test/fixtures/permissions.yml (3428 => 3429)


--- branches/wf4ever/test/fixtures/permissions.yml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/fixtures/permissions.yml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -43,3 +43,13 @@
   created_at: 2008-04-06 14:13:12
   updated_at: 2008-04-06 14:13:12
 
+permission_for_group_policy:
+  id: 5
+  contributor_id: 4
+  contributor_type: Network
+  policy_id: 7
+  download: true
+  edit: true
+  view: true
+  created_at: 2008-04-06 14:13:12
+  updated_at: 2008-04-06 14:13:12
\ No newline at end of file

Modified: branches/wf4ever/test/fixtures/pictures.yml (3428 => 3429)


--- branches/wf4ever/test/fixtures/pictures.yml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/fixtures/pictures.yml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -4,7 +4,7 @@
 # or http://www.realityforge.org/articles/2006/04/06/loading-binary-data-into-rails-fixtures
 <%
   def load_blob_data(name)
-    filename = "#{RAILS_ROOT}/test/fixtures/files/#{name}"
+    filename = "#{Rails.root}/test/fixtures/files/#{name}"
     data = ""
     "!binary | #{[data].pack('m').gsub(/\n/,"\n    ")}\n"
   end

Modified: branches/wf4ever/test/fixtures/policies.yml (3428 => 3429)


--- branches/wf4ever/test/fixtures/policies.yml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/fixtures/policies.yml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -59,3 +59,42 @@
   created_at: 2007-10-22 18:54:22
   updated_at: 2008-01-09 12:12:12
 
+group_policy:
+  id: 7
+  contributor_id: 4
+  contributor_type: Network
+  name: Group Policy
+  share_mode: 0
+  update_mode: 0
+  created_at: 2007-10-22 18:54:22
+  updated_at: 2008-01-09 12:12:12
+
+unused_group_policy:
+  id: 8
+  contributor_id: 4
+  contributor_type: Network
+  name: Unused Group Policy
+  share_mode: 0
+  update_mode: 0
+  created_at: 2007-10-22 18:54:22
+  updated_at: 2008-01-09 12:12:12
+
+component_workflow_policy:
+  id: 9
+  contributor_id: 1
+  contributor_type: User
+  name: auto
+  share_mode: 0
+  update_mode: 0
+  created_at: 2007-10-22 18:54:22
+  updated_at: 2008-01-09 12:12:12
+
+component_workflow_policy2:
+  id: 10
+  contributor_id: 2
+  contributor_type: User
+  name: auto
+  share_mode: 0
+  update_mode: 0
+  created_at: 2007-10-22 18:54:22
+  updated_at: 2008-01-09 12:12:12
\ No newline at end of file

Copied: branches/wf4ever/test/fixtures/semantic_annotations.yml (from rev 3428, trunk/test/fixtures/semantic_annotations.yml) (0 => 3429)


--- branches/wf4ever/test/fixtures/semantic_annotations.yml	                        (rev 0)
+++ branches/wf4ever/test/fixtures/semantic_annotations.yml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,36 @@
+has_migration_path:
+  subject_id: 3
+  subject_type: Workflow
+  predicate: http://scape-project.eu/pc/vocab/profiles#hasMigrationPath
+  object: http://scape-project.eu/pc/vocab/profiles#jpegToTiff
+
+has_dependency:
+  subject_id: 1
+  subject_type: WorkflowProcessor
+  predicate: http://scape-project.eu/pc/vocab/profiles#hasDependency
+  object: http://scape-project.eu/pc/vocab/profiles#imagemagick-image2tiff
+
+has_port_type_from:
+  subject_id: 1
+  subject_type: WorkflowPort
+  predicate: http://scape-project.eu/pc/vocab/profiles#hasPortType
+  object: http://scape-project.eu/pc/vocab/profiles#FromURIPort
+
+has_port_type_to:
+  subject_id: 2
+  subject_type: WorkflowPort
+  predicate: http://scape-project.eu/pc/vocab/profiles#hasPortType
+  object: http://scape-project.eu/pc/vocab/profiles#ToURIPort
+
+has_port_type_from2:
+  subject_id: 3
+  subject_type: WorkflowPort
+  predicate: http://scape-project.eu/pc/vocab/profiles#hasPortType
+  object: http://scape-project.eu/pc/vocab/profiles#FromURIPort
+
+second_port_annotation:
+  subject_id: 3
+  subject_type: WorkflowPort
+  predicate: http://scape-project.eu/pc/vocab/profiles#hasFish
+  object: http://scape-project.eu/pc/vocab/profiles#CornishSardine
+

Modified: branches/wf4ever/test/fixtures/taverna_enactors.yml (3428 => 3429)


--- branches/wf4ever/test/fixtures/taverna_enactors.yml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/fixtures/taverna_enactors.yml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -7,7 +7,7 @@
   contributor_type: User
   url: http://rpc269.cs.man.ac.uk:8180/remotetaverna/v1/
   username: user
-  crypted_password: password                    # password should be put through an encrypt function before being stored in the DB
+  password: password                    # password should be put through an encrypt function before being stored in the DB
   created_at: 2008-01-06 17:52:45
   updated_at: 2008-01-06 17:52:45
 
@@ -19,6 +19,6 @@
   contributor_type: User
   url: http://rpc269.cs.man.ac.uk:8180/remotetaverna/v1/
   username: user
-  crypted_password: password                    # password should be put through an encrypt function before being stored in the DB
+  password: password                    # password should be put through an encrypt function before being stored in the DB
   created_at: 2008-04-28 23:19:35
   updated_at: 2008-04-28 23:19:35

Copied: branches/wf4ever/test/fixtures/workflow_ports.yml (from rev 3428, trunk/test/fixtures/workflow_ports.yml) (0 => 3429)


--- branches/wf4ever/test/fixtures/workflow_ports.yml	                        (rev 0)
+++ branches/wf4ever/test/fixtures/workflow_ports.yml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,18 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+from_uri_port:
+  id: 1
+  name: from_uri
+  port_type: input
+  workflow_id: 3
+
+to_uri_port:
+  id: 2
+  name: to_uri
+  port_type: input
+  workflow_id: 3
+
+single_port:
+  id: 3
+  name: from_uri
+  port_type: input
+  workflow_id: 4
\ No newline at end of file

Copied: branches/wf4ever/test/fixtures/workflow_processors.yml (from rev 3428, trunk/test/fixtures/workflow_processors.yml) (0 => 3429)


--- branches/wf4ever/test/fixtures/workflow_processors.yml	                        (rev 0)
+++ branches/wf4ever/test/fixtures/workflow_processors.yml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,5 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+migration_tool:
+  id: 1
+  name: Tool
+  workflow_id: 3

Modified: branches/wf4ever/test/fixtures/workflows.yml (3428 => 3429)


--- branches/wf4ever/test/fixtures/workflows.yml	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/fixtures/workflows.yml	2013-02-18 12:37:26 UTC (rev 3429)
@@ -26,3 +26,32 @@
   current_version: 1
   content_type_id: 3
   content_blob_id: 4
+
+component_workflow:
+  id: 3
+  contributor_id: 1
+  contributor_type: User
+  title: Image to TIFF Migration Component
+  unique_name: image_to_tiff
+  body: Component thing with annotations
+  created_at: 2008-04-11 22:19:33
+  updated_at: 2008-05-14 06:45:08
+  license_id: 2
+  current_version: 1
+  content_type_id: 4
+  content_blob_id: 5
+
+component_workflow2:
+  id: 4
+  contributor_id: 2
+  contributor_type: User
+  title: Another Component
+  unique_name: component_workflow
+  body: Second component thing with annotations
+  created_at: 2008-04-11 22:19:33
+  updated_at: 2008-05-14 06:45:08
+  license_id: 2
+  current_version: 1
+  content_type_id: 4
+  content_blob_id: 5
+

Modified: branches/wf4ever/test/functional/api_controller_test.rb (3428 => 3429)


--- branches/wf4ever/test/functional/api_controller_test.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/functional/api_controller_test.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -191,6 +191,7 @@
         <title>#{title}</title>
         <description>#{description}</description>
         <license-type>#{license_type}</license-type>
+        <filename>test.txt</filename>
         <content-type>#{content_type}</content-type>
         <content>#{content}</content>
       </file>")
@@ -1013,6 +1014,74 @@
     assert_response(:not_found)
   end
 
+  # component querying
+
+  def test_basic_component_query
+    login_as(:john)
+
+    resp = rest_request(:get, 'components', nil, {"input" => {"0" => '"http://scape-project.eu/pc/vocab/profiles#hasPortType http://scape-project.eu/pc/vocab/profiles#FromURIPort"'}})
+
+    assert_response(:success)
+    assert_equal 2, resp.find('//workflow').size
+    assert_equal [3,4], resp.find('//workflow').map {|w| w['uri'].split('?id=').last.to_i}
+  end
+
+  def test_two_annotation_component_query
+    login_as(:john)
+
+    anns = '"http://scape-project.eu/pc/vocab/profiles#hasPortType http://scape-project.eu/pc/vocab/profiles#FromURIPort"' +
+          ',"http://scape-project.eu/pc/vocab/profiles#hasFish http://scape-project.eu/pc/vocab/profiles#CornishSardine"'
+    resp = rest_request(:get, 'components', nil, {"input" => {"0" => anns}})
+
+    assert_response(:success)
+    assert_equal 1, resp.find('//workflow').size
+    assert_equal 4, resp.find('//workflow').first['uri'].split('?id=').last.to_i
+  end
+
+  def test_two_feature_component_query
+    login_as(:john)
+
+    resp = rest_request(:get, 'components', nil, {'input' => {'0' => '"http://scape-project.eu/pc/vocab/profiles#hasPortType http://scape-project.eu/pc/vocab/profiles#FromURIPort"',
+                                                              '1' => '"http://scape-project.eu/pc/vocab/profiles#hasPortType http://scape-project.eu/pc/vocab/profiles#ToURIPort"'}
+                                                 })
+
+    assert_response(:success)
+    assert_equal 1, resp.find('//workflow').size
+    assert_equal 3, resp.find('//workflow').first['uri'].split('?id=').last.to_i
+  end
+
+  def test_verbose_component_query
+    login_as(:john)
+
+    resp = rest_request(:get, 'components', nil, {'input' => {'0' => '"http://scape-project.eu/pc/vocab/profiles#hasPortType http://scape-project.eu/pc/vocab/profiles#FromURIPort"',
+                                                              '1' => '"http://scape-project.eu/pc/vocab/profiles#hasPortType http://scape-project.eu/pc/vocab/profiles#ToURIPort"'},
+                                                  'processor' => {'0' => '"http://scape-project.eu/pc/vocab/profiles#hasDependency http://scape-project.eu/pc/vocab/profiles#imagemagick-image2tiff"'},
+                                                  'annotations' => '"http://scape-project.eu/pc/vocab/profiles#hasMigrationPath http://scape-project.eu/pc/vocab/profiles#jpegToTiff"'
+                                                 })
+
+    assert_response(:success)
+    assert_equal 1, resp.find('//workflow').size
+    assert_equal 3, resp.find('//workflow').first['uri'].split('?id=').last.to_i
+  end
+
+  def test_component_query_with_filters
+    login_as(:john)
+
+    resp = rest_request(:get, 'components', nil, {"input" => {"0" => '"http://scape-project.eu/pc/vocab/profiles#hasPortType http://scape-project.eu/pc/vocab/profiles#FromURIPort"'},
+                                                  "filter" => 'USER_ID("2")'})
+
+    assert_response(:success)
+    assert_equal 1, resp.find('//workflow').size
+    assert_equal 4, resp.find('//workflow').last['uri'].split('?id=').last.to_i
+
+    resp = rest_request(:get, 'components', nil, {"input" => {"0" => '"http://scape-project.eu/pc/vocab/profiles#hasPortType http://scape-project.eu/pc/vocab/profiles#FromURIPort"'},
+                                                  "filter" => 'USER_ID("1")'})
+
+    assert_response(:success)
+    assert_equal 1, resp.find('//workflow').size
+    assert_equal 3, resp.find('//workflow').last['uri'].split('?id=').last.to_i
+  end
+
   private
 
   def rest_request(method, uri, data = "" query = {})

Modified: branches/wf4ever/test/functional/blobs_controller_test.rb (3428 => 3429)


--- branches/wf4ever/test/functional/blobs_controller_test.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/functional/blobs_controller_test.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -68,4 +68,46 @@
     assert_equal old_count-1, Blob.count   
     assert_redirected_to blobs_path
   end
+
+  def test_should_apply_group_policy
+    login_as(:john)
+    old_policy_id = policies(:john_policy).id
+    assert_difference("Policy.count", -1) do
+      put :update, :id => 1, :blob => { :title => 'Test blob - updated', :body => 'updated test test test' },
+                             :credits_me => 'false',
+                             :credits_users => '',
+                             :credits_groups => '',
+                             :attributions_workflows => '',
+                             :attributions_files => '',
+                             :policy_type => "group",
+                             :group_policy => "7"
+
+      assert_redirected_to blob_path(assigns(:blob))
+      assert_equal 7, assigns(:blob).contribution.policy_id
+      assert_nil Policy.find_by_id(old_policy_id) # Old, custom policy should be deleted
+    end
+  end
+
+  def test_should_apply_custom_policy
+    login_as(:john)
+
+    blob = blobs(:group_file_one)
+
+    assert_difference("Policy.count", 1) do
+      put :update, :id => blob.id, :blob => { :title => 'Updated', :body => 'updated test test test' },
+                                   :credits_me => 'false',
+                                   :credits_users => '',
+                                   :credits_groups => '',
+                                   :attributions_workflows => '',
+                                   :attributions_files => '',
+                                   :policy_type => "custom",
+                                   :sharing => {:class_id => "1"},
+                                   :updating => {:class_id => "1"}
+      assert_not_equal 7, assigns(:blob).contribution.policy_id
+      assert_equal 7, blobs(:group_file_two).contribution.policy_id
+      assert_equal 0, blobs(:group_file_two).contribution.policy.share_mode
+      assert_equal 1, assigns(:blob).contribution.policy.share_mode
+    end
+
+  end
 end

Deleted: branches/wf4ever/test/functional/blog_posts_controller_test.rb (3428 => 3429)


--- branches/wf4ever/test/functional/blog_posts_controller_test.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/functional/blog_posts_controller_test.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,15 +0,0 @@
-# myExperiment: test/functional/blog_posts_controller_test.rb
-#
-# Copyright (c) 2007 University of Manchester and the University of Southampton.
-# See license.txt for details.
-
-require File.dirname(__FILE__) + '/../test_helper'
-require 'blog_posts_controller'
-
-class BlogPostsControllerTest < ActionController::TestCase
-
-  def test_true
-    assert true
-  end
-
-end

Deleted: branches/wf4ever/test/functional/blogs_controller_test.rb (3428 => 3429)


--- branches/wf4ever/test/functional/blogs_controller_test.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/functional/blogs_controller_test.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,15 +0,0 @@
-# myExperiment: test/functional/blogs_controller_test.rb
-#
-# Copyright (c) 2007 University of Manchester and the University of Southampton.
-# See license.txt for details.
-
-require File.dirname(__FILE__) + '/../test_helper'
-require 'blogs_controller'
-
-class BlogsControllerTest < ActionController::TestCase
-
-  def test_true
-    assert true
-  end
-
-end

Copied: branches/wf4ever/test/functional/group_policies_controller_test.rb (from rev 3428, trunk/test/functional/group_policies_controller_test.rb) (0 => 3429)


--- branches/wf4ever/test/functional/group_policies_controller_test.rb	                        (rev 0)
+++ branches/wf4ever/test/functional/group_policies_controller_test.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -0,0 +1,59 @@
+require File.dirname(__FILE__) + '/../test_helper'
+require 'group_policies_controller'
+
+class GroupPoliciesControllerTest < ActionController::TestCase
+  fixtures :policies, :blobs, :permissions, :networks, :users
+
+  def test_administrators_can_view
+    login_as(:john)
+    get :index, :network_id => networks(:exclusive_network).id
+    assert_response :success
+  end
+
+  def test_non_admins_cannot_view
+    login_as(:jane)
+    get :index, :network_id => networks(:exclusive_network).id
+    assert_response :redirect
+  end
+
+  def test_can_create
+    login_as(:john)
+
+    assert_difference("Policy.count", 1) do
+      post :create, :network_id => networks(:exclusive_network).id,
+                    :name => "New Policy", :share_mode  => 0
+    end
+  end
+
+  def test_can_delete_if_not_used
+    login_as(:john)
+
+    assert_difference("Policy.count", -1) do
+      delete :destroy, :network_id => networks(:exclusive_network).id, :id => policies(:unused_group_policy).id
+      assert_response :redirect
+    end
+  end
+
+  def test_cannot_delete_if_used
+    login_as(:john)
+
+    assert_no_difference("Policy.count") do
+      delete :destroy, :network_id => networks(:exclusive_network).id, :id => policies(:group_policy).id
+      assert_response :redirect
+    end
+  end
+
+  def test_can_update
+    login_as(:john)
+
+    assert_equal 0, policies(:group_policy).share_mode
+
+    put :update, :network_id => networks(:exclusive_network).id, :id => policies(:group_policy).id,
+                 :share_mode  => 2
+
+    assert_response :success
+
+    assert_equal 2, assigns(:policy).share_mode
+  end
+
+end
\ No newline at end of file

Modified: branches/wf4ever/test/functional/networks_controller_test.rb (3428 => 3429)


--- branches/wf4ever/test/functional/networks_controller_test.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/functional/networks_controller_test.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -26,7 +26,7 @@
     old_count = Network.count
 
     login_as(:john)
-    post :create, :network => { :user_id => '990', :title => 'test network', :unique_name => 'test_network', :new_member_policy => 'open', :description => "..." }
+    post :create, :network => { :title => 'test network', :unique_name => 'test_network', :new_member_policy => 'open', :description => "..." }
 
     assert_equal old_count+1, Network.count    
     assert_redirected_to network_path(assigns(:network))
@@ -47,7 +47,7 @@
   def test_should_update_network
     login_as(:john)
     put :update, :id => 1, 
-                 :network => { :user_id => '990', :title => 'test network', :unique_name => 'update_network', :new_member_policy => 'open', :description => ".?."}
+                 :network => { :title => 'test network', :unique_name => 'update_network', :new_member_policy => 'open', :description => ".?."}
 
     assert_redirected_to network_path(assigns(:network))
   end

Deleted: branches/wf4ever/test/unit/blog_post_test.rb (3428 => 3429)


--- branches/wf4ever/test/unit/blog_post_test.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/unit/blog_post_test.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,10 +0,0 @@
-require File.dirname(__FILE__) + '/../test_helper'
-
-class BlogPostTest < ActiveSupport::TestCase
-  fixtures :blog_posts
-
-  # Replace this with your real tests.
-  def test_truth
-    assert true
-  end
-end

Deleted: branches/wf4ever/test/unit/blog_test.rb (3428 => 3429)


--- branches/wf4ever/test/unit/blog_test.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/test/unit/blog_test.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -1,10 +0,0 @@
-require File.dirname(__FILE__) + '/../test_helper'
-
-class BlogTest < ActiveSupport::TestCase
-  fixtures :blogs
-
-  # Replace this with your real tests.
-  def test_truth
-    assert true
-  end
-end

Modified: branches/wf4ever/vendor/plugins/versioning/lib/versioning.rb (3428 => 3429)


--- branches/wf4ever/vendor/plugins/versioning/lib/versioning.rb	2013-02-15 17:15:11 UTC (rev 3428)
+++ branches/wf4ever/vendor/plugins/versioning/lib/versioning.rb	2013-02-18 12:37:26 UTC (rev 3429)
@@ -23,7 +23,7 @@
 
       class_eval do
 
-        has_many :versions, :class_name => self.version_class.name
+        has_many :versions, :class_name => self.version_class.name, :dependent => :destroy
 
         def find_version(v)
           match = self.version_class.find(:first, :conditions => ["#{self.versioned_resource_column} = ? AND version = ?", id, v])

reply via email to

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