TD14SP2 Content Importer - Importing illustration items that do not exist in the repository

Please, read this post first: https://community.sdl.com/product-groups/sdl-tridion-dx/tridion-docs/f/forum/29947/td14-content-importer-replacing-batch-import for an overview.

Starting points for this scenario:

  1. The items do not already exist in the repository
  2. The user running the import has the required credentials to create the items in the repository
  3. The Tridion Docs setup has no database mandatory custom fields for the image type
  4. All files have the correct filenaming convention
  5. The files have been moved/copied into a single folder (referred to as input folder)

Possible use cases for this scenario:

  1. Import of localized images
  2. Importing images exported by another system
  3. Importing a batch of local images for which the filenames have been set for use by (deprecated) batch import

There are 2 possible ways to do this:

  1. Using the 'Standard' import option
  2. Using the 'Without conversion' option (advanced)

Starting with the 'Standard' import option, the procedure is as follows:

  1. Create an empty output folder. Recommended to create this at the same location as the input folder.
  2. Start Content Importer
  3. Select 'Standard'
  4. Select the input folder for the Folder location field.
  5. Select the output folder for the Conversion folder field.
  6. Select a Target folder in the repository. This must be a folder with folder type Image.
  7. Click Convert and import and wait for completion
  8. Click Continue with Import (see note below)
  9. Click Done or click the Home button

Note: it's possible to check the option ' ' before step 7 to skip the confirmation needed at step 8.

If all starting points are met then all items have been created in the repository.

If there is a need to update some files and re-import then this can be done directly in the input folder. I have not tested extensively how this updating is supported. To re-import everything it is needed to delete the contents of the output folder.

See also the tip to remove the Content Imports history to re-start the import from scratch.

This procedure has the limitation that it is not possible to set initial metadata that will be copied to all items during import. There is an alternative for this using an XSL file. In that case select an XSL file for the XSL file location field before step 7. Attached an example of such XSL file that should work on almost each instance if it is not too much customized.

Because I do not know how the attach a file, just copy paste the content at the end of this post and save it in a file with extension .xsl (for example set-import-fields.xsl) using Notepad or another Text editor.

I have not tested how this works for existing items. The content of existing items will be overwritten for sure but not sure if the metadata will be updated (I expect it will). At least it won't be a problem to import the same items twice for retry / troubleshooting purposes.

example XSL file content:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="">www.w3.org/.../Transform" version="1.0">

  <!-- Example of an XSL file to process a metadata file after conversion and before import. -->

  <xsl:output method="xml" />

  <xsl:param name="username" select="'Unknown'" />

  <!-- Input  folder path, e.g. "C:\Import\In". -->
  <xsl:param name="sourcebasepath" />

  <!-- Output folder path, e.g. "C:\Import\Out". -->
  <xsl:param name="targetbasepath" />

  <!-- Relative path to content file, e.g. "Sample\Topics\Topic.dita". -->
  <xsl:param name="filepath" />

  <xsl:variable name="fullpath" select="concat('file:///', $sourcebasepath, '/', $filepath)" />
  <xsl:variable name="objecttype" select="/ishobject/@ishtype" />


  <xsl:template match="ishfields">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()" />
      
      <!-- set initial fields formally entered into the batch import dialog -->
      <ishfield name="FCHANGES" level="version">Content imported by <xsl:value-of select="$username"/> .</ishfield>
      <ishfield name="FREVIEWER" level="lng">Admin</ishfield>
      
      <!-- end custom fields -->
    </xsl:copy>
  </xsl:template>


  <!-- catch all -->
  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()" />
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>