This article describes the different ways CSV mapping template files can be handled in different versions.
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:
Live systems means that the systemType
for a server deployment is set to 'live'.
config { staging { systemType = 'live' } }
The background of the behavior described in the second point is the following modification handling strategy:
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 }
Recompiling CSV mapping template files in the target system addresses two aspects:
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.
Create a higher modificationPriority
than 'intershop'
(e.g. 'myProject'
) by simply adding a priority name to the end of the modificationPriorities
.
Development Environment
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
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.
Override the default modification handling strategy on live systems only for CSV mapping template files by using a higher priority.
Development Environment
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
deployment { modification { overwrite('CSVMappingTemplates') { priority 'myProject' dir target.shareDirectory include 'sites/*/1/templates/default/CSVMappingTemplates/**' } } }
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
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
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
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' }
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
# 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