Java classes for generating data load input files for promotion folders and folder relationships

We can create and use a Java class to generate input files for use with the Data Load utility to create promotion folders and sort promotions into folders. If the store contains many promotions that must be sorted into many promotion folders, consider creating a Java class to generate the Data Load utility input files.

Note: Before creating a class for generating input files to create promotion folders, ensure that your promotions can be sorted based on a specific property of the promotions. For instance, we can create promotion folders that sort promotions based on the defined promotion start or end date. The promotion folder identifiers can then be based on the start or end dates, creating a hierarchy similar to the following structure, which is based on the starting dates:

We can create one Java class to define how to generate an input file that includes data for creating folders for each year, month, and week in which promotions are activated for a store. A second Java class can then define how to read the starting date for the promotions from the STARTDATE column in the PX_PROMOTION database table. This second class can then define how to match the promotions with the right folder and populate the corresponding identifier values into the generated input file. To view a set of Java classes that generate CSV input files for creating promotion folders and folder relationships, download and extract the GeneratingFolderInputFileSample.zip compressed file. This file includes two classes for generating input CSV files:

We can use each of these sample Java classes or our own classes to generate a CSV input file for loading data with the Data Load utility. For a Data Load sample that loads input files that were generated with the sample classes, see Loading promotion folders and promotions into promotion folders. To invoke the provided sample classes, run the following usage command:

Where: