Document Tree
Document Properties
Kbid
29646Y
Last Modified
25-Jan-2023
Added to KB
23-Sep-2020
Public Access
Everyone
Status
Online
Doc Type
Support Articles
Product
ICM 7.10
Support Article - CSV Mapping Template Handling

Introduction

This article describes the different ways CSV mapping template files can be handled in different versions.

References


Old CSV Mapping Template Handling (valid until ICM 7.10.30.2)

CSV mapping template files that are stored in <IS_SHARE>/sites/*/1/templates/default/CSVMappingTemplates/* are compiled once during the first processing. These files (*.isml, *.jsp) may remain in an old state after deployment to the target (live) system, although they should be modified during deployment.

The following applies to live systems only since Gradle Tools 2.0:

  • Files in <IS_SHARE>/sites/*/1 will also be deployed to <IS_SHARE>/sites/*/2.
  • Staged content in <IS_SHARE>/sites/*/[1,2] (including the .active flag) will not be overwritten by deployment.

Live systems means that the systemType for a server deployment is set to 'live'.

settings.gradle
config {
  staging {
    systemType = 'live'
  }
}

The background of the behavior described in the second point is the following modification handling strategy:

StagingDeploymentPlugin.groovy
0062 if (extension.systemType == 'live') {
0063   modification {
0064     keep('stagedFiles') {
0065       priority 'intershop'
0066       dir target.shareDirectory
0067       include 'sites/*/.active'
0068       include 'sites/*/?/**'
0069     }
0070   }
0071
0072   directories
0073   {
0074     sitesFolder {
0075       path new File(target.shareDirectory, 'sites')
0076     }
0077   }
0078 }

How to Update CSV Mapping Template Files in the Target System

Recompiling CSV mapping template files in the target system addresses two aspects:

  • Change the modification handling strategy for all CSV mapping template files during deployment of a live system (see step 1 and 2).
  • Enable recompilation of the CSV mapping template files in the pagecompile directory (see step 3).

Note

Instead of performing Step 1 to 3, an alternative solution for the handling of CSV mapping templates was introduced with ICM 7.9.4.22 and 7.10.18.2 and is required since 7.10.31.2. See section New Mapping Template Handling for details.

Step 1: Add Higher Modification Priority than 'intershop'

Create a higher modificationPriority than 'intershop' (e.g. 'myProject') by simply adding a priority name to the end of the modificationPriorities.

  • Development Environment

    <cartridge>/deployment/deploy.gradle
    apply plugin: com.intershop.deploy.infrastructure.InfrastructureDeploymentPlugin
    apply plugin: com.intershop.deploy.cartridge.CartridgeDeploymentPlugin
    apply plugin: com.intershop.deploy.assembly.TargetPlugin
    
    deployment {
      assemblyDeployment {
        modificationPriorities = ['default', 'intershop', 'myProject']
      }
    }
  • Deployment Environment

    settings.gradle
    assemblyDeployment {
      modificationPriorities = ['default', 'intershop', 'myProject']
    }

Note

The modificationPriorities are an ordered list of priority levels for modification handling. Levels that are listed later are preferred over levels listed earlier, propagated to property modificationPriorities of the ResourceDeploymentExtension of this and all child projects.

Step 2: Add Modification Handling Strategy

Override the default modification handling strategy on live systems only for CSV mapping template files by using a higher priority.

  • Development Environment

    <cartridge>/deployment/deploy.gradle
    apply plugin: com.intershop.deploy.infrastructure.InfrastructureDeploymentPlugin
    apply plugin: com.intershop.deploy.cartridge.CartridgeDeploymentPlugin
    apply plugin: com.intershop.deploy.assembly.TargetPlugin
    
    deployment {
      modification {
        overwrite('CSVMappingTemplates') {
          priority 'myProject'
          dir target.shareDirectory
          include 'sites/*/1/templates/default/CSVMappingTemplates/**'
        }
      }
    }
  • Deployment Environment

    settings.gradle
    deployment {
      modification {
        overwrite('CSVMappingTemplates') {
          priority 'myProject'
          dir target.shareDirectory
          include 'sites/*/1/templates/default/CSVMappingTemplates/**'
        }
      }
    }

Step 3: Add Deletion Step of Compiled CSV Mapping Template Files During Deployment

Enable the recompilation of all .jsp files simply by adding a deletion step in the deployment section. This step is necessary to apply the changes to the CSV mapping templates to the system, as they are recompiled only once during tge first processing and not during the deployment. 

Note

It would also be possible to execute the CompileTemplates job, which recompiles the CSV mapping templates in the active directory. However, this job would also recompile all templates on the server.
  • Development Environment

    <cartridge>/deployment/deploy.gradle
    apply plugin: com.intershop.deploy.infrastructure.InfrastructureDeploymentPlugin
    apply plugin: com.intershop.deploy.cartridge.CartridgeDeploymentPlugin
    apply plugin: com.intershop.deploy.assembly.TargetPlugin
    
    deployment {
      // specify all relevant .jsp files to be deleted during deployment
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/1/pagecompile/default/CSVMappingTemplates/CategoryCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/2/pagecompile/default/CSVMappingTemplates/CategoryCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/1/pagecompile/default/CSVMappingTemplates/CouponCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/2/pagecompile/default/CSVMappingTemplates/CouponCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/1/pagecompile/default/CSVMappingTemplates/CustomerCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/2/pagecompile/default/CSVMappingTemplates/CustomerCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/1/pagecompile/default/CSVMappingTemplates/PriceListCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/2/pagecompile/default/CSVMappingTemplates/PriceListCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/1/pagecompile/default/CSVMappingTemplates/ProductCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/2/pagecompile/default/CSVMappingTemplates/ProductCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/1/pagecompile/default/CSVMappingTemplates/VariationTypeCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/2/pagecompile/default/CSVMappingTemplates/VariationTypeCSVConvert.jsp'
    }
  • Deployment Environment

    settings.gradle
    deployment {
      // specify all relevant .jsp files to be deleted during deployment
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/1/pagecompile/default/CSVMappingTemplates/CategoryCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/2/pagecompile/default/CSVMappingTemplates/CategoryCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/1/pagecompile/default/CSVMappingTemplates/CouponCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/2/pagecompile/default/CSVMappingTemplates/CouponCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/1/pagecompile/default/CSVMappingTemplates/CustomerCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/2/pagecompile/default/CSVMappingTemplates/CustomerCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/1/pagecompile/default/CSVMappingTemplates/PriceListCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/2/pagecompile/default/CSVMappingTemplates/PriceListCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/1/pagecompile/default/CSVMappingTemplates/ProductCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/2/pagecompile/default/CSVMappingTemplates/ProductCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/1/pagecompile/default/CSVMappingTemplates/VariationTypeCSVConvert.jsp'
      delete "$target.shareDirectory"+'/sites/inSPIRED-Site/2/pagecompile/default/CSVMappingTemplates/VariationTypeCSVConvert.jsp'
    }

New CSV Mapping Template Handling

Note

This new handling is valid from 7.9.4.22 and 7.10.18.2 and mandatory since 7.10.31.2. The old location still works and no immediate migration is necessary (until ICM 7.10.30.2).

Starting with ICM 7.9, it is possible to place the CSV mapping template files into a project cartridge which is assigned to the back office. This way the ISML files are no longer part of the sites directory and are always updated and compiled during deployment.

The location of each CSV mapping template file can be specified in the cartridge properties file (<cartridge>/src/main/resources/cartridges/<cartridge>.properties). This way it is still possible to apply the properties and thus the CSV mapping templates application type and domain specific.

An example cartridge can be downloaded here: a_responsive_csv.zip

  • Development Environment

    <cartridge>/src/main/resources/cartridges/<cartridge>.properties
    # specify each csv mapping template file separately with: 
    # intershop.csvmapping.<name>=default/path/to/file.isml 
    
    intershop.csvmapping.1=default/impex/CSVMappingTemplates/CategoryCSVConvert.isml
    intershop.csvmapping.2=default/impex/CSVMappingTemplates/CouponCSVConvert.isml
    intershop.csvmapping.3=default/impex/CSVMappingTemplates/CustomerCSVConvert.isml
    intershop.csvmapping.4=default/impex/CSVMappingTemplates/PriceListCSVConvert.isml
    intershop.csvmapping.5=default/impex/CSVMappingTemplates/ProductCSVConvert.isml
    intershop.csvmapping.6=default/impex/CSVMappingTemplates/VariationTypeCSVConvert.isml
Disclaimer
The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.
Home
Knowledge Base
Product Releases
Log on to continue
This Knowledge Base document is reserved for registered customers.
Log on with your Intershop Entra ID to continue.
Write an email to supportadmin@intershop.de if you experience login issues,
or if you want to register as customer.