Skip to content

This guide provides instructions and information about Stanford Web Services Jumpstart platform, based on Drupal 7.

We've released our new Stanford Sites on Drupal 8 (D8) platform — the new framework for Stanford Sites in 2020 and beyond. Check out our new User Guide to help you set up your website on the D8 platform. 

Read more about our road to D8 

Reusing Mappers with CAPx Import/Export

Configuration import and export was added in CAPx 3.0 and allows you to replicate a CAPx configuration from one site to another. This is ideal for copying a mapper and any tampers you created on one site onto another site.

Prerequisites

  1. Ensure that the CAPx 3.0 module is enabled on your site. If you are unsure, please contact us for support.

  2. Ensure that CAPx is Connected for your site.

  3. Exporting a mapper requires an existing mapper; create a new mapper first if needed.

Exporting a Mapper and Its Tampers

  1. Log into your source site as an administrator.

  2. Via the admin menu, navigate to Configuration > CAPx > Map.

  3. On your Map list page, click on the Export action next to the mapper which you’d like to export to another site:

 

 

  1. A box of JSON text will appear containing the configuration data for that mapper, and its tampers.



    You can copy this text and save it as plain text somewhere (such as a text file, or somewhere online) to reuse later, or you can copy this text and directly import it into another site to create a mapper and tampers with the exact same configuration.

  2. Use your browser’s Back button to return to your previous page (the Map list page).

Importing a Mapper/Tampers Configuration

  1. Log into your destination site as an administrator.

  2. Via the admin menu, navigate to Configuration > CAPx > Map.

  3. On your Map list page, click on the Import mapping button:

  4. In the Code box, paste in the code that you copied from your previously exported configuration, or from a saved location. Ensure that there is no extra formatting on the text as it may cause errors; make sure that you are copying from a plain text source.

  5. Enter a new value after the colon for the machine_name variable, if needed. In the example on the exporting step, the value is jse. The machine_name needs to be unique per site for each mapper.

    1. Make sure that the syntax is maintained; the code follows JSON syntax.

    2. The configuration importer also has syntax validation checking; try to avoid modifying other parts of the import code directly unless you are comfortable editing and formatting JSON.

    3. If you would like to overwrite an existing mapper, make sure the machine_name is set to be the same as the mapper you would like to overwrite, and check the Replace existing box.

  6. Click Submit to import the mapper configuration.

Notes and Troubleshooting

  • Only one mapper and its tampers can be exported and imported at a time. If you have multiple mappers/tampers to export and import, you will need to repeat the export/import process for each one.

  • Importers and their filters cannot be exported and imported at this time.

  • While mappers can have the same titles, when importing a configuration a unique machine_name is required.

    • If the machine_name is already in use, the importer will give you an error to avoid overwriting the existing mapper.

    • You can check the box for Replace existing when importing to overwrite the configuration for a mapper with the same machine name.

  • The configuration importer has syntax validation checking; try to avoid modifying the import code (except for the machine_name) unless you are comfortable editing JSON.

  • UID in the configuration refers to the user ID who created the mapper; it is not the unique identifier of the mapper, and can be ignored. Refer to the machine_name for the uniqueness of the mapper configuration.

  • If you are getting other errors when trying to import, try exporting your mapper configuration again from the source, and importing again. Ensure that you are saving to and copying from plain text to avoid any extra hidden formatting.

  • Note for developers: With CAPx 3.0 and newer, it is also possible to export mappers and importers into a feature.