Posting new items - mjanowiecki/levy-api Wiki

Step 1: Post taxonomies

  1. Post new taxonomy terms and record identifiers.
  2. Add taxonomy identifiers to spreadsheet of new items.
    • input: logOfTaxonomyTermsAdded.csv, levy-api/items-matched/, and finalmetadata.csv.
    • script:
    • output:
      • completed_field_instrumentation_metadata_id.csv
      • completed_field_publisher_id.csv
      • completed_field_publisher_id.csv
      • 01_finalmetadata.csv
      • allTaxonomyIdentifiersByFileIdentifiers.csv

Step 2: Post levy_collection_name nodes and paragraphs

  1. Post new levy_collection_names nodes and record identifiers.
  2. Create spreadsheet for collection_name paragraphs for each field_people field, using levy_collection_names and creator_r identifiers.
    • input: matched_CollectionNames.csv and logOfLevyCollectionNamesAdded.csv
    • script:
    • output: paragraph_levy_collection_namesToAdd.csv
  3. Post new levy_collection_name paragraphs and record identifiers.
  4. Add levy_collection_name identifiers to spreadsheet of new items.

Step 3: Post files

  1. Post new image files to Drupal site and create associated collection_item_images paragraphs and record identifiers.
  2. Post new pdf files to Drupal site and record identifiers.
    • input: spreadsheet with pdf file locations and fileIdentifiers
    • script: postPDFs.csv
    • output: logOfPDFS.csv
  3. Add PDF file identifiers and collection_item_images paragraph identifiers to spreadsheet of new items.

Step 4: Post new levy_collection_items

  1. Post levy_collection_item.
    • script:
      • Creates new levy_collection_item.
      • Updates parent_id in collection_name paragraphs with drupal_internal__nid from levy_collection_items and record drupal_internal__revision_id.
      • Updates parent_id in collection_item_image paragraphs with drupal_internal__nid from levy_collection_items.
      • Updates field_people with type, id, and target_revision_id from collection_name.
      • Updates field_images with type, id, and target_revision_id from collection_item_image.