mapping for asset type
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package com.bayer.edam;
|
package com.bayer.edam;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -62,6 +61,7 @@ public class ToolboxImportFileGenerator {
|
|||||||
|
|
||||||
private static final Map<String, String> brandMap;
|
private static final Map<String, String> brandMap;
|
||||||
private static final Map<String, String> unitMap;
|
private static final Map<String, String> unitMap;
|
||||||
|
private static final Map<String, String> categoryMap;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
brandMap = new HashMap<String, String>();
|
brandMap = new HashMap<String, String>();
|
||||||
@@ -336,8 +336,7 @@ public class ToolboxImportFileGenerator {
|
|||||||
brandMap.put("ICP-Programs", "Bayer/General");
|
brandMap.put("ICP-Programs", "Bayer/General");
|
||||||
brandMap.put("ICP - Veg/Potato", "Bayer/General");
|
brandMap.put("ICP - Veg/Potato", "Bayer/General");
|
||||||
brandMap.put("Poncho/VOTiVO 2", "TEMPORARY"); // set both 'Poncho' and 'Votivo' via special rule
|
brandMap.put("Poncho/VOTiVO 2", "TEMPORARY"); // set both 'Poncho' and 'Votivo' via special rule
|
||||||
brandMap.put("Poncho 1250/VOTiVO 2", "TEMPORARY"); // set both 'Poncho 250/1250' and 'Votivo' via special rule (there is no Votivo
|
brandMap.put("Poncho 1250/VOTiVO 2", "TEMPORARY"); // set 'Poncho 250/1250' and 'Votivo' via special rule (there is no Votivo 2)
|
||||||
// 2)
|
|
||||||
brandMap.put("Velum", "Velum One");
|
brandMap.put("Velum", "Velum One");
|
||||||
brandMap.put("Velum Prime 3", "Velum Prime");
|
brandMap.put("Velum Prime 3", "Velum Prime");
|
||||||
|
|
||||||
@@ -606,6 +605,128 @@ public class ToolboxImportFileGenerator {
|
|||||||
// TODO to be checked by business
|
// TODO to be checked by business
|
||||||
unitMap.put("TEMPORARY", "Crop Protection");
|
unitMap.put("TEMPORARY", "Crop Protection");
|
||||||
unitMap.put("Finish Pro", "Crop Protection");
|
unitMap.put("Finish Pro", "Crop Protection");
|
||||||
|
|
||||||
|
|
||||||
|
categoryMap = new HashMap<String, String>();
|
||||||
|
categoryMap.put("Bag Tags : Bag Requirements", "Seed Company Materials : Seed Bag Guidelines");
|
||||||
|
categoryMap.put("Bag Tags : Bag Stencil", "Seed Company Materials : Seed Bag Stencil");
|
||||||
|
categoryMap.put("Bag Tags : Bag Tag", "Seed Company Materials : Seed Bag Tag");
|
||||||
|
categoryMap.put("Bag Tags : Bag Tag Guidelines", "Seed Company Materials : Seed Bag Guidelines");
|
||||||
|
categoryMap.put("ExcellenceinCommAwardEntries : Comm Award Entry", "");
|
||||||
|
categoryMap.put("ExcellenceinCommAwardEntries : Direct Mail", "Advertising - Print : Direct Mail");
|
||||||
|
categoryMap.put("ExcellenceinCommAwardEntries : Presentation", "Advertising - PR, Product Publicity : Presentation");
|
||||||
|
categoryMap.put("ExcellenceinCommAwardEntries : Print Ad", "Advertising - Print : Print Ad");
|
||||||
|
categoryMap.put("ExcellenceinCommAwardEntries : Radio Spot", "Advertising - Radio/Audio : Radio Produced Spot");
|
||||||
|
categoryMap.put("ExcellenceinCommAwardEntries : TV Spot", "Advertising - TV : TV Produced Spot");
|
||||||
|
categoryMap.put("ExcellenceinCommAwardEntries : Website", "Advertising - Digital : Web Content - Article/Copy");
|
||||||
|
categoryMap.put("Field Signs : Bag Stencil", "Seed Company Materials : Seed Bag Stencil");
|
||||||
|
categoryMap.put("Field Signs : Bag Tag", "Seed Company Materials : Seed Bag Tag");
|
||||||
|
categoryMap.put("Field Signs : Decal", "Field Day / Tradeshow / Event Materials : Decal/Sticker");
|
||||||
|
categoryMap.put("Field Signs : Field Marker", "Field Day / Tradeshow / Event Materials : Field Marker Flag");
|
||||||
|
categoryMap.put("Field Signs : Plot sign", "Field Day / Tradeshow / Event Materials : Plot/Field Sign");
|
||||||
|
categoryMap.put("Field Signs : Storyboard", "Field Day / Tradeshow / Event Materials : Storyboard");
|
||||||
|
categoryMap.put("Literature : Application Card", "Sales Literature / Collateral : Application Card");
|
||||||
|
categoryMap.put("Literature : Brochure", "Sales Literature / Collateral : Brochure");
|
||||||
|
categoryMap.put("Literature : Pest ID Card", "Sales Literature / Collateral : Fact/Topic Sheet");
|
||||||
|
categoryMap.put("Literature : Portfolio Quick Guide", "Sales Literature / Collateral : Portfolio Quick Guide");
|
||||||
|
categoryMap.put("Literature : Product Bulletin", "Sales Literature / Collateral : Product Bulletin");
|
||||||
|
categoryMap.put("Literature : Product Information Sheet", "Sales Literature / Collateral : Fact/Topic Sheet");
|
||||||
|
categoryMap.put("Literature : Product Information Template", "Custom Templates : Sales/Product Sheet Template");
|
||||||
|
categoryMap.put("Literature : Product Q&A", "Sales Literature / Collateral : FAQ Sheet");
|
||||||
|
categoryMap.put("Literature : Program Materials", "Program Materials : Program Detailer");
|
||||||
|
categoryMap.put("Literature : Quick Guide Template", "Custom Templates : Sales/Product Sheet Template");
|
||||||
|
categoryMap.put("Literature : Technical Bulletin", "Sales Literature / Collateral : Tech Sheet");
|
||||||
|
categoryMap.put("Literature : Technology Use Manual", "Sales Literature / Collateral : TTUM");
|
||||||
|
categoryMap.put("LocalCampaignTools : Copy Points", "Advertising - PR, Product Publicity : Talking Points");
|
||||||
|
categoryMap.put("LocalCampaignTools : Direct Mail", "Advertising - Print : Direct Mail");
|
||||||
|
categoryMap.put("LocalCampaignTools : Local Live Read Radio", "Advertising - Radio/Audio : Radio Live-Read - Local Rep Use");
|
||||||
|
categoryMap.put("LocalCampaignTools : Local Print Ad", "Advertising - Print : Print Ad - Local Rep Use");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : Agenda template", "Field Day / Tradeshow / Event Materials : Agenda");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : Banner - 3'X4'", "Field Day / Tradeshow / Event Materials : Banner");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : Banner - 3'X8'", "Field Day / Tradeshow / Event Materials : Banner");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : Bannerup", "Field Day / Tradeshow / Event Materials : Banner Up");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : BannerUp Base (for dual-sided graphics)", "Field Day / Tradeshow / Event Materials : Banner Up");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : BannerUp Base (for single-sided graphics)", "Field Day / Tradeshow / Event Materials : Banner Up");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : BannerUp Graphic Cartridge (Custom) - dual sided", "Field Day / Tradeshow / Event Materials : Banner Up");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : BannerUp Graphic Cartridge (Custom) - single sided", "Field Day / Tradeshow / Event Materials : Banner Up");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : BannerUp Graphic Cartridge (Standard) - dual sided", "Field Day / Tradeshow / Event Materials : Banner Up");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : BannerUp Graphic Cartridge (Standard) - single sided", "Field Day / Tradeshow / Event Materials : Banner Up");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : Canopy tent (10' X 10')", "Field Day / Tradeshow / Event Materials : Tent");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : Display graphic - 12\"X24\" oval", "Field Day / Tradeshow / Event Materials : Popup Graphic");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : Display graphic - 5\"X12\" oval", "Field Day / Tradeshow / Event Materials : Popup Graphic");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : Display graphic package - 10' floor display", "Field Day / Tradeshow / Event Materials : Popup Graphic");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : Display graphic package - tabletop", "Field Day / Tradeshow / Event Materials : Popup Graphic");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : Displays - 10' floor display frame", "Field Day / Tradeshow / Event Materials : Popup Display");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : Displays - tabletop display frame", "Field Day / Tradeshow / Event Materials : Tabletop Display");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : Invitation template", "Field Day / Tradeshow / Event Materials : Invitation");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : Local Show/Event SetUp Suggestions", "Field Day / Tradeshow / Event Materials : Layout/Set Up Guides");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : Outdoor Sign", "Field Day / Tradeshow / Event Materials : Banner");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : Podium Sign", "Field Day / Tradeshow / Event Materials : Podium Sign");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : Tableskirt", "Field Day / Tradeshow / Event Materials : Table Cover");
|
||||||
|
categoryMap.put("LocalTradeshowsEventTools : LocalTradeShowGraphic", "Field Day / Tradeshow / Event Materials : Popup Graphic");
|
||||||
|
categoryMap.put("LogosBrandTags : Brand Tag", "Logos / Brand Tags : Brand Tag");
|
||||||
|
categoryMap.put("LogosBrandTags : Logo", "Logos / Brand Tags : Logo");
|
||||||
|
categoryMap.put("NationalCampaign : Campaign Summary", "Sales Literature / Collateral : Brand PPT");
|
||||||
|
categoryMap.put("NationalCampaign : Dealer Point of Purchase", "Point of Sales Materials : POS Display");
|
||||||
|
categoryMap.put("NationalCampaign : Google Ads", "Advertising - Digital : Search/PPC");
|
||||||
|
categoryMap.put("NationalCampaign : National Digital/New Media", "Advertising - Digital : Web Content - Article/Copy");
|
||||||
|
categoryMap.put("NationalCampaign : National Print", "Advertising - Print : Print Ad");
|
||||||
|
categoryMap.put("NationalCampaign : National Radio", "Advertising - Radio/Audio : Radio Produced Spot");
|
||||||
|
categoryMap.put("NationalCampaign : National TV", "Advertising - TV : TV Produced Spot");
|
||||||
|
categoryMap.put("NationalCampaign : Outdoor Billboard", "Advertising - OOH : Billboard");
|
||||||
|
categoryMap.put("NationalCampaign : PPC (pay per click)", "Advertising - Digital : Search/PPC");
|
||||||
|
categoryMap.put("NationalCampaign : Text Messaging", "Advertising - Digital : Text Messaging");
|
||||||
|
categoryMap.put("NationalCampaign : Tweets", "Advertising - Digital : Social");
|
||||||
|
categoryMap.put("NationalCampaign : Video", "Advertising - Digital : Web Content - Video");
|
||||||
|
categoryMap.put("NationalCRMDirect : Direct Mail", "Advertising - Print : Direct Mail");
|
||||||
|
categoryMap.put("NationalCRMDirect : Eblast", "Advertising - Digital : Email");
|
||||||
|
categoryMap.put("NationalPRCampaign : Audio Release", "Advertising - PR, Product Publicity : News Release");
|
||||||
|
categoryMap.put("NationalPRCampaign : PR Overview", "Advertising - PR, Product Publicity : Presentation");
|
||||||
|
categoryMap.put("NationalPRCampaign : PR Results", "Advertising - PR, Product Publicity : Presentation");
|
||||||
|
categoryMap.put("NationalPRCampaign : Press Kit", "Advertising - PR, Product Publicity : Media Kit");
|
||||||
|
categoryMap.put("NationalPRCampaign : Press Release", "Advertising - PR, Product Publicity : News Release");
|
||||||
|
categoryMap.put("NationalPRCampaign : Print Article", "Advertising - Print : Print Advertorial");
|
||||||
|
categoryMap.put("NationalPRCampaign : Radio Interview", "Advertising - Radio/Audio : Radio Interview");
|
||||||
|
categoryMap.put("NationalPRCampaign : Talking Points", "Advertising - PR, Product Publicity : Talking Points");
|
||||||
|
categoryMap.put("NationalPRCampaign : TV Interview", "Advertising - TV : TV Interview");
|
||||||
|
categoryMap.put("NationalPRCampaign : Video", "Advertising - PR, Product Publicity : Testimonial");
|
||||||
|
categoryMap.put("NationalProgramsPromotions : Program Ad", "Program Materials : Program Mailing/Ad");
|
||||||
|
categoryMap.put("NationalProgramsPromotions : Program Mailing", "Program Materials : Program Mailing/Ad");
|
||||||
|
categoryMap.put("NationalProgramsPromotions : Program Material", "Program Materials : Program Detailer");
|
||||||
|
categoryMap.put("NationalProgramsPromotions : Program Materials", "Program Materials : Program Detailer");
|
||||||
|
categoryMap.put("NationalProgramsPromotions : Program Rules", "Program Materials : Program Rules");
|
||||||
|
categoryMap.put("SalesTools : Premium", "Field Day / Tradeshow / Event Materials : Premiums/Giveaways");
|
||||||
|
categoryMap.put("SalesTools : Presentation", "Advertising - PR, Product Publicity : Presentation");
|
||||||
|
categoryMap.put("SalesTools : Presentation template", "Custom Templates : Presentation Template");
|
||||||
|
categoryMap.put("SalesTools : Talking Points", "Advertising - PR, Product Publicity : Talking Points");
|
||||||
|
categoryMap.put("SalesTools : Training Module", "Advertising - Digital : Web Content - Tool/Training Module");
|
||||||
|
categoryMap.put("AgIssues Forum : NTS - Booth Graphics", "Field Day / Tradeshow / Event Materials : Popup Graphic");
|
||||||
|
categoryMap.put("AgIssues Forum : NTS - Summary/Review", "Advertising - PR, Product Publicity : Presentation");
|
||||||
|
categoryMap.put("AgIssues Forum : NTS - Talking Points", "Advertising - PR, Product Publicity : Talking Points");
|
||||||
|
categoryMap.put("AgRetailersAssociation : NTS - Talking Points", "Advertising - PR, Product Publicity : Talking Points");
|
||||||
|
categoryMap.put("ASFMRA : NTS - Talking Points", "Advertising - PR, Product Publicity : Talking Points");
|
||||||
|
categoryMap.put("ASTA : NTS - Booth Graphics", "Field Day / Tradeshow / Event Materials : Popup Graphic");
|
||||||
|
categoryMap.put("ASTA : NTS - PR Results", "Advertising - PR, Product Publicity : Presentation");
|
||||||
|
categoryMap.put("ASTA : NTS - Talking Points", "Advertising - PR, Product Publicity : Talking Points");
|
||||||
|
categoryMap.put("Beltwide : NTS - Booth Graphics", "Field Day / Tradeshow / Event Materials : Popup Graphic");
|
||||||
|
categoryMap.put("CAPCA : NTS - Booth Graphics", "Field Day / Tradeshow / Event Materials : Popup Graphic");
|
||||||
|
categoryMap.put("CAPCA : NTS - Booth/Event Photos", "Image : Photo - Event");
|
||||||
|
categoryMap.put("CAPCA : NTS - PR Results", "Advertising - PR, Product Publicity : Presentation");
|
||||||
|
categoryMap.put("CAPCA : NTS - Talking Points", "Advertising - PR, Product Publicity : Talking Points");
|
||||||
|
categoryMap.put("CAPCA : NTS - Videos", "Image : Photo - Event");
|
||||||
|
categoryMap.put("CommodityClassic : NTS - Booth Graphics", "Field Day / Tradeshow / Event Materials : Popup Graphic");
|
||||||
|
categoryMap.put("Equipment : Product Information Sheet", "Sales Literature / Collateral : Fact/Topic Sheet");
|
||||||
|
categoryMap.put("FarmProgress : NTS - Booth Graphics", "Field Day / Tradeshow / Event Materials : Popup Graphic");
|
||||||
|
categoryMap.put("FarmProgress : NTS - PR Results", "Advertising - PR, Product Publicity : Presentation");
|
||||||
|
categoryMap.put("NationalAerialApplicatorsConvention : NTS - Booth Graphics", "Field Day / Tradeshow / Event Materials : Popup Graphic");
|
||||||
|
categoryMap.put("NationalPotatoShow : NTS - Booth Graphics", "Field Day / Tradeshow / Event Materials : Popup Graphic");
|
||||||
|
categoryMap.put("NationalPotatoShow : NTS - PR Results", "Advertising - PR, Product Publicity : Presentation");
|
||||||
|
categoryMap.put("NationalPotatoShow : NTS - Summary/Review", "Advertising - PR, Product Publicity : Presentation");
|
||||||
|
categoryMap.put("NationalPotatoShow : NTS - Talking Points", "Advertising - PR, Product Publicity : Talking Points");
|
||||||
|
categoryMap.put("NationalPotatoShow : NTS - Videos", "Image : Photo - Event");
|
||||||
|
categoryMap.put("OurCompany : Company Statement", "Advertising - PR, Product Publicity : Presentation");
|
||||||
|
categoryMap.put("OurCompany : Company Values", "Advertising - PR, Product Publicity : Presentation");
|
||||||
|
categoryMap.put("ProfitMaximizer : NTS - Booth Graphics", "Field Day / Tradeshow / Event Materials : Popup Graphic");
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String[]> inputRows;
|
private List<String[]> inputRows;
|
||||||
@@ -628,6 +749,7 @@ public class ToolboxImportFileGenerator {
|
|||||||
long originalFilenameNull = 0;
|
long originalFilenameNull = 0;
|
||||||
long noTargetBrand = 0;
|
long noTargetBrand = 0;
|
||||||
long noTargetBusinessUnit = 0;
|
long noTargetBusinessUnit = 0;
|
||||||
|
long noAssetType = 0;
|
||||||
|
|
||||||
for (String[] line : inputRows) {
|
for (String[] line : inputRows) {
|
||||||
Integer assetId = Integer.parseInt(line[0]);
|
Integer assetId = Integer.parseInt(line[0]);
|
||||||
@@ -678,12 +800,27 @@ public class ToolboxImportFileGenerator {
|
|||||||
else
|
else
|
||||||
asset.byr_cs_description = "[Asset imported from Toolbox, ID " + asset.toolboxAssetId + "]";
|
asset.byr_cs_description = "[Asset imported from Toolbox, ID " + asset.toolboxAssetId + "]";
|
||||||
|
|
||||||
|
|
||||||
asset.byr_cs_keywords_tl = "toolbox import";
|
asset.byr_cs_keywords_tl = "toolbox import";
|
||||||
|
|
||||||
asset.byr_MarketingId = line[3];
|
asset.byr_MarketingId = line[3];
|
||||||
|
|
||||||
asset.appendClassification = "/Definitions/Common/Status/Released";
|
asset.appendClassification = "/Definitions/Agencies/Bayer/Bayer CS\n" + "/Definitions/Common/Status/Released";
|
||||||
|
|
||||||
|
// determine asset type (from Toolbox "category")
|
||||||
|
String assetCategory = line[12] + " : " + line[13];
|
||||||
|
String targetType = categoryMap.get(assetCategory);
|
||||||
|
if (targetType != null) {
|
||||||
|
asset.appendClassification = asset.appendClassification
|
||||||
|
+ "\n/Bayer/Crop Science/Categroy\\/Item/" + targetType.substring(0, targetType.indexOf(" : "))
|
||||||
|
+ "\n/Bayer/Crop Science/Categroy\\/Item/" + targetType.substring(targetType.indexOf(" : ") + 3);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
noAssetType++;
|
||||||
|
log.info(asset.toolboxAssetId + ": Could not map category '" + assetCategory + "' to any asset type");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
asset.fileSize = Long.parseLong(line[16]);
|
asset.fileSize = Long.parseLong(line[16]);
|
||||||
|
|
||||||
@@ -702,9 +839,10 @@ public class ToolboxImportFileGenerator {
|
|||||||
|
|
||||||
log.info("Processed lines: " + processedLines);
|
log.info("Processed lines: " + processedLines);
|
||||||
log.info("Assets included: " + assetsIncluded);
|
log.info("Assets included: " + assetsIncluded);
|
||||||
log.info("Original filname NULL: " + originalFilenameNull);
|
log.info("Skipped: Original filname NULL: " + originalFilenameNull);
|
||||||
log.info("No target brand: " + noTargetBrand);
|
log.info("Skipped: No target brand: " + noTargetBrand);
|
||||||
log.info("No target business unit: " + noTargetBusinessUnit);
|
log.info("Skipped: No target business unit: " + noTargetBusinessUnit);
|
||||||
|
log.info("No asset type: " + noAssetType);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void readToolboxExport() {
|
private void readToolboxExport() {
|
||||||
|
|||||||
Reference in New Issue
Block a user