Class: Blacklight::DocumentPresenter Deprecated
- Inherits:
-
Object
- Object
- Blacklight::DocumentPresenter
- Extended by:
- Deprecation
- Defined in:
- app/presenters/blacklight/document_presenter.rb
Overview
Instance Method Summary collapse
-
#document_heading ⇒ String
deprecated
Deprecated.
use ShowPresenter#heading instead
-
#document_show_html_title ⇒ String
deprecated
Deprecated.
use ShowPresenter#html_title instead
-
#field_values(field_config, options = {}) ⇒ Object
Get the value for a document's field, and prepare to render it.
- #get_field_values(_field, field_config, options = {}) ⇒ Object deprecated Deprecated.
-
#initialize(document, controller, configuration = controller.blacklight_config) ⇒ DocumentPresenter
constructor
A new instance of DocumentPresenter.
-
#link_rel_alternates(options = {}) ⇒ Object
deprecated
Deprecated.
moved to ShowPresenter#link_rel_alternates
-
#render_document_index_label(field, opts) ⇒ Object
deprecated
Deprecated.
use IndexPresenter#label instead
-
#render_index_field_value(field, options) ⇒ Object
Render the show field value for a document.
- #render_field_value(values, field_config = Configuration::NullField.new) ⇒ Object deprecated Deprecated.
-
#render_index_field_value(field, opts) ⇒ Object
deprecated
Deprecated.
use IndexPresenter#field_value instead
- #render_values(values, field_config = Configuration::NullField.new) ⇒ Object deprecated Deprecated.
Constructor Details
#initialize(document, controller, configuration = controller.blacklight_config) ⇒ DocumentPresenter
Returns a new instance of DocumentPresenter.
11 12 13 14 15 |
# File 'app/presenters/blacklight/document_presenter.rb', line 11 def initialize(document, controller, configuration = controller.blacklight_config) @document = document @configuration = configuration @controller = controller end |
Instance Method Details
#document_heading ⇒ String
use ShowPresenter#heading instead
Get the value of the document's “title” field, or a placeholder value (if empty)
23 24 25 |
# File 'app/presenters/blacklight/document_presenter.rb', line 23 def document_heading show_presenter.heading end |
#document_show_html_title ⇒ String
use ShowPresenter#html_title instead
Get the document's “title” to display in the <title> element. (by default, use the #document_heading)
49 50 51 |
# File 'app/presenters/blacklight/document_presenter.rb', line 49 def document_show_html_title show_presenter.html_title end |
#field_values(field_config, options = {}) ⇒ Object
Get the value for a document's field, and prepare to render it.
-
highlight_field
-
accessor
-
solr field
Rendering:
- helper_method
- link_to_search
126 127 128 |
# File 'app/presenters/blacklight/document_presenter.rb', line 126 def field_values(field_config, ={}) FieldPresenter.new(@controller, @document, field_config, ).render end |
#get_field_values(_field, field_config, options = {}) ⇒ Object
Get the value for a document's field, and prepare to render it.
-
highlight_field
-
accessor
-
solr field
Rendering:
- helper_method
- link_to_search
110 111 112 |
# File 'app/presenters/blacklight/document_presenter.rb', line 110 def get_field_values _field, field_config, = {} field_values(field_config, ) end |
#link_rel_alternates(options = {}) ⇒ Object
moved to ShowPresenter#link_rel_alternates
Create <link rel=“alternate”> links from a documents dynamically provided export formats. Returns empty string if no links available.
37 38 39 |
# File 'app/presenters/blacklight/document_presenter.rb', line 37 def link_rel_alternates( = {}) show_presenter.link_rel_alternates() end |
#render_document_index_label(field, opts) ⇒ Object
use IndexPresenter#label instead
Render the document index heading
61 62 63 |
# File 'app/presenters/blacklight/document_presenter.rb', line 61 def render_document_index_label(*args) index_presenter.label(*args) end |
#render_index_field_value(field, options) ⇒ Object
Render the show field value for a document
Allow an extention point where information in the document
may drive the value of the field
92 93 94 |
# File 'app/presenters/blacklight/document_presenter.rb', line 92 def render_document_show_field_value *args show_presenter.field_value(*args) end |
#render_field_value(values, field_config = Configuration::NullField.new) ⇒ Object
132 133 134 |
# File 'app/presenters/blacklight/document_presenter.rb', line 132 def render_field_value(values, field_config = Configuration::NullField.new) field_values(field_config, value: Array(values)) end |
#render_index_field_value(field, opts) ⇒ Object
use IndexPresenter#field_value instead
Render the index field label for a document
Allow an extention point where information in the document may drive the value of the field
76 77 78 |
# File 'app/presenters/blacklight/document_presenter.rb', line 76 def render_index_field_value *args index_presenter.field_value(*args) end |
#render_values(values, field_config = Configuration::NullField.new) ⇒ Object
138 139 140 |
# File 'app/presenters/blacklight/document_presenter.rb', line 138 def render_values(values, field_config = Configuration::NullField.new) field_values(field_config, value: Array(values)) end |