Java classes for generating data load input files for promotion folders and folder relationships
You 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 your 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.
You 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 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.
- PromotionFolders.java
- A sample Java class for generating an input file that contains
data for creating promotion folders. Use this sample class to help
you create your own Java class to generate an input CSV file to load
promotion folder data. When you are creating a Java class for generating
an input CSV file, ensure that your class includes code to complete
the following functions:
- Generate the folder IDENTIFIER values.
- Generate any parent folder and child folder relationships. Your method can populate the relationships into a hash map.
- Add the generated IDENTIFIER values into an array.
- Print the array to an output file that generates in a specified file path with a specified file name.
- SortPromotionsIntoFolders.java
- A sample Java class for generating an input file that contains
data for creating promotion folder relationships to sort store promotions
into folders. Use this sample class to help you create your own Java
class to generate an input CSV file to sort promotions into folders.
When you are creating a Java class for generating an input CSV file,
ensure that your class includes code to complete the following functions:
- Retrieve the PX_PROMOTION_ID and values for sorting promotions (STARTDATE) from the PX_PROMOTION table for all promotions for a store.
- Retrieve all folder IDENTIFIER values from the table for the store that owns the folders.
- Use the value for sorting promotions (STARTDATE) to generate the promotion folder relationships by comparing the value to the folder IDENTIFIER values.
- Add the generated relationships into an array.
- Print the array to an output file that generates in a specified file path with a specified file name.
PromotionFolders output_file_path start_year
Where: - output_file_path
- The absolute file path, including the file name and file extension, to the output file.
- start_year
- (Optional). The starting year in the format
\"YYYY\"
. The year should be less than or equal to the current year. If you do not specify the start_year, a default value of 2012 is used. This default value is defined in the sample classes.