Class: Concept
Instance Method Summary
collapse
#add_member, #has_struct_metadata?, #member_ids, #members, #remove_member, #representative_image, #representative_image=, #solr_members, #thumbnail_info
#cmodel_pid, #datastreams_in_fedora, #get_representative_generic_resource, #get_singular_rel, #has_desc?, #initialize, #label=, #rdf_type, #rdf_types!, #set_singular_rel, #set_size_labels, #thumbnail_info, #update_datastream_attributes
#proxies, #set_size_labels, #type_label_for, #update_index
Instance Method Details
#abstract ⇒ Object
27
28
29
|
# File 'app/models/concept.rb', line 27
def abstract
get_singular_rel(:abstract)
end
|
#abstract=(val) ⇒ Object
31
32
33
|
# File 'app/models/concept.rb', line 31
def abstract=(val)
set_singular_rel(:abstract, val, true)
end
|
#description ⇒ Object
45
46
47
48
49
|
# File 'app/models/concept.rb', line 45
def description
ds = description_ds
return nil unless ds
ds.content.to_s
end
|
#description=(value) ⇒ Object
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# File 'app/models/concept.rb', line 51
def description=(value)
ds = description_ds
if value.nil? || value.empty?
if ds
datastreams['descriptionText'].delete
clear_relationship(:description)
end
else
if ds
ds.content = value
else
add_relationship(:description, internal_uri.to_s + "/descriptionText")
datastreams['descriptionText'].content = value
end
end
end
|
#description_ds ⇒ Object
35
36
37
38
39
40
41
|
# File 'app/models/concept.rb', line 35
def description_ds
candidate =
relationships(:description).select { |v| v.to_s.index(self.internal_uri.to_s) == 0 }
candidate = candidate.first
candidate = candidate.to_s.split('/')[2]
datastreams[candidate] unless candidate.blank?
end
|
#index_type_label ⇒ Object
23
24
25
|
# File 'app/models/concept.rb', line 23
def index_type_label
"CONCEPT"
end
|
#restriction ⇒ Object
71
72
73
|
# File 'app/models/concept.rb', line 71
def restriction
get_singular_rel(:restriction)
end
|
#restriction=(val) ⇒ Object
75
76
77
|
# File 'app/models/concept.rb', line 75
def restriction=(val)
set_singular_rel(:restriction, val, true)
end
|
#route_as ⇒ Object
19
20
21
|
# File 'app/models/concept.rb', line 19
def route_as
"concept"
end
|
#short_title ⇒ Object
101
102
103
|
# File 'app/models/concept.rb', line 101
def short_title
get_singular_rel(:short_title)
end
|
#short_title=(val) ⇒ Object
105
106
107
|
# File 'app/models/concept.rb', line 105
def short_title=(val)
set_singular_rel(:short_title, val, true)
end
|
#slug ⇒ Object
81
82
83
|
# File 'app/models/concept.rb', line 81
def slug
get_singular_rel(:slug)
end
|
#slug=(val) ⇒ Object
85
86
87
|
# File 'app/models/concept.rb', line 85
def slug=(val)
set_singular_rel(:slug, val, true)
end
|
#source ⇒ Object
91
92
93
|
# File 'app/models/concept.rb', line 91
def source
get_singular_rel(:source)
end
|
#source=(val) ⇒ Object
95
96
97
|
# File 'app/models/concept.rb', line 95
def source=(val)
set_singular_rel(:source, val)
end
|
#to_solr(solr_doc = Hash.new, opts = {}) ⇒ Object
109
110
111
112
113
|
# File 'app/models/concept.rb', line 109
def to_solr(solr_doc = Hash.new, opts={})
solr_doc = super(solr_doc, opts)
solr_doc[::ActiveFedora::SolrService.solr_name(:description_text, :displayable)] = description
solr_doc
end
|