sufia 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/views/catalog/_index_partials/_list_files.html.erb +5 -6
 - data/app/views/catalog/_recent_document.html.erb +2 -2
 - data/app/views/dashboard/_index_partials/_default_group.html.erb +1 -1
 - data/app/views/dashboard/_index_partials/_list_files.html.erb +2 -2
 - data/app/views/generic_files/_show_descriptions.html.erb +14 -112
 - data/app/views/generic_files/show_fields/_based_near.html.erb +9 -0
 - data/app/views/generic_files/show_fields/_contributor.html.erb +9 -0
 - data/app/views/generic_files/show_fields/_creator.html.erb +9 -0
 - data/app/views/generic_files/show_fields/_date_created.html.erb +9 -0
 - data/app/views/generic_files/show_fields/_description.html.erb +9 -0
 - data/app/views/generic_files/show_fields/_identifier.html.erb +9 -0
 - data/app/views/generic_files/show_fields/_language.html.erb +9 -0
 - data/app/views/generic_files/show_fields/_publisher.html.erb +9 -0
 - data/app/views/generic_files/show_fields/_related_url.html.erb +9 -0
 - data/app/views/generic_files/show_fields/_resource_type.html.erb +9 -0
 - data/app/views/generic_files/show_fields/_rights.html.erb +9 -0
 - data/app/views/generic_files/show_fields/_subject.html.erb +9 -0
 - data/app/views/generic_files/show_fields/_tag.html.erb +9 -0
 - data/app/views/generic_files/show_fields/_title.html.erb +9 -0
 - data/lib/generators/sufia/templates/catalog_controller.rb +72 -72
 - data/lib/sufia/files_controller_behavior.rb +13 -4
 - data/lib/sufia/solr_document_behavior.rb +1 -1
 - data/lib/sufia/version.rb +1 -1
 - data/spec/controllers/catalog_controller_spec.rb +9 -9
 - data/spec/models/generic_file_spec.rb +16 -16
 - data/spec/routing/route_spec.rb +1 -1
 - data/sufia.gemspec +3 -3
 - metadata +20 -6
 
| 
         @@ -1,5 +1,4 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            <% if document.has_key?(:noid_s) %>
         
     | 
| 
       2 
     | 
    
         
            -
            <%# logger.info document[:generic_file__creator_t].inspect %>
         
     | 
| 
       3 
2 
     | 
    
         
             
            <li>
         
     | 
| 
       4 
3 
     | 
    
         
             
              <h2>
         
     | 
| 
       5 
4 
     | 
    
         
             
                <%= link_to render_document_show_field_value(:document=>document, :field=>document.title_or_label), sufia.generic_file_path(document[:noid_s].first) %>
         
     | 
| 
         @@ -10,7 +9,7 @@ 
     | 
|
| 
       10 
9 
     | 
    
         
             
                  <td rowspan="6" class="span20"> <%= render :partial => 'dashboard/_index_partials/thumbnail_display', :locals => {:document=>document, :height=>200, :width=>150} %>
         
     | 
| 
       11 
10 
     | 
    
         
             
                  </td>
         
     | 
| 
       12 
11 
     | 
    
         
             
                  <th><h4>Title:</h4></th>
         
     | 
| 
       13 
     | 
    
         
            -
                  <td><%= render_document_show_field_value(:document=>document, :field=>" 
     | 
| 
      
 12 
     | 
    
         
            +
                  <td><%= render_document_show_field_value(:document=>document, :field=>"desc_metadata__title_display") %></td>
         
     | 
| 
       14 
13 
     | 
    
         
             
                </tr>
         
     | 
| 
       15 
14 
     | 
    
         
             
                <tr>
         
     | 
| 
       16 
15 
     | 
    
         
             
                  <th><h4>Depositor:<h4></div>
         
     | 
| 
         @@ -18,19 +17,19 @@ 
     | 
|
| 
       18 
17 
     | 
    
         
             
                </tr>
         
     | 
| 
       19 
18 
     | 
    
         
             
                <tr>
         
     | 
| 
       20 
19 
     | 
    
         
             
                  <th><h4>Creator:</h4></th>
         
     | 
| 
       21 
     | 
    
         
            -
                  <td><%= render_document_show_field_value(:document=>document, :field=>" 
     | 
| 
      
 20 
     | 
    
         
            +
                  <td><%= render_document_show_field_value(:document=>document, :field=>"desc_metadata__creator_display") %></td>
         
     | 
| 
       22 
21 
     | 
    
         
             
                </tr>
         
     | 
| 
       23 
22 
     | 
    
         
             
                <tr>
         
     | 
| 
       24 
23 
     | 
    
         
             
                  <th><h4>Description:</h4></th>
         
     | 
| 
       25 
     | 
    
         
            -
                  <td><%= iconify_auto_link(render_document_show_field_value(:document=>document, :field=>" 
     | 
| 
      
 24 
     | 
    
         
            +
                  <td><%= iconify_auto_link(render_document_show_field_value(:document=>document, :field=>"desc_metadata__description_display")) %></th>
         
     | 
| 
       26 
25 
     | 
    
         
             
                </tr>
         
     | 
| 
       27 
26 
     | 
    
         
             
                <tr>
         
     | 
| 
       28 
27 
     | 
    
         
             
                  <th><h4>Keywords:</h4></th>
         
     | 
| 
       29 
     | 
    
         
            -
                  <td><%= render_document_show_field_value(:document=>document, :field=>" 
     | 
| 
      
 28 
     | 
    
         
            +
                  <td><%= render_document_show_field_value(:document=>document, :field=>"desc_metadata__tag_display") %></td>
         
     | 
| 
       30 
29 
     | 
    
         
             
                </tr>
         
     | 
| 
       31 
30 
     | 
    
         
             
                <tr>
         
     | 
| 
       32 
31 
     | 
    
         
             
                  <th><h4>Date Uploaded:</h4></th>
         
     | 
| 
       33 
     | 
    
         
            -
                  <td><%= render_document_show_field_value(:document=>document, :field=>" 
     | 
| 
      
 32 
     | 
    
         
            +
                  <td><%= render_document_show_field_value(:document=>document, :field=>"desc_metadata__date_uploaded_display") %></td>
         
     | 
| 
       34 
33 
     | 
    
         
             
                </tr>
         
     | 
| 
       35 
34 
     | 
    
         
             
              </table>
         
     | 
| 
       36 
35 
     | 
    
         
             
            </li>
         
     | 
| 
         @@ -1,6 +1,6 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            <%- keywords = link_to_facet_list(recent_document[: 
     | 
| 
      
 1 
     | 
    
         
            +
            <%- keywords = link_to_facet_list(recent_document[:desc_metadata__tag_t], 'desc_metadata__tag_facet', 'no keywords specified') -%>
         
     | 
| 
       2 
2 
     | 
    
         
             
            <%- filename = render_document_show_field_value(:document=>recent_document, :field=>"label_t") -%>
         
     | 
| 
       3 
     | 
    
         
            -
            <%- title = render_document_show_field_value(:document=>recent_document, :field=>" 
     | 
| 
      
 3 
     | 
    
         
            +
            <%- title = render_document_show_field_value(:document=>recent_document, :field=>"desc_metadata__title_t") -%>
         
     | 
| 
       4 
4 
     | 
    
         
             
            <%- title = filename if title.empty? -%>
         
     | 
| 
       5 
5 
     | 
    
         
             
            <%- short_title = truncate(title, :length => 28, :separator => ' ') -%>
         
     | 
| 
       6 
6 
     | 
    
         
             
            <%- depositor = get_depositor_from_document(recent_document) -%>
         
     | 
| 
         @@ -22,7 +22,7 @@ limitations under the License. 
     | 
|
| 
       22 
22 
     | 
    
         
             
                <th class="sm"><%= render :partial => 'batch_edits/check_all' %></th>
         
     | 
| 
       23 
23 
     | 
    
         
             
                <th> </th>
         
     | 
| 
       24 
24 
     | 
    
         
             
                <th class="center">Title</th>
         
     | 
| 
       25 
     | 
    
         
            -
                <th class="sorts-dash"><i id=" 
     | 
| 
      
 25 
     | 
    
         
            +
                <th class="sorts-dash"><i id="desc_metadata__date_uploaded_dt" class="<%=params[:sort]== "desc_metadata__date_uploaded_dt desc" ? 'icon-caret-down' : params[:sort]== "desc_metadata__date_uploaded_dt asc" ? 'icon-caret-up' : ''%>"></i>Date Uploaded</th>
         
     | 
| 
       26 
26 
     | 
    
         
             
                <th>Visibility</th>
         
     | 
| 
       27 
27 
     | 
    
         
             
                <th class="center">Action</th>
         
     | 
| 
       28 
28 
     | 
    
         
             
              </tr>
         
     | 
| 
         @@ -34,7 +34,7 @@ on element ids --> 
     | 
|
| 
       34 
34 
     | 
    
         
             
                <%= render :partial => 'dashboard/_index_partials/thumbnail_display', :locals => {:document=>document} %>
         
     | 
| 
       35 
35 
     | 
    
         
             
                <span class=center><%= link_to render_document_show_field_value(:document=>document, :field=>document.title_or_label), sufia.generic_file_path(noid), :id => "src_copy_link#{noid}" %> <br /></span>
         
     | 
| 
       36 
36 
     | 
    
         
             
              </td>
         
     | 
| 
       37 
     | 
    
         
            -
              <td width="17%"><%= document.fetch(: 
     | 
| 
      
 37 
     | 
    
         
            +
              <td width="17%"><%= document.fetch(:desc_metadata__date_uploaded_dt,'').to_time.strftime("%m/%d/%Y") unless document.fetch(:desc_metadata__date_uploaded_dt,'').blank? %> </td>
         
     | 
| 
       38 
38 
     | 
    
         
             
              <td width="5%" align="center">
         
     | 
| 
       39 
39 
     | 
    
         
             
                <% if !document[:read_access_group_t].blank? and document[:read_access_group_t].include?('registered') %>
         
     | 
| 
       40 
40 
     | 
    
         
             
                  <a href="<%= sufia.generic_file_path(noid) %>/edit/?tab=permissions" id="permission_<%= noid %>"><span class="label label-info" title="<%=t('sufia.institution_name') %>"><%=t('sufia.institution_name') %></span></a> 
         
     | 
| 
         @@ -63,7 +63,7 @@ on element ids --> 
     | 
|
| 
       63 
63 
     | 
    
         
             
                    <td><strong>File Format: </strong> <%= render_document_show_field_value(:document=>document, :field=>"file_format_t") %> </td>
         
     | 
| 
       64 
64 
     | 
    
         
             
                  </tr>
         
     | 
| 
       65 
65 
     | 
    
         
             
                  <tr>
         
     | 
| 
       66 
     | 
    
         
            -
                    <td><strong>Creator: </strong> <%= render_document_show_field_value(:document=>document, :field=>" 
     | 
| 
      
 66 
     | 
    
         
            +
                    <td><strong>Creator: </strong> <%= render_document_show_field_value(:document=>document, :field=>"desc_metadata__creator_display") %> </td>
         
     | 
| 
       67 
67 
     | 
    
         
             
                    <td><strong>Depositor: </strong> <%= link_to_profile render_document_show_field_value(:document=>document, :field=>"depositor_t") %> </td>
         
     | 
| 
       68 
68 
     | 
    
         
             
                  </tr>
         
     | 
| 
       69 
69 
     | 
    
         
             
                  <tr>
         
     | 
| 
         @@ -1,118 +1,20 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
                <h2 class="non lower">Descriptions</h2>
         
     | 
| 
       2 
2 
     | 
    
         
             
                <table class="table table-striped"><!-- class="verticalheadings"> -->
         
     | 
| 
       3 
3 
     | 
    
         
             
                  <tbody>
         
     | 
| 
       4 
     | 
    
         
            -
                     
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
                     
     | 
| 
       12 
     | 
    
         
            -
                     
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
                      </td>
         
     | 
| 
       19 
     | 
    
         
            -
                    </tr>
         
     | 
| 
       20 
     | 
    
         
            -
                    <tr>
         
     | 
| 
       21 
     | 
    
         
            -
                      <th>Contributor</th>
         
     | 
| 
       22 
     | 
    
         
            -
                      <td>
         
     | 
| 
       23 
     | 
    
         
            -
                        <% @generic_file.contributor.each do |contributor| %>
         
     | 
| 
       24 
     | 
    
         
            -
                          <%= link_to_field('contributor', contributor) %><br />
         
     | 
| 
       25 
     | 
    
         
            -
                        <% end %>
         
     | 
| 
       26 
     | 
    
         
            -
                      </td>
         
     | 
| 
       27 
     | 
    
         
            -
                    </tr>
         
     | 
| 
       28 
     | 
    
         
            -
                    <tr>
         
     | 
| 
       29 
     | 
    
         
            -
                      <th>Related URL</th>
         
     | 
| 
       30 
     | 
    
         
            -
                      <td>
         
     | 
| 
       31 
     | 
    
         
            -
                        <% @generic_file.related_url.each do |url| %>
         
     | 
| 
       32 
     | 
    
         
            -
                          <%= iconify_auto_link(url) %><br />
         
     | 
| 
       33 
     | 
    
         
            -
                        <% end %>
         
     | 
| 
       34 
     | 
    
         
            -
                      </td>
         
     | 
| 
       35 
     | 
    
         
            -
                    </tr>
         
     | 
| 
       36 
     | 
    
         
            -
                    <tr>
         
     | 
| 
       37 
     | 
    
         
            -
                      <th>Location</th>
         
     | 
| 
       38 
     | 
    
         
            -
                      <td>
         
     | 
| 
       39 
     | 
    
         
            -
                        <% @generic_file.based_near.each do |bn| %>
         
     | 
| 
       40 
     | 
    
         
            -
                          <%= link_to_facet(bn, 'generic_file__based_near_facet') %><br />
         
     | 
| 
       41 
     | 
    
         
            -
                        <% end %>
         
     | 
| 
       42 
     | 
    
         
            -
                      </td>
         
     | 
| 
       43 
     | 
    
         
            -
                    </tr>
         
     | 
| 
       44 
     | 
    
         
            -
                    <tr>
         
     | 
| 
       45 
     | 
    
         
            -
                      <th>Abstract or Summary</th>
         
     | 
| 
       46 
     | 
    
         
            -
                      <td>
         
     | 
| 
       47 
     | 
    
         
            -
                        <% @generic_file.description.each do |desc| %>
         
     | 
| 
       48 
     | 
    
         
            -
                          <%= iconify_auto_link(desc) %><br />
         
     | 
| 
       49 
     | 
    
         
            -
                        <% end %>
         
     | 
| 
       50 
     | 
    
         
            -
                      </td>
         
     | 
| 
       51 
     | 
    
         
            -
                    </tr>
         
     | 
| 
       52 
     | 
    
         
            -
                    <tr>
         
     | 
| 
       53 
     | 
    
         
            -
                      <th>Language</th>
         
     | 
| 
       54 
     | 
    
         
            -
                      <td>
         
     | 
| 
       55 
     | 
    
         
            -
                        <% @generic_file.language.each do |lang| %>
         
     | 
| 
       56 
     | 
    
         
            -
                          <%= link_to_facet(lang,'generic_file__language_facet') %><br />
         
     | 
| 
       57 
     | 
    
         
            -
                        <% end %>
         
     | 
| 
       58 
     | 
    
         
            -
                      </td>
         
     | 
| 
       59 
     | 
    
         
            -
                    </tr>
         
     | 
| 
       60 
     | 
    
         
            -
                    <tr>
         
     | 
| 
       61 
     | 
    
         
            -
                      <th>Resource Type</th>
         
     | 
| 
       62 
     | 
    
         
            -
                      <td>
         
     | 
| 
       63 
     | 
    
         
            -
                        <% @generic_file.resource_type.each do |rtype| %>
         
     | 
| 
       64 
     | 
    
         
            -
                          <%= link_to_facet(rtype, 'generic_file__resource_type_facet') %><br />
         
     | 
| 
       65 
     | 
    
         
            -
                        <% end %>
         
     | 
| 
       66 
     | 
    
         
            -
                      </td>
         
     | 
| 
       67 
     | 
    
         
            -
                    </tr>
         
     | 
| 
       68 
     | 
    
         
            -
                    <tr>
         
     | 
| 
       69 
     | 
    
         
            -
                      <th>Publisher</th>
         
     | 
| 
       70 
     | 
    
         
            -
                      <td>
         
     | 
| 
       71 
     | 
    
         
            -
                        <% @generic_file.publisher.each do |pub| %>
         
     | 
| 
       72 
     | 
    
         
            -
                          <%= link_to_facet(pub,'generic_file__publisher_facet') %><br />
         
     | 
| 
       73 
     | 
    
         
            -
                        <% end %>
         
     | 
| 
       74 
     | 
    
         
            -
                      </td>
         
     | 
| 
       75 
     | 
    
         
            -
                    </tr>
         
     | 
| 
       76 
     | 
    
         
            -
                    <tr>
         
     | 
| 
       77 
     | 
    
         
            -
                      <th>Rights</th>
         
     | 
| 
       78 
     | 
    
         
            -
                      <td>
         
     | 
| 
       79 
     | 
    
         
            -
                        <% @generic_file.rights.each do |r| %>
         
     | 
| 
       80 
     | 
    
         
            -
                          <%=link_to_field('rights',r, Sufia::Engine.config.cc_licenses_reverse[r])%> <%= iconify_auto_link(r,false) %><br />
         
     | 
| 
       81 
     | 
    
         
            -
                        <% end %>
         
     | 
| 
       82 
     | 
    
         
            -
                      </td>
         
     | 
| 
       83 
     | 
    
         
            -
                    </tr>
         
     | 
| 
       84 
     | 
    
         
            -
                    <tr>
         
     | 
| 
       85 
     | 
    
         
            -
                      <th>Subject</th>
         
     | 
| 
       86 
     | 
    
         
            -
                      <td>
         
     | 
| 
       87 
     | 
    
         
            -
                        <% @generic_file.subject.each do |sub| %>
         
     | 
| 
       88 
     | 
    
         
            -
                          <%= link_to_facet(sub, 'generic_file__subject_facet') %><br />
         
     | 
| 
       89 
     | 
    
         
            -
                        <% end %>
         
     | 
| 
       90 
     | 
    
         
            -
                      </td>
         
     | 
| 
       91 
     | 
    
         
            -
                    </tr>
         
     | 
| 
       92 
     | 
    
         
            -
                    <tr>
         
     | 
| 
       93 
     | 
    
         
            -
                      <th>Keyword</th>
         
     | 
| 
       94 
     | 
    
         
            -
                      <td>
         
     | 
| 
       95 
     | 
    
         
            -
                        <% @generic_file.tag.each do |t| %>
         
     | 
| 
       96 
     | 
    
         
            -
                          <%= link_to_facet(t, 'generic_file__tag_facet') %><br />
         
     | 
| 
       97 
     | 
    
         
            -
                        <% end %>
         
     | 
| 
       98 
     | 
    
         
            -
                      </td>
         
     | 
| 
       99 
     | 
    
         
            -
                    </tr>
         
     | 
| 
       100 
     | 
    
         
            -
                    <tr>
         
     | 
| 
       101 
     | 
    
         
            -
                      <th>Identifier</th>
         
     | 
| 
       102 
     | 
    
         
            -
                      <td>
         
     | 
| 
       103 
     | 
    
         
            -
                        <% @generic_file.identifier.each do |id| %>
         
     | 
| 
       104 
     | 
    
         
            -
                          <%= id %><br />
         
     | 
| 
       105 
     | 
    
         
            -
                        <% end %>
         
     | 
| 
       106 
     | 
    
         
            -
                      </td>
         
     | 
| 
       107 
     | 
    
         
            -
                    </tr>
         
     | 
| 
       108 
     | 
    
         
            -
                    <tr>
         
     | 
| 
       109 
     | 
    
         
            -
                      <th>Date Created</th>
         
     | 
| 
       110 
     | 
    
         
            -
                      <td>
         
     | 
| 
       111 
     | 
    
         
            -
                        <% @generic_file.date_created.each do |dc| %>
         
     | 
| 
       112 
     | 
    
         
            -
                          <%= dc %><br />
         
     | 
| 
       113 
     | 
    
         
            -
                        <% end %>
         
     | 
| 
       114 
     | 
    
         
            -
                      </td>
         
     | 
| 
       115 
     | 
    
         
            -
                    </tr>
         
     | 
| 
      
 4 
     | 
    
         
            +
                    <%= render :partial=>'generic_files/show_fields/title' %>
         
     | 
| 
      
 5 
     | 
    
         
            +
                    <%= render :partial=>'generic_files/show_fields/creator' %>
         
     | 
| 
      
 6 
     | 
    
         
            +
                    <%= render :partial=>'generic_files/show_fields/contributor' %>
         
     | 
| 
      
 7 
     | 
    
         
            +
                    <%= render :partial=>'generic_files/show_fields/related_url' %>
         
     | 
| 
      
 8 
     | 
    
         
            +
                    <%= render :partial=>'generic_files/show_fields/based_near' %>
         
     | 
| 
      
 9 
     | 
    
         
            +
                    <%= render :partial=>'generic_files/show_fields/description' %>
         
     | 
| 
      
 10 
     | 
    
         
            +
                    <%= render :partial=>'generic_files/show_fields/language' %>
         
     | 
| 
      
 11 
     | 
    
         
            +
                    <%= render :partial=>'generic_files/show_fields/resource_type' %>
         
     | 
| 
      
 12 
     | 
    
         
            +
                    <%= render :partial=>'generic_files/show_fields/publisher' %>
         
     | 
| 
      
 13 
     | 
    
         
            +
                    <%= render :partial=>'generic_files/show_fields/rights' %>
         
     | 
| 
      
 14 
     | 
    
         
            +
                    <%= render :partial=>'generic_files/show_fields/subject' %>
         
     | 
| 
      
 15 
     | 
    
         
            +
                    <%= render :partial=>'generic_files/show_fields/tag' %>
         
     | 
| 
      
 16 
     | 
    
         
            +
                    <%= render :partial=>'generic_files/show_fields/identifier' %>
         
     | 
| 
      
 17 
     | 
    
         
            +
                    <%= render :partial=>'generic_files/show_fields/date_created' %>
         
     | 
| 
       116 
18 
     | 
    
         
             
                  </tbody>
         
     | 
| 
       117 
19 
     | 
    
         
             
                </table> <!-- /verticalheadings -->
         
     | 
| 
       118 
20 
     | 
    
         | 
| 
         @@ -103,24 +103,24 @@ class CatalogController < ApplicationController 
     | 
|
| 
       103 
103 
     | 
    
         
             
                }
         
     | 
| 
       104 
104 
     | 
    
         | 
| 
       105 
105 
     | 
    
         
             
                # solr field configuration for search results/index views
         
     | 
| 
       106 
     | 
    
         
            -
                config.index.show_link = " 
     | 
| 
      
 106 
     | 
    
         
            +
                config.index.show_link = "desc_metadata__title_display"
         
     | 
| 
       107 
107 
     | 
    
         
             
                config.index.record_display_type = "id"
         
     | 
| 
       108 
108 
     | 
    
         | 
| 
       109 
109 
     | 
    
         
             
                # solr field configuration for document/show views
         
     | 
| 
       110 
     | 
    
         
            -
                config.show.html_title = " 
     | 
| 
       111 
     | 
    
         
            -
                config.show.heading = " 
     | 
| 
      
 110 
     | 
    
         
            +
                config.show.html_title = "desc_metadata__title_display"
         
     | 
| 
      
 111 
     | 
    
         
            +
                config.show.heading = "desc_metadata__title_display"
         
     | 
| 
       112 
112 
     | 
    
         
             
                config.show.display_type = "has_model_s"
         
     | 
| 
       113 
113 
     | 
    
         | 
| 
       114 
114 
     | 
    
         
             
                # solr fields that will be treated as facets by the blacklight application
         
     | 
| 
       115 
115 
     | 
    
         
             
                #   The ordering of the field names is the order of the display
         
     | 
| 
       116 
     | 
    
         
            -
                config.add_facet_field " 
     | 
| 
       117 
     | 
    
         
            -
                #config.add_facet_field " 
     | 
| 
       118 
     | 
    
         
            -
                config.add_facet_field " 
     | 
| 
       119 
     | 
    
         
            -
                config.add_facet_field " 
     | 
| 
       120 
     | 
    
         
            -
                config.add_facet_field " 
     | 
| 
       121 
     | 
    
         
            -
                config.add_facet_field " 
     | 
| 
       122 
     | 
    
         
            -
                config.add_facet_field " 
     | 
| 
       123 
     | 
    
         
            -
                config.add_facet_field " 
     | 
| 
      
 116 
     | 
    
         
            +
                config.add_facet_field "desc_metadata__resource_type_facet", :label => "Resource Type", :limit => 5
         
     | 
| 
      
 117 
     | 
    
         
            +
                #config.add_facet_field "desc_metadata__contributor_facet", :label => "Contributor", :limit => 5
         
     | 
| 
      
 118 
     | 
    
         
            +
                config.add_facet_field "desc_metadata__creator_facet", :label => "Creator", :limit => 5
         
     | 
| 
      
 119 
     | 
    
         
            +
                config.add_facet_field "desc_metadata__tag_facet", :label => "Keyword", :limit => 5
         
     | 
| 
      
 120 
     | 
    
         
            +
                config.add_facet_field "desc_metadata__subject_facet", :label => "Subject", :limit => 5
         
     | 
| 
      
 121 
     | 
    
         
            +
                config.add_facet_field "desc_metadata__language_facet", :label => "Language", :limit => 5
         
     | 
| 
      
 122 
     | 
    
         
            +
                config.add_facet_field "desc_metadata__based_near_facet", :label => "Location", :limit => 5
         
     | 
| 
      
 123 
     | 
    
         
            +
                config.add_facet_field "desc_metadata__publisher_facet", :label => "Publisher", :limit => 5
         
     | 
| 
       124 
124 
     | 
    
         
             
                config.add_facet_field "file_format_facet", :label => "File Format", :limit => 5
         
     | 
| 
       125 
125 
     | 
    
         | 
| 
       126 
126 
     | 
    
         
             
                # Have BL send all facet field names to Solr, which has been the default
         
     | 
| 
         @@ -130,41 +130,41 @@ class CatalogController < ApplicationController 
     | 
|
| 
       130 
130 
     | 
    
         | 
| 
       131 
131 
     | 
    
         
             
                # solr fields to be displayed in the index (search results) view
         
     | 
| 
       132 
132 
     | 
    
         
             
                #   The ordering of the field names is the order of the display
         
     | 
| 
       133 
     | 
    
         
            -
                config.add_index_field " 
     | 
| 
       134 
     | 
    
         
            -
                config.add_index_field " 
     | 
| 
       135 
     | 
    
         
            -
                config.add_index_field " 
     | 
| 
       136 
     | 
    
         
            -
                config.add_index_field " 
     | 
| 
       137 
     | 
    
         
            -
                config.add_index_field " 
     | 
| 
       138 
     | 
    
         
            -
                config.add_index_field " 
     | 
| 
       139 
     | 
    
         
            -
                config.add_index_field " 
     | 
| 
       140 
     | 
    
         
            -
                config.add_index_field " 
     | 
| 
       141 
     | 
    
         
            -
                config.add_index_field " 
     | 
| 
       142 
     | 
    
         
            -
                config.add_index_field " 
     | 
| 
       143 
     | 
    
         
            -
                config.add_index_field " 
     | 
| 
       144 
     | 
    
         
            -
                config.add_index_field " 
     | 
| 
       145 
     | 
    
         
            -
                config.add_index_field " 
     | 
| 
       146 
     | 
    
         
            -
                config.add_index_field " 
     | 
| 
       147 
     | 
    
         
            -
                config.add_index_field " 
     | 
| 
       148 
     | 
    
         
            -
                config.add_index_field " 
     | 
| 
      
 133 
     | 
    
         
            +
                config.add_index_field "desc_metadata__title_display", :label => "Title"
         
     | 
| 
      
 134 
     | 
    
         
            +
                config.add_index_field "desc_metadata__description_display", :label => "Description"
         
     | 
| 
      
 135 
     | 
    
         
            +
                config.add_index_field "desc_metadata__tag_display", :label => "Keyword"
         
     | 
| 
      
 136 
     | 
    
         
            +
                config.add_index_field "desc_metadata__subject_display", :label => "Subject"
         
     | 
| 
      
 137 
     | 
    
         
            +
                config.add_index_field "desc_metadata__creator_display", :label => "Creator"
         
     | 
| 
      
 138 
     | 
    
         
            +
                config.add_index_field "desc_metadata__contributor_display", :label => "Contributor"
         
     | 
| 
      
 139 
     | 
    
         
            +
                config.add_index_field "desc_metadata__publisher_display", :label => "Publisher"
         
     | 
| 
      
 140 
     | 
    
         
            +
                config.add_index_field "desc_metadata__based_near_display", :label => "Location"
         
     | 
| 
      
 141 
     | 
    
         
            +
                config.add_index_field "desc_metadata__language_display", :label => "Language"
         
     | 
| 
      
 142 
     | 
    
         
            +
                config.add_index_field "desc_metadata__date_uploaded_display", :label => "Date Uploaded"
         
     | 
| 
      
 143 
     | 
    
         
            +
                config.add_index_field "desc_metadata__date_modified_display", :label => "Date Modified"
         
     | 
| 
      
 144 
     | 
    
         
            +
                config.add_index_field "desc_metadata__date_created_display", :label => "Date Created"
         
     | 
| 
      
 145 
     | 
    
         
            +
                config.add_index_field "desc_metadata__rights_display", :label => "Rights"
         
     | 
| 
      
 146 
     | 
    
         
            +
                config.add_index_field "desc_metadata__resource_type_display", :label => "Resource Type"
         
     | 
| 
      
 147 
     | 
    
         
            +
                config.add_index_field "desc_metadata__format_display", :label => "File Format"
         
     | 
| 
      
 148 
     | 
    
         
            +
                config.add_index_field "desc_metadata__identifier_display", :label => "Identifier"
         
     | 
| 
       149 
149 
     | 
    
         | 
| 
       150 
150 
     | 
    
         
             
                # solr fields to be displayed in the show (single result) view
         
     | 
| 
       151 
151 
     | 
    
         
             
                #   The ordering of the field names is the order of the display
         
     | 
| 
       152 
     | 
    
         
            -
                config.add_show_field " 
     | 
| 
       153 
     | 
    
         
            -
                config.add_show_field " 
     | 
| 
       154 
     | 
    
         
            -
                config.add_show_field " 
     | 
| 
       155 
     | 
    
         
            -
                config.add_show_field " 
     | 
| 
       156 
     | 
    
         
            -
                config.add_show_field " 
     | 
| 
       157 
     | 
    
         
            -
                config.add_show_field " 
     | 
| 
       158 
     | 
    
         
            -
                config.add_show_field " 
     | 
| 
       159 
     | 
    
         
            -
                config.add_show_field " 
     | 
| 
       160 
     | 
    
         
            -
                config.add_show_field " 
     | 
| 
       161 
     | 
    
         
            -
                config.add_show_field " 
     | 
| 
       162 
     | 
    
         
            -
                config.add_show_field " 
     | 
| 
       163 
     | 
    
         
            -
                config.add_show_field " 
     | 
| 
       164 
     | 
    
         
            -
                config.add_show_field " 
     | 
| 
       165 
     | 
    
         
            -
                config.add_show_field " 
     | 
| 
       166 
     | 
    
         
            -
                config.add_show_field " 
     | 
| 
       167 
     | 
    
         
            -
                config.add_show_field " 
     | 
| 
      
 152 
     | 
    
         
            +
                config.add_show_field "desc_metadata__title_display", :label => "Title"
         
     | 
| 
      
 153 
     | 
    
         
            +
                config.add_show_field "desc_metadata__description_display", :label => "Description"
         
     | 
| 
      
 154 
     | 
    
         
            +
                config.add_show_field "desc_metadata__tag_display", :label => "Keyword"
         
     | 
| 
      
 155 
     | 
    
         
            +
                config.add_show_field "desc_metadata__subject_display", :label => "Subject"
         
     | 
| 
      
 156 
     | 
    
         
            +
                config.add_show_field "desc_metadata__creator_display", :label => "Creator"
         
     | 
| 
      
 157 
     | 
    
         
            +
                config.add_show_field "desc_metadata__contributor_display", :label => "Contributor"
         
     | 
| 
      
 158 
     | 
    
         
            +
                config.add_show_field "desc_metadata__publisher_display", :label => "Publisher"
         
     | 
| 
      
 159 
     | 
    
         
            +
                config.add_show_field "desc_metadata__based_near_display", :label => "Location"
         
     | 
| 
      
 160 
     | 
    
         
            +
                config.add_show_field "desc_metadata__language_display", :label => "Language"
         
     | 
| 
      
 161 
     | 
    
         
            +
                config.add_show_field "desc_metadata__date_uploaded_display", :label => "Date Uploaded"
         
     | 
| 
      
 162 
     | 
    
         
            +
                config.add_show_field "desc_metadata__date_modified_display", :label => "Date Modified"
         
     | 
| 
      
 163 
     | 
    
         
            +
                config.add_show_field "desc_metadata__date_created_display", :label => "Date Created"
         
     | 
| 
      
 164 
     | 
    
         
            +
                config.add_show_field "desc_metadata__rights_display", :label => "Rights"
         
     | 
| 
      
 165 
     | 
    
         
            +
                config.add_show_field "desc_metadata__resource_type_display", :label => "Resource Type"
         
     | 
| 
      
 166 
     | 
    
         
            +
                config.add_show_field "desc_metadata__file_format_display", :label => "File Format"
         
     | 
| 
      
 167 
     | 
    
         
            +
                config.add_show_field "desc_metadata__identifier_display", :label => "Identifier"
         
     | 
| 
       168 
168 
     | 
    
         | 
| 
       169 
169 
     | 
    
         
             
                # "fielded" search configuration. Used by pulldown among other places.
         
     | 
| 
       170 
170 
     | 
    
         
             
                # For supported keys in hash, see rdoc for Blacklight::SearchFields
         
     | 
| 
         @@ -200,16 +200,16 @@ class CatalogController < ApplicationController 
     | 
|
| 
       200 
200 
     | 
    
         
             
                  # Solr parameter de-referencing like $title_qf.
         
     | 
| 
       201 
201 
     | 
    
         
             
                  # See: http://wiki.apache.org/solr/LocalParams
         
     | 
| 
       202 
202 
     | 
    
         
             
                  field.solr_local_parameters = {
         
     | 
| 
       203 
     | 
    
         
            -
                    :qf => " 
     | 
| 
       204 
     | 
    
         
            -
                    :pf => " 
     | 
| 
      
 203 
     | 
    
         
            +
                    :qf => "desc_metadata__contributor_t",
         
     | 
| 
      
 204 
     | 
    
         
            +
                    :pf => "desc_metadata__contributor_t"
         
     | 
| 
       205 
205 
     | 
    
         
             
                  }
         
     | 
| 
       206 
206 
     | 
    
         
             
                end
         
     | 
| 
       207 
207 
     | 
    
         | 
| 
       208 
208 
     | 
    
         
             
                config.add_search_field('creator') do |field|
         
     | 
| 
       209 
209 
     | 
    
         
             
                  field.solr_parameters = { :"spellcheck.dictionary" => "creator" }
         
     | 
| 
       210 
210 
     | 
    
         
             
                  field.solr_local_parameters = {
         
     | 
| 
       211 
     | 
    
         
            -
                    :qf => " 
     | 
| 
       212 
     | 
    
         
            -
                    :pf => " 
     | 
| 
      
 211 
     | 
    
         
            +
                    :qf => "desc_metadata__creator_t",
         
     | 
| 
      
 212 
     | 
    
         
            +
                    :pf => "desc_metadata__creator_t"
         
     | 
| 
       213 
213 
     | 
    
         
             
                  }
         
     | 
| 
       214 
214 
     | 
    
         
             
                end
         
     | 
| 
       215 
215 
     | 
    
         | 
| 
         @@ -218,8 +218,8 @@ class CatalogController < ApplicationController 
     | 
|
| 
       218 
218 
     | 
    
         
             
                    :"spellcheck.dictionary" => "title"
         
     | 
| 
       219 
219 
     | 
    
         
             
                  }
         
     | 
| 
       220 
220 
     | 
    
         
             
                  field.solr_local_parameters = {
         
     | 
| 
       221 
     | 
    
         
            -
                    :qf => " 
     | 
| 
       222 
     | 
    
         
            -
                    :pf => " 
     | 
| 
      
 221 
     | 
    
         
            +
                    :qf => "desc_metadata__title_t",
         
     | 
| 
      
 222 
     | 
    
         
            +
                    :pf => "desc_metadata__title_t"
         
     | 
| 
       223 
223 
     | 
    
         
             
                  }
         
     | 
| 
       224 
224 
     | 
    
         
             
                end
         
     | 
| 
       225 
225 
     | 
    
         | 
| 
         @@ -229,8 +229,8 @@ class CatalogController < ApplicationController 
     | 
|
| 
       229 
229 
     | 
    
         
             
                    :"spellcheck.dictionary" => "description"
         
     | 
| 
       230 
230 
     | 
    
         
             
                  }
         
     | 
| 
       231 
231 
     | 
    
         
             
                  field.solr_local_parameters = {
         
     | 
| 
       232 
     | 
    
         
            -
                    :qf => " 
     | 
| 
       233 
     | 
    
         
            -
                    :pf => " 
     | 
| 
      
 232 
     | 
    
         
            +
                    :qf => "desc_metadata__description_t",
         
     | 
| 
      
 233 
     | 
    
         
            +
                    :pf => "desc_metadata__description_t"
         
     | 
| 
       234 
234 
     | 
    
         
             
                  }
         
     | 
| 
       235 
235 
     | 
    
         
             
                end
         
     | 
| 
       236 
236 
     | 
    
         | 
| 
         @@ -239,8 +239,8 @@ class CatalogController < ApplicationController 
     | 
|
| 
       239 
239 
     | 
    
         
             
                    :"spellcheck.dictionary" => "publisher"
         
     | 
| 
       240 
240 
     | 
    
         
             
                  }
         
     | 
| 
       241 
241 
     | 
    
         
             
                  field.solr_local_parameters = {
         
     | 
| 
       242 
     | 
    
         
            -
                    :qf => " 
     | 
| 
       243 
     | 
    
         
            -
                    :pf => " 
     | 
| 
      
 242 
     | 
    
         
            +
                    :qf => "desc_metadata__publisher_t",
         
     | 
| 
      
 243 
     | 
    
         
            +
                    :pf => "desc_metadata__publisher_t"
         
     | 
| 
       244 
244 
     | 
    
         
             
                  }
         
     | 
| 
       245 
245 
     | 
    
         
             
                end
         
     | 
| 
       246 
246 
     | 
    
         | 
| 
         @@ -249,8 +249,8 @@ class CatalogController < ApplicationController 
     | 
|
| 
       249 
249 
     | 
    
         
             
                    :"spellcheck.dictionary" => "date_created"
         
     | 
| 
       250 
250 
     | 
    
         
             
                  }
         
     | 
| 
       251 
251 
     | 
    
         
             
                  field.solr_local_parameters = {
         
     | 
| 
       252 
     | 
    
         
            -
                    :qf => " 
     | 
| 
       253 
     | 
    
         
            -
                    :pf => " 
     | 
| 
      
 252 
     | 
    
         
            +
                    :qf => "desc_metadata__date_created_t",
         
     | 
| 
      
 253 
     | 
    
         
            +
                    :pf => "desc_metadata__date_created_t"
         
     | 
| 
       254 
254 
     | 
    
         
             
                  }
         
     | 
| 
       255 
255 
     | 
    
         
             
                end
         
     | 
| 
       256 
256 
     | 
    
         | 
| 
         @@ -259,8 +259,8 @@ class CatalogController < ApplicationController 
     | 
|
| 
       259 
259 
     | 
    
         
             
                    :"spellcheck.dictionary" => "subject"
         
     | 
| 
       260 
260 
     | 
    
         
             
                  }
         
     | 
| 
       261 
261 
     | 
    
         
             
                  field.solr_local_parameters = {
         
     | 
| 
       262 
     | 
    
         
            -
                    :qf => " 
     | 
| 
       263 
     | 
    
         
            -
                    :pf => " 
     | 
| 
      
 262 
     | 
    
         
            +
                    :qf => "desc_metadata__subject_t",
         
     | 
| 
      
 263 
     | 
    
         
            +
                    :pf => "desc_metadata__subject_t"
         
     | 
| 
       264 
264 
     | 
    
         
             
                  }
         
     | 
| 
       265 
265 
     | 
    
         
             
                end
         
     | 
| 
       266 
266 
     | 
    
         | 
| 
         @@ -269,8 +269,8 @@ class CatalogController < ApplicationController 
     | 
|
| 
       269 
269 
     | 
    
         
             
                    :"spellcheck.dictionary" => "language"
         
     | 
| 
       270 
270 
     | 
    
         
             
                  }
         
     | 
| 
       271 
271 
     | 
    
         
             
                  field.solr_local_parameters = {
         
     | 
| 
       272 
     | 
    
         
            -
                    :qf => " 
     | 
| 
       273 
     | 
    
         
            -
                    :pf => " 
     | 
| 
      
 272 
     | 
    
         
            +
                    :qf => "desc_metadata__language_t",
         
     | 
| 
      
 273 
     | 
    
         
            +
                    :pf => "desc_metadata__language_t"
         
     | 
| 
       274 
274 
     | 
    
         
             
                  }
         
     | 
| 
       275 
275 
     | 
    
         
             
                end
         
     | 
| 
       276 
276 
     | 
    
         | 
| 
         @@ -279,8 +279,8 @@ class CatalogController < ApplicationController 
     | 
|
| 
       279 
279 
     | 
    
         
             
                    :"spellcheck.dictionary" => "resource_type"
         
     | 
| 
       280 
280 
     | 
    
         
             
                  }
         
     | 
| 
       281 
281 
     | 
    
         
             
                  field.solr_local_parameters = {
         
     | 
| 
       282 
     | 
    
         
            -
                    :qf => " 
     | 
| 
       283 
     | 
    
         
            -
                    :pf => " 
     | 
| 
      
 282 
     | 
    
         
            +
                    :qf => "desc_metadata__resource_type_t",
         
     | 
| 
      
 283 
     | 
    
         
            +
                    :pf => "desc_metadata__resource_type_t"
         
     | 
| 
       284 
284 
     | 
    
         
             
                  }
         
     | 
| 
       285 
285 
     | 
    
         
             
                end
         
     | 
| 
       286 
286 
     | 
    
         | 
| 
         @@ -312,8 +312,8 @@ class CatalogController < ApplicationController 
     | 
|
| 
       312 
312 
     | 
    
         
             
                    :"spellcheck.dictionary" => "based_near"
         
     | 
| 
       313 
313 
     | 
    
         
             
                  }
         
     | 
| 
       314 
314 
     | 
    
         
             
                  field.solr_local_parameters = {
         
     | 
| 
       315 
     | 
    
         
            -
                    :qf => " 
     | 
| 
       316 
     | 
    
         
            -
                    :pf => " 
     | 
| 
      
 315 
     | 
    
         
            +
                    :qf => "desc_metadata__based_near_t",
         
     | 
| 
      
 316 
     | 
    
         
            +
                    :pf => "desc_metadata__based_near_t"
         
     | 
| 
       317 
317 
     | 
    
         
             
                  }
         
     | 
| 
       318 
318 
     | 
    
         
             
                end
         
     | 
| 
       319 
319 
     | 
    
         | 
| 
         @@ -322,8 +322,8 @@ class CatalogController < ApplicationController 
     | 
|
| 
       322 
322 
     | 
    
         
             
                    :"spellcheck.dictionary" => "tag"
         
     | 
| 
       323 
323 
     | 
    
         
             
                  }
         
     | 
| 
       324 
324 
     | 
    
         
             
                  field.solr_local_parameters = {
         
     | 
| 
       325 
     | 
    
         
            -
                    :qf => " 
     | 
| 
       326 
     | 
    
         
            -
                    :pf => " 
     | 
| 
      
 325 
     | 
    
         
            +
                    :qf => "desc_metadata__tag_t",
         
     | 
| 
      
 326 
     | 
    
         
            +
                    :pf => "desc_metadata__tag_t"
         
     | 
| 
       327 
327 
     | 
    
         
             
                  }
         
     | 
| 
       328 
328 
     | 
    
         
             
                end
         
     | 
| 
       329 
329 
     | 
    
         | 
| 
         @@ -336,8 +336,8 @@ class CatalogController < ApplicationController 
     | 
|
| 
       336 
336 
     | 
    
         | 
| 
       337 
337 
     | 
    
         
             
                config.add_search_field('rights') do |field|
         
     | 
| 
       338 
338 
     | 
    
         
             
                  field.solr_local_parameters = {
         
     | 
| 
       339 
     | 
    
         
            -
                    :qf => " 
     | 
| 
       340 
     | 
    
         
            -
                    :pf => " 
     | 
| 
      
 339 
     | 
    
         
            +
                    :qf => "desc_metadata__rights_t",
         
     | 
| 
      
 340 
     | 
    
         
            +
                    :pf => "desc_metadata__rights_t"
         
     | 
| 
       341 
341 
     | 
    
         
             
                  }
         
     | 
| 
       342 
342 
     | 
    
         
             
                end
         
     | 
| 
       343 
343 
     | 
    
         | 
| 
         @@ -346,11 +346,11 @@ class CatalogController < ApplicationController 
     | 
|
| 
       346 
346 
     | 
    
         
             
                # whether the sort is ascending or descending (it must be asc or desc
         
     | 
| 
       347 
347 
     | 
    
         
             
                # except in the relevancy case).
         
     | 
| 
       348 
348 
     | 
    
         
             
                # label is key, solr field is value
         
     | 
| 
       349 
     | 
    
         
            -
                config.add_sort_field 'score desc,  
     | 
| 
       350 
     | 
    
         
            -
                config.add_sort_field ' 
     | 
| 
       351 
     | 
    
         
            -
                config.add_sort_field ' 
     | 
| 
       352 
     | 
    
         
            -
                config.add_sort_field ' 
     | 
| 
       353 
     | 
    
         
            -
                config.add_sort_field ' 
     | 
| 
      
 349 
     | 
    
         
            +
                config.add_sort_field 'score desc, desc_metadata__date_uploaded_dt desc', :label => "relevance \u25BC"
         
     | 
| 
      
 350 
     | 
    
         
            +
                config.add_sort_field 'desc_metadata__date_uploaded_dt desc', :label => "date uploaded \u25BC"
         
     | 
| 
      
 351 
     | 
    
         
            +
                config.add_sort_field 'desc_metadata__date_uploaded_dt asc', :label => "date uploaded \u25B2"
         
     | 
| 
      
 352 
     | 
    
         
            +
                config.add_sort_field 'desc_metadata__date_modified_dt desc', :label => "date modified \u25BC"
         
     | 
| 
      
 353 
     | 
    
         
            +
                config.add_sort_field 'desc_metadata__date_modified_dt asc', :label => "date modified \u25B2"
         
     | 
| 
       354 
354 
     | 
    
         | 
| 
       355 
355 
     | 
    
         
             
                # If there are more than this many search results, no spelling ("did you
         
     | 
| 
       356 
356 
     | 
    
         
             
                # mean") suggestion is offered.
         
     | 
| 
         @@ -157,10 +157,9 @@ module Sufia 
     | 
|
| 
       157 
157 
     | 
    
         
             
                    version_event = true
         
     | 
| 
       158 
158 
     | 
    
         
             
                    Sufia.queue.push(ContentNewVersionEventJob.new(@generic_file.pid, current_user.user_key))
         
     | 
| 
       159 
159 
     | 
    
         
             
                  end
         
     | 
| 
       160 
     | 
    
         
            -
             
     | 
| 
       161 
     | 
    
         
            -
                   
     | 
| 
       162 
     | 
    
         
            -
             
     | 
| 
       163 
     | 
    
         
            -
                  @generic_file.save!
         
     | 
| 
      
 160 
     | 
    
         
            +
             
     | 
| 
      
 161 
     | 
    
         
            +
                  update_metadata
         
     | 
| 
      
 162 
     | 
    
         
            +
             
     | 
| 
       164 
163 
     | 
    
         
             
                  # do not trigger an update event if a version event has already been triggered
         
     | 
| 
       165 
164 
     | 
    
         
             
                  Sufia.queue.push(ContentUpdateEventJob.new(@generic_file.pid, current_user.user_key)) unless version_event
         
     | 
| 
       166 
165 
     | 
    
         
             
                  record_version_committer(@generic_file, current_user)
         
     | 
| 
         @@ -169,6 +168,16 @@ module Sufia 
     | 
|
| 
       169 
168 
     | 
    
         
             
                end
         
     | 
| 
       170 
169 
     | 
    
         | 
| 
       171 
170 
     | 
    
         
             
                protected
         
     | 
| 
      
 171 
     | 
    
         
            +
             
     | 
| 
      
 172 
     | 
    
         
            +
                # this is provided so that implementing application can override this behavior and map params to different attributes
         
     | 
| 
      
 173 
     | 
    
         
            +
                def update_metadata
         
     | 
| 
      
 174 
     | 
    
         
            +
                  valid_attributes = params[:generic_file].select { |k,v| (@generic_file.terms_for_editing + [:permissions]).include? k.to_sym}
         
     | 
| 
      
 175 
     | 
    
         
            +
                  @generic_file.attributes = valid_attributes
         
     | 
| 
      
 176 
     | 
    
         
            +
                  @generic_file.set_visibility(params[:visibility])
         
     | 
| 
      
 177 
     | 
    
         
            +
                  @generic_file.date_modified = DateTime.now
         
     | 
| 
      
 178 
     | 
    
         
            +
                  @generic_file.save!
         
     | 
| 
      
 179 
     | 
    
         
            +
                end
         
     | 
| 
      
 180 
     | 
    
         
            +
             
     | 
| 
       172 
181 
     | 
    
         
             
                def record_version_committer(generic_file, user)
         
     | 
| 
       173 
182 
     | 
    
         
             
                  version = generic_file.content.latest_version
         
     | 
| 
       174 
183 
     | 
    
         
             
                  # content datastream not (yet?) present
         
     | 
    
        data/lib/sufia/version.rb
    CHANGED
    
    
| 
         @@ -49,12 +49,12 @@ describe CatalogController do 
     | 
|
| 
       49 
49 
     | 
    
         
             
                    assigns(:document_list).map(&:id) == [@gf1.id]
         
     | 
| 
       50 
50 
     | 
    
         | 
| 
       51 
51 
     | 
    
         
             
                    assigns(:document_list).count.should eql(1)
         
     | 
| 
       52 
     | 
    
         
            -
                    assigns(:document_list)[0].fetch(: 
     | 
| 
      
 52 
     | 
    
         
            +
                    assigns(:document_list)[0].fetch(:desc_metadata__title_t)[0].should eql('Test Document PDF')
         
     | 
| 
       53 
53 
     | 
    
         
             
                  end
         
     | 
| 
       54 
54 
     | 
    
         
             
                end
         
     | 
| 
       55 
55 
     | 
    
         
             
                describe "facet search" do
         
     | 
| 
       56 
56 
     | 
    
         
             
                  before do
         
     | 
| 
       57 
     | 
    
         
            -
                    xhr :get, :index, :q=>"{f= 
     | 
| 
      
 57 
     | 
    
         
            +
                    xhr :get, :index, :q=>"{f=desc_metadata__contributor_facet}Contrib1"
         
     | 
| 
       58 
58 
     | 
    
         
             
                  end
         
     | 
| 
       59 
59 
     | 
    
         
             
                  it "should find facet files" do
         
     | 
| 
       60 
60 
     | 
    
         
             
                    response.should be_success
         
     | 
| 
         @@ -96,17 +96,17 @@ describe CatalogController do 
     | 
|
| 
       96 
96 
     | 
    
         
             
                  response.should render_template('catalog/recent')
         
     | 
| 
       97 
97 
     | 
    
         
             
                  assigns(:recent_documents).count.should eql(4)
         
     | 
| 
       98 
98 
     | 
    
         
             
                  # the order is reversed since the first in should be the last out in descending time order
         
     | 
| 
       99 
     | 
    
         
            -
                  #assigns(:recent_documents).each {|doc| logger.info doc.fetch(: 
     | 
| 
      
 99 
     | 
    
         
            +
                  #assigns(:recent_documents).each {|doc| logger.info doc.fetch(:desc_metadata__title_t)[0]}
         
     | 
| 
       100 
100 
     | 
    
         
             
                  lgf4 = assigns(:recent_documents)[0]
         
     | 
| 
       101 
101 
     | 
    
         
             
                  lgf3 = assigns(:recent_documents)[1]
         
     | 
| 
       102 
102 
     | 
    
         
             
                  lgf2 = assigns(:recent_documents)[2]
         
     | 
| 
       103 
103 
     | 
    
         
             
                  lgf1 = assigns(:recent_documents)[3]
         
     | 
| 
       104 
     | 
    
         
            -
                  lgf4.fetch(: 
     | 
| 
       105 
     | 
    
         
            -
                  lgf4.fetch(: 
     | 
| 
       106 
     | 
    
         
            -
                  lgf4.fetch(: 
     | 
| 
       107 
     | 
    
         
            -
                  lgf1.fetch(: 
     | 
| 
       108 
     | 
    
         
            -
                  lgf1.fetch(: 
     | 
| 
       109 
     | 
    
         
            -
                  lgf1.fetch(: 
     | 
| 
      
 104 
     | 
    
         
            +
                  lgf4.fetch(:desc_metadata__title_t)[0].should eql(@gf4.title[0])
         
     | 
| 
      
 105 
     | 
    
         
            +
                  lgf4.fetch(:desc_metadata__contributor_t)[0].should eql(@gf4.contributor[0])
         
     | 
| 
      
 106 
     | 
    
         
            +
                  lgf4.fetch(:desc_metadata__resource_type_t)[0].should eql(@gf4.resource_type[0])
         
     | 
| 
      
 107 
     | 
    
         
            +
                  lgf1.fetch(:desc_metadata__title_t)[0].should eql(@gf1.title[0])
         
     | 
| 
      
 108 
     | 
    
         
            +
                  lgf1.fetch(:desc_metadata__contributor_t)[0].should eql(@gf1.contributor[0])
         
     | 
| 
      
 109 
     | 
    
         
            +
                  lgf1.fetch(:desc_metadata__resource_type_t)[0].should eql(@gf1.resource_type[0])
         
     | 
| 
       110 
110 
     | 
    
         
             
                end
         
     | 
| 
       111 
111 
     | 
    
         
             
              end
         
     | 
| 
       112 
112 
     | 
    
         
             
            end
         
     | 
| 
         @@ -211,23 +211,23 @@ describe GenericFile do 
     | 
|
| 
       211 
211 
     | 
    
         
             
                @file.format_label = "JPEG Image"
         
     | 
| 
       212 
212 
     | 
    
         
             
                local = @file.to_solr
         
     | 
| 
       213 
213 
     | 
    
         
             
                local.should_not be_nil
         
     | 
| 
       214 
     | 
    
         
            -
                local[" 
     | 
| 
       215 
     | 
    
         
            -
                local[" 
     | 
| 
       216 
     | 
    
         
            -
                local[" 
     | 
| 
       217 
     | 
    
         
            -
                local[" 
     | 
| 
       218 
     | 
    
         
            -
                local[" 
     | 
| 
       219 
     | 
    
         
            -
                local[" 
     | 
| 
       220 
     | 
    
         
            -
                local[" 
     | 
| 
       221 
     | 
    
         
            -
                local[" 
     | 
| 
       222 
     | 
    
         
            -
                local[" 
     | 
| 
       223 
     | 
    
         
            -
                local[" 
     | 
| 
       224 
     | 
    
         
            -
                local[" 
     | 
| 
       225 
     | 
    
         
            -
                local[" 
     | 
| 
       226 
     | 
    
         
            -
                local[" 
     | 
| 
       227 
     | 
    
         
            -
                local[" 
     | 
| 
      
 214 
     | 
    
         
            +
                local["desc_metadata__part_of_t"].should be_nil
         
     | 
| 
      
 215 
     | 
    
         
            +
                local["desc_metadata__date_uploaded_t"].should be_nil
         
     | 
| 
      
 216 
     | 
    
         
            +
                local["desc_metadata__date_modified_t"].should be_nil
         
     | 
| 
      
 217 
     | 
    
         
            +
                local["desc_metadata__rights_t"].should == ["Wide open, buddy."]
         
     | 
| 
      
 218 
     | 
    
         
            +
                local["desc_metadata__related_url_t"].should be_nil
         
     | 
| 
      
 219 
     | 
    
         
            +
                local["desc_metadata__contributor_t"].should == ["Mohammad"]
         
     | 
| 
      
 220 
     | 
    
         
            +
                local["desc_metadata__creator_t"].should == ["Allah"]
         
     | 
| 
      
 221 
     | 
    
         
            +
                local["desc_metadata__title_t"].should == ["The Work"]
         
     | 
| 
      
 222 
     | 
    
         
            +
                local["desc_metadata__description_t"].should == ["The work by Allah"]
         
     | 
| 
      
 223 
     | 
    
         
            +
                local["desc_metadata__publisher_t"].should == ["Vertigo Comics"]
         
     | 
| 
      
 224 
     | 
    
         
            +
                local["desc_metadata__subject_t"].should == ["Theology"]
         
     | 
| 
      
 225 
     | 
    
         
            +
                local["desc_metadata__language_t"].should == ["Arabic"]
         
     | 
| 
      
 226 
     | 
    
         
            +
                local["desc_metadata__date_created_t"].should == ["1200-01-01"]
         
     | 
| 
      
 227 
     | 
    
         
            +
                local["desc_metadata__resource_type_t"].should == ["Book"]
         
     | 
| 
       228 
228 
     | 
    
         
             
                local["file_format_t"].should == "jpeg (JPEG Image)"
         
     | 
| 
       229 
     | 
    
         
            -
                local[" 
     | 
| 
       230 
     | 
    
         
            -
                local[" 
     | 
| 
      
 229 
     | 
    
         
            +
                local["desc_metadata__identifier_t"].should == ["urn:isbn:1234567890"]
         
     | 
| 
      
 230 
     | 
    
         
            +
                local["desc_metadata__based_near_t"].should == ["Medina, Saudi Arabia"]
         
     | 
| 
       231 
231 
     | 
    
         
             
                local["mime_type_t"].should == ["image/jpeg"]    
         
     | 
| 
       232 
232 
     | 
    
         
             
                local["noid_s"].should == "__DO_NOT_USE__"
         
     | 
| 
       233 
233 
     | 
    
         
             
              end
         
     | 
    
        data/spec/routing/route_spec.rb
    CHANGED
    
    | 
         @@ -215,7 +215,7 @@ describe 'Routes' do 
     | 
|
| 
       215 
215 
     | 
    
         | 
| 
       216 
216 
     | 
    
         
             
              describe "Catch-all" do
         
     | 
| 
       217 
217 
     | 
    
         
             
                it "should route non-existent routes to errors" do
         
     | 
| 
       218 
     | 
    
         
            -
             
     | 
| 
      
 218 
     | 
    
         
            +
                  { get: '/awesome' }.should route_to(controller: 'errors', action: 'routing', error: 'awesome')
         
     | 
| 
       219 
219 
     | 
    
         
             
                end
         
     | 
| 
       220 
220 
     | 
    
         
             
              end
         
     | 
| 
       221 
221 
     | 
    
         
             
            end
         
     | 
    
        data/sufia.gemspec
    CHANGED
    
    | 
         @@ -4,8 +4,8 @@ require File.expand_path('../lib/sufia/version', __FILE__) 
     | 
|
| 
       4 
4 
     | 
    
         
             
            Gem::Specification.new do |gem|
         
     | 
| 
       5 
5 
     | 
    
         
             
              gem.authors       = ["Justin Coyne"]
         
     | 
| 
       6 
6 
     | 
    
         
             
              gem.email         = ["justin.coyne@yourmediashelf.com"]
         
     | 
| 
       7 
     | 
    
         
            -
              gem.description   = %q{ 
     | 
| 
       8 
     | 
    
         
            -
              gem.summary       = %q{ 
     | 
| 
      
 7 
     | 
    
         
            +
              gem.description   = %q{Sufia is a Rails engine for creating a self-deposit institutional repository}
         
     | 
| 
      
 8 
     | 
    
         
            +
              gem.summary       = %q{Sufia was extracted from ScholarSphere developed by Penn State University}
         
     | 
| 
       9 
9 
     | 
    
         
             
              gem.homepage      = ""
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
              gem.files         = `git ls-files`.split($\)
         
     | 
| 
         @@ -19,7 +19,7 @@ Gem::Specification.new do |gem| 
     | 
|
| 
       19 
19 
     | 
    
         
             
              gem.add_dependency 'blacklight', '~> 4.0.0'
         
     | 
| 
       20 
20 
     | 
    
         
             
              gem.add_dependency 'blacklight_advanced_search'
         
     | 
| 
       21 
21 
     | 
    
         
             
              gem.add_dependency "hydra-head", "~> 5.2"
         
     | 
| 
       22 
     | 
    
         
            -
              gem.add_dependency "active-fedora", "~> 5.5.0. 
     | 
| 
      
 22 
     | 
    
         
            +
              gem.add_dependency "active-fedora", "~> 5.5.0.rc2"
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
              gem.add_dependency 'noid', '0.5.5'
         
     | 
| 
       25 
25 
     | 
    
         
             
              gem.add_dependency 'hydra-batch-edit', '~> 0.1.0'
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: sufia
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.7
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2013-01- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2013-01-18 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: rails
         
     | 
| 
         @@ -82,7 +82,7 @@ dependencies: 
     | 
|
| 
       82 
82 
     | 
    
         
             
                requirements:
         
     | 
| 
       83 
83 
     | 
    
         
             
                - - ~>
         
     | 
| 
       84 
84 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       85 
     | 
    
         
            -
                    version: 5.5.0. 
     | 
| 
      
 85 
     | 
    
         
            +
                    version: 5.5.0.rc2
         
     | 
| 
       86 
86 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       87 
87 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       88 
88 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -90,7 +90,7 @@ dependencies: 
     | 
|
| 
       90 
90 
     | 
    
         
             
                requirements:
         
     | 
| 
       91 
91 
     | 
    
         
             
                - - ~>
         
     | 
| 
       92 
92 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       93 
     | 
    
         
            -
                    version: 5.5.0. 
     | 
| 
      
 93 
     | 
    
         
            +
                    version: 5.5.0.rc2
         
     | 
| 
       94 
94 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       95 
95 
     | 
    
         
             
              name: noid
         
     | 
| 
       96 
96 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -427,7 +427,7 @@ dependencies: 
     | 
|
| 
       427 
427 
     | 
    
         
             
                - - ~>
         
     | 
| 
       428 
428 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       429 
429 
     | 
    
         
             
                    version: '2.0'
         
     | 
| 
       430 
     | 
    
         
            -
            description:  
     | 
| 
      
 430 
     | 
    
         
            +
            description: Sufia is a Rails engine for creating a self-deposit institutional repository
         
     | 
| 
       431 
431 
     | 
    
         
             
            email:
         
     | 
| 
       432 
432 
     | 
    
         
             
            - justin.coyne@yourmediashelf.com
         
     | 
| 
       433 
433 
     | 
    
         
             
            executables:
         
     | 
| 
         @@ -690,6 +690,20 @@ files: 
     | 
|
| 
       690 
690 
     | 
    
         
             
            - app/views/generic_files/edit_fields/_type.html.erb
         
     | 
| 
       691 
691 
     | 
    
         
             
            - app/views/generic_files/new.html.erb
         
     | 
| 
       692 
692 
     | 
    
         
             
            - app/views/generic_files/show.html.erb
         
     | 
| 
      
 693 
     | 
    
         
            +
            - app/views/generic_files/show_fields/_based_near.html.erb
         
     | 
| 
      
 694 
     | 
    
         
            +
            - app/views/generic_files/show_fields/_contributor.html.erb
         
     | 
| 
      
 695 
     | 
    
         
            +
            - app/views/generic_files/show_fields/_creator.html.erb
         
     | 
| 
      
 696 
     | 
    
         
            +
            - app/views/generic_files/show_fields/_date_created.html.erb
         
     | 
| 
      
 697 
     | 
    
         
            +
            - app/views/generic_files/show_fields/_description.html.erb
         
     | 
| 
      
 698 
     | 
    
         
            +
            - app/views/generic_files/show_fields/_identifier.html.erb
         
     | 
| 
      
 699 
     | 
    
         
            +
            - app/views/generic_files/show_fields/_language.html.erb
         
     | 
| 
      
 700 
     | 
    
         
            +
            - app/views/generic_files/show_fields/_publisher.html.erb
         
     | 
| 
      
 701 
     | 
    
         
            +
            - app/views/generic_files/show_fields/_related_url.html.erb
         
     | 
| 
      
 702 
     | 
    
         
            +
            - app/views/generic_files/show_fields/_resource_type.html.erb
         
     | 
| 
      
 703 
     | 
    
         
            +
            - app/views/generic_files/show_fields/_rights.html.erb
         
     | 
| 
      
 704 
     | 
    
         
            +
            - app/views/generic_files/show_fields/_subject.html.erb
         
     | 
| 
      
 705 
     | 
    
         
            +
            - app/views/generic_files/show_fields/_tag.html.erb
         
     | 
| 
      
 706 
     | 
    
         
            +
            - app/views/generic_files/show_fields/_title.html.erb
         
     | 
| 
       693 
707 
     | 
    
         
             
            - app/views/kaminari/blacklight/_first_page.html.erb
         
     | 
| 
       694 
708 
     | 
    
         
             
            - app/views/kaminari/blacklight/_gap.html.erb
         
     | 
| 
       695 
709 
     | 
    
         
             
            - app/views/kaminari/blacklight/_last_page.html.erb
         
     | 
| 
         @@ -963,7 +977,7 @@ rubyforge_project: 
     | 
|
| 
       963 
977 
     | 
    
         
             
            rubygems_version: 1.8.24
         
     | 
| 
       964 
978 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       965 
979 
     | 
    
         
             
            specification_version: 3
         
     | 
| 
       966 
     | 
    
         
            -
            summary:  
     | 
| 
      
 980 
     | 
    
         
            +
            summary: Sufia was extracted from ScholarSphere developed by Penn State University
         
     | 
| 
       967 
981 
     | 
    
         
             
            test_files:
         
     | 
| 
       968 
982 
     | 
    
         
             
            - features/browse_dashboard_files.feature
         
     | 
| 
       969 
983 
     | 
    
         
             
            - features/browse_files.feature
         
     |