Document Properties
Kbid29646Y
Last Modified24-Sep-2020
Added to KB23-Sep-2020
Public AccessEveryone
StatusOnline
Doc TypeSupport Articles
Product
  • ICM 7.6
  • ICM 7.7
  • ICM 7.8
  • ICM 7.9
  • ICM 7.10

Support Article - Keeping CSV Mapping Template Files Up-To-Date After Deployment

1 Introduction

This article describes the procedure when CSV mapping template files (*.isml, *.jsp) in the <IS_SHARE>/sites directory are modified in the source system but remain in an old state after deployment in the target system.

1.1 References

2 Background

CSV mapping template files that are stored in <IS_SHARE>/sites/*/1/templates/default/CSVMappingTemplates/* are compiled once during the first processing. 

Furthermore, 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 for 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 }

3 Solution

The solution 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. See Section 3.4 Alternative Solution (valid from 7.9.4.22 and 7.10.18.2) for details.

3.1 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
    
    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.

3.2 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
    
    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/**'
        }
      }
    }

3.3 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 first processing and not during 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
    
    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'
    }

3.4 Alternative Solution (valid from 7.9.4.22 and 7.10.18.2)

Starting with ICM 7.9, it is possible to alternatively place the CSV mapping template files into a project cartridge which is assigned to the backoffice. 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 the ISML files are no longer part of the sites directory and are always updated and compiled during deployment.

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.CategoryCSVConvert=${intershop.SharedDirectory}/system/cartridges/<cartridge>/release/templates/default/CSVMappingTemplates/CategoryCSVConvert.isml
    intershop.csvmapping.CouponCSVConvert=${intershop.SharedDirectory}/system/cartridges/<cartridge>/release/templates/default/CSVMappingTemplates/CouponCSVConvert.isml
    intershop.csvmapping.CustomerCSVConvert=${intershop.SharedDirectory}/system/cartridges/<cartridge>/release/templates/default/CSVMappingTemplates/CustomerCSVConvert.isml
    intershop.csvmapping.PriceListCSVConvert=${intershop.SharedDirectory}/system/cartridges/<cartridge>/release/templates/default/CSVMappingTemplates/PriceListCSVConvert.isml
    intershop.csvmapping.ProductCSVConvert=${intershop.SharedDirectory}/system/cartridges/<cartridge>/release/templates/default/CSVMappingTemplates/ProductCSVConvert.isml
    intershop.csvmapping.VariationTypeCSVConvert=${intershop.SharedDirectory}/system/cartridges/<cartridge>/release/templates/default/CSVMappingTemplates/VariationTypeCSVConvert.isml

Note

The old location still works and no immediate migration is necessary. The new location and template compiling with the project will be default with upcoming versions.

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.

Customer Support
Knowledge Base
Product Resources
Support Tickets