3 -- SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version);
5 -- NEW config.metabib_field entries
7 UPDATE config.metabib_field SET display_xpath = facet_xpath, display_field = TRUE WHERE id = 33;
9 INSERT INTO config.metabib_field (id, field_class, name,
10 label, xpath, display_field, search_field, browse_field)
12 38, 'keyword', 'edition',
13 oils_i18n_gettext(38, 'Edition', 'cmf', 'label'),
14 $$//mods33:mods/mods33:originInfo//mods33:edition[1]$$,
18 INSERT INTO config.metabib_field (id, field_class, name,
19 label, xpath, display_field, search_field, browse_field)
21 39, 'keyword', 'physical_description',
22 oils_i18n_gettext(39, 'Physical Descrption', 'cmf', 'label'),
23 $$(//mods33:mods/mods33:physicalDescription/mods33:form|//mods33:mods/mods33:physicalDescription/mods33:extent|//mods33:mods/mods33:physicalDescription/mods33:reformattingQuality|//mods33:mods/mods33:physicalDescription/mods33:internetMediaType|//mods33:mods/mods33:physicalDescription/mods33:digitalOrigin)$$,
27 INSERT INTO config.metabib_field (id, field_class, name,
28 label, xpath, display_field, search_field, browse_field)
30 40, 'keyword', 'publisher',
31 oils_i18n_gettext(40, 'Publisher', 'cmf', 'label'),
32 $$//mods33:mods/mods33:originInfo//mods33:publisher[1]$$,
36 INSERT INTO config.metabib_field (id, field_class, name,
37 label, xpath, display_field, search_field, browse_field)
39 41, 'keyword', 'abstract',
40 oils_i18n_gettext(41, 'Abstract', 'cmf', 'label'),
41 $$//mods33:mods/mods33:abstract$$,
45 INSERT INTO config.metabib_field (id, field_class, name,
46 label, xpath, display_field, search_field, browse_field)
49 oils_i18n_gettext(42, 'Table of Contents', 'cmf', 'label'),
50 $$//mods33:tableOfContents$$,
54 INSERT INTO config.metabib_field (id, field_class, name,
55 label, xpath, display_field, search_field, browse_field)
57 43, 'identifier', 'type_of_resource',
58 oils_i18n_gettext(43, 'Type of Resource', 'cmf', 'label'),
59 $$//mods33:mods/mods33:typeOfResource$$,
63 INSERT INTO config.metabib_field (id, field_class, name,
64 label, xpath, display_field, search_field, browse_field)
66 44, 'identifier', 'pubdate',
67 oils_i18n_gettext(44, 'Publication Date', 'cmf', 'label'),
68 $$//mods33:mods/mods33:originInfo//mods33:dateIssued[@encoding="marc"]|//mods33:mods/mods33:originInfo//mods33:dateIssued[1]$$,
72 INSERT INTO config.metabib_field (id, field_class, name,
73 label, xpath, display_field, search_field, browse_field)
75 46, 'keyword', 'bibliography',
76 oils_i18n_gettext(46, 'Bibliography', 'cmf', 'label'),
77 $$//mods33:note[@type='bibliography']$$,
80 47, 'keyword', 'thesis',
81 oils_i18n_gettext(47, 'Thesis', 'cmf', 'label'),
82 $$//mods33:note[@type='thesis']$$,
85 48, 'keyword', 'production_credits',
86 oils_i18n_gettext(48, 'Creation/Production Credits', 'cmf', 'label'),
87 $$//mods33:note[@type='creation/production credits']$$,
90 49, 'keyword', 'performers',
91 oils_i18n_gettext(49, 'Performers', 'cmf', 'label'),
92 $$//mods33:note[@type='performers']$$,
95 50, 'keyword', 'general_note',
96 oils_i18n_gettext(50, 'General Note', 'cmf', 'label'),
97 $$//mods33:note[not(@type)]$$,
103 -- Modify existing config.metabib_field entries
105 UPDATE config.metabib_field SET display_field = TRUE WHERE id IN (
107 11, -- subject_geographic
109 13, -- subject_temporal
116 -- Map display field names to config.metabib_field entries
118 INSERT INTO config.display_field_map (name, field, multi) VALUES
119 ('series_title', 1, FALSE),
120 ('subject_geographic', 11, TRUE),
121 ('subject_name', 12, TRUE),
122 ('subject_temporal', 13, TRUE),
123 ('subject_topic', 14, TRUE),
127 ('edition', 38, FALSE),
128 ('physical_description',39, TRUE),
129 ('publisher', 40, FALSE),
130 ('abstract', 41, FALSE),
132 ('type_of_resource', 43, FALSE),
133 ('pubdate', 44, FALSE)
136 -- Add a column to wide-display-entry per well-known field
138 DROP VIEW metabib.wide_display_entry;
139 CREATE VIEW metabib.wide_display_entry AS
142 COALESCE(mcde_title.value, 'null') AS title,
143 COALESCE(mcde_author.value, 'null') AS author,
144 COALESCE(mcde_subject_geographic.value, 'null') AS subject_geographic,
145 COALESCE(mcde_subject_name.value, 'null') AS subject_name,
146 COALESCE(mcde_subject_temporal.value, 'null') AS subject_temporal,
147 COALESCE(mcde_subject_topic.value, 'null') AS subject_topic,
148 COALESCE(mcde_creators.value, 'null') AS creators,
149 COALESCE(mcde_isbn.value, 'null') AS isbn,
150 COALESCE(mcde_issn.value, 'null') AS issn,
151 COALESCE(mcde_upc.value, 'null') AS upc,
152 COALESCE(mcde_tcn.value, 'null') AS tcn,
153 COALESCE(mcde_edition.value, 'null') AS edition,
154 COALESCE(mcde_physical_description.value, 'null') AS physical_description,
155 COALESCE(mcde_publisher.value, 'null') AS publisher,
156 COALESCE(mcde_series_title.value, 'null') AS series_title,
157 COALESCE(mcde_abstract.value, 'null') AS abstract,
158 COALESCE(mcde_toc.value, 'null') AS toc,
159 COALESCE(mcde_pubdate.value, 'null') AS pubdate,
160 COALESCE(mcde_type_of_resource.value, 'null') AS type_of_resource
161 FROM biblio.record_entry bre
162 LEFT JOIN metabib.compressed_display_entry mcde_title
163 ON (bre.id = mcde_title.source AND mcde_title.name = 'title')
164 LEFT JOIN metabib.compressed_display_entry mcde_author
165 ON (bre.id = mcde_author.source AND mcde_author.name = 'author')
166 LEFT JOIN metabib.compressed_display_entry mcde_subject
167 ON (bre.id = mcde_subject.source AND mcde_subject.name = 'subject')
168 LEFT JOIN metabib.compressed_display_entry mcde_subject_geographic
169 ON (bre.id = mcde_subject_geographic.source
170 AND mcde_subject_geographic.name = 'subject_geographic')
171 LEFT JOIN metabib.compressed_display_entry mcde_subject_name
172 ON (bre.id = mcde_subject_name.source
173 AND mcde_subject_name.name = 'subject_name')
174 LEFT JOIN metabib.compressed_display_entry mcde_subject_temporal
175 ON (bre.id = mcde_subject_temporal.source
176 AND mcde_subject_temporal.name = 'subject_temporal')
177 LEFT JOIN metabib.compressed_display_entry mcde_subject_topic
178 ON (bre.id = mcde_subject_topic.source
179 AND mcde_subject_topic.name = 'subject_topic')
180 LEFT JOIN metabib.compressed_display_entry mcde_creators
181 ON (bre.id = mcde_creators.source AND mcde_creators.name = 'creators')
182 LEFT JOIN metabib.compressed_display_entry mcde_isbn
183 ON (bre.id = mcde_isbn.source AND mcde_isbn.name = 'isbn')
184 LEFT JOIN metabib.compressed_display_entry mcde_issn
185 ON (bre.id = mcde_issn.source AND mcde_issn.name = 'issn')
186 LEFT JOIN metabib.compressed_display_entry mcde_upc
187 ON (bre.id = mcde_upc.source AND mcde_upc.name = 'upc')
188 LEFT JOIN metabib.compressed_display_entry mcde_tcn
189 ON (bre.id = mcde_tcn.source AND mcde_tcn.name = 'tcn')
190 LEFT JOIN metabib.compressed_display_entry mcde_edition
191 ON (bre.id = mcde_edition.source AND mcde_edition.name = 'edition')
192 LEFT JOIN metabib.compressed_display_entry mcde_physical_description
193 ON (bre.id = mcde_physical_description.source
194 AND mcde_physical_description.name = 'physical_description')
195 LEFT JOIN metabib.compressed_display_entry mcde_publisher
196 ON (bre.id = mcde_publisher.source AND mcde_publisher.name = 'publisher')
197 LEFT JOIN metabib.compressed_display_entry mcde_series_title
198 ON (bre.id = mcde_series_title.source AND mcde_series_title.name = 'series_title')
199 LEFT JOIN metabib.compressed_display_entry mcde_abstract
200 ON (bre.id = mcde_abstract.source AND mcde_abstract.name = 'abstract')
201 LEFT JOIN metabib.compressed_display_entry mcde_toc
202 ON (bre.id = mcde_toc.source AND mcde_toc.name = 'toc')
203 LEFT JOIN metabib.compressed_display_entry mcde_pubdate
204 ON (bre.id = mcde_pubdate.source AND mcde_pubdate.name = 'pubdate')
205 LEFT JOIN metabib.compressed_display_entry mcde_type_of_resource
206 ON (bre.id = mcde_type_of_resource.source
207 AND mcde_type_of_resource.name = 'type_of_resource')