-
Notifications
You must be signed in to change notification settings - Fork 2
SUP-7358 : Adding OaiMetadataMap & DssiNodeAlter #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
2a17685
cbbd305
ef2bd5e
8190263
3fb968a
d0cdc50
c1672c9
22f242c
592387a
dd935b9
b490330
1fb6907
e6c261d
7e07d5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| <?php | ||
|
|
||
| namespace Drupal\pcdora\Plugin\OaiMetadataMap; | ||
|
|
||
| use Drupal\dgi_standard_oai\Plugin\OaiMetadataMap\DgiStandard; | ||
|
|
||
| /** | ||
| * OAI implementation for the PC metadata profile. | ||
| * | ||
| * @OaiMetadataMap( | ||
| * id = "pc_standard_oai", | ||
| * label = @Translation("DPLAVA (PC)"), | ||
| * metadata_format = "mdRecord", | ||
| * template = { | ||
| * "type" = "module", | ||
| * "name" = "rest_oai_pmh", | ||
adam-vessey marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * "directory" = "templates", | ||
| * "file" = "oai-default" | ||
| * } | ||
| * ) | ||
| */ | ||
|
Comment on lines
+7
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify the metadata format and template configuration. The Run the following script to verify the template reference: 🏁 Script executed: #!/bin/bash
# Description: Verify the template file exists in rest_oai_pmh module
# Search for the template file
fd -t f "oai-default" --full-path --exec echo "Found: {}"
# Search for rest_oai_pmh module usage
rg -n "rest_oai_pmh" --type=php -C2Length of output: 354 🏁 Script executed: #!/bin/bash
# Search for template files with common extensions
echo "=== Searching for template files with common extensions ==="
fd -t f "oai" --exec file {} \; | grep -i "template\|text"
# Search for any files named "oai-default" with any extension
echo -e "\n=== Searching for oai-default with any extension ==="
fd "oai-default" -t f
# Search for rest_oai_pmh module/directory
echo -e "\n=== Searching for rest_oai_pmh directory or module ==="
fd "rest_oai_pmh" -t d
# Look at similar OaiMetadataMap plugins for comparison
echo -e "\n=== Checking other OaiMetadataMap plugins ==="
fd -t f ".*Standard\.php$" -path "*/OaiMetadataMap/*"Length of output: 385 🏁 Script executed: #!/bin/bash
# Find all OaiMetadataMap plugin files
echo "=== All OaiMetadataMap plugin files ==="
fd -t f -path "*/OaiMetadataMap/*.php"
# Check if there's a modules or contrib directory
echo -e "\n=== Checking for external modules directories ==="
fd -t d "modules\|contrib" -d 2
# Look for any configuration files that might reference rest_oai_pmh
echo -e "\n=== References to rest_oai_pmh in entire codebase ==="
rg "rest_oai_pmh" -n
# Check for template directories
echo -e "\n=== Template directories in repo ==="
fd -t d "templates"Length of output: 427 🏁 Script executed: #!/bin/bash
# Find all OaiMetadataMap plugin files (corrected syntax)
echo "=== All OaiMetadataMap plugin files ==="
find src -type f -name "*.php" -path "*/OaiMetadataMap/*" 2>/dev/null
# Show content of OaiMetadataMap directory
echo -e "\n=== Contents of OaiMetadataMap directory ==="
find src -type f -path "*/OaiMetadataMap/*" 2>/dev/null | head -20
# Check directory structure around PcStandard.php
echo -e "\n=== Directory structure of OaiMetadataMap ==="
find src/Plugin/OaiMetadataMap -type f 2>/dev/null || echo "Directory not found"
# Look at the actual class definition in PcStandard.php
echo -e "\n=== Full PcStandard.php file ==="
cat src/Plugin/OaiMetadataMap/PcStandard.phpLength of output: 2296 🏁 Script executed: #!/bin/bash
# Find DgiStandard class (parent class)
echo "=== Searching for DgiStandard class ==="
find . -type f -name "*.php" -exec grep -l "class DgiStandard" {} \;
# Check for dgi_standard_oai module
echo -e "\n=== Searching for dgi_standard_oai module ==="
find . -type d -name "dgi_standard_oai"
# Look for composer.json to see dependencies
echo -e "\n=== Checking for composer.json ==="
find . -maxdepth 2 -name "composer.json" -exec cat {} \;
# Search for .info.yml files (Drupal module definitions)
echo -e "\n=== Drupal module files (.info.yml) ==="
find . -name "*.info.yml" | head -10Length of output: 345 🏁 Script executed: #!/bin/bash
# Check the module info file for dependencies
echo "=== pcdora.info.yml content ==="
cat ./pcdora.info.ymlLength of output: 177 </web_search> 🌐 Web query: 💡 Result: Short answer: mdRecord is not part of the OAI‑PMH protocol standard — it’s an implementation‑specific metadataPrefix used by some repositories (e.g., Islandora/related projects) to expose a repository’s native/richer metadata. OAI‑PMH itself requires only oai_dc (Dublin Core) and allows repositories to define additional metadata formats identified by a metadataPrefix and a metadata schema. See the OAI‑PMH spec for how metadataPrefix/metadataSchema are defined and returned via ListMetadataFormats, and an example of mdRecord usage in Islandora/Islandora‑derived docs. [1][2][3] If you need details for a particular repository:
Sources
References
Add required module dependencies to pcdora.info.yml. The code references external modules ( Additionally, while 🤖 Prompt for AI Agents |
||
| class PcStandard extends DgiStandard { | ||
|
|
||
|
|
||
| /** | ||
| * Mapping of paragraph fields to maps of subfields to element names. | ||
| * | ||
| * @var string[][] | ||
| */ | ||
| protected const PARAGRAPH_MAPPING = [ | ||
| 'field_faceted_subject' => [ | ||
| 'field_topic_general_subdivision_' => 'dcterms:subject', | ||
| 'field_temporal_chronological_sub' => 'dcterms:temporal', | ||
| 'field_geographic_geographic_subd' => 'dcterms:spatial', | ||
| ], | ||
| 'field_hierarchical_geographic_su' => [ | ||
| 'field_continent' => 'dcterms:spatial', | ||
| 'field_country' => 'dcterms:spatial', | ||
| 'field_region' => 'dcterms:spatial', | ||
| 'field_state' => 'dcterms:spatial', | ||
| 'field_territory' => 'dcterms:spatial', | ||
| 'field_county' => 'dcterms:spatial', | ||
| 'field_city' => 'dcterms:spatial', | ||
| 'field_city_section' => 'dcterms:spatial', | ||
| 'field_island' => 'dcterms:spatial', | ||
| 'field_area' => 'dcterms:spatial', | ||
| 'field_extraterrestrial_area' => 'dcterms:spatial', | ||
| ], | ||
| 'field_origin_information' => [ | ||
| 'field_date_created' => 'dcterms:created', | ||
| 'field_date_issued' => 'dcterms:issued', | ||
| 'field_date_note' => 'dcterms:date', | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mapping overriden to include |
||
| 'field_date_captured' => 'dcterms:date', | ||
| 'field_date_valid' => 'dcterms:date', | ||
| 'field_date_modified' => 'dcterms:date', | ||
| 'field_copyright_date' => 'dcterms:date', | ||
| 'field_publisher' => 'dcterms:publisher', | ||
| 'field_other_date' => 'dcterms:date', | ||
| ], | ||
| 'field_related_item' => [ | ||
| 'field_title' => 'dcterms:relation', | ||
| 'field_url' => 'dcterms:relation', | ||
| ], | ||
| ]; | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| <?php | ||
|
|
||
| namespace Drupal\pcdora\Plugin\dgi_migrate_alter\spreadsheet; | ||
|
|
||
| use Drupal\dgi_migrate_alter\Plugin\MigrationAlterBase; | ||
| use Drupal\dgi_migrate_alter\Plugin\MigrationAlterInterface; | ||
| use Drupal\Core\Annotation\Translation; | ||
|
|
||
| /** | ||
| * Alter for dssi_node migration. | ||
| * | ||
| * @MigrationAlter( | ||
| * id = "pcdora_dssi_node_alter", | ||
| * label = @Translation("DSSI Node Migration Alteration"), | ||
| * description = @Translation("Alters the DSSI Node migration."), | ||
| * migration_id = "dssi_node" | ||
| * ) | ||
| */ | ||
| class DssiNodeAlter extends MigrationAlterBase implements MigrationAlterInterface { | ||
|
|
||
| /** | ||
| * {@inheritdoc} | ||
| */ | ||
| public function alter(array &$migration): void { | ||
| $process =& $migration['process']; | ||
|
|
||
| $process['field_origin_information'][1]['keys'] = [ | ||
| 'event_type', | ||
| 'place', | ||
| 'date_created', | ||
| 'date_issued', | ||
| 'date_captured', | ||
| 'date_valid', | ||
| 'date_modified', | ||
| 'other_date', | ||
| 'copyright_date', | ||
| 'publisher', | ||
| 'edition', | ||
| 'issuance', | ||
| 'frequency', | ||
| 'date_note', | ||
| ]; | ||
|
|
||
| // Using frequency as a template. | ||
| $process['field_origin_information'][2]['values']['field_date_note'] = $process['field_origin_information'][2]['values']['field_frequency']; | ||
| $process['field_origin_information'][2]['values']['field_date_note'][0]['source'] = 'parent_value/date_note'; | ||
| } | ||
|
|
||
| } |
Uh oh!
There was an error while loading. Please reload this page.