From b3d52703047a5c3dfdb6c782ab1af660398bafa3 Mon Sep 17 00:00:00 2001 From: Allison Sherrick <67483756+alliomeria@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:38:01 -0400 Subject: [PATCH 01/14] Metadata API default View & Config --- ...wberryfield.metadataapi_entity.oai_pmh.yml | 186 +++++++ ...iews.view.oai_exposed_entity_reference.yml | 474 ++++++++++++++++++ 2 files changed, 660 insertions(+) create mode 100644 config/sync/format_strawberryfield.metadataapi_entity.oai_pmh.yml create mode 100644 config/sync/views.view.oai_exposed_entity_reference.yml diff --git a/config/sync/format_strawberryfield.metadataapi_entity.oai_pmh.yml b/config/sync/format_strawberryfield.metadataapi_entity.oai_pmh.yml new file mode 100644 index 0000000..c6c98cc --- /dev/null +++ b/config/sync/format_strawberryfield.metadataapi_entity.oai_pmh.yml @@ -0,0 +1,186 @@ +uuid: 0484e0db-4339-4cb1-b33e-caeb5dcaaa1a +langcode: en +status: true +dependencies: + module: + - node +id: oai_pmh +label: oai-pmh +configuration: + openAPI: + verb: + name: verb + weight: '-10' + param: + in: query + name: verb + schema: + type: string + enum: + - GetRecord + - Identify + - ListIdentifiers + - ListMetadataFormats + - ListRecords + - ListSets + style: form + explode: true + required: true + deprecated: false + description: '' + mapping: + 'oai_exposed_entity_reference:entity_reference_solr_1:nid': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:changed': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:changed_1': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:nid_ref': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:@page': 0 + set: + name: set + mapping: + 'oai_exposed_entity_reference:entity_reference_solr_1:nid_ref': 'oai_exposed_entity_reference:entity_reference_solr_1:nid_ref' + 'oai_exposed_entity_reference:entity_reference_solr_1:nid': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:changed': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:changed_1': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:@page': 0 + weight: '-9' + param: + in: query + name: set + schema: + type: string + format: uuid + style: form + explode: true + required: false + deprecated: false + description: '' + identifier: + name: identifier + mapping: + 'oai_exposed_entity_reference:entity_reference_solr_1:nid': 'oai_exposed_entity_reference:entity_reference_solr_1:nid' + 'oai_exposed_entity_reference:entity_reference_solr_1:changed': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:changed_1': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:nid_ref': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:@page': 0 + weight: '-8' + param: + in: query + name: identifier + schema: + type: string + format: uuid + style: form + explode: true + required: false + deprecated: false + description: '' + oai: + name: oai + weight: '-7' + param: + in: path + name: oai + schema: + type: string + style: simple + explode: false + required: true + deprecated: false + description: '' + mapping: + 'oai_exposed_entity_reference:entity_reference_solr_1:nid': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:changed': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:changed_1': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:nid_ref': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:@page': 0 + page: + name: page + mapping: + 'oai_exposed_entity_reference:entity_reference_solr_1:@page': 'oai_exposed_entity_reference:entity_reference_solr_1:@page' + 'oai_exposed_entity_reference:entity_reference_solr_1:nid': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:changed': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:changed_1': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:nid_ref': 0 + weight: '-6' + param: + in: query + name: page + schema: + type: integer + style: form + explode: true + required: false + deprecated: false + description: '' + metadataPrefix: + name: metadataPrefix + weight: '-5' + param: + in: query + name: metadataPrefix + schema: + type: string + enum: + - oai_dc + - mods + style: form + explode: true + required: false + deprecated: false + description: '' + mapping: + 'oai_exposed_entity_reference:entity_reference_solr_1:nid': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:changed': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:changed_1': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:nid_ref': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:@page': 0 + from: + name: from + mapping: + 'oai_exposed_entity_reference:entity_reference_solr_1:changed': 'oai_exposed_entity_reference:entity_reference_solr_1:changed' + 'oai_exposed_entity_reference:entity_reference_solr_1:nid': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:changed_1': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:nid_ref': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:@page': 0 + weight: '7' + param: + in: query + name: from + schema: + type: string + format: date + style: form + explode: true + required: false + deprecated: false + description: '' + until: + name: until + mapping: + 'oai_exposed_entity_reference:entity_reference_solr_1:changed_1': 'oai_exposed_entity_reference:entity_reference_solr_1:changed_1' + 'oai_exposed_entity_reference:entity_reference_solr_1:nid': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:changed': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:nid_ref': 0 + 'oai_exposed_entity_reference:entity_reference_solr_1:@page': 0 + weight: '8' + param: + in: query + name: until + schema: + type: string + format: date + style: form + explode: true + required: false + deprecated: false + description: '' + metadataWrapperDisplayentity: + - 7ed7f7b2-7690-402f-93ea-a9b50a094f30 + metadataItemDisplayentity: + - b5c12175-e0a9-49e9-a698-cbba342667e0 + api_type: + - SWORD +views_source_ids: + 'oai_exposed_entity_reference:entity_reference_solr_1': 'oai_exposed_entity_reference:entity_reference_solr_1' +cache: 0 +active: true diff --git a/config/sync/views.view.oai_exposed_entity_reference.yml b/config/sync/views.view.oai_exposed_entity_reference.yml new file mode 100644 index 0000000..e4e14a4 --- /dev/null +++ b/config/sync/views.view.oai_exposed_entity_reference.yml @@ -0,0 +1,474 @@ +uuid: 831cc2a5-a8ba-485a-ab76-f9638c35d92b +langcode: en +status: true +dependencies: + config: + - search_api.index.default_solr_index + module: + - search_api + - webform_strawberryfield +id: oai_exposed_entity_reference +label: OAI_exposed_entity_reference +module: views +description: '' +tag: '' +base_table: search_api_index_default_solr_index +base_field: search_api_id +display: + default: + id: default + display_title: Default + display_plugin: default + position: 0 + display_options: + fields: + title: + id: title + table: search_api_datasource_default_solr_index_entity_node + field: title + relationship: none + group_type: group + admin_label: '' + entity_type: node + plugin_id: search_api_field + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: + link_to_entity: false + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_rendering: false + fallback_handler: search_api + fallback_options: + link_to_item: false + use_highlighting: false + multi_type: separator + multi_separator: ', ' + pager: + type: mini + options: + offset: 0 + items_per_page: 10 + total_pages: null + id: 0 + tags: + next: ›› + previous: ‹‹ + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + access: + type: none + options: { } + cache: + type: search_api_none + options: { } + empty: { } + sorts: { } + arguments: + nid_ref: + id: nid_ref + table: search_api_index_default_solr_index + field: nid_ref + relationship: none + group_type: group + admin_label: '' + plugin_id: search_api + default_action: default + exception: + value: all + title_enable: false + title: All + title_enable: false + title: '' + default_argument_type: node + default_argument_options: { } + default_argument_skip_url: false + summary_options: { } + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: false + validate: + type: none + fail: 'not found' + validate_options: { } + break_phrase: false + not: false + nid: + id: nid + table: search_api_index_default_solr_index + field: nid + relationship: none + group_type: group + admin_label: '' + plugin_id: search_api + default_action: ignore + exception: + value: all + title_enable: false + title: All + title_enable: false + title: '' + default_argument_type: fixed + default_argument_options: + argument: '' + default_argument_skip_url: false + summary_options: { } + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: true + validate: + type: 'entity:node' + fail: 'not found' + validate_options: + bundles: { } + access: false + operation: view + multiple: 0 + break_phrase: false + not: false + filters: + nid: + id: nid + table: search_api_index_default_solr_index + field: nid + relationship: none + group_type: group + admin_label: '' + plugin_id: search_api_numeric + operator: '=' + value: + min: '' + max: '' + value: '' + group: 1 + exposed: true + expose: + operator_id: nid_op + label: ID + description: '' + use_operator: false + operator: nid_op + operator_limit_selection: false + operator_list: { } + identifier: nid + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + metadata_api: '0' + metadata_pro: '0' + min_placeholder: '' + max_placeholder: '' + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + nid_ref: + id: nid_ref + table: search_api_index_default_solr_index + field: nid_ref + relationship: none + group_type: group + admin_label: '' + plugin_id: search_api_numeric + operator: '=' + value: + min: '' + max: '' + value: '25' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + min_placeholder: '' + max_placeholder: '' + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + changed: + id: changed + table: search_api_index_default_solr_index + field: changed + relationship: none + group_type: group + admin_label: '' + plugin_id: search_api_date + operator: '=' + value: + min: '' + max: '' + value: '1970-01-01' + type: date + group: 1 + exposed: true + expose: + operator_id: changed_op + label: Changed + description: '' + use_operator: false + operator: changed_op + operator_limit_selection: false + operator_list: { } + identifier: changed_from + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + metadata_api: '0' + metadata_pro: '0' + min_placeholder: '' + max_placeholder: '' + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + changed_1: + id: changed_1 + table: search_api_index_default_solr_index + field: changed + relationship: none + group_type: group + admin_label: '' + plugin_id: search_api_date + operator: '=' + value: + min: '' + max: '' + value: '2055-01-01' + type: date + group: 1 + exposed: true + expose: + operator_id: changed_1_op + label: Changed + description: '' + use_operator: false + operator: changed_1_op + operator_limit_selection: false + operator_list: { } + identifier: changed_to + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + metadata_api: '0' + metadata_pro: '0' + min_placeholder: '' + max_placeholder: '' + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + filter_groups: + operator: AND + groups: + 1: AND + style: + type: default + options: + grouping: { } + row_class: '' + default_row_class: true + uses_fields: false + row: + type: fields + options: + default_field_elements: true + inline: { } + separator: '' + hide_empty: false + query: + type: search_api_query + options: + bypass_access: false + skip_access: false + preserve_facet_query_args: false + query_tags: { } + relationships: { } + header: { } + footer: { } + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - 'user.node_grants:view' + tags: + - 'config:search_api.index.default_solr_index' + - 'search_api_list:default_solr_index' + entity_reference_solr_1: + id: entity_reference_solr_1 + display_title: 'OAI Results' + display_plugin: entity_reference_solr + position: 1 + display_options: + display_extenders: + sbf_ajax_interactions: { } + style: + type: entity_reference + options: + search_fields: + title: title + pager: + type: full + options: + items_per_page: '25' + offset: '0' + id: '0' + total_pages: '' + tags: + previous: ‹‹ + next: ›› + first: '« First' + last: 'Last »' + expose: + items_per_page: 0 + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: 0 + items_per_page_options_all_label: '- All -' + offset: 0 + offset_label: Offset + quantity: '9' + display_description: '' + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - 'user.node_grants:view' + tags: + - 'config:search_api.index.default_solr_index' + - 'search_api_list:default_solr_index' From 21acf53d614bfc06af25848d0d7efd9355bb7afc Mon Sep 17 00:00:00 2001 From: Allison Sherrick <67483756+alliomeria@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:41:04 -0400 Subject: [PATCH 02/14] Metadata API Related Default Templates - OAI-PMH Item & Wrapper --- d8content/metadatadisplay_entity_16.json | 13 +------------ d8content/metadatadisplay_entity_17.json | 1 + 2 files changed, 2 insertions(+), 12 deletions(-) create mode 100644 d8content/metadatadisplay_entity_17.json diff --git a/d8content/metadatadisplay_entity_16.json b/d8content/metadatadisplay_entity_16.json index 6f0be3c..48702fc 100644 --- a/d8content/metadatadisplay_entity_16.json +++ b/d8content/metadatadisplay_entity_16.json @@ -1,12 +1 @@ -{ - "data": { - "type": "metadatadisplay_entity--metadatadisplay_entity", - "id": "adf12524-11ca-4925-bc23-d028556e75ac", - "attributes": { - "name": "IIIF Presentation API 3 Thumbnail", - "twig": "{# \nThis Template generates Thumbnails for various Media representations\nUpdated 31\/10\/2023 for 1.3.0 \n\nStructures passed from Archipelago are\n- node\n The full Node entitya\n- data\n The Full JSON Structure converted in an Array\n- iiif_server\n The publicly available IIIF Server (Global Setting)\n\nSince JSON was decoded into the 'data' values are valid PHP but could not\nbe valid JSON when outputting. So We use data.description|json_encode|raw\nWithout Double quotes.\n#}\n{# <---- SETUP ---> #}\n{# -- The Desired width -- #}\n{% set width = 240 %}\n{# -- The IIIF Server URLS -- #}\n{% set Webserverurl = url('')|render|replace({':8001\/':''}) ~ ':8183\/iiif\/2\/' %}\n{% set IIIFserverurl = iiif_server ? iiif_server ~ '\/': Webserverurl %}\n{# -- Node Info -- #}\n{% if node.id %}\n {% set nodeurl = url('entity.node.canonical', {'node': node.id}, {'absolute': true}) %}\n{% else %}\n {% set nodeurl = '' ~ '\/iiif\/manifest' %}\n{% endif%}\n{# -- Language -- #}\n{% set len = language.getId() ? language.getId() : \"en\" %}\n{# --THIS WILL BE THE IMAGE IIIF URL. CAN HAVE A DEFAULT VALUE IN CASE OF FAILURE THERE IS ALWAYS A GENERIC THUMB-- #}\n{# -- NOTE: for loops are scoped so if we onlt define source inside one it will not be accesible from the outside- #}\n{% set source = '' %}\n{# <---- END SETUP --> #}\n{# We will test for 3 main options\n1.- Images\n2.- PDF\n3.- Movies\n#}\n{% apply spaceless %} \n{% if attribute(data, 'as:image')|length > 0 %} \n {% set document = data['as:image']|first %} \n {# if the default size is smaller than the source use the source one #}\n {% if document['flv:exif'].ImageWidth is defined and document['flv:exif'].ImageWidth < width %}\n {% set width = document['flv:exif'].ImageWidth %} \n {% endif %}\n {% set cantaloupeid = IIIFserverurl ~ document['url']|replace({'s3:\/\/':''})|replace({'private:\/\/':''})|url_encode %}\n {% set source = cantaloupeid ~ \"\/full\/\" ~ width ~ \",\/0\/default.jpg\" %}\n{% elseif attribute(data, 'as:document')|length > 0 %}\n {% set break = false %}\n {% for document in data['as:document'] %}\n {% if not break %}\n {# this is just an example, we allow every PDF here but we can also filter by pronom id \"info:pronom\/fmt\/17\" or info:pronom\/fmt\/18 #}\n {% if document['flv:exif'].MIMEType == \"application\/pdf\" and document['flv:exif'].PageCount > 0 %} \n {% set cantaloupeid = IIIFserverurl ~ document['url']|replace({'s3:\/\/':''})|replace({'private:\/\/':''})|url_encode %} \n {% set source = cantaloupeid ~ \";1\/full\/\" ~ width ~ \",\/0\/default.jpg\" %}\n {% set break = true %}\n {% endif%}\n {% endif%}\n {% endfor %}\n{% elseif attribute(data, 'as:video')|length > 0 %} \n {% set break = false %}\n {% for document in data['as:video'] %}\n {% if not break %}\n {# this is just an example, we process here only MP4 quicktimes #}\n {% if document['flv:pronom'].mimetype == \"video\/quicktime\" %}\n {% set cantaloupeid = IIIFserverurl ~ document['url']|replace({'s3:\/\/':''})|replace({'private:\/\/':''})|url_encode %} \n {% set source = cantaloupeid ~ \";1\/full\/\" ~ width ~ \",\/0\/default.jpg\" %}\n {% set break = true %}\n {% endif %}\n {% endif %}\n {% endfor %} \n{% endif%}\n{% if source|length > 0 %}\n {% set thumb_width = width < max_thumb_width ? width: max_thumb_width %}\n {% set thumb_height = (thumb_width\/width * height)|round() %}\n\"thumbnail\": [{\n \"id\": \"{{ source }}\",\n \"type\": \"Image\",\n \"format\": \"image\/jpeg\",\n \"width\": {{ width }},\n \"height\": 180\n}]\n{% else %}\n\"thumbnail\": \n[{\n \"id\": \"{{ url('')|render ~ file_url('public:\/\/media-icons\/generic\/no-thumbnail.png') }}\",\n \"type\": \"Image\",\n \"format\": \"image\/png\",\n \"width\": 180,\n \"height\": 180\n}]\n{% endif %}\n{% endapply %}", - "langcode": "und", - "mimetype": "text/text" - } - } -} +{"data":{"id":"7ed7f7b2-7690-402f-93ea-a9b50a094f30","attributes":{"mimetype":"application\/xml","revision_translation_affected":null,"revision_created":"2024-03-08T16:54:36+00:00","twig":"\r\n\r\n {{ data_api.request_date }}<\/responseDate>\r\n {%- if data|length > 0 -%}\r\n {%- set resumptiontoken_arguments = data_api.query %}\r\n {%- if data_api.query.page is defined and not empty -%}\r\n {%- set resumptiontoken_arguments = resumptiontoken_arguments|merge({\"page\":(data_api.query.page+1)})-%}\r\n {%- else -%}\r\n {%- set resumptiontoken_arguments = resumptiontoken_arguments|merge({\"page\":2})-%}\r\n {% endif %}\r\n {%-\r\n set resumptiontoken = '?' ~ resumptiontoken_arguments|url_encode\r\n -%}\r\n {%- else -%}\r\n {# No results so no resumption token #}\r\n {%- set resumptiontoken = '' -%}\r\n {%- endif -%}\r\n {{ resumptiontoken }}<\/request>\r\n {%- if data_api.query.verb == \"ListSets\" -%} \r\n\t\tThis repository does not support sets<\/error>\r\n {%- else -%}\r\n {%- if data_api.query.verb -%}\r\n <{{ data_api.query.verb }}>\r\n {%- else -%}\r\n \r\n {%- endif -%} \r\n {%- for XML_doc in data -%}\r\n {%- if data_api.query.verb == \"ListRecords\" -%}\r\n \r\n {%- endif -%}\r\n {{ XML_doc }}\r\n {%- if data_api.query.verb == \"ListRecords\" -%} \r\n <\/record>\r\n {%- endif -%}\r\n {% endfor %}\r\n {# {{ data_api|json_encode|raw }} #}\r\n {# {{ data_api_context|json_encode|raw }} #}\r\n {%- if data_api.query.verb -%}\r\n <\/{{ data_api.query.verb }}>\r\n {%- else -%}\r\n <\/GetRecord>\r\n {%- endif -%}\r\n {%- endif -%}\r\n<\/OAI-PMH>","name":"OAI-PMH Wrapper","langcode":"und","revision_log_message":null,"drupal_internal__vid":17},"type":"metadatadisplay_entity--metadatadisplay_entity"}} \ No newline at end of file diff --git a/d8content/metadatadisplay_entity_17.json b/d8content/metadatadisplay_entity_17.json new file mode 100644 index 0000000..65ff26c --- /dev/null +++ b/d8content/metadatadisplay_entity_17.json @@ -0,0 +1 @@ +{"data":{"attributes":{"mimetype":"application\/xml","revision_translation_affected":null,"revision_log_message":null,"name":"OAI-PMH Item with DC","revision_created":"2024-03-08T16:55:15+00:00","drupal_internal__vid":18,"langcode":"und","twig":"{# Created by Allison & Diego March 2024.\r\nUses Archipelago's default Simple Dublin Core XML template as base. #}\r\n{%- set oai_id = 'oai:fake:test' -%}\r\n{%- if node.uuid.value -%}\r\n{%- set oai_id = node.uuid.value -%}\r\n{%- set changed = node.changed.value|date(\"Y-m-d\") -%}\r\n{%- endif -%}\r\n
\r\n oai:localhost:{{ oai_id }}<\/identifier>\r\n {{ changed }}<\/datestamp>\r\n{%- if attribute(data, 'ismemberof') -%} \r\n {%- if attribute(data, 'ismemberof') is iterable -%} \r\n {%- for collection in attribute(data, 'ismemberof') -%} \r\n {%- set parentnode = bamboo_load_entity('node', collection) -%} \r\n {%- if parentnode -%} \r\n {{ parentnode.uuid.value }}<\/setSpec>\r\n {%- endif -%} \r\n {%- endfor -%} \r\n {% else %} \r\n\t {% set parentnode = bamboo_load_entity('node', attribute(data, 'ismemberof')) %} \r\n {% if parentnode %} \r\n\t\t{{ parentnode.uuid.value }}<\/setSpec>\r\n {% endif %} \r\n {% endif %} \r\n{% endif %} \r\n <\/header>\r\n{% if data_api.query.verb == \"ListRecords\" or data_api.query.verb == \"GetRecord\" %} \r\n\r\n{% if data_api.query.metadataPrefix == 'oai_dc' %}\r\n\r\n\r\n{{ data.label|escape('html') }}<\/dc:title>\r\n{# Creator #}\r\n{% if data.creator|length > 0 %}\r\n\t{% if data.creator is iterable %}\r\n\t\t{% for creator in data.creator %}\r\n\t\t\t{{ creator }}<\/dc:creator>\r\n\t\t{% endfor %}\r\n {% else %}\r\n \t{{ data.creator }}<\/dc:creator>\r\n\t{% endif %} \r\n{% endif %}\r\n{% if data.creator_lod|length > 0 %}\r\n\t{% for creator_lod in data.creator_lod %}\r\n \t{{ creator_lod.name_label }}<\/dc:creator>\r\n\t{% endfor %}\r\n{% endif %}\r\n{# Contributor\r\n<\/dc:contributor>\r\n#}\r\n{# Coverage \r\n<\/dc:coverage>\r\n#}\r\n{# Date #}\r\n{% if data.date_created|length > 0 %}\r\n\t{{ data.date_created }}<\/dc:date>\r\n{% endif %}\r\n\t{% if data.date_created_edtf.date_free is defined and not empty %}\r\n\t\t{{ data.date_created_edtf.date_free }}<\/dc:date>\r\n\t{% endif %}\r\n\t{% if data.date_issued_edtf.date_free is defined and not empty %}\t\r\n\t\t{{ data.date_issued_edtf.date_free }}<\/dc:date>\r\n\t{% endif %}\t\r\n{# Description #}\r\n{% if data.description|length > 0 %}\r\n\t{% if data.description is iterable %}\r\n\t\t{% for description in data.description %}\r\n\t\t\t{{ description|escape('html_attr') }}<\/dc:description>\r\n\t\t{% endfor %}\r\n {% else %}\r\n\t{{ data.description|escape('html_attr') }}<\/dc:description>\r\n\t{% endif %} \r\n{% endif %}\r\n{# Subject #}\r\n{# LoD Subjects #}\r\n{% if data.subject_loc|length > 0 %}\r\n\t{% for subject_loc in data.subject_loc %}\r\n \t{{ subject_loc.label }}<\/dc:subject>\r\n\t{% endfor %}\r\n{% endif %}\r\n{% if data.subject_lcgft_terms|length > 0 %}\r\n\t{% for subject_lcgft_terms in data.subject_lcgft_terms %}\r\n \t{{ subject_lcgft_terms.label }}<\/dc:subject>\r\n\t{% endfor %}\r\n{% endif %}\r\n{# Publisher #}\r\n{% if data.publisher|length > 0 %}\r\n\t{{ data.publisher }}<\/dc:publisher>\r\n{% endif %} \r\n{# Language #}\r\n{% if data.language|length > 0 %}\r\n {% if data.language is iterable %}\r\n \t{% for language in data.language %}\r\n \t\t{{ language }}<\/dc:language>\r\n \t{% endfor %}\r\n {% else %}\r\n \t\t{{ data.language }}<\/dc:language>\r\n {% endif %} \r\n{% endif %}\r\n{# Type #}\r\n{% if data.type|length > 0 %}\r\n\t{{ data.type }}<\/dc:type>\r\n{% endif %} \r\n{# Format \r\n<\/dc:format>\r\n#}\r\n{# Identifier #}\r\n{% if data.local_identifier|length > 0 %}\r\n \t{% if data.local_identifier is iterable %}\r\n \t{% for local_identifier in data.local_identifier %}\r\n\t\t\t{{ local_identifier|escape('html_attr') }}<\/dc:identifier>\r\n {% endfor %}\r\n {% else %}\r\n \t\t{{ data.local_identifier|escape('html_attr') }}<\/dc:identifier>\r\n {% endif %} \r\n{% endif %}\r\n{# Source #}\r\n{# Source #}\r\n{% if data.owner|length > 0 %}\r\n\t{{ data.owner }}<\/dc:source>\r\n{% endif %}\r\n{# Relation #}\r\n{% if node.id %}\r\n {% set nodeurl = url('entity.node.canonical', {'node': node.id}, {'absolute': true}) %}\r\n{% else %}\r\n {% set nodeurl = '' ~ '\/iiif\/manifest' %}\r\n{% endif%}\r\n {% if attribute(data, 'ismemberof') %}\r\n {% if attribute(data, 'ismemberof') is iterable %}\r\n {% for collection in attribute(data, 'ismemberof')%}\r\n {% set parentnode = bamboo_load_entity('node', collection) %}\r\n {% set parentnodeurl = url('entity.node.canonical', {'node': collection}, {'absolute': true}) %}\r\n{{ parentnode.title.value }}<\/dc:relation>\r\n{% endfor %}\r\n{% else %}\r\n {% set parentnode = bamboo_load_entity('node', attribute(data, 'ismemberof')) %}\r\n {% set parentnodeurl = url('entity.node.canonical', {'node': attribute(data, 'ismemberof')}, {'absolute': true}) %}\r\n {{ parentnode.title.value }}<\/dc:relation>\r\n {% endif %}\r\n{% endif %}\r\n{# Rights #}\r\n{% if data.rights|length > 0 %} \r\n {{ data.rights }}<\/dc:rights>\r\n{% endif %}\r\n<\/oai_dc:dc>\r\n{% endif %}\r\n<\/metadata>\r\n{% endif %}"},"id":"b5c12175-e0a9-49e9-a698-cbba342667e0","type":"metadatadisplay_entity--metadatadisplay_entity"}} \ No newline at end of file From 8b93777e2821662f9f0b2f9952b8e0593cd9cc13 Mon Sep 17 00:00:00 2001 From: Allison Sherrick <67483756+alliomeria@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:43:50 -0400 Subject: [PATCH 03/14] Update metadatadisplay_entity_16.json Revert to correct #16 (IIIF Presentation API 3 Thumbnail) --- d8content/metadatadisplay_entity_16.json | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/d8content/metadatadisplay_entity_16.json b/d8content/metadatadisplay_entity_16.json index 48702fc..6f0be3c 100644 --- a/d8content/metadatadisplay_entity_16.json +++ b/d8content/metadatadisplay_entity_16.json @@ -1 +1,12 @@ -{"data":{"id":"7ed7f7b2-7690-402f-93ea-a9b50a094f30","attributes":{"mimetype":"application\/xml","revision_translation_affected":null,"revision_created":"2024-03-08T16:54:36+00:00","twig":"\r\n\r\n {{ data_api.request_date }}<\/responseDate>\r\n {%- if data|length > 0 -%}\r\n {%- set resumptiontoken_arguments = data_api.query %}\r\n {%- if data_api.query.page is defined and not empty -%}\r\n {%- set resumptiontoken_arguments = resumptiontoken_arguments|merge({\"page\":(data_api.query.page+1)})-%}\r\n {%- else -%}\r\n {%- set resumptiontoken_arguments = resumptiontoken_arguments|merge({\"page\":2})-%}\r\n {% endif %}\r\n {%-\r\n set resumptiontoken = '?' ~ resumptiontoken_arguments|url_encode\r\n -%}\r\n {%- else -%}\r\n {# No results so no resumption token #}\r\n {%- set resumptiontoken = '' -%}\r\n {%- endif -%}\r\n {{ resumptiontoken }}<\/request>\r\n {%- if data_api.query.verb == \"ListSets\" -%} \r\n\t\tThis repository does not support sets<\/error>\r\n {%- else -%}\r\n {%- if data_api.query.verb -%}\r\n <{{ data_api.query.verb }}>\r\n {%- else -%}\r\n \r\n {%- endif -%} \r\n {%- for XML_doc in data -%}\r\n {%- if data_api.query.verb == \"ListRecords\" -%}\r\n \r\n {%- endif -%}\r\n {{ XML_doc }}\r\n {%- if data_api.query.verb == \"ListRecords\" -%} \r\n <\/record>\r\n {%- endif -%}\r\n {% endfor %}\r\n {# {{ data_api|json_encode|raw }} #}\r\n {# {{ data_api_context|json_encode|raw }} #}\r\n {%- if data_api.query.verb -%}\r\n <\/{{ data_api.query.verb }}>\r\n {%- else -%}\r\n <\/GetRecord>\r\n {%- endif -%}\r\n {%- endif -%}\r\n<\/OAI-PMH>","name":"OAI-PMH Wrapper","langcode":"und","revision_log_message":null,"drupal_internal__vid":17},"type":"metadatadisplay_entity--metadatadisplay_entity"}} \ No newline at end of file +{ + "data": { + "type": "metadatadisplay_entity--metadatadisplay_entity", + "id": "adf12524-11ca-4925-bc23-d028556e75ac", + "attributes": { + "name": "IIIF Presentation API 3 Thumbnail", + "twig": "{# \nThis Template generates Thumbnails for various Media representations\nUpdated 31\/10\/2023 for 1.3.0 \n\nStructures passed from Archipelago are\n- node\n The full Node entitya\n- data\n The Full JSON Structure converted in an Array\n- iiif_server\n The publicly available IIIF Server (Global Setting)\n\nSince JSON was decoded into the 'data' values are valid PHP but could not\nbe valid JSON when outputting. So We use data.description|json_encode|raw\nWithout Double quotes.\n#}\n{# <---- SETUP ---> #}\n{# -- The Desired width -- #}\n{% set width = 240 %}\n{# -- The IIIF Server URLS -- #}\n{% set Webserverurl = url('')|render|replace({':8001\/':''}) ~ ':8183\/iiif\/2\/' %}\n{% set IIIFserverurl = iiif_server ? iiif_server ~ '\/': Webserverurl %}\n{# -- Node Info -- #}\n{% if node.id %}\n {% set nodeurl = url('entity.node.canonical', {'node': node.id}, {'absolute': true}) %}\n{% else %}\n {% set nodeurl = '' ~ '\/iiif\/manifest' %}\n{% endif%}\n{# -- Language -- #}\n{% set len = language.getId() ? language.getId() : \"en\" %}\n{# --THIS WILL BE THE IMAGE IIIF URL. CAN HAVE A DEFAULT VALUE IN CASE OF FAILURE THERE IS ALWAYS A GENERIC THUMB-- #}\n{# -- NOTE: for loops are scoped so if we onlt define source inside one it will not be accesible from the outside- #}\n{% set source = '' %}\n{# <---- END SETUP --> #}\n{# We will test for 3 main options\n1.- Images\n2.- PDF\n3.- Movies\n#}\n{% apply spaceless %} \n{% if attribute(data, 'as:image')|length > 0 %} \n {% set document = data['as:image']|first %} \n {# if the default size is smaller than the source use the source one #}\n {% if document['flv:exif'].ImageWidth is defined and document['flv:exif'].ImageWidth < width %}\n {% set width = document['flv:exif'].ImageWidth %} \n {% endif %}\n {% set cantaloupeid = IIIFserverurl ~ document['url']|replace({'s3:\/\/':''})|replace({'private:\/\/':''})|url_encode %}\n {% set source = cantaloupeid ~ \"\/full\/\" ~ width ~ \",\/0\/default.jpg\" %}\n{% elseif attribute(data, 'as:document')|length > 0 %}\n {% set break = false %}\n {% for document in data['as:document'] %}\n {% if not break %}\n {# this is just an example, we allow every PDF here but we can also filter by pronom id \"info:pronom\/fmt\/17\" or info:pronom\/fmt\/18 #}\n {% if document['flv:exif'].MIMEType == \"application\/pdf\" and document['flv:exif'].PageCount > 0 %} \n {% set cantaloupeid = IIIFserverurl ~ document['url']|replace({'s3:\/\/':''})|replace({'private:\/\/':''})|url_encode %} \n {% set source = cantaloupeid ~ \";1\/full\/\" ~ width ~ \",\/0\/default.jpg\" %}\n {% set break = true %}\n {% endif%}\n {% endif%}\n {% endfor %}\n{% elseif attribute(data, 'as:video')|length > 0 %} \n {% set break = false %}\n {% for document in data['as:video'] %}\n {% if not break %}\n {# this is just an example, we process here only MP4 quicktimes #}\n {% if document['flv:pronom'].mimetype == \"video\/quicktime\" %}\n {% set cantaloupeid = IIIFserverurl ~ document['url']|replace({'s3:\/\/':''})|replace({'private:\/\/':''})|url_encode %} \n {% set source = cantaloupeid ~ \";1\/full\/\" ~ width ~ \",\/0\/default.jpg\" %}\n {% set break = true %}\n {% endif %}\n {% endif %}\n {% endfor %} \n{% endif%}\n{% if source|length > 0 %}\n {% set thumb_width = width < max_thumb_width ? width: max_thumb_width %}\n {% set thumb_height = (thumb_width\/width * height)|round() %}\n\"thumbnail\": [{\n \"id\": \"{{ source }}\",\n \"type\": \"Image\",\n \"format\": \"image\/jpeg\",\n \"width\": {{ width }},\n \"height\": 180\n}]\n{% else %}\n\"thumbnail\": \n[{\n \"id\": \"{{ url('')|render ~ file_url('public:\/\/media-icons\/generic\/no-thumbnail.png') }}\",\n \"type\": \"Image\",\n \"format\": \"image\/png\",\n \"width\": 180,\n \"height\": 180\n}]\n{% endif %}\n{% endapply %}", + "langcode": "und", + "mimetype": "text/text" + } + } +} From de9f443bd7546bfd4715ca5c65775c10735cb569 Mon Sep 17 00:00:00 2001 From: Allison Sherrick <67483756+alliomeria@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:44:57 -0400 Subject: [PATCH 04/14] Update metadatadisplay_entity_17.json --- d8content/metadatadisplay_entity_17.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d8content/metadatadisplay_entity_17.json b/d8content/metadatadisplay_entity_17.json index 65ff26c..9399291 100644 --- a/d8content/metadatadisplay_entity_17.json +++ b/d8content/metadatadisplay_entity_17.json @@ -1 +1 @@ -{"data":{"attributes":{"mimetype":"application\/xml","revision_translation_affected":null,"revision_log_message":null,"name":"OAI-PMH Item with DC","revision_created":"2024-03-08T16:55:15+00:00","drupal_internal__vid":18,"langcode":"und","twig":"{# Created by Allison & Diego March 2024.\r\nUses Archipelago's default Simple Dublin Core XML template as base. #}\r\n{%- set oai_id = 'oai:fake:test' -%}\r\n{%- if node.uuid.value -%}\r\n{%- set oai_id = node.uuid.value -%}\r\n{%- set changed = node.changed.value|date(\"Y-m-d\") -%}\r\n{%- endif -%}\r\n
\r\n oai:localhost:{{ oai_id }}<\/identifier>\r\n {{ changed }}<\/datestamp>\r\n{%- if attribute(data, 'ismemberof') -%} \r\n {%- if attribute(data, 'ismemberof') is iterable -%} \r\n {%- for collection in attribute(data, 'ismemberof') -%} \r\n {%- set parentnode = bamboo_load_entity('node', collection) -%} \r\n {%- if parentnode -%} \r\n {{ parentnode.uuid.value }}<\/setSpec>\r\n {%- endif -%} \r\n {%- endfor -%} \r\n {% else %} \r\n\t {% set parentnode = bamboo_load_entity('node', attribute(data, 'ismemberof')) %} \r\n {% if parentnode %} \r\n\t\t{{ parentnode.uuid.value }}<\/setSpec>\r\n {% endif %} \r\n {% endif %} \r\n{% endif %} \r\n <\/header>\r\n{% if data_api.query.verb == \"ListRecords\" or data_api.query.verb == \"GetRecord\" %} \r\n\r\n{% if data_api.query.metadataPrefix == 'oai_dc' %}\r\n\r\n\r\n{{ data.label|escape('html') }}<\/dc:title>\r\n{# Creator #}\r\n{% if data.creator|length > 0 %}\r\n\t{% if data.creator is iterable %}\r\n\t\t{% for creator in data.creator %}\r\n\t\t\t{{ creator }}<\/dc:creator>\r\n\t\t{% endfor %}\r\n {% else %}\r\n \t{{ data.creator }}<\/dc:creator>\r\n\t{% endif %} \r\n{% endif %}\r\n{% if data.creator_lod|length > 0 %}\r\n\t{% for creator_lod in data.creator_lod %}\r\n \t{{ creator_lod.name_label }}<\/dc:creator>\r\n\t{% endfor %}\r\n{% endif %}\r\n{# Contributor\r\n<\/dc:contributor>\r\n#}\r\n{# Coverage \r\n<\/dc:coverage>\r\n#}\r\n{# Date #}\r\n{% if data.date_created|length > 0 %}\r\n\t{{ data.date_created }}<\/dc:date>\r\n{% endif %}\r\n\t{% if data.date_created_edtf.date_free is defined and not empty %}\r\n\t\t{{ data.date_created_edtf.date_free }}<\/dc:date>\r\n\t{% endif %}\r\n\t{% if data.date_issued_edtf.date_free is defined and not empty %}\t\r\n\t\t{{ data.date_issued_edtf.date_free }}<\/dc:date>\r\n\t{% endif %}\t\r\n{# Description #}\r\n{% if data.description|length > 0 %}\r\n\t{% if data.description is iterable %}\r\n\t\t{% for description in data.description %}\r\n\t\t\t{{ description|escape('html_attr') }}<\/dc:description>\r\n\t\t{% endfor %}\r\n {% else %}\r\n\t{{ data.description|escape('html_attr') }}<\/dc:description>\r\n\t{% endif %} \r\n{% endif %}\r\n{# Subject #}\r\n{# LoD Subjects #}\r\n{% if data.subject_loc|length > 0 %}\r\n\t{% for subject_loc in data.subject_loc %}\r\n \t{{ subject_loc.label }}<\/dc:subject>\r\n\t{% endfor %}\r\n{% endif %}\r\n{% if data.subject_lcgft_terms|length > 0 %}\r\n\t{% for subject_lcgft_terms in data.subject_lcgft_terms %}\r\n \t{{ subject_lcgft_terms.label }}<\/dc:subject>\r\n\t{% endfor %}\r\n{% endif %}\r\n{# Publisher #}\r\n{% if data.publisher|length > 0 %}\r\n\t{{ data.publisher }}<\/dc:publisher>\r\n{% endif %} \r\n{# Language #}\r\n{% if data.language|length > 0 %}\r\n {% if data.language is iterable %}\r\n \t{% for language in data.language %}\r\n \t\t{{ language }}<\/dc:language>\r\n \t{% endfor %}\r\n {% else %}\r\n \t\t{{ data.language }}<\/dc:language>\r\n {% endif %} \r\n{% endif %}\r\n{# Type #}\r\n{% if data.type|length > 0 %}\r\n\t{{ data.type }}<\/dc:type>\r\n{% endif %} \r\n{# Format \r\n<\/dc:format>\r\n#}\r\n{# Identifier #}\r\n{% if data.local_identifier|length > 0 %}\r\n \t{% if data.local_identifier is iterable %}\r\n \t{% for local_identifier in data.local_identifier %}\r\n\t\t\t{{ local_identifier|escape('html_attr') }}<\/dc:identifier>\r\n {% endfor %}\r\n {% else %}\r\n \t\t{{ data.local_identifier|escape('html_attr') }}<\/dc:identifier>\r\n {% endif %} \r\n{% endif %}\r\n{# Source #}\r\n{# Source #}\r\n{% if data.owner|length > 0 %}\r\n\t{{ data.owner }}<\/dc:source>\r\n{% endif %}\r\n{# Relation #}\r\n{% if node.id %}\r\n {% set nodeurl = url('entity.node.canonical', {'node': node.id}, {'absolute': true}) %}\r\n{% else %}\r\n {% set nodeurl = '' ~ '\/iiif\/manifest' %}\r\n{% endif%}\r\n {% if attribute(data, 'ismemberof') %}\r\n {% if attribute(data, 'ismemberof') is iterable %}\r\n {% for collection in attribute(data, 'ismemberof')%}\r\n {% set parentnode = bamboo_load_entity('node', collection) %}\r\n {% set parentnodeurl = url('entity.node.canonical', {'node': collection}, {'absolute': true}) %}\r\n{{ parentnode.title.value }}<\/dc:relation>\r\n{% endfor %}\r\n{% else %}\r\n {% set parentnode = bamboo_load_entity('node', attribute(data, 'ismemberof')) %}\r\n {% set parentnodeurl = url('entity.node.canonical', {'node': attribute(data, 'ismemberof')}, {'absolute': true}) %}\r\n {{ parentnode.title.value }}<\/dc:relation>\r\n {% endif %}\r\n{% endif %}\r\n{# Rights #}\r\n{% if data.rights|length > 0 %} \r\n {{ data.rights }}<\/dc:rights>\r\n{% endif %}\r\n<\/oai_dc:dc>\r\n{% endif %}\r\n<\/metadata>\r\n{% endif %}"},"id":"b5c12175-e0a9-49e9-a698-cbba342667e0","type":"metadatadisplay_entity--metadatadisplay_entity"}} \ No newline at end of file +{"data":{"id":"7ed7f7b2-7690-402f-93ea-a9b50a094f30","attributes":{"mimetype":"application\/xml","revision_translation_affected":null,"revision_created":"2024-03-08T16:54:36+00:00","twig":"\r\n\r\n {{ data_api.request_date }}<\/responseDate>\r\n {%- if data|length > 0 -%}\r\n {%- set resumptiontoken_arguments = data_api.query %}\r\n {%- if data_api.query.page is defined and not empty -%}\r\n {%- set resumptiontoken_arguments = resumptiontoken_arguments|merge({\"page\":(data_api.query.page+1)})-%}\r\n {%- else -%}\r\n {%- set resumptiontoken_arguments = resumptiontoken_arguments|merge({\"page\":2})-%}\r\n {% endif %}\r\n {%-\r\n set resumptiontoken = '?' ~ resumptiontoken_arguments|url_encode\r\n -%}\r\n {%- else -%}\r\n {# No results so no resumption token #}\r\n {%- set resumptiontoken = '' -%}\r\n {%- endif -%}\r\n {{ resumptiontoken }}<\/request>\r\n {%- if data_api.query.verb == \"ListSets\" -%} \r\n\t\tThis repository does not support sets<\/error>\r\n {%- else -%}\r\n {%- if data_api.query.verb -%}\r\n <{{ data_api.query.verb }}>\r\n {%- else -%}\r\n \r\n {%- endif -%} \r\n {%- for XML_doc in data -%}\r\n {%- if data_api.query.verb == \"ListRecords\" -%}\r\n \r\n {%- endif -%}\r\n {{ XML_doc }}\r\n {%- if data_api.query.verb == \"ListRecords\" -%} \r\n <\/record>\r\n {%- endif -%}\r\n {% endfor %}\r\n {# {{ data_api|json_encode|raw }} #}\r\n {# {{ data_api_context|json_encode|raw }} #}\r\n {%- if data_api.query.verb -%}\r\n <\/{{ data_api.query.verb }}>\r\n {%- else -%}\r\n <\/GetRecord>\r\n {%- endif -%}\r\n {%- endif -%}\r\n<\/OAI-PMH>","name":"OAI-PMH Wrapper","langcode":"und","revision_log_message":null,"drupal_internal__vid":17},"type":"metadatadisplay_entity--metadatadisplay_entity"}} From 3671577da1d84dd254e569e25025a342902c7a31 Mon Sep 17 00:00:00 2001 From: Allison Sherrick <67483756+alliomeria@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:45:13 -0400 Subject: [PATCH 05/14] #18 --- d8content/metadatadisplay_entity_18.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 d8content/metadatadisplay_entity_18.json diff --git a/d8content/metadatadisplay_entity_18.json b/d8content/metadatadisplay_entity_18.json new file mode 100644 index 0000000..65ff26c --- /dev/null +++ b/d8content/metadatadisplay_entity_18.json @@ -0,0 +1 @@ +{"data":{"attributes":{"mimetype":"application\/xml","revision_translation_affected":null,"revision_log_message":null,"name":"OAI-PMH Item with DC","revision_created":"2024-03-08T16:55:15+00:00","drupal_internal__vid":18,"langcode":"und","twig":"{# Created by Allison & Diego March 2024.\r\nUses Archipelago's default Simple Dublin Core XML template as base. #}\r\n{%- set oai_id = 'oai:fake:test' -%}\r\n{%- if node.uuid.value -%}\r\n{%- set oai_id = node.uuid.value -%}\r\n{%- set changed = node.changed.value|date(\"Y-m-d\") -%}\r\n{%- endif -%}\r\n
\r\n oai:localhost:{{ oai_id }}<\/identifier>\r\n {{ changed }}<\/datestamp>\r\n{%- if attribute(data, 'ismemberof') -%} \r\n {%- if attribute(data, 'ismemberof') is iterable -%} \r\n {%- for collection in attribute(data, 'ismemberof') -%} \r\n {%- set parentnode = bamboo_load_entity('node', collection) -%} \r\n {%- if parentnode -%} \r\n {{ parentnode.uuid.value }}<\/setSpec>\r\n {%- endif -%} \r\n {%- endfor -%} \r\n {% else %} \r\n\t {% set parentnode = bamboo_load_entity('node', attribute(data, 'ismemberof')) %} \r\n {% if parentnode %} \r\n\t\t{{ parentnode.uuid.value }}<\/setSpec>\r\n {% endif %} \r\n {% endif %} \r\n{% endif %} \r\n <\/header>\r\n{% if data_api.query.verb == \"ListRecords\" or data_api.query.verb == \"GetRecord\" %} \r\n\r\n{% if data_api.query.metadataPrefix == 'oai_dc' %}\r\n\r\n\r\n{{ data.label|escape('html') }}<\/dc:title>\r\n{# Creator #}\r\n{% if data.creator|length > 0 %}\r\n\t{% if data.creator is iterable %}\r\n\t\t{% for creator in data.creator %}\r\n\t\t\t{{ creator }}<\/dc:creator>\r\n\t\t{% endfor %}\r\n {% else %}\r\n \t{{ data.creator }}<\/dc:creator>\r\n\t{% endif %} \r\n{% endif %}\r\n{% if data.creator_lod|length > 0 %}\r\n\t{% for creator_lod in data.creator_lod %}\r\n \t{{ creator_lod.name_label }}<\/dc:creator>\r\n\t{% endfor %}\r\n{% endif %}\r\n{# Contributor\r\n<\/dc:contributor>\r\n#}\r\n{# Coverage \r\n<\/dc:coverage>\r\n#}\r\n{# Date #}\r\n{% if data.date_created|length > 0 %}\r\n\t{{ data.date_created }}<\/dc:date>\r\n{% endif %}\r\n\t{% if data.date_created_edtf.date_free is defined and not empty %}\r\n\t\t{{ data.date_created_edtf.date_free }}<\/dc:date>\r\n\t{% endif %}\r\n\t{% if data.date_issued_edtf.date_free is defined and not empty %}\t\r\n\t\t{{ data.date_issued_edtf.date_free }}<\/dc:date>\r\n\t{% endif %}\t\r\n{# Description #}\r\n{% if data.description|length > 0 %}\r\n\t{% if data.description is iterable %}\r\n\t\t{% for description in data.description %}\r\n\t\t\t{{ description|escape('html_attr') }}<\/dc:description>\r\n\t\t{% endfor %}\r\n {% else %}\r\n\t{{ data.description|escape('html_attr') }}<\/dc:description>\r\n\t{% endif %} \r\n{% endif %}\r\n{# Subject #}\r\n{# LoD Subjects #}\r\n{% if data.subject_loc|length > 0 %}\r\n\t{% for subject_loc in data.subject_loc %}\r\n \t{{ subject_loc.label }}<\/dc:subject>\r\n\t{% endfor %}\r\n{% endif %}\r\n{% if data.subject_lcgft_terms|length > 0 %}\r\n\t{% for subject_lcgft_terms in data.subject_lcgft_terms %}\r\n \t{{ subject_lcgft_terms.label }}<\/dc:subject>\r\n\t{% endfor %}\r\n{% endif %}\r\n{# Publisher #}\r\n{% if data.publisher|length > 0 %}\r\n\t{{ data.publisher }}<\/dc:publisher>\r\n{% endif %} \r\n{# Language #}\r\n{% if data.language|length > 0 %}\r\n {% if data.language is iterable %}\r\n \t{% for language in data.language %}\r\n \t\t{{ language }}<\/dc:language>\r\n \t{% endfor %}\r\n {% else %}\r\n \t\t{{ data.language }}<\/dc:language>\r\n {% endif %} \r\n{% endif %}\r\n{# Type #}\r\n{% if data.type|length > 0 %}\r\n\t{{ data.type }}<\/dc:type>\r\n{% endif %} \r\n{# Format \r\n<\/dc:format>\r\n#}\r\n{# Identifier #}\r\n{% if data.local_identifier|length > 0 %}\r\n \t{% if data.local_identifier is iterable %}\r\n \t{% for local_identifier in data.local_identifier %}\r\n\t\t\t{{ local_identifier|escape('html_attr') }}<\/dc:identifier>\r\n {% endfor %}\r\n {% else %}\r\n \t\t{{ data.local_identifier|escape('html_attr') }}<\/dc:identifier>\r\n {% endif %} \r\n{% endif %}\r\n{# Source #}\r\n{# Source #}\r\n{% if data.owner|length > 0 %}\r\n\t{{ data.owner }}<\/dc:source>\r\n{% endif %}\r\n{# Relation #}\r\n{% if node.id %}\r\n {% set nodeurl = url('entity.node.canonical', {'node': node.id}, {'absolute': true}) %}\r\n{% else %}\r\n {% set nodeurl = '' ~ '\/iiif\/manifest' %}\r\n{% endif%}\r\n {% if attribute(data, 'ismemberof') %}\r\n {% if attribute(data, 'ismemberof') is iterable %}\r\n {% for collection in attribute(data, 'ismemberof')%}\r\n {% set parentnode = bamboo_load_entity('node', collection) %}\r\n {% set parentnodeurl = url('entity.node.canonical', {'node': collection}, {'absolute': true}) %}\r\n{{ parentnode.title.value }}<\/dc:relation>\r\n{% endfor %}\r\n{% else %}\r\n {% set parentnode = bamboo_load_entity('node', attribute(data, 'ismemberof')) %}\r\n {% set parentnodeurl = url('entity.node.canonical', {'node': attribute(data, 'ismemberof')}, {'absolute': true}) %}\r\n {{ parentnode.title.value }}<\/dc:relation>\r\n {% endif %}\r\n{% endif %}\r\n{# Rights #}\r\n{% if data.rights|length > 0 %} \r\n {{ data.rights }}<\/dc:rights>\r\n{% endif %}\r\n<\/oai_dc:dc>\r\n{% endif %}\r\n<\/metadata>\r\n{% endif %}"},"id":"b5c12175-e0a9-49e9-a698-cbba342667e0","type":"metadatadisplay_entity--metadatadisplay_entity"}} \ No newline at end of file From 3a02c8702d194e3871efab731da4365e09473103 Mon Sep 17 00:00:00 2001 From: Allison Sherrick <67483756+alliomeria@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:50:26 -0400 Subject: [PATCH 06/14] Twig.html versions of OAI-PMH templates --- .../oai-pmh-item-with-DC.twig.html | 153 ++++++++++++++++++ .../oai-pmh-wrapper.twig.html | 47 ++++++ 2 files changed, 200 insertions(+) create mode 100644 d8content/metadatadisplays/oai-pmh-item-with-DC.twig.html create mode 100644 d8content/metadatadisplays/oai-pmh-wrapper.twig.html diff --git a/d8content/metadatadisplays/oai-pmh-item-with-DC.twig.html b/d8content/metadatadisplays/oai-pmh-item-with-DC.twig.html new file mode 100644 index 0000000..0ed4b7c --- /dev/null +++ b/d8content/metadatadisplays/oai-pmh-item-with-DC.twig.html @@ -0,0 +1,153 @@ +{# Created by Allison & Diego March 2024. +Uses Archipelago's default Simple Dublin Core XML template as base. #} +{%- set oai_id = 'oai:fake:test' -%} +{%- if node.uuid.value -%} +{%- set oai_id = node.uuid.value -%} +{%- set changed = node.changed.value|date("Y-m-d") -%} +{%- endif -%} +
+ oai:localhost:{{ oai_id }} + {{ changed }} +{%- if attribute(data, 'ismemberof') -%} + {%- if attribute(data, 'ismemberof') is iterable -%} + {%- for collection in attribute(data, 'ismemberof') -%} + {%- set parentnode = bamboo_load_entity('node', collection) -%} + {%- if parentnode -%} + {{ parentnode.uuid.value }} + {%- endif -%} + {%- endfor -%} + {% else %} + {% set parentnode = bamboo_load_entity('node', attribute(data, 'ismemberof')) %} + {% if parentnode %} + {{ parentnode.uuid.value }} + {% endif %} + {% endif %} +{% endif %} +
+{% if data_api.query.verb == "ListRecords" or data_api.query.verb == "GetRecord" %} + +{% if data_api.query.metadataPrefix == 'oai_dc' %} + + +{{ data.label|escape('html') }} +{# Creator #} +{% if data.creator|length > 0 %} + {% if data.creator is iterable %} + {% for creator in data.creator %} + {{ creator }} + {% endfor %} + {% else %} + {{ data.creator }} + {% endif %} +{% endif %} +{% if data.creator_lod|length > 0 %} + {% for creator_lod in data.creator_lod %} + {{ creator_lod.name_label }} + {% endfor %} +{% endif %} +{# Contributor + +#} +{# Coverage + +#} +{# Date #} +{% if data.date_created|length > 0 %} + {{ data.date_created }} +{% endif %} + {% if data.date_created_edtf.date_free is defined and not empty %} + {{ data.date_created_edtf.date_free }} + {% endif %} + {% if data.date_issued_edtf.date_free is defined and not empty %} + {{ data.date_issued_edtf.date_free }} + {% endif %} +{# Description #} +{% if data.description|length > 0 %} + {% if data.description is iterable %} + {% for description in data.description %} + {{ description|escape('html_attr') }} + {% endfor %} + {% else %} + {{ data.description|escape('html_attr') }} + {% endif %} +{% endif %} +{# Subject #} +{# LoD Subjects #} +{% if data.subject_loc|length > 0 %} + {% for subject_loc in data.subject_loc %} + {{ subject_loc.label }} + {% endfor %} +{% endif %} +{% if data.subject_lcgft_terms|length > 0 %} + {% for subject_lcgft_terms in data.subject_lcgft_terms %} + {{ subject_lcgft_terms.label }} + {% endfor %} +{% endif %} +{# Publisher #} +{% if data.publisher|length > 0 %} + {{ data.publisher }} +{% endif %} +{# Language #} +{% if data.language|length > 0 %} + {% if data.language is iterable %} + {% for language in data.language %} + {{ language }} + {% endfor %} + {% else %} + {{ data.language }} + {% endif %} +{% endif %} +{# Type #} +{% if data.type|length > 0 %} + {{ data.type }} +{% endif %} +{# Format + +#} +{# Identifier #} +{% if data.local_identifier|length > 0 %} + {% if data.local_identifier is iterable %} + {% for local_identifier in data.local_identifier %} + {{ local_identifier|escape('html_attr') }} + {% endfor %} + {% else %} + {{ data.local_identifier|escape('html_attr') }} + {% endif %} +{% endif %} +{# Source #} +{# Source #} +{% if data.owner|length > 0 %} + {{ data.owner }} +{% endif %} +{# Relation #} +{% if node.id %} + {% set nodeurl = url('entity.node.canonical', {'node': node.id}, {'absolute': true}) %} +{% else %} + {% set nodeurl = '' ~ '/iiif/manifest' %} +{% endif%} + {% if attribute(data, 'ismemberof') %} + {% if attribute(data, 'ismemberof') is iterable %} + {% for collection in attribute(data, 'ismemberof')%} + {% set parentnode = bamboo_load_entity('node', collection) %} + {% set parentnodeurl = url('entity.node.canonical', {'node': collection}, {'absolute': true}) %} +{{ parentnode.title.value }} +{% endfor %} +{% else %} + {% set parentnode = bamboo_load_entity('node', attribute(data, 'ismemberof')) %} + {% set parentnodeurl = url('entity.node.canonical', {'node': attribute(data, 'ismemberof')}, {'absolute': true}) %} + {{ parentnode.title.value }} + {% endif %} +{% endif %} +{# Rights #} +{% if data.rights|length > 0 %} + {{ data.rights }} +{% endif %} + +{% endif %} + +{% endif %} \ No newline at end of file diff --git a/d8content/metadatadisplays/oai-pmh-wrapper.twig.html b/d8content/metadatadisplays/oai-pmh-wrapper.twig.html new file mode 100644 index 0000000..7ad2d53 --- /dev/null +++ b/d8content/metadatadisplays/oai-pmh-wrapper.twig.html @@ -0,0 +1,47 @@ + + + {{ data_api.request_date }} + {%- if data|length > 0 -%} + {%- set resumptiontoken_arguments = data_api.query %} + {%- if data_api.query.page is defined and not empty -%} + {%- set resumptiontoken_arguments = resumptiontoken_arguments|merge({"page":(data_api.query.page+1)})-%} + {%- else -%} + {%- set resumptiontoken_arguments = resumptiontoken_arguments|merge({"page":2})-%} + {% endif %} + {%- + set resumptiontoken = '?' ~ resumptiontoken_arguments|url_encode + -%} + {%- else -%} + {# No results so no resumption token #} + {%- set resumptiontoken = '' -%} + {%- endif -%} + {{ resumptiontoken }} + {%- if data_api.query.verb == "ListSets" -%} + This repository does not support sets + {%- else -%} + {%- if data_api.query.verb -%} + <{{ data_api.query.verb }}> + {%- else -%} + + {%- endif -%} + {%- for XML_doc in data -%} + {%- if data_api.query.verb == "ListRecords" -%} + + {%- endif -%} + {{ XML_doc }} + {%- if data_api.query.verb == "ListRecords" -%} + + {%- endif -%} + {% endfor %} + {# {{ data_api|json_encode|raw }} #} + {# {{ data_api_context|json_encode|raw }} #} + {%- if data_api.query.verb -%} + + {%- else -%} + + {%- endif -%} + {%- endif -%} + \ No newline at end of file From 0baf45225b84fa485f5c2f52dc778a9465f473dc Mon Sep 17 00:00:00 2001 From: Allison Sherrick <67483756+alliomeria@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:37:14 -0400 Subject: [PATCH 07/14] Update deploy.sh To add the two OAI-PMH templates --- scripts/archipelago/deploy.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/archipelago/deploy.sh b/scripts/archipelago/deploy.sh index da49427..88562de 100755 --- a/scripts/archipelago/deploy.sh +++ b/scripts/archipelago/deploy.sh @@ -65,6 +65,14 @@ echo -e "IIIF 3.0 Thumbnail Manifest Snippet for Collections\n" curl -w "\n" --user jsonapi:jsonapi -H 'Accept: application/vnd.api+json' -H 'Content-type: application/vnd.api+json' -XPOST http://esmero-web/jsonapi/metadatadisplay_entity/metadatadisplay_entity --data-binary @d8content/metadatadisplay_entity_16.json; +echo -e "OAI-PMH Wrapper\n" + +curl -w "\n" --user jsonapi:jsonapi -H 'Accept: application/vnd.api+json' -H 'Content-type: application/vnd.api+json' -XPOST http://esmero-web/jsonapi/metadatadisplay_entity/metadatadisplay_entity --data-binary @d8content/metadatadisplay_entity_17.json; + +echo -e "OAI-PMH Item with DC\n" + +curl -w "\n" --user jsonapi:jsonapi -H 'Accept: application/vnd.api+json' -H 'Content-type: application/vnd.api+json' -XPOST http://esmero-web/jsonapi/metadatadisplay_entity/metadatadisplay_entity --data-binary @d8content/metadatadisplay_entity_18.json; + echo -e "Deploying Menu Items\n" curl -w "\n" --user jsonapi:jsonapi -H 'Accept: application/vnd.api+json' -H 'Content-type: application/vnd.api+json' -XPOST http://esmero-web/jsonapi/menu_link_content/menu_link_content --data-binary @d8content/menu_link_content_01.json; From af53cdcbc2b8d29dcca66a09e650e42ae39cc98f Mon Sep 17 00:00:00 2001 From: Allison Sherrick <67483756+alliomeria@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:56:11 -0400 Subject: [PATCH 08/14] Update iiif_presentation_api_3_collection_manifest.twig.html Part 1 for https://github.com/esmero/archipelago-deployment/issues/267 --- ...sentation_api_3_collection_manifest.twig.html | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/d8content/metadatadisplays/iiif_presentation_api_3_collection_manifest.twig.html b/d8content/metadatadisplays/iiif_presentation_api_3_collection_manifest.twig.html index 05316b5..75bd432 100644 --- a/d8content/metadatadisplays/iiif_presentation_api_3_collection_manifest.twig.html +++ b/d8content/metadatadisplays/iiif_presentation_api_3_collection_manifest.twig.html @@ -1,5 +1,7 @@ {# -Updated 07/08/2022 for 1.0.0 +Updated 06/13/2024 for 1.4.0 + +Uses metadata exposed endpoint Route to generate URL so Aliases don't break it This Template generates IIIF 3.0 API Manifest for Collections using a Drupal Views JSON to be used by a Drupal Views (REST) to generate a simpler to parse/join listing of Canvases @@ -20,6 +22,7 @@ {% set Webserverurl = url('')|render|replace({':8001/':''}) ~ ':8183/iiif/2/' %} {% set IIIFserverurl = iiif_server ? iiif_server ~ '/': Webserverurl %} {% set currenturl = url('')|render %} +{% set nodeid = 1 %} {% if node.id %} {# this is needed to the View Argument can conform to the format even when no node exists when saving the template #} {% set nodeid = node.id %} @@ -156,13 +159,16 @@ {# canvas|json_encode #} { {% if 'CreativeWorkSeries' in items['ado_type']|split(',') %} - "id": "{{ url('entity.node.canonical', {'node': items['nid']}, {'absolute': true}) }}/metadata/iiifmanifest3cws/default.jsonld", + "id": "{{ url('format_strawberryfield.metadatadisplay_caster', {'node': items['uuid'],'metadataexposeconfig_entity':'iiifmanifest3cws', + 'format':'default.jsonld'}, {'absolute': true, 'alias': true}) }}", "type": "Manifest", {% elseif 'Collection' in items['ado_type']|split(',') %} - "id": "{{ url('entity.node.canonical', {'node': items['nid']}, {'absolute': true}) }}/metadata/iiifmanifest3collection/default.jsonld", + "id": "{{ url('format_strawberryfield.metadatadisplay_caster', {'node': items['uuid'], 'metadataexposeconfig_entity':'iiifmanifest3collection', + 'format':'default.jsonld'}, {'absolute': true, 'alias': true}) }}", "type": "Collection", {% else %} - "id": "{{ url('entity.node.canonical', {'node': items['nid']}, {'absolute': true}) }}/metadata/iiifmanifest/default.jsonld", + "id": "{{ url('format_strawberryfield.metadatadisplay_caster', {'node': items['uuid'], 'metadataexposeconfig_entity':'iiifmanifest', + 'format':'default.jsonld'}, {'absolute': true, 'alias': true}) }}", "type": "Manifest", {% endif %} "label": { "{{len}}": [ "{{ items['label'] }}" ] }, @@ -171,4 +177,4 @@ {{ not loop.last ? ',' : '' }} {% endfor %} ] -} \ No newline at end of file +} From a09643a389edfe3d91d2cdc922896a8068857615 Mon Sep 17 00:00:00 2001 From: Allison Sherrick <67483756+alliomeria@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:56:58 -0400 Subject: [PATCH 09/14] Update metadatadisplay_entity_15.json Part 2 for https://github.com/esmero/archipelago-deployment/issues/267 --- d8content/metadatadisplay_entity_15.json | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/d8content/metadatadisplay_entity_15.json b/d8content/metadatadisplay_entity_15.json index d64230f..9399291 100644 --- a/d8content/metadatadisplay_entity_15.json +++ b/d8content/metadatadisplay_entity_15.json @@ -1,12 +1 @@ -{ - "data": { - "type": "metadatadisplay_entity--metadatadisplay_entity", - "id": "9be8473c-3fb3-42ee-aef2-431b2d4f93bb", - "attributes": { - "name": "IIIF Presentation API 3 Collection Manifest", - "twig": "{#\nUpdated 07\/08\/2022 for 1.0.0\n\nThis Template generates IIIF 3.0 API Manifest for Collections using a Drupal Views\nJSON to be used by a Drupal Views (REST) to generate a simpler to parse\/join listing of Canvases\nFor a Collection Manifest Manifest\n\nStructures passed from Archipelago are\n- node\n The full Node entity\n- data\n The Full JSON Structure converted in an Array\n- iiif_server\n The publicly available IIIF Server (Global Setting)\n\nSince JSON was decoded into the 'data' values are valid PHP but could not\nbe valid JSON when outputting. So We use data.description|json_encode|raw\nWithout Double quotes.\n#}\n{% set Webserverurl = url('')|render|replace({':8001\/':''}) ~ ':8183\/iiif\/2\/' %}\n{% set IIIFserverurl = iiif_server ? iiif_server ~ '\/': Webserverurl %}\n{% set currenturl = url('')|render %}\n{% if node.id %}\n{# this is needed to the View Argument can conform to the format even when no node exists when saving the template #}\n {% set nodeid = node.id %}\n {% set nodeurl = url('entity.node.canonical', {'node': node.id}, {'absolute': true}) %}\n{% else %}\n {% set nodeid = 1 %} \n {% set nodeurl = currenturl %}\n{% endif%}\n{% set len = language.getId() ? language.getId() : \"en\" %}\n{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC-EDU\/1.0\/\" %}\n{% if data.rights|length > 0 or data.rights_statements|length > 0 %}\n\t{% if data.rights|length > 0 %} \n\t\t{% set computed_rights = data.rights %}\n\t{% endif %}\n{% elseif data.rights_statements|length > 0 %}\n\t{% if data.rights_statements in ['In Copyright'] %} \n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC\/1.0\/\" %}\n\t{% endif %}\n\t{% if data.rights_statements in ['In Copyright - EU Orphan Work'] %} \n \t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC-OW-EU\/1.0\/\" %}\n\t{% endif %}\n\t{% if data.rights_statements in ['In Copyright - Educational Use Permitted'] %} \n\t \t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC-EDU\/1.0\/\" %}\n\t{% endif %}\n\t{% if data.rights_statements in ['In Copyright - Non-Commercial Use Permitted'] %} \n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC-NC\/1.0\/\" %}\n\t{% endif %}\n\t{% if data.rights_statements in ['In Copyright - Rights-holder(s) Unlocatable or Unidentifiable'] %} \n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC-RUU\/1.0\/\" %}\n\t{% endif %}\n\t{% if data.rights_statements in ['No Copyright - Contractual Restrictions'] %} \n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/NoC-CR\/1.0\/\" %}\n\t{% endif %} \n\t{% if data.rights_statements in ['No Copyright - Non-Commercial Use Only'] %} \n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/NoC-NC\/1.0\/\" %}\n\t{% endif %}\n\t{% if data.rights_statements in ['No Copyright - Other Known Legal Restrictions'] %} \n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/NoC-OKLR\/1.0\/\" %}\n\t{% endif %}\n\t{% if data.rights_statements in ['No Copyright - United States'] %} \n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/NoC-US\/1.0\/\" %}\n\t{% endif %} \n\t{% if data.rights_statements in ['Copyright Not Evaluated'] %} \n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/CNE\/1.0\/\" %}\n\t{% endif %}\n\t{% if data.rights_statements in ['Copyright Undetermined'] %} \n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/UND\/1.0\/\" %}\n\t{% endif %}\n\t{% if data.rights_statements in ['No Known Copyright'] %} \n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/NKC\/1.0\/\" %}\n\t{% endif %}\n{% endif %}\n{\n{# Top Object Metadata #}\n\"@context\": [\n \"http:\/\/www.w3.org\/ns\/anno.jsonld\",\n \"http:\/\/iiif.io\/api\/presentation\/3\/context.json\"\n],\n\"type\": \"Collection\",\n\"id\": \"{{ currenturl }}\",\n\"label\": {\n\"{{ len }}\": [\n{{ node.label|json_encode|raw }}\n]\n},\n\"requiredStatement\": {\n\"label\": { \"en\": [ \"Attribution\" ] },\n\"value\": { \"en\": [ \"Provided by Archipelago Deployment\" ] }\n},\n\"rights\": {{ computed_rights|json_encode|raw }},\n\"metadata\": [\n{% for agent in attribute(data, 'edm_agent') %}\n {\n \"label\": {\n \"{{ len }}\": [\n {{ agent.role_label|json_encode|raw }}\n ]\n },\n \"value\": {\n \"{{ len }}\": [\n {{ agent.name_label|json_encode|raw }}\n ]\n }\n },\n{% endfor %}\n{\n\"label\": {\n\"{{ len }}\": [\n\"description\"\n]\n},\n\"value\": {\n\"{{ len }}\": [\n{{ data.description|json_encode|raw }}\n]\n}\n},\n{\n\"label\": {\n\"{{ len }}\": [\n\"navDate\"\n]\n},\n\"value\": {\n\"{{ len }}\": [\n\"{{ node.getChangedTime|date(\"F jS \\\\a\\\\t g:ia\") }}\"\n]\n}\n},\n{\n\"label\": {\n\"{{ len }}\": [\n\"license\"\n]\n},\n\"value\": {\n\"{{ len }}\": [\n{{ computed_rights|json_encode|raw }}\n]\n}\n}\n],\n{% if attribute(data, 'memberof') %}\n {% set currentnode = 'node\/' ~ data.memberof %}\n \"within\": \"{{ url(currentnode) }}\",\n{% else %}\n {% set currentnode = '' %}\n{% endif %}\n{# fetch all children using a View and attach them as Items #}\n \"items\": [\n{% set collection_view = drupal_view('data_collection_manifest','children_ismemberof_manifest_rest', nodeid)|render %}\n{% set collection_items = collection_view|sbf_json_decode %}\n{% for items in collection_items %}\n{# canvas|json_encode #}\n {\n {% if 'CreativeWorkSeries' in items['ado_type']|split(',') %}\n \"id\": \"{{ url('entity.node.canonical', {'node': items['nid']}, {'absolute': true}) }}\/metadata\/iiifmanifest3cws\/default.jsonld\",\n \"type\": \"Manifest\",\n {% elseif 'Collection' in items['ado_type']|split(',') %}\n \"id\": \"{{ url('entity.node.canonical', {'node': items['nid']}, {'absolute': true}) }}\/metadata\/iiifmanifest3collection\/default.jsonld\",\n \"type\": \"Collection\",\n {% else %}\n \"id\": \"{{ url('entity.node.canonical', {'node': items['nid']}, {'absolute': true}) }}\/metadata\/iiifmanifest\/default.jsonld\",\n \"type\": \"Manifest\",\n {% endif %}\n \"label\": { \"{{len}}\": [ \"{{ items['label'] }}\" ] },\n {{ items['thumbnail']|raw }}\n }\n {{ not loop.last ? ',' : '' }}\n{% endfor %}\n ]\n}", - "langcode": "und", - "mimetype": "application/ld+json" - } - } -} +{"data":{"id":"7ed7f7b2-7690-402f-93ea-a9b50a094f30","attributes":{"mimetype":"application\/xml","revision_translation_affected":null,"revision_created":"2024-03-08T16:54:36+00:00","twig":"\r\n\r\n {{ data_api.request_date }}<\/responseDate>\r\n {%- if data|length > 0 -%}\r\n {%- set resumptiontoken_arguments = data_api.query %}\r\n {%- if data_api.query.page is defined and not empty -%}\r\n {%- set resumptiontoken_arguments = resumptiontoken_arguments|merge({\"page\":(data_api.query.page+1)})-%}\r\n {%- else -%}\r\n {%- set resumptiontoken_arguments = resumptiontoken_arguments|merge({\"page\":2})-%}\r\n {% endif %}\r\n {%-\r\n set resumptiontoken = '?' ~ resumptiontoken_arguments|url_encode\r\n -%}\r\n {%- else -%}\r\n {# No results so no resumption token #}\r\n {%- set resumptiontoken = '' -%}\r\n {%- endif -%}\r\n {{ resumptiontoken }}<\/request>\r\n {%- if data_api.query.verb == \"ListSets\" -%} \r\n\t\tThis repository does not support sets<\/error>\r\n {%- else -%}\r\n {%- if data_api.query.verb -%}\r\n <{{ data_api.query.verb }}>\r\n {%- else -%}\r\n \r\n {%- endif -%} \r\n {%- for XML_doc in data -%}\r\n {%- if data_api.query.verb == \"ListRecords\" -%}\r\n \r\n {%- endif -%}\r\n {{ XML_doc }}\r\n {%- if data_api.query.verb == \"ListRecords\" -%} \r\n <\/record>\r\n {%- endif -%}\r\n {% endfor %}\r\n {# {{ data_api|json_encode|raw }} #}\r\n {# {{ data_api_context|json_encode|raw }} #}\r\n {%- if data_api.query.verb -%}\r\n <\/{{ data_api.query.verb }}>\r\n {%- else -%}\r\n <\/GetRecord>\r\n {%- endif -%}\r\n {%- endif -%}\r\n<\/OAI-PMH>","name":"OAI-PMH Wrapper","langcode":"und","revision_log_message":null,"drupal_internal__vid":17},"type":"metadatadisplay_entity--metadatadisplay_entity"}} From 4218521466a78f8c53ebc0dc0de98ba37c87cf20 Mon Sep 17 00:00:00 2001 From: Allison Sherrick <67483756+alliomeria@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:06:13 -0400 Subject: [PATCH 10/14] Update update_deployed.sh This one too :) --- scripts/archipelago/update_deployed.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/archipelago/update_deployed.sh b/scripts/archipelago/update_deployed.sh index 219740c..3ddd31c 100755 --- a/scripts/archipelago/update_deployed.sh +++ b/scripts/archipelago/update_deployed.sh @@ -65,6 +65,14 @@ echo -e "IIIF 3.0 Thumbnail Manifest Snippet for Collections\n" curl -w "\n" --user jsonapi:jsonapi -H 'Accept: application/vnd.api+json' -H 'Content-type: application/vnd.api+json' -XPATCH http://esmero-web/jsonapi/metadatadisplay_entity/metadatadisplay_entity/adf12524-11ca-4925-bc23-d028556e75ac --data-binary @d8content/metadatadisplay_entity_16.json; +echo -e "OAI-PMH Wrapper\n" + +curl -w "\n" --user jsonapi:jsonapi -H 'Accept: application/vnd.api+json' -H 'Content-type: application/vnd.api+json' -XPATCH http://esmero-web/jsonapi/metadatadisplay_entity/metadatadisplay_entity/7ed7f7b2-7690-402f-93ea-a9b50a094f30 --data-binary @d8content/metadatadisplay_entity_17.json; + +echo -e "OAI-PMH Item with DC\n" + +curl -w "\n" --user jsonapi:jsonapi -H 'Accept: application/vnd.api+json' -H 'Content-type: application/vnd.api+json' -XPATCH http://esmero-web/jsonapi/metadatadisplay_entity/metadatadisplay_entity/b5c12175-e0a9-49e9-a698-cbba342667e0 --data-binary @d8content/metadatadisplay_entity_18.json; + echo -e "Updating Menu Items\n" curl -w "\n" --user jsonapi:jsonapi -H 'Accept: application/vnd.api+json' -H 'Content-type: application/vnd.api+json' -XPATCH http://esmero-web/jsonapi/menu_link_content/menu_link_content/a580dad6-5932-4f9d-bdaa-06b5563c386c --data-binary @d8content/menu_link_content_01.json; From dd5bee354e0fdcd5288ff2040a5833a5e145ae19 Mon Sep 17 00:00:00 2001 From: Allison Sherrick <67483756+alliomeria@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:16:07 -0400 Subject: [PATCH 11/14] Update metadatadisplay_entity_15.json --- d8content/metadatadisplay_entity_15.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d8content/metadatadisplay_entity_15.json b/d8content/metadatadisplay_entity_15.json index 9399291..df285b2 100644 --- a/d8content/metadatadisplay_entity_15.json +++ b/d8content/metadatadisplay_entity_15.json @@ -1 +1 @@ -{"data":{"id":"7ed7f7b2-7690-402f-93ea-a9b50a094f30","attributes":{"mimetype":"application\/xml","revision_translation_affected":null,"revision_created":"2024-03-08T16:54:36+00:00","twig":"\r\n\r\n {{ data_api.request_date }}<\/responseDate>\r\n {%- if data|length > 0 -%}\r\n {%- set resumptiontoken_arguments = data_api.query %}\r\n {%- if data_api.query.page is defined and not empty -%}\r\n {%- set resumptiontoken_arguments = resumptiontoken_arguments|merge({\"page\":(data_api.query.page+1)})-%}\r\n {%- else -%}\r\n {%- set resumptiontoken_arguments = resumptiontoken_arguments|merge({\"page\":2})-%}\r\n {% endif %}\r\n {%-\r\n set resumptiontoken = '?' ~ resumptiontoken_arguments|url_encode\r\n -%}\r\n {%- else -%}\r\n {# No results so no resumption token #}\r\n {%- set resumptiontoken = '' -%}\r\n {%- endif -%}\r\n {{ resumptiontoken }}<\/request>\r\n {%- if data_api.query.verb == \"ListSets\" -%} \r\n\t\tThis repository does not support sets<\/error>\r\n {%- else -%}\r\n {%- if data_api.query.verb -%}\r\n <{{ data_api.query.verb }}>\r\n {%- else -%}\r\n \r\n {%- endif -%} \r\n {%- for XML_doc in data -%}\r\n {%- if data_api.query.verb == \"ListRecords\" -%}\r\n \r\n {%- endif -%}\r\n {{ XML_doc }}\r\n {%- if data_api.query.verb == \"ListRecords\" -%} \r\n <\/record>\r\n {%- endif -%}\r\n {% endfor %}\r\n {# {{ data_api|json_encode|raw }} #}\r\n {# {{ data_api_context|json_encode|raw }} #}\r\n {%- if data_api.query.verb -%}\r\n <\/{{ data_api.query.verb }}>\r\n {%- else -%}\r\n <\/GetRecord>\r\n {%- endif -%}\r\n {%- endif -%}\r\n<\/OAI-PMH>","name":"OAI-PMH Wrapper","langcode":"und","revision_log_message":null,"drupal_internal__vid":17},"type":"metadatadisplay_entity--metadatadisplay_entity"}} +{"data":{"attributes":{"twig":"{#\r\nUpdated 06\/13\/2024 for 1.4.0\r\n\r\nUses metadata exposed endpoint Route to generate URL so Aliases don't break it\r\n\r\nThis Template generates IIIF 3.0 API Manifest for Collections using a Drupal Views\r\nJSON to be used by a Drupal Views (REST) to generate a simpler to parse\/join listing of Canvases\r\nFor a Collection Manifest Manifest\r\n\r\nStructures passed from Archipelago are\r\n- node\r\n The full Node entity\r\n- data\r\n The Full JSON Structure converted in an Array\r\n- iiif_server\r\n The publicly available IIIF Server (Global Setting)\r\n\r\nSince JSON was decoded into the 'data' values are valid PHP but could not\r\nbe valid JSON when outputting. So We use data.description|json_encode|raw\r\nWithout Double quotes.\r\n#}\r\n{% set Webserverurl = url('')|render|replace({':8001\/':''}) ~ ':8183\/iiif\/2\/' %}\r\n{% set IIIFserverurl = iiif_server ? iiif_server ~ '\/': Webserverurl %}\r\n{% set currenturl = url('')|render %}\r\n{% set nodeid = 1 %} \r\n{% if node.id %}\r\n{# this is needed to the View Argument can conform to the format even when no node exists when saving the template #}\r\n {% set nodeid = node.id %}\r\n {% set nodeurl = url('entity.node.canonical', {'node': node.id}, {'absolute': true}) %}\r\n{% else %}\r\n {% set nodeid = 1 %} \r\n {% set nodeurl = currenturl %}\r\n{% endif%}\r\n{% set len = language.getId() ? language.getId() : \"en\" %}\r\n{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC-EDU\/1.0\/\" %}\r\n{% if data.rights|length > 0 or data.rights_statements|length > 0 %}\r\n\t{% if data.rights|length > 0 %} \r\n\t\t{% set computed_rights = data.rights %}\r\n\t{% endif %}\r\n{% elseif data.rights_statements|length > 0 %}\r\n\t{% if data.rights_statements in ['In Copyright'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['In Copyright - EU Orphan Work'] %} \r\n \t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC-OW-EU\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['In Copyright - Educational Use Permitted'] %} \r\n\t \t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC-EDU\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['In Copyright - Non-Commercial Use Permitted'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC-NC\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['In Copyright - Rights-holder(s) Unlocatable or Unidentifiable'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC-RUU\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['No Copyright - Contractual Restrictions'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/NoC-CR\/1.0\/\" %}\r\n\t{% endif %} \r\n\t{% if data.rights_statements in ['No Copyright - Non-Commercial Use Only'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/NoC-NC\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['No Copyright - Other Known Legal Restrictions'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/NoC-OKLR\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['No Copyright - United States'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/NoC-US\/1.0\/\" %}\r\n\t{% endif %} \r\n\t{% if data.rights_statements in ['Copyright Not Evaluated'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/CNE\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['Copyright Undetermined'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/UND\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['No Known Copyright'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/NKC\/1.0\/\" %}\r\n\t{% endif %}\r\n{% endif %}\r\n{\r\n{# Top Object Metadata #}\r\n\"@context\": [\r\n \"http:\/\/www.w3.org\/ns\/anno.jsonld\",\r\n \"http:\/\/iiif.io\/api\/presentation\/3\/context.json\"\r\n],\r\n\"type\": \"Collection\",\r\n\"id\": \"{{ currenturl }}\",\r\n\"label\": {\r\n\"{{ len }}\": [\r\n{{ node.label|json_encode|raw }}\r\n]\r\n},\r\n\"requiredStatement\": {\r\n\"label\": { \"en\": [ \"Attribution\" ] },\r\n\"value\": { \"en\": [ \"Provided by Archipelago Deployment\" ] }\r\n},\r\n\"rights\": {{ computed_rights|json_encode|raw }},\r\n\"metadata\": [\r\n{% for agent in attribute(data, 'edm_agent') %}\r\n {\r\n \"label\": {\r\n \"{{ len }}\": [\r\n {{ agent.role_label|json_encode|raw }}\r\n ]\r\n },\r\n \"value\": {\r\n \"{{ len }}\": [\r\n {{ agent.name_label|json_encode|raw }}\r\n ]\r\n }\r\n },\r\n{% endfor %}\r\n{\r\n\"label\": {\r\n\"{{ len }}\": [\r\n\"description\"\r\n]\r\n},\r\n\"value\": {\r\n\"{{ len }}\": [\r\n{{ data.description|json_encode|raw }}\r\n]\r\n}\r\n},\r\n{\r\n\"label\": {\r\n\"{{ len }}\": [\r\n\"navDate\"\r\n]\r\n},\r\n\"value\": {\r\n\"{{ len }}\": [\r\n\"{{ node.getChangedTime|date(\"F jS \\\\a\\\\t g:ia\") }}\"\r\n]\r\n}\r\n},\r\n{\r\n\"label\": {\r\n\"{{ len }}\": [\r\n\"license\"\r\n]\r\n},\r\n\"value\": {\r\n\"{{ len }}\": [\r\n{{ computed_rights|json_encode|raw }}\r\n]\r\n}\r\n}\r\n],\r\n{% if attribute(data, 'memberof') %}\r\n {% set currentnode = 'node\/' ~ data.memberof %}\r\n \"within\": \"{{ url(currentnode) }}\",\r\n{% else %}\r\n {% set currentnode = '' %}\r\n{% endif %}\r\n{# fetch all children using a View and attach them as Items #}\r\n \"items\": [\r\n{% set collection_view = drupal_view('data_collection_manifest','children_ismemberof_manifest_rest', nodeid)|render %}\r\n{% set collection_items = collection_view|sbf_json_decode %}\r\n{% for items in collection_items %}\r\n{# canvas|json_encode #}\r\n {\r\n {% if 'CreativeWorkSeries' in items['ado_type']|split(',') %}\r\n \"id\": \"{{ url('format_strawberryfield.metadatadisplay_caster', {'node': items['uuid'],'metadataexposeconfig_entity':'iiifmanifest3cws', \r\n 'format':'default.jsonld'}, {'absolute': true, 'alias': true}) }}\",\r\n \"type\": \"Manifest\",\r\n {% elseif 'Collection' in items['ado_type']|split(',') %}\r\n \"id\": \"{{ url('format_strawberryfield.metadatadisplay_caster', {'node': items['uuid'], 'metadataexposeconfig_entity':'iiifmanifest3collection', \r\n 'format':'default.jsonld'}, {'absolute': true, 'alias': true}) }}\",\r\n \"type\": \"Collection\",\r\n {% else %}\r\n \"id\": \"{{ url('format_strawberryfield.metadatadisplay_caster', {'node': items['uuid'], 'metadataexposeconfig_entity':'iiifmanifest', \r\n 'format':'default.jsonld'}, {'absolute': true, 'alias': true}) }}\",\r\n \"type\": \"Manifest\",\r\n {% endif %}\r\n \"label\": { \"{{len}}\": [ \"{{ items['label'] }}\" ] },\r\n {{ items['thumbnail']|raw }}\r\n }\r\n {{ not loop.last ? ',' : '' }}\r\n{% endfor %}\r\n ]\r\n}","name":"IIIF Presentation API 3 Collection Manifest","mimetype":"application\/ld+json","revision_created":"2024-01-10T19:01:08+00:00","revision_log_message":null,"langcode":"und","revision_translation_affected":null,"drupal_internal__vid":15},"id":"9be8473c-3fb3-42ee-aef2-431b2d4f93bb","type":"metadatadisplay_entity--metadatadisplay_entity"}} From f9966211182638df9cf4e704e02ffb0e1134e0b6 Mon Sep 17 00:00:00 2001 From: Allison Sherrick <67483756+alliomeria@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:22:50 -0400 Subject: [PATCH 12/14] Update metadatadisplay_entity_15.json Remove the extra new revisions & Drupal IDs --- d8content/metadatadisplay_entity_15.json | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/d8content/metadatadisplay_entity_15.json b/d8content/metadatadisplay_entity_15.json index df285b2..39f2eec 100644 --- a/d8content/metadatadisplay_entity_15.json +++ b/d8content/metadatadisplay_entity_15.json @@ -1 +1,12 @@ -{"data":{"attributes":{"twig":"{#\r\nUpdated 06\/13\/2024 for 1.4.0\r\n\r\nUses metadata exposed endpoint Route to generate URL so Aliases don't break it\r\n\r\nThis Template generates IIIF 3.0 API Manifest for Collections using a Drupal Views\r\nJSON to be used by a Drupal Views (REST) to generate a simpler to parse\/join listing of Canvases\r\nFor a Collection Manifest Manifest\r\n\r\nStructures passed from Archipelago are\r\n- node\r\n The full Node entity\r\n- data\r\n The Full JSON Structure converted in an Array\r\n- iiif_server\r\n The publicly available IIIF Server (Global Setting)\r\n\r\nSince JSON was decoded into the 'data' values are valid PHP but could not\r\nbe valid JSON when outputting. So We use data.description|json_encode|raw\r\nWithout Double quotes.\r\n#}\r\n{% set Webserverurl = url('')|render|replace({':8001\/':''}) ~ ':8183\/iiif\/2\/' %}\r\n{% set IIIFserverurl = iiif_server ? iiif_server ~ '\/': Webserverurl %}\r\n{% set currenturl = url('')|render %}\r\n{% set nodeid = 1 %} \r\n{% if node.id %}\r\n{# this is needed to the View Argument can conform to the format even when no node exists when saving the template #}\r\n {% set nodeid = node.id %}\r\n {% set nodeurl = url('entity.node.canonical', {'node': node.id}, {'absolute': true}) %}\r\n{% else %}\r\n {% set nodeid = 1 %} \r\n {% set nodeurl = currenturl %}\r\n{% endif%}\r\n{% set len = language.getId() ? language.getId() : \"en\" %}\r\n{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC-EDU\/1.0\/\" %}\r\n{% if data.rights|length > 0 or data.rights_statements|length > 0 %}\r\n\t{% if data.rights|length > 0 %} \r\n\t\t{% set computed_rights = data.rights %}\r\n\t{% endif %}\r\n{% elseif data.rights_statements|length > 0 %}\r\n\t{% if data.rights_statements in ['In Copyright'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['In Copyright - EU Orphan Work'] %} \r\n \t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC-OW-EU\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['In Copyright - Educational Use Permitted'] %} \r\n\t \t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC-EDU\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['In Copyright - Non-Commercial Use Permitted'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC-NC\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['In Copyright - Rights-holder(s) Unlocatable or Unidentifiable'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/InC-RUU\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['No Copyright - Contractual Restrictions'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/NoC-CR\/1.0\/\" %}\r\n\t{% endif %} \r\n\t{% if data.rights_statements in ['No Copyright - Non-Commercial Use Only'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/NoC-NC\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['No Copyright - Other Known Legal Restrictions'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/NoC-OKLR\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['No Copyright - United States'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/NoC-US\/1.0\/\" %}\r\n\t{% endif %} \r\n\t{% if data.rights_statements in ['Copyright Not Evaluated'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/CNE\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['Copyright Undetermined'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/UND\/1.0\/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['No Known Copyright'] %} \r\n\t\t{% set computed_rights = \"http:\/\/rightsstatements.org\/vocab\/NKC\/1.0\/\" %}\r\n\t{% endif %}\r\n{% endif %}\r\n{\r\n{# Top Object Metadata #}\r\n\"@context\": [\r\n \"http:\/\/www.w3.org\/ns\/anno.jsonld\",\r\n \"http:\/\/iiif.io\/api\/presentation\/3\/context.json\"\r\n],\r\n\"type\": \"Collection\",\r\n\"id\": \"{{ currenturl }}\",\r\n\"label\": {\r\n\"{{ len }}\": [\r\n{{ node.label|json_encode|raw }}\r\n]\r\n},\r\n\"requiredStatement\": {\r\n\"label\": { \"en\": [ \"Attribution\" ] },\r\n\"value\": { \"en\": [ \"Provided by Archipelago Deployment\" ] }\r\n},\r\n\"rights\": {{ computed_rights|json_encode|raw }},\r\n\"metadata\": [\r\n{% for agent in attribute(data, 'edm_agent') %}\r\n {\r\n \"label\": {\r\n \"{{ len }}\": [\r\n {{ agent.role_label|json_encode|raw }}\r\n ]\r\n },\r\n \"value\": {\r\n \"{{ len }}\": [\r\n {{ agent.name_label|json_encode|raw }}\r\n ]\r\n }\r\n },\r\n{% endfor %}\r\n{\r\n\"label\": {\r\n\"{{ len }}\": [\r\n\"description\"\r\n]\r\n},\r\n\"value\": {\r\n\"{{ len }}\": [\r\n{{ data.description|json_encode|raw }}\r\n]\r\n}\r\n},\r\n{\r\n\"label\": {\r\n\"{{ len }}\": [\r\n\"navDate\"\r\n]\r\n},\r\n\"value\": {\r\n\"{{ len }}\": [\r\n\"{{ node.getChangedTime|date(\"F jS \\\\a\\\\t g:ia\") }}\"\r\n]\r\n}\r\n},\r\n{\r\n\"label\": {\r\n\"{{ len }}\": [\r\n\"license\"\r\n]\r\n},\r\n\"value\": {\r\n\"{{ len }}\": [\r\n{{ computed_rights|json_encode|raw }}\r\n]\r\n}\r\n}\r\n],\r\n{% if attribute(data, 'memberof') %}\r\n {% set currentnode = 'node\/' ~ data.memberof %}\r\n \"within\": \"{{ url(currentnode) }}\",\r\n{% else %}\r\n {% set currentnode = '' %}\r\n{% endif %}\r\n{# fetch all children using a View and attach them as Items #}\r\n \"items\": [\r\n{% set collection_view = drupal_view('data_collection_manifest','children_ismemberof_manifest_rest', nodeid)|render %}\r\n{% set collection_items = collection_view|sbf_json_decode %}\r\n{% for items in collection_items %}\r\n{# canvas|json_encode #}\r\n {\r\n {% if 'CreativeWorkSeries' in items['ado_type']|split(',') %}\r\n \"id\": \"{{ url('format_strawberryfield.metadatadisplay_caster', {'node': items['uuid'],'metadataexposeconfig_entity':'iiifmanifest3cws', \r\n 'format':'default.jsonld'}, {'absolute': true, 'alias': true}) }}\",\r\n \"type\": \"Manifest\",\r\n {% elseif 'Collection' in items['ado_type']|split(',') %}\r\n \"id\": \"{{ url('format_strawberryfield.metadatadisplay_caster', {'node': items['uuid'], 'metadataexposeconfig_entity':'iiifmanifest3collection', \r\n 'format':'default.jsonld'}, {'absolute': true, 'alias': true}) }}\",\r\n \"type\": \"Collection\",\r\n {% else %}\r\n \"id\": \"{{ url('format_strawberryfield.metadatadisplay_caster', {'node': items['uuid'], 'metadataexposeconfig_entity':'iiifmanifest', \r\n 'format':'default.jsonld'}, {'absolute': true, 'alias': true}) }}\",\r\n \"type\": \"Manifest\",\r\n {% endif %}\r\n \"label\": { \"{{len}}\": [ \"{{ items['label'] }}\" ] },\r\n {{ items['thumbnail']|raw }}\r\n }\r\n {{ not loop.last ? ',' : '' }}\r\n{% endfor %}\r\n ]\r\n}","name":"IIIF Presentation API 3 Collection Manifest","mimetype":"application\/ld+json","revision_created":"2024-01-10T19:01:08+00:00","revision_log_message":null,"langcode":"und","revision_translation_affected":null,"drupal_internal__vid":15},"id":"9be8473c-3fb3-42ee-aef2-431b2d4f93bb","type":"metadatadisplay_entity--metadatadisplay_entity"}} +{ + "data": { + "attributes": { + "twig": "{#\r\nUpdated 06/13/2024 for 1.4.0\r\n\r\nUses metadata exposed endpoint Route to generate URL so Aliases don't break it\r\n\r\nThis Template generates IIIF 3.0 API Manifest for Collections using a Drupal Views\r\nJSON to be used by a Drupal Views (REST) to generate a simpler to parse/join listing of Canvases\r\nFor a Collection Manifest Manifest\r\n\r\nStructures passed from Archipelago are\r\n- node\r\n The full Node entity\r\n- data\r\n The Full JSON Structure converted in an Array\r\n- iiif_server\r\n The publicly available IIIF Server (Global Setting)\r\n\r\nSince JSON was decoded into the 'data' values are valid PHP but could not\r\nbe valid JSON when outputting. So We use data.description|json_encode|raw\r\nWithout Double quotes.\r\n#}\r\n{% set Webserverurl = url('')|render|replace({':8001/':''}) ~ ':8183/iiif/2/' %}\r\n{% set IIIFserverurl = iiif_server ? iiif_server ~ '/': Webserverurl %}\r\n{% set currenturl = url('')|render %}\r\n{% set nodeid = 1 %} \r\n{% if node.id %}\r\n{# this is needed to the View Argument can conform to the format even when no node exists when saving the template #}\r\n {% set nodeid = node.id %}\r\n {% set nodeurl = url('entity.node.canonical', {'node': node.id}, {'absolute': true}) %}\r\n{% else %}\r\n {% set nodeid = 1 %} \r\n {% set nodeurl = currenturl %}\r\n{% endif%}\r\n{% set len = language.getId() ? language.getId() : \"en\" %}\r\n{% set computed_rights = \"http://rightsstatements.org/vocab/InC-EDU/1.0/\" %}\r\n{% if data.rights|length > 0 or data.rights_statements|length > 0 %}\r\n\t{% if data.rights|length > 0 %} \r\n\t\t{% set computed_rights = data.rights %}\r\n\t{% endif %}\r\n{% elseif data.rights_statements|length > 0 %}\r\n\t{% if data.rights_statements in ['In Copyright'] %} \r\n\t\t{% set computed_rights = \"http://rightsstatements.org/vocab/InC/1.0/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['In Copyright - EU Orphan Work'] %} \r\n \t{% set computed_rights = \"http://rightsstatements.org/vocab/InC-OW-EU/1.0/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['In Copyright - Educational Use Permitted'] %} \r\n\t \t{% set computed_rights = \"http://rightsstatements.org/vocab/InC-EDU/1.0/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['In Copyright - Non-Commercial Use Permitted'] %} \r\n\t\t{% set computed_rights = \"http://rightsstatements.org/vocab/InC-NC/1.0/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['In Copyright - Rights-holder(s) Unlocatable or Unidentifiable'] %} \r\n\t\t{% set computed_rights = \"http://rightsstatements.org/vocab/InC-RUU/1.0/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['No Copyright - Contractual Restrictions'] %} \r\n\t\t{% set computed_rights = \"http://rightsstatements.org/vocab/NoC-CR/1.0/\" %}\r\n\t{% endif %} \r\n\t{% if data.rights_statements in ['No Copyright - Non-Commercial Use Only'] %} \r\n\t\t{% set computed_rights = \"http://rightsstatements.org/vocab/NoC-NC/1.0/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['No Copyright - Other Known Legal Restrictions'] %} \r\n\t\t{% set computed_rights = \"http://rightsstatements.org/vocab/NoC-OKLR/1.0/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['No Copyright - United States'] %} \r\n\t\t{% set computed_rights = \"http://rightsstatements.org/vocab/NoC-US/1.0/\" %}\r\n\t{% endif %} \r\n\t{% if data.rights_statements in ['Copyright Not Evaluated'] %} \r\n\t\t{% set computed_rights = \"http://rightsstatements.org/vocab/CNE/1.0/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['Copyright Undetermined'] %} \r\n\t\t{% set computed_rights = \"http://rightsstatements.org/vocab/UND/1.0/\" %}\r\n\t{% endif %}\r\n\t{% if data.rights_statements in ['No Known Copyright'] %} \r\n\t\t{% set computed_rights = \"http://rightsstatements.org/vocab/NKC/1.0/\" %}\r\n\t{% endif %}\r\n{% endif %}\r\n{\r\n{# Top Object Metadata #}\r\n\"@context\": [\r\n \"http://www.w3.org/ns/anno.jsonld\",\r\n \"http://iiif.io/api/presentation/3/context.json\"\r\n],\r\n\"type\": \"Collection\",\r\n\"id\": \"{{ currenturl }}\",\r\n\"label\": {\r\n\"{{ len }}\": [\r\n{{ node.label|json_encode|raw }}\r\n]\r\n},\r\n\"requiredStatement\": {\r\n\"label\": { \"en\": [ \"Attribution\" ] },\r\n\"value\": { \"en\": [ \"Provided by Archipelago Deployment\" ] }\r\n},\r\n\"rights\": {{ computed_rights|json_encode|raw }},\r\n\"metadata\": [\r\n{% for agent in attribute(data, 'edm_agent') %}\r\n {\r\n \"label\": {\r\n \"{{ len }}\": [\r\n {{ agent.role_label|json_encode|raw }}\r\n ]\r\n },\r\n \"value\": {\r\n \"{{ len }}\": [\r\n {{ agent.name_label|json_encode|raw }}\r\n ]\r\n }\r\n },\r\n{% endfor %}\r\n{\r\n\"label\": {\r\n\"{{ len }}\": [\r\n\"description\"\r\n]\r\n},\r\n\"value\": {\r\n\"{{ len }}\": [\r\n{{ data.description|json_encode|raw }}\r\n]\r\n}\r\n},\r\n{\r\n\"label\": {\r\n\"{{ len }}\": [\r\n\"navDate\"\r\n]\r\n},\r\n\"value\": {\r\n\"{{ len }}\": [\r\n\"{{ node.getChangedTime|date(\"F jS \\\\a\\\\t g:ia\") }}\"\r\n]\r\n}\r\n},\r\n{\r\n\"label\": {\r\n\"{{ len }}\": [\r\n\"license\"\r\n]\r\n},\r\n\"value\": {\r\n\"{{ len }}\": [\r\n{{ computed_rights|json_encode|raw }}\r\n]\r\n}\r\n}\r\n],\r\n{% if attribute(data, 'memberof') %}\r\n {% set currentnode = 'node/' ~ data.memberof %}\r\n \"within\": \"{{ url(currentnode) }}\",\r\n{% else %}\r\n {% set currentnode = '' %}\r\n{% endif %}\r\n{# fetch all children using a View and attach them as Items #}\r\n \"items\": [\r\n{% set collection_view = drupal_view('data_collection_manifest','children_ismemberof_manifest_rest', nodeid)|render %}\r\n{% set collection_items = collection_view|sbf_json_decode %}\r\n{% for items in collection_items %}\r\n{# canvas|json_encode #}\r\n {\r\n {% if 'CreativeWorkSeries' in items['ado_type']|split(',') %}\r\n \"id\": \"{{ url('format_strawberryfield.metadatadisplay_caster', {'node': items['uuid'],'metadataexposeconfig_entity':'iiifmanifest3cws', \r\n 'format':'default.jsonld'}, {'absolute': true, 'alias': true}) }}\",\r\n \"type\": \"Manifest\",\r\n {% elseif 'Collection' in items['ado_type']|split(',') %}\r\n \"id\": \"{{ url('format_strawberryfield.metadatadisplay_caster', {'node': items['uuid'], 'metadataexposeconfig_entity':'iiifmanifest3collection', \r\n 'format':'default.jsonld'}, {'absolute': true, 'alias': true}) }}\",\r\n \"type\": \"Collection\",\r\n {% else %}\r\n \"id\": \"{{ url('format_strawberryfield.metadatadisplay_caster', {'node': items['uuid'], 'metadataexposeconfig_entity':'iiifmanifest', \r\n 'format':'default.jsonld'}, {'absolute': true, 'alias': true}) }}\",\r\n \"type\": \"Manifest\",\r\n {% endif %}\r\n \"label\": { \"{{len}}\": [ \"{{ items['label'] }}\" ] },\r\n {{ items['thumbnail']|raw }}\r\n }\r\n {{ not loop.last ? ',' : '' }}\r\n{% endfor %}\r\n ]\r\n}", + "name": "IIIF Presentation API 3 Collection Manifest", + "mimetype": "application/ld+json", + "langcode": "und" + }, + "id": "9be8473c-3fb3-42ee-aef2-431b2d4f93bb", + "type": "metadatadisplay_entity--metadatadisplay_entity" + } +} From 462737475c5afceae5a6930fcc4f8397f4c26230 Mon Sep 17 00:00:00 2001 From: Allison Sherrick <67483756+alliomeria@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:23:49 -0400 Subject: [PATCH 13/14] Update metadatadisplay_entity_17.json --- d8content/metadatadisplay_entity_17.json | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/d8content/metadatadisplay_entity_17.json b/d8content/metadatadisplay_entity_17.json index 9399291..a09f82c 100644 --- a/d8content/metadatadisplay_entity_17.json +++ b/d8content/metadatadisplay_entity_17.json @@ -1 +1,12 @@ -{"data":{"id":"7ed7f7b2-7690-402f-93ea-a9b50a094f30","attributes":{"mimetype":"application\/xml","revision_translation_affected":null,"revision_created":"2024-03-08T16:54:36+00:00","twig":"\r\n\r\n {{ data_api.request_date }}<\/responseDate>\r\n {%- if data|length > 0 -%}\r\n {%- set resumptiontoken_arguments = data_api.query %}\r\n {%- if data_api.query.page is defined and not empty -%}\r\n {%- set resumptiontoken_arguments = resumptiontoken_arguments|merge({\"page\":(data_api.query.page+1)})-%}\r\n {%- else -%}\r\n {%- set resumptiontoken_arguments = resumptiontoken_arguments|merge({\"page\":2})-%}\r\n {% endif %}\r\n {%-\r\n set resumptiontoken = '?' ~ resumptiontoken_arguments|url_encode\r\n -%}\r\n {%- else -%}\r\n {# No results so no resumption token #}\r\n {%- set resumptiontoken = '' -%}\r\n {%- endif -%}\r\n {{ resumptiontoken }}<\/request>\r\n {%- if data_api.query.verb == \"ListSets\" -%} \r\n\t\tThis repository does not support sets<\/error>\r\n {%- else -%}\r\n {%- if data_api.query.verb -%}\r\n <{{ data_api.query.verb }}>\r\n {%- else -%}\r\n \r\n {%- endif -%} \r\n {%- for XML_doc in data -%}\r\n {%- if data_api.query.verb == \"ListRecords\" -%}\r\n \r\n {%- endif -%}\r\n {{ XML_doc }}\r\n {%- if data_api.query.verb == \"ListRecords\" -%} \r\n <\/record>\r\n {%- endif -%}\r\n {% endfor %}\r\n {# {{ data_api|json_encode|raw }} #}\r\n {# {{ data_api_context|json_encode|raw }} #}\r\n {%- if data_api.query.verb -%}\r\n <\/{{ data_api.query.verb }}>\r\n {%- else -%}\r\n <\/GetRecord>\r\n {%- endif -%}\r\n {%- endif -%}\r\n<\/OAI-PMH>","name":"OAI-PMH Wrapper","langcode":"und","revision_log_message":null,"drupal_internal__vid":17},"type":"metadatadisplay_entity--metadatadisplay_entity"}} +{ + "data": { + "id": "7ed7f7b2-7690-402f-93ea-a9b50a094f30", + "attributes": { + "mimetype": "application/xml", + "twig": "\r\n\r\n {{ data_api.request_date }}\r\n {%- if data|length > 0 -%}\r\n {%- set resumptiontoken_arguments = data_api.query %}\r\n {%- if data_api.query.page is defined and not empty -%}\r\n {%- set resumptiontoken_arguments = resumptiontoken_arguments|merge({\"page\":(data_api.query.page+1)})-%}\r\n {%- else -%}\r\n {%- set resumptiontoken_arguments = resumptiontoken_arguments|merge({\"page\":2})-%}\r\n {% endif %}\r\n {%-\r\n set resumptiontoken = '?' ~ resumptiontoken_arguments|url_encode\r\n -%}\r\n {%- else -%}\r\n {# No results so no resumption token #}\r\n {%- set resumptiontoken = '' -%}\r\n {%- endif -%}\r\n {{ resumptiontoken }}\r\n {%- if data_api.query.verb == \"ListSets\" -%} \r\n\t\tThis repository does not support sets\r\n {%- else -%}\r\n {%- if data_api.query.verb -%}\r\n <{{ data_api.query.verb }}>\r\n {%- else -%}\r\n \r\n {%- endif -%} \r\n {%- for XML_doc in data -%}\r\n {%- if data_api.query.verb == \"ListRecords\" -%}\r\n \r\n {%- endif -%}\r\n {{ XML_doc }}\r\n {%- if data_api.query.verb == \"ListRecords\" -%} \r\n \r\n {%- endif -%}\r\n {% endfor %}\r\n {# {{ data_api|json_encode|raw }} #}\r\n {# {{ data_api_context|json_encode|raw }} #}\r\n {%- if data_api.query.verb -%}\r\n \r\n {%- else -%}\r\n \r\n {%- endif -%}\r\n {%- endif -%}\r\n", + "name": "OAI-PMH Wrapper", + "langcode": "und" + }, + "type": "metadatadisplay_entity--metadatadisplay_entity" + } +} From e87e2380b31a95a58798e554b271151b24cc42b8 Mon Sep 17 00:00:00 2001 From: Allison Sherrick <67483756+alliomeria@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:24:14 -0400 Subject: [PATCH 14/14] Update metadatadisplay_entity_18.json --- d8content/metadatadisplay_entity_18.json | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/d8content/metadatadisplay_entity_18.json b/d8content/metadatadisplay_entity_18.json index 65ff26c..c7278ad 100644 --- a/d8content/metadatadisplay_entity_18.json +++ b/d8content/metadatadisplay_entity_18.json @@ -1 +1,12 @@ -{"data":{"attributes":{"mimetype":"application\/xml","revision_translation_affected":null,"revision_log_message":null,"name":"OAI-PMH Item with DC","revision_created":"2024-03-08T16:55:15+00:00","drupal_internal__vid":18,"langcode":"und","twig":"{# Created by Allison & Diego March 2024.\r\nUses Archipelago's default Simple Dublin Core XML template as base. #}\r\n{%- set oai_id = 'oai:fake:test' -%}\r\n{%- if node.uuid.value -%}\r\n{%- set oai_id = node.uuid.value -%}\r\n{%- set changed = node.changed.value|date(\"Y-m-d\") -%}\r\n{%- endif -%}\r\n
\r\n oai:localhost:{{ oai_id }}<\/identifier>\r\n {{ changed }}<\/datestamp>\r\n{%- if attribute(data, 'ismemberof') -%} \r\n {%- if attribute(data, 'ismemberof') is iterable -%} \r\n {%- for collection in attribute(data, 'ismemberof') -%} \r\n {%- set parentnode = bamboo_load_entity('node', collection) -%} \r\n {%- if parentnode -%} \r\n {{ parentnode.uuid.value }}<\/setSpec>\r\n {%- endif -%} \r\n {%- endfor -%} \r\n {% else %} \r\n\t {% set parentnode = bamboo_load_entity('node', attribute(data, 'ismemberof')) %} \r\n {% if parentnode %} \r\n\t\t{{ parentnode.uuid.value }}<\/setSpec>\r\n {% endif %} \r\n {% endif %} \r\n{% endif %} \r\n <\/header>\r\n{% if data_api.query.verb == \"ListRecords\" or data_api.query.verb == \"GetRecord\" %} \r\n\r\n{% if data_api.query.metadataPrefix == 'oai_dc' %}\r\n\r\n\r\n{{ data.label|escape('html') }}<\/dc:title>\r\n{# Creator #}\r\n{% if data.creator|length > 0 %}\r\n\t{% if data.creator is iterable %}\r\n\t\t{% for creator in data.creator %}\r\n\t\t\t{{ creator }}<\/dc:creator>\r\n\t\t{% endfor %}\r\n {% else %}\r\n \t{{ data.creator }}<\/dc:creator>\r\n\t{% endif %} \r\n{% endif %}\r\n{% if data.creator_lod|length > 0 %}\r\n\t{% for creator_lod in data.creator_lod %}\r\n \t{{ creator_lod.name_label }}<\/dc:creator>\r\n\t{% endfor %}\r\n{% endif %}\r\n{# Contributor\r\n<\/dc:contributor>\r\n#}\r\n{# Coverage \r\n<\/dc:coverage>\r\n#}\r\n{# Date #}\r\n{% if data.date_created|length > 0 %}\r\n\t{{ data.date_created }}<\/dc:date>\r\n{% endif %}\r\n\t{% if data.date_created_edtf.date_free is defined and not empty %}\r\n\t\t{{ data.date_created_edtf.date_free }}<\/dc:date>\r\n\t{% endif %}\r\n\t{% if data.date_issued_edtf.date_free is defined and not empty %}\t\r\n\t\t{{ data.date_issued_edtf.date_free }}<\/dc:date>\r\n\t{% endif %}\t\r\n{# Description #}\r\n{% if data.description|length > 0 %}\r\n\t{% if data.description is iterable %}\r\n\t\t{% for description in data.description %}\r\n\t\t\t{{ description|escape('html_attr') }}<\/dc:description>\r\n\t\t{% endfor %}\r\n {% else %}\r\n\t{{ data.description|escape('html_attr') }}<\/dc:description>\r\n\t{% endif %} \r\n{% endif %}\r\n{# Subject #}\r\n{# LoD Subjects #}\r\n{% if data.subject_loc|length > 0 %}\r\n\t{% for subject_loc in data.subject_loc %}\r\n \t{{ subject_loc.label }}<\/dc:subject>\r\n\t{% endfor %}\r\n{% endif %}\r\n{% if data.subject_lcgft_terms|length > 0 %}\r\n\t{% for subject_lcgft_terms in data.subject_lcgft_terms %}\r\n \t{{ subject_lcgft_terms.label }}<\/dc:subject>\r\n\t{% endfor %}\r\n{% endif %}\r\n{# Publisher #}\r\n{% if data.publisher|length > 0 %}\r\n\t{{ data.publisher }}<\/dc:publisher>\r\n{% endif %} \r\n{# Language #}\r\n{% if data.language|length > 0 %}\r\n {% if data.language is iterable %}\r\n \t{% for language in data.language %}\r\n \t\t{{ language }}<\/dc:language>\r\n \t{% endfor %}\r\n {% else %}\r\n \t\t{{ data.language }}<\/dc:language>\r\n {% endif %} \r\n{% endif %}\r\n{# Type #}\r\n{% if data.type|length > 0 %}\r\n\t{{ data.type }}<\/dc:type>\r\n{% endif %} \r\n{# Format \r\n<\/dc:format>\r\n#}\r\n{# Identifier #}\r\n{% if data.local_identifier|length > 0 %}\r\n \t{% if data.local_identifier is iterable %}\r\n \t{% for local_identifier in data.local_identifier %}\r\n\t\t\t{{ local_identifier|escape('html_attr') }}<\/dc:identifier>\r\n {% endfor %}\r\n {% else %}\r\n \t\t{{ data.local_identifier|escape('html_attr') }}<\/dc:identifier>\r\n {% endif %} \r\n{% endif %}\r\n{# Source #}\r\n{# Source #}\r\n{% if data.owner|length > 0 %}\r\n\t{{ data.owner }}<\/dc:source>\r\n{% endif %}\r\n{# Relation #}\r\n{% if node.id %}\r\n {% set nodeurl = url('entity.node.canonical', {'node': node.id}, {'absolute': true}) %}\r\n{% else %}\r\n {% set nodeurl = '' ~ '\/iiif\/manifest' %}\r\n{% endif%}\r\n {% if attribute(data, 'ismemberof') %}\r\n {% if attribute(data, 'ismemberof') is iterable %}\r\n {% for collection in attribute(data, 'ismemberof')%}\r\n {% set parentnode = bamboo_load_entity('node', collection) %}\r\n {% set parentnodeurl = url('entity.node.canonical', {'node': collection}, {'absolute': true}) %}\r\n{{ parentnode.title.value }}<\/dc:relation>\r\n{% endfor %}\r\n{% else %}\r\n {% set parentnode = bamboo_load_entity('node', attribute(data, 'ismemberof')) %}\r\n {% set parentnodeurl = url('entity.node.canonical', {'node': attribute(data, 'ismemberof')}, {'absolute': true}) %}\r\n {{ parentnode.title.value }}<\/dc:relation>\r\n {% endif %}\r\n{% endif %}\r\n{# Rights #}\r\n{% if data.rights|length > 0 %} \r\n {{ data.rights }}<\/dc:rights>\r\n{% endif %}\r\n<\/oai_dc:dc>\r\n{% endif %}\r\n<\/metadata>\r\n{% endif %}"},"id":"b5c12175-e0a9-49e9-a698-cbba342667e0","type":"metadatadisplay_entity--metadatadisplay_entity"}} \ No newline at end of file +{ + "data": { + "attributes": { + "mimetype": "application/xml", + "name": "OAI-PMH Item with DC", + "langcode": "und", + "twig": "{# Created by Allison & Diego March 2024.\r\nUses Archipelago's default Simple Dublin Core XML template as base. #}\r\n{%- set oai_id = 'oai:fake:test' -%}\r\n{%- if node.uuid.value -%}\r\n{%- set oai_id = node.uuid.value -%}\r\n{%- set changed = node.changed.value|date(\"Y-m-d\") -%}\r\n{%- endif -%}\r\n
\r\n oai:localhost:{{ oai_id }}\r\n {{ changed }}\r\n{%- if attribute(data, 'ismemberof') -%} \r\n {%- if attribute(data, 'ismemberof') is iterable -%} \r\n {%- for collection in attribute(data, 'ismemberof') -%} \r\n {%- set parentnode = bamboo_load_entity('node', collection) -%} \r\n {%- if parentnode -%} \r\n {{ parentnode.uuid.value }}\r\n {%- endif -%} \r\n {%- endfor -%} \r\n {% else %} \r\n\t {% set parentnode = bamboo_load_entity('node', attribute(data, 'ismemberof')) %} \r\n {% if parentnode %} \r\n\t\t{{ parentnode.uuid.value }}\r\n {% endif %} \r\n {% endif %} \r\n{% endif %} \r\n
\r\n{% if data_api.query.verb == \"ListRecords\" or data_api.query.verb == \"GetRecord\" %} \r\n\r\n{% if data_api.query.metadataPrefix == 'oai_dc' %}\r\n\r\n\r\n{{ data.label|escape('html') }}\r\n{# Creator #}\r\n{% if data.creator|length > 0 %}\r\n\t{% if data.creator is iterable %}\r\n\t\t{% for creator in data.creator %}\r\n\t\t\t{{ creator }}\r\n\t\t{% endfor %}\r\n {% else %}\r\n \t{{ data.creator }}\r\n\t{% endif %} \r\n{% endif %}\r\n{% if data.creator_lod|length > 0 %}\r\n\t{% for creator_lod in data.creator_lod %}\r\n \t{{ creator_lod.name_label }}\r\n\t{% endfor %}\r\n{% endif %}\r\n{# Contributor\r\n\r\n#}\r\n{# Coverage \r\n\r\n#}\r\n{# Date #}\r\n{% if data.date_created|length > 0 %}\r\n\t{{ data.date_created }}\r\n{% endif %}\r\n\t{% if data.date_created_edtf.date_free is defined and not empty %}\r\n\t\t{{ data.date_created_edtf.date_free }}\r\n\t{% endif %}\r\n\t{% if data.date_issued_edtf.date_free is defined and not empty %}\t\r\n\t\t{{ data.date_issued_edtf.date_free }}\r\n\t{% endif %}\t\r\n{# Description #}\r\n{% if data.description|length > 0 %}\r\n\t{% if data.description is iterable %}\r\n\t\t{% for description in data.description %}\r\n\t\t\t{{ description|escape('html_attr') }}\r\n\t\t{% endfor %}\r\n {% else %}\r\n\t{{ data.description|escape('html_attr') }}\r\n\t{% endif %} \r\n{% endif %}\r\n{# Subject #}\r\n{# LoD Subjects #}\r\n{% if data.subject_loc|length > 0 %}\r\n\t{% for subject_loc in data.subject_loc %}\r\n \t{{ subject_loc.label }}\r\n\t{% endfor %}\r\n{% endif %}\r\n{% if data.subject_lcgft_terms|length > 0 %}\r\n\t{% for subject_lcgft_terms in data.subject_lcgft_terms %}\r\n \t{{ subject_lcgft_terms.label }}\r\n\t{% endfor %}\r\n{% endif %}\r\n{# Publisher #}\r\n{% if data.publisher|length > 0 %}\r\n\t{{ data.publisher }}\r\n{% endif %} \r\n{# Language #}\r\n{% if data.language|length > 0 %}\r\n {% if data.language is iterable %}\r\n \t{% for language in data.language %}\r\n \t\t{{ language }}\r\n \t{% endfor %}\r\n {% else %}\r\n \t\t{{ data.language }}\r\n {% endif %} \r\n{% endif %}\r\n{# Type #}\r\n{% if data.type|length > 0 %}\r\n\t{{ data.type }}\r\n{% endif %} \r\n{# Format \r\n\r\n#}\r\n{# Identifier #}\r\n{% if data.local_identifier|length > 0 %}\r\n \t{% if data.local_identifier is iterable %}\r\n \t{% for local_identifier in data.local_identifier %}\r\n\t\t\t{{ local_identifier|escape('html_attr') }}\r\n {% endfor %}\r\n {% else %}\r\n \t\t{{ data.local_identifier|escape('html_attr') }}\r\n {% endif %} \r\n{% endif %}\r\n{# Source #}\r\n{# Source #}\r\n{% if data.owner|length > 0 %}\r\n\t{{ data.owner }}\r\n{% endif %}\r\n{# Relation #}\r\n{% if node.id %}\r\n {% set nodeurl = url('entity.node.canonical', {'node': node.id}, {'absolute': true}) %}\r\n{% else %}\r\n {% set nodeurl = '' ~ '/iiif/manifest' %}\r\n{% endif%}\r\n {% if attribute(data, 'ismemberof') %}\r\n {% if attribute(data, 'ismemberof') is iterable %}\r\n {% for collection in attribute(data, 'ismemberof')%}\r\n {% set parentnode = bamboo_load_entity('node', collection) %}\r\n {% set parentnodeurl = url('entity.node.canonical', {'node': collection}, {'absolute': true}) %}\r\n{{ parentnode.title.value }}\r\n{% endfor %}\r\n{% else %}\r\n {% set parentnode = bamboo_load_entity('node', attribute(data, 'ismemberof')) %}\r\n {% set parentnodeurl = url('entity.node.canonical', {'node': attribute(data, 'ismemberof')}, {'absolute': true}) %}\r\n {{ parentnode.title.value }}\r\n {% endif %}\r\n{% endif %}\r\n{# Rights #}\r\n{% if data.rights|length > 0 %} \r\n {{ data.rights }}\r\n{% endif %}\r\n\r\n{% endif %}\r\n\r\n{% endif %}" + }, + "id": "b5c12175-e0a9-49e9-a698-cbba342667e0", + "type": "metadatadisplay_entity--metadatadisplay_entity" + } +}