1 -- Evergreen DB patch 0626.schema.bookbag-goodies.sql
5 SELECT evergreen.upgrade_deps_block_check('0626', :eg_version);
7 ALTER TABLE container.biblio_record_entry_bucket
8 ADD COLUMN description TEXT;
10 ALTER TABLE container.call_number_bucket
11 ADD COLUMN description TEXT;
13 ALTER TABLE container.copy_bucket
14 ADD COLUMN description TEXT;
16 ALTER TABLE container.user_bucket
17 ADD COLUMN description TEXT;
19 INSERT INTO action_trigger.hook (key, core_type, description, passive)
21 'container.biblio_record_entry_bucket.csv',
24 'container.biblio_record_entry_bucket.csv',
25 'Produce a CSV file representing a bookbag',
32 INSERT INTO action_trigger.reactor (module, description)
37 'Facilitates produce a CSV file representing a bookbag by introducing an "items" variable into the TT environment, sorted as dictated according to user params',
43 INSERT INTO action_trigger.event_definition (
49 'Bookbag CSV', 'container.biblio_record_entry_bucket.csv', 'ContainerCSV',
53 # target is the bookbag itself. The 'items' variable does not need to be in
54 # the environment because a special reactor will take care of filling it in.
57 bibxml = helpers.xml_doc(item.target_biblio_record_entry.marc);
59 FOR part IN bibxml.findnodes('//*[@tag="245"]/*[@code="a" or @code="b"]');
60 title = title _ part.textContent;
62 author = bibxml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent;
64 helpers.csv_datum(title) %],[% helpers.csv_datum(author) %],[% FOR note IN item.notes; helpers.csv_datum(note.note); ","; END; "\n";