diff --git a/Toolbox Migration/src/com/bayer/edam/excelimport/CropAssetCopyTool.java b/Toolbox Migration/src/com/bayer/edam/excelimport/CropAssetCopyTool.java index abe01a9..492c069 100644 --- a/Toolbox Migration/src/com/bayer/edam/excelimport/CropAssetCopyTool.java +++ b/Toolbox Migration/src/com/bayer/edam/excelimport/CropAssetCopyTool.java @@ -43,7 +43,7 @@ public class CropAssetCopyTool { private static String toolboxExportFilePath = "C:\\Temp\\Migration CS - PhotoGallery\\export - 2017-08-28 - logos and tags not included in first migration.csv"; - private static String toolboxExportUpdateFilePath = "C:\\Temp\\Migration CS - PhotoGallery\\export - 2017-08-28 - logos and tags not included in first migration-update.csv"; + private static String toolboxExportUpdateFilePath = "C:\\Temp\\Migration CS - PhotoGallery\\export - 2017-08-28 - logos and tags not included in first migration.copytool.csv"; private static String logfilePath = "C:\\Temp\\Migration CS - PhotoGallery\\export - 2017-08-28 - logos and tags not included in first migration.copytool.log"; private static String assetPath = "D:\\ToolboxLogosAndTags"; // private static String videoPath = "D:\\Toolbox\\Movies\\"; diff --git a/Toolbox Migration/src/com/bayer/edam/excelimport/ToolboxImportFileGenerator.java b/Toolbox Migration/src/com/bayer/edam/excelimport/ToolboxImportFileGenerator.java index ca92b78..401c803 100644 --- a/Toolbox Migration/src/com/bayer/edam/excelimport/ToolboxImportFileGenerator.java +++ b/Toolbox Migration/src/com/bayer/edam/excelimport/ToolboxImportFileGenerator.java @@ -29,12 +29,12 @@ import com.univocity.parsers.csv.CsvWriterSettings; public class ToolboxImportFileGenerator { private static Logger log = Logger.getLogger(ToolboxImportFileGenerator.class); - private static String toolboxExportFilePath = "C:\\Temp\\Migration CS - PhotoGallery\\export - 2017-08-28 - logos and tags not included in first migration-update.csv"; - private static String logfilePath = "C:\\Temp\\Migration CS - PhotoGallery\\export - 2017-08-28 - logos and tags not included in first migration-update.log"; + private static String toolboxExportFilePath = "C:\\Temp\\Migration CS - PhotoGallery\\export - 2017-08-28 - logos and tags not included in first migration.copytool.csv"; + private static String logfilePath = "C:\\Temp\\Migration CS - PhotoGallery\\export - 2017-08-28 - logos and tags not included in first migration.copytool.generator.log"; private static String licenseGuidsFilePath = "C:\\Temp\\Migration CS - SQL Server\\Release_GUIDs.csv"; // XXX Spreadsheet needs be be named "Records" in Excel for the importer - private static String importFilePath = "C:\\Temp\\Migration CS - PhotoGallery\\export - 2017-08-28 - logos and tags not included in first migration-update-IMPORT.csv"; + private static String importFilePath = "C:\\Temp\\Migration CS - PhotoGallery\\export - 2017-08-28 - logos and tags not included in first migration.copytool.generator.csv"; private static String uploadPath = "/Resources/Upload/ToolboxLogosAndTags"; private static final Map brandMap; @@ -980,6 +980,8 @@ public class ToolboxImportFileGenerator { private SimpleDateFormat inputDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); private SimpleDateFormat outputDateFormat = new SimpleDateFormat("MM/dd/yyyy"); + + private HashSet marketingIDs = new HashSet(); public ToolboxImportFileGenerator() throws Exception { parserSettings.getFormat().setLineSeparator("\r\n"); @@ -1071,6 +1073,17 @@ public class ToolboxImportFileGenerator { asset.byr_cs_country = "United States"; asset.byr_MarketingId = line[3]; + if (!marketingIDs.add(asset.byr_MarketingId)) { + CropScienceAsset assetWithMarketingID = null; + for (CropScienceAsset ast : assets.values()) { + if (ast.byr_MarketingId.equals(asset.byr_MarketingId)) { + assetWithMarketingID = ast; + break; + } + } + + log.error(asset.toolboxAssetId + ", line " + lineNo + ": marketing ID " + asset.byr_MarketingId + " already bound to asset " + assetWithMarketingID.toolboxAssetId); + } // asset.fileSize = Long.parseLong(line[15]);