SU-HKKU/cardinal_service_profile

View on GitHub
config/sync/migrate_plus.migration.stanford_events_importer.yml

Summary

Maintainability
Test Coverage
uuid: f12377a6-f9c4-4050-8493-87df53c70bae
langcode: en
status: true
dependencies: {  }
_core:
  default_config_hash: cGwmz8ZjzFcJd_ygOCdIMWZpXlLTbA3JM3CN-rniTws
id: stanford_events_importer
class: null
field_plugin_method: null
cck_plugin_method: null
migration_tags: null
migration_group: stanford_events
label: 'Events importer'
source:
  orphan_action: forget
  track_changes: true
  plugin: url
  data_fetcher_plugin: http
  urls: {  }
  data_parser_plugin: simple_xml
  item_selector: /EventList/Event
  fields:
    -
      name: guid
      label: GUID
      selector: guid
    -
      name: event_id
      label: 'Event ID'
      selector: eventID
    -
      name: title
      label: 'Event Title'
      selector: title
    -
      name: body
      label: Description
      selector: description
    -
      name: event_start
      label: 'Event start'
      selector: isoEventDate
    -
      name: event_end
      label: 'Event end'
      selector: isoEventEndDate
    -
      name: link
      label: 'Event Link'
      selector: link
    -
      name: audience
      label: 'Event Audience'
      selector: audiences
    -
      name: categories
      label: Categories
      selector: categories
    -
      name: location
      label: Location
      selector: locationText
    -
      name: map_link
      label: 'Map Link'
      selector: mapUrl
    -
      name: event_sponsor
      label: Sponsor
      selector: sponsor
    -
      name: contact_email
      label: 'Contact Email'
      selector: contactEmail
    -
      name: contact_phone
      label: 'Contact Phone'
      selector: contactPhone
  ids:
    event_id:
      type: string
    event_start:
      type: string
    event_end:
      type: string
  constants:
    status: 1
    type: stanford_event
    stanford_html: stanford_html
    stanford_minimal_html: stanford_minimal_html
    map_title: 'Open in map'
    image_path: 'public://events/'
process:
  status: constants/status
  type: constants/type
  title: title
  body/value: body
  body/format: constants/stanford_html
  su_event_email: contact_email
  su_event_telephone: contact_phone
  su_event_sponsor:
    -
      plugin: explode
      source: event_sponsor
      delimiter: ', '
      limit: 100
    -
      plugin: substr
      start: 0
      length: 120
    -
      plugin: callback
      callable: trim
  su_event_alt_loc: location
  su_event_map_link/uri: map_link
  su_event_map_link/title: constants/map_title
  su_event_source/uri:
    plugin: str_replace
    source:
      plugin: str_replace
      source: link
      search: events.stanford.edu
      replace: events-legacy.stanford.edu
    search: events.stanford.edu
    replace: events-legacy.stanford.edu
  su_event_date_time/value:
    -
      plugin: format_date
      source: event_start
      from_format: 'Y-m-d H:i:s O'
      to_format: U
      timezone: Etc/GMT
  su_event_date_time/end_value:
    -
      plugin: format_date
      source: event_end
      from_format: 'Y-m-d H:i:s O'
      to_format: U
      timezone: Etc/GMT
  su_event_date_time/duration:
    -
      plugin: stanford_events_datemath
      operation: subtraction
      source: event_end
      values:
        - event_start
  su_event_date_time/timezone:
    plugin: default_value
    default_value: America/Los_Angeles
  su_event_type:
    -
      plugin: explode
      source: categories
      delimiter: ','
    -
      plugin: array_shift
    -
      plugin: callback
      callable: trim
    -
      plugin: entity_generate
      access_check: false
      entity_type: taxonomy_term
      bundle_key: vid
      bundle: stanford_event_types
      value_key: name
      ignore_case: true
  su_event_audience:
    -
      plugin: explode
      source: audience
      delimiter: ','
    -
      plugin: callback
      callable: trim
    -
      plugin: entity_generate
      access_check: false
      entity_type: taxonomy_term
      bundle_key: vid
      bundle: event_audience
      value_key: name
      ignore_case: true
destination:
  plugin: 'entity:node'
  overwrite_properties:
    - body/format
    - body/value
    - su_event_alt_loc
    - su_event_audience
    - su_event_date_time/duration
    - su_event_date_time/end_value
    - su_event_date_time/timezone
    - su_event_date_time/value
    - su_event_email
    - su_event_map_link/title
    - su_event_map_link/uri
    - su_event_source/uri
    - su_event_sponsor
    - su_event_telephone
    - su_event_type
    - title
    - type
migration_dependencies: {  }