Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

902 lines (594 sloc) 38.496 kb
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="Content-Type" content="text/html; charset=utf-8" />
<title>Module: HydraHelper</title>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
relpath = '';
if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
</head>
<body>
<script type="text/javascript" charset="utf-8">
if (window.top.frames.main) document.body.className = 'frames';
</script>
<div id="header">
<div id="menu">
<a href="_index.html">Index (H)</a> &raquo;
<span class="title">HydraHelper</span>
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>
<div id="search">
<a id="class_list_link" href="#">Class List</a>
<a id="method_list_link" href="#">Method List</a>
<a id ="file_list_link" href="#">File List</a>
</div>
<div class="clear"></div>
</div>
<iframe id="search_frame"></iframe>
<div id="content"><h1>Module: HydraHelper
</h1>
<dl class="box">
<dt class="r1">Included in:</dt>
<dd class="r1"><span class='object_link'><a href="ApplicationHelper.html" title="ApplicationHelper (module)">ApplicationHelper</a></span></dd>
<dt class="r2 last">Defined in:</dt>
<dd class="r2 last">vendor/plugins/hydra_repository/app/models/hydra_helper.rb</dd>
</dl>
<div class="clear"></div>
<h2>
Instance Method Summary
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#async_load_tag-instance_method" title="#async_load_tag (instance method)">- (Object) <strong>async_load_tag</strong>(url, tag) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#document_fedora_show_html_title-instance_method" title="#document_fedora_show_html_title (instance method)">- (Object) <strong>document_fedora_show_html_title</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#edit_and_browse_links-instance_method" title="#edit_and_browse_links (instance method)">- (Object) <strong>edit_and_browse_links</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#facet_value_hits-instance_method" title="#facet_value_hits (instance method)">- (Object) <strong>facet_value_hits</strong>(solr_result, solr_fname, facet_value, default_response = &quot;1&quot;) </a>
</span>
<span class="summary_desc"><div class='inline'><p>
Returns the hits for facet_value within facet solr_fname within the
solr_result.
</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#get_html_data_with_label-instance_method" title="#get_html_data_with_label (instance method)">- (Object) <strong>get_html_data_with_label</strong>(doc, label, field_string, opts = {}) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#get_textile_data_with_label-instance_method" title="#get_textile_data_with_label (instance method)">- (Object) <strong>get_textile_data_with_label</strong>(doc, label, field_string, opts = {}) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#grouped_result_count-instance_method" title="#grouped_result_count (instance method)">- (Object) <strong>grouped_result_count</strong>(response, facet_name = nil, facet_value = nil) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#grouping_facet-instance_method" title="#grouping_facet (instance method)">- (Object) <strong>grouping_facet</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#javascript_includes-instance_method" title="#javascript_includes (instance method)">- (Object) <strong>javascript_includes</strong> </a>
</span>
<span class="summary_desc"><div class='inline'><p>
collection of javascript includes to be rendered in the <head>.
</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#link_to_multifacet-instance_method" title="#link_to_multifacet (instance method)">- (Object) <strong>link_to_multifacet</strong>(name, args = {}) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#stylesheet_links-instance_method" title="#stylesheet_links (instance method)">- (Object) <strong>stylesheet_links</strong> </a>
</span>
<span class="summary_desc"><div class='inline'><p>
collection of stylesheet links to be rendered in the <head>.
</p>
</div></span>
</li>
</ul>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<p class="signature first" id="async_load_tag-instance_method">
- (<tt>Object</tt>) <strong>async_load_tag</strong>(url, tag)
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
13
14
15
16
17
18</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/hydra_repository/app/models/hydra_helper.rb', line 13</span>
<span class='def def kw'>def</span> <span class='async_load_tag identifier id'>async_load_tag</span><span class='lparen token'>(</span> <span class='url identifier id'>url</span><span class='comma token'>,</span> <span class='tag identifier id'>tag</span> <span class='rparen token'>)</span>
<span class='javascript_tag identifier id'>javascript_tag</span> <span class='do do kw'>do</span>
<span class='dstring node'>&quot;window._token='#{form_authenticity_token}'&quot;</span>
<span class='dstring node'>&quot;async_load('#{url}', '\##{tag}');&quot;</span>
<span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="document_fedora_show_html_title-instance_method">
- (<tt>Object</tt>) <strong>document_fedora_show_html_title</strong>
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
78
79
80</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/hydra_repository/app/models/hydra_helper.rb', line 78</span>
<span class='def def kw'>def</span> <span class='document_fedora_show_html_title identifier id'>document_fedora_show_html_title</span>
<span class='@document ivar id'>@document</span><span class='dot token'>.</span><span class='datastreams identifier id'>datastreams</span><span class='lbrack token'>[</span><span class='string val'>&quot;descMetadata&quot;</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='title_values identifier id'>title_values</span><span class='dot token'>.</span><span class='first identifier id'>first</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="edit_and_browse_links-instance_method">
- (<tt>Object</tt>) <strong>edit_and_browse_links</strong>
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
37
38
39
40
41
42
43
44
45
46
47
48
49</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/hydra_repository/app/models/hydra_helper.rb', line 37</span>
<span class='def def kw'>def</span> <span class='edit_and_browse_links identifier id'>edit_and_browse_links</span>
<span class='result identifier id'>result</span> <span class='assign token'>=</span> <span class='string val'>&quot;&quot;</span>
<span class='if if kw'>if</span> <span class='params identifier id'>params</span><span class='lbrack token'>[</span><span class='symbol val'>:action</span><span class='rbrack token'>]</span> <span class='eq op'>==</span> <span class='string val'>&quot;edit&quot;</span>
<span class='result identifier id'>result</span> <span class='lshft op'>&lt;&lt;</span> <span class='dstring node'>&quot;&lt;a href=\&quot;#{catalog_path(@document[:id], :viewing_context=&gt;&quot;browse&quot;)}\&quot; class=\&quot;browse toggle\&quot;&gt;Browse&lt;/a&gt;&quot;</span>
<span class='result identifier id'>result</span> <span class='lshft op'>&lt;&lt;</span> <span class='string val'>&quot;&lt;span class=\&quot;edit toggle active\&quot;&gt;Edit&lt;/span&gt;&quot;</span>
<span class='else else kw'>else</span>
<span class='result identifier id'>result</span> <span class='lshft op'>&lt;&lt;</span> <span class='string val'>&quot;&lt;span class=\&quot;browse toggle active\&quot;&gt;Browse&lt;/span&gt;&quot;</span>
<span class='result identifier id'>result</span> <span class='lshft op'>&lt;&lt;</span> <span class='dstring node'>&quot;&lt;a href=\&quot;#{edit_catalog_path(@document[:id])}\&quot; class=\&quot;edit toggle\&quot;&gt;Edit&lt;/a&gt;&quot;</span>
<span class='end end kw'>end</span>
<span class='comment val'># result &lt;&lt; link_to &quot;Browse&quot;, &quot;#&quot;, :class=&gt;&quot;browse&quot;</span>
<span class='comment val'># result &lt;&lt; link_to &quot;Edit&quot;, edit_document_path(@document[:id]), :class=&gt;&quot;edit&quot;</span>
<span class='return return kw'>return</span> <span class='result identifier id'>result</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="facet_value_hits-instance_method">
- (<tt>Object</tt>) <strong>facet_value_hits</strong>(solr_result, solr_fname, facet_value, default_response = &quot;1&quot;)
</p><div class="docstring">
<div class="discussion">
<p>
Returns the hits for facet_value within facet solr_fname within the
solr_result.
</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
83
84
85
86
87
88
89
90</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/hydra_repository/app/models/hydra_helper.rb', line 83</span>
<span class='def def kw'>def</span> <span class='facet_value_hits identifier id'>facet_value_hits</span><span class='lparen token'>(</span><span class='solr_result identifier id'>solr_result</span><span class='comma token'>,</span> <span class='solr_fname identifier id'>solr_fname</span><span class='comma token'>,</span> <span class='facet_value identifier id'>facet_value</span><span class='comma token'>,</span> <span class='default_response identifier id'>default_response</span><span class='assign token'>=</span><span class='string val'>&quot;1&quot;</span><span class='rparen token'>)</span>
<span class='item identifier id'>item</span> <span class='assign token'>=</span> <span class='solr_result identifier id'>solr_result</span><span class='dot token'>.</span><span class='facets identifier id'>facets</span><span class='dot token'>.</span><span class='detect identifier id'>detect</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='f identifier id'>f</span><span class='bitor op'>|</span> <span class='f identifier id'>f</span><span class='dot token'>.</span><span class='name identifier id'>name</span> <span class='eq op'>==</span> <span class='solr_fname identifier id'>solr_fname</span><span class='rbrace token'>}</span><span class='dot token'>.</span><span class='items identifier id'>items</span><span class='dot token'>.</span><span class='detect identifier id'>detect</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='i identifier id'>i</span><span class='bitor op'>|</span> <span class='i identifier id'>i</span><span class='dot token'>.</span><span class='value identifier id'>value</span> <span class='eq op'>==</span> <span class='facet_value identifier id'>facet_value</span><span class='rbrace token'>}</span>
<span class='if if kw'>if</span> <span class='item identifier id'>item</span>
<span class='return return kw'>return</span> <span class='item identifier id'>item</span><span class='dot token'>.</span><span class='hits identifier id'>hits</span>
<span class='else else kw'>else</span>
<span class='return return kw'>return</span> <span class='default_response identifier id'>default_response</span>
<span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="get_html_data_with_label-instance_method">
- (<tt>Object</tt>) <strong>get_html_data_with_label</strong>(doc, label, field_string, opts = {})
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/hydra_repository/app/models/hydra_helper.rb', line 92</span>
<span class='def def kw'>def</span> <span class='get_html_data_with_label identifier id'>get_html_data_with_label</span><span class='lparen token'>(</span><span class='doc identifier id'>doc</span><span class='comma token'>,</span> <span class='label identifier id'>label</span><span class='comma token'>,</span> <span class='field_string identifier id'>field_string</span><span class='comma token'>,</span> <span class='opts identifier id'>opts</span><span class='assign token'>=</span><span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='rparen token'>)</span>
<span class='if if kw'>if</span> <span class='opts identifier id'>opts</span><span class='lbrack token'>[</span><span class='symbol val'>:default</span><span class='rbrack token'>]</span> <span class='andop op'>&amp;&amp;</span> <span class='notop op'>!</span><span class='doc identifier id'>doc</span><span class='lbrack token'>[</span><span class='field_string identifier id'>field_string</span><span class='rbrack token'>]</span>
<span class='doc identifier id'>doc</span><span class='lbrack token'>[</span><span class='field_string identifier id'>field_string</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='opts identifier id'>opts</span><span class='lbrack token'>[</span><span class='symbol val'>:default</span><span class='rbrack token'>]</span>
<span class='end end kw'>end</span>
<span class='if if kw'>if</span> <span class='doc identifier id'>doc</span><span class='lbrack token'>[</span><span class='field_string identifier id'>field_string</span><span class='rbrack token'>]</span>
<span class='field identifier id'>field</span> <span class='assign token'>=</span> <span class='doc identifier id'>doc</span><span class='lbrack token'>[</span><span class='field_string identifier id'>field_string</span><span class='rbrack token'>]</span>
<span class='text identifier id'>text</span> <span class='assign token'>=</span> <span class='dstring node'>&quot;&lt;dt&gt;#{label}&lt;/dt&gt;&lt;dd&gt;&quot;</span>
<span class='if if kw'>if</span> <span class='field identifier id'>field</span><span class='dot token'>.</span><span class='is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='Array constant id'>Array</span><span class='rparen token'>)</span>
<span class='field identifier id'>field</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='l identifier id'>l</span><span class='bitor op'>|</span>
<span class='text identifier id'>text</span> <span class='opasgn op'>+=</span> <span class='dstring node'>&quot;#{CGI::unescapeHTML(l)}&quot;</span>
<span class='if if kw'>if</span> <span class='l identifier id'>l</span> <span class='neq op'>!=</span> <span class='h identifier id'>h</span><span class='lparen token'>(</span><span class='field identifier id'>field</span><span class='dot token'>.</span><span class='last identifier id'>last</span><span class='rparen token'>)</span>
<span class='text identifier id'>text</span> <span class='opasgn op'>+=</span> <span class='string val'>&quot;&lt;br/&gt;&quot;</span>
<span class='end end kw'>end</span>
<span class='end end kw'>end</span>
<span class='else else kw'>else</span>
<span class='text identifier id'>text</span> <span class='opasgn op'>+=</span> <span class='CGI constant id'>CGI</span><span class='colon2 op'>::</span><span class='unescapeHTML identifier id'>unescapeHTML</span><span class='lparen token'>(</span><span class='field identifier id'>field</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
<span class='comment val'>#Does the field have a vernacular equivalent? </span>
<span class='if if kw'>if</span> <span class='doc identifier id'>doc</span><span class='lbrack token'>[</span><span class='dstring node'>&quot;vern_#{field_string}&quot;</span><span class='rbrack token'>]</span>
<span class='vern_field identifier id'>vern_field</span> <span class='assign token'>=</span> <span class='doc identifier id'>doc</span><span class='lbrack token'>[</span><span class='dstring node'>&quot;vern_#{field_string}&quot;</span><span class='rbrack token'>]</span>
<span class='text identifier id'>text</span> <span class='opasgn op'>+=</span> <span class='string val'>&quot;&lt;br/&gt;&quot;</span>
<span class='if if kw'>if</span> <span class='vern_field identifier id'>vern_field</span><span class='dot token'>.</span><span class='is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='Array constant id'>Array</span><span class='rparen token'>)</span>
<span class='vern_field identifier id'>vern_field</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='l identifier id'>l</span><span class='bitor op'>|</span>
<span class='text identifier id'>text</span> <span class='opasgn op'>+=</span> <span class='dstring node'>&quot;#{CGI::unescapeHTML(l)}&quot;</span>
<span class='if if kw'>if</span> <span class='l identifier id'>l</span> <span class='neq op'>!=</span> <span class='h identifier id'>h</span><span class='lparen token'>(</span><span class='vern_field identifier id'>vern_field</span><span class='dot token'>.</span><span class='last identifier id'>last</span><span class='rparen token'>)</span>
<span class='text identifier id'>text</span> <span class='opasgn op'>+=</span> <span class='string val'>&quot;&lt;br/&gt;&quot;</span>
<span class='end end kw'>end</span>
<span class='end end kw'>end</span>
<span class='else else kw'>else</span>
<span class='text identifier id'>text</span> <span class='opasgn op'>+=</span> <span class='CGI constant id'>CGI</span><span class='colon2 op'>::</span><span class='unescapeHTML identifier id'>unescapeHTML</span><span class='lparen token'>(</span><span class='vern_field identifier id'>vern_field</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
<span class='end end kw'>end</span>
<span class='text identifier id'>text</span> <span class='opasgn op'>+=</span> <span class='string val'>&quot;&lt;/dd&gt;&quot;</span>
<span class='text identifier id'>text</span>
<span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="get_textile_data_with_label-instance_method">
- (<tt>Object</tt>) <strong>get_textile_data_with_label</strong>(doc, label, field_string, opts = {})
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/hydra_repository/app/models/hydra_helper.rb', line 130</span>
<span class='def def kw'>def</span> <span class='get_textile_data_with_label identifier id'>get_textile_data_with_label</span><span class='lparen token'>(</span><span class='doc identifier id'>doc</span><span class='comma token'>,</span> <span class='label identifier id'>label</span><span class='comma token'>,</span> <span class='field_string identifier id'>field_string</span><span class='comma token'>,</span> <span class='opts identifier id'>opts</span><span class='assign token'>=</span><span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='rparen token'>)</span>
<span class='if if kw'>if</span> <span class='opts identifier id'>opts</span><span class='lbrack token'>[</span><span class='symbol val'>:default</span><span class='rbrack token'>]</span> <span class='andop op'>&amp;&amp;</span> <span class='notop op'>!</span><span class='doc identifier id'>doc</span><span class='lbrack token'>[</span><span class='field_string identifier id'>field_string</span><span class='rbrack token'>]</span>
<span class='doc identifier id'>doc</span><span class='lbrack token'>[</span><span class='field_string identifier id'>field_string</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='opts identifier id'>opts</span><span class='lbrack token'>[</span><span class='symbol val'>:default</span><span class='rbrack token'>]</span>
<span class='end end kw'>end</span>
<span class='if if kw'>if</span> <span class='doc identifier id'>doc</span><span class='lbrack token'>[</span><span class='field_string identifier id'>field_string</span><span class='rbrack token'>]</span>
<span class='field identifier id'>field</span> <span class='assign token'>=</span> <span class='doc identifier id'>doc</span><span class='lbrack token'>[</span><span class='field_string identifier id'>field_string</span><span class='rbrack token'>]</span>
<span class='text identifier id'>text</span> <span class='assign token'>=</span> <span class='dstring node'>&quot;&lt;dt&gt;#{label}&lt;/dt&gt;&lt;dd&gt;&quot;</span>
<span class='if if kw'>if</span> <span class='field identifier id'>field</span><span class='dot token'>.</span><span class='is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='Array constant id'>Array</span><span class='rparen token'>)</span>
<span class='field identifier id'>field</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='l identifier id'>l</span><span class='bitor op'>|</span>
<span class='text identifier id'>text</span> <span class='opasgn op'>+=</span> <span class='dstring node'>&quot;#{RedCloth.new(l).to_html}&quot;</span>
<span class='if if kw'>if</span> <span class='l identifier id'>l</span> <span class='neq op'>!=</span> <span class='h identifier id'>h</span><span class='lparen token'>(</span><span class='field identifier id'>field</span><span class='dot token'>.</span><span class='last identifier id'>last</span><span class='rparen token'>)</span>
<span class='text identifier id'>text</span> <span class='opasgn op'>+=</span> <span class='string val'>&quot;&lt;br/&gt;&quot;</span>
<span class='end end kw'>end</span>
<span class='end end kw'>end</span>
<span class='else else kw'>else</span>
<span class='text identifier id'>text</span> <span class='opasgn op'>+=</span> <span class='RedCloth constant id'>RedCloth</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='field identifier id'>field</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='to_html identifier id'>to_html</span>
<span class='end end kw'>end</span>
<span class='text identifier id'>text</span> <span class='opasgn op'>+=</span> <span class='string val'>&quot;&lt;/dd&gt;&quot;</span>
<span class='text identifier id'>text</span>
<span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="grouped_result_count-instance_method">
- (<tt>Object</tt>) <strong>grouped_result_count</strong>(response, facet_name = nil, facet_value = nil)
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
51
52
53
54
55
56
57
58
59
60</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/hydra_repository/app/models/hydra_helper.rb', line 51</span>
<span class='def def kw'>def</span> <span class='grouped_result_count identifier id'>grouped_result_count</span><span class='lparen token'>(</span><span class='response identifier id'>response</span><span class='comma token'>,</span> <span class='facet_name identifier id'>facet_name</span><span class='assign token'>=</span><span class='nil nil kw'>nil</span><span class='comma token'>,</span> <span class='facet_value identifier id'>facet_value</span><span class='assign token'>=</span><span class='nil nil kw'>nil</span><span class='rparen token'>)</span>
<span class='if if kw'>if</span> <span class='facet_name identifier id'>facet_name</span> <span class='andop op'>&amp;&amp;</span> <span class='facet_value identifier id'>facet_value</span>
<span class='facet identifier id'>facet</span> <span class='assign token'>=</span> <span class='response identifier id'>response</span><span class='dot token'>.</span><span class='facets identifier id'>facets</span><span class='dot token'>.</span><span class='detect identifier id'>detect</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='f identifier id'>f</span><span class='bitor op'>|</span> <span class='f identifier id'>f</span><span class='dot token'>.</span><span class='name identifier id'>name</span> <span class='eq op'>==</span> <span class='facet_name identifier id'>facet_name</span><span class='rbrace token'>}</span>
<span class='facet_item identifier id'>facet_item</span> <span class='assign token'>=</span> <span class='facet identifier id'>facet</span><span class='dot token'>.</span><span class='items identifier id'>items</span><span class='dot token'>.</span><span class='detect identifier id'>detect</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='i identifier id'>i</span><span class='bitor op'>|</span> <span class='i identifier id'>i</span><span class='dot token'>.</span><span class='value identifier id'>value</span> <span class='eq op'>==</span> <span class='facet_value identifier id'>facet_value</span><span class='rbrace token'>}</span> <span class='if if_mod kw'>if</span> <span class='facet identifier id'>facet</span>
<span class='count identifier id'>count</span> <span class='assign token'>=</span> <span class='facet_item identifier id'>facet_item</span> <span class='integer val'>? </span><span class='facet_item identifier id'>facet_item</span><span class='dot token'>.</span><span class='hits identifier id'>hits</span> <span class='colon op'>:</span> <span class='integer val'>0</span>
<span class='else else kw'>else</span>
<span class='count identifier id'>count</span> <span class='assign token'>=</span> <span class='response identifier id'>response</span><span class='dot token'>.</span><span class='docs identifier id'>docs</span><span class='dot token'>.</span><span class='total identifier id'>total</span>
<span class='end end kw'>end</span>
<span class='pluralize identifier id'>pluralize</span><span class='lparen token'>(</span><span class='count identifier id'>count</span><span class='comma token'>,</span> <span class='string val'>'document'</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="grouping_facet-instance_method">
- (<tt>Object</tt>) <strong>grouping_facet</strong>
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/hydra_repository/app/models/hydra_helper.rb', line 62</span>
<span class='def def kw'>def</span> <span class='grouping_facet identifier id'>grouping_facet</span>
<span class='fields identifier id'>fields</span> <span class='assign token'>=</span> <span class='Hash constant id'>Hash</span><span class='lbrack token'>[</span><span class='sort_fields identifier id'>sort_fields</span><span class='rbrack token'>]</span>
<span class='case case kw'>case</span> <span class='h identifier id'>h</span><span class='lparen token'>(</span><span class='params identifier id'>params</span><span class='lbrack token'>[</span><span class='symbol val'>:sort</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
<span class='when when kw'>when</span> <span class='fields identifier id'>fields</span><span class='lbrack token'>[</span><span class='string val'>'date -'</span><span class='rbrack token'>]</span>
<span class='string val'>'year_facet'</span>
<span class='when when kw'>when</span> <span class='fields identifier id'>fields</span><span class='lbrack token'>[</span><span class='string val'>'date +'</span><span class='rbrack token'>]</span>
<span class='string val'>'year_facet'</span>
<span class='when when kw'>when</span> <span class='fields identifier id'>fields</span><span class='lbrack token'>[</span><span class='string val'>'document type'</span><span class='rbrack token'>]</span>
<span class='string val'>'medium_t'</span>
<span class='when when kw'>when</span> <span class='fields identifier id'>fields</span><span class='lbrack token'>[</span><span class='string val'>'location'</span><span class='rbrack token'>]</span>
<span class='string val'>'series_facet'</span>
<span class='else else kw'>else</span>
<span class='nil nil kw'>nil</span>
<span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="javascript_includes-instance_method">
- (<tt>Object</tt>) <strong>javascript_includes</strong>
</p><div class="docstring">
<div class="discussion">
<p>
collection of javascript includes to be rendered in the <head>
</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
9
10
11</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/hydra_repository/app/models/hydra_helper.rb', line 9</span>
<span class='def def kw'>def</span> <span class='javascript_includes identifier id'>javascript_includes</span>
<span class='@javascript_includes ivar id'>@javascript_includes</span> <span class='opasgn op'>||=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="link_to_multifacet-instance_method">
- (<tt>Object</tt>) <strong>link_to_multifacet</strong>(name, args = {})
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/hydra_repository/app/models/hydra_helper.rb', line 20</span>
<span class='def def kw'>def</span> <span class='link_to_multifacet identifier id'>link_to_multifacet</span><span class='lparen token'>(</span> <span class='name identifier id'>name</span><span class='comma token'>,</span> <span class='args identifier id'>args</span><span class='assign token'>=</span><span class='lbrace token'>{</span><span class='rbrace token'>}</span> <span class='rparen token'>)</span>
<span class='facet_params identifier id'>facet_params</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
<span class='options identifier id'>options</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
<span class='args identifier id'>args</span><span class='dot token'>.</span><span class='each_pair identifier id'>each_pair</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='k identifier id'>k</span><span class='comma token'>,</span><span class='v identifier id'>v</span><span class='bitor op'>|</span>
<span class='if if kw'>if</span> <span class='k identifier id'>k</span> <span class='eq op'>==</span> <span class='symbol val'>:options</span>
<span class='options identifier id'>options</span> <span class='assign token'>=</span> <span class='v identifier id'>v</span>
<span class='else else kw'>else</span>
<span class='facet_params identifier id'>facet_params</span><span class='lbrack token'>[</span><span class='symbol val'>:f</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
<span class='facet_params identifier id'>facet_params</span><span class='lbrack token'>[</span><span class='symbol val'>:f</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='k identifier id'>k</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span>
<span class='v identifier id'>v</span> <span class='assign token'>=</span> <span class='v identifier id'>v</span><span class='dot token'>.</span><span class='instance_of? fid id'>instance_of?</span><span class='lparen token'>(</span><span class='Array constant id'>Array</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='v identifier id'>v</span><span class='dot token'>.</span><span class='first identifier id'>first</span> <span class='colon op'>:</span> <span class='v identifier id'>v</span>
<span class='facet_params identifier id'>facet_params</span><span class='lbrack token'>[</span><span class='symbol val'>:f</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='k identifier id'>k</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='push identifier id'>push</span><span class='lparen token'>(</span><span class='v identifier id'>v</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
<span class='end end kw'>end</span>
<span class='link_to identifier id'>link_to</span><span class='lparen token'>(</span><span class='name identifier id'>name</span><span class='comma token'>,</span> <span class='catalog_index_path identifier id'>catalog_index_path</span><span class='lparen token'>(</span><span class='facet_params identifier id'>facet_params</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='options identifier id'>options</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="stylesheet_links-instance_method">
- (<tt>Object</tt>) <strong>stylesheet_links</strong>
</p><div class="docstring">
<div class="discussion">
<p>
collection of stylesheet links to be rendered in the <head>
</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
4
5
6</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/hydra_repository/app/models/hydra_helper.rb', line 4</span>
<span class='def def kw'>def</span> <span class='stylesheet_links identifier id'>stylesheet_links</span>
<span class='@stylesheet_links ivar id'>@stylesheet_links</span> <span class='opasgn op'>||=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Jan 17 21:46:35 2011 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.6.4 (ruby-1.8.7).
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.