From 3857bbcb7587ae43e653bac28c79bd8e9ef6243b Mon Sep 17 00:00:00 2001 From: gexce Date: Mon, 11 Sep 2017 14:29:53 +0200 Subject: [PATCH] maintenance --- .../edam/excelimport/CropAssetCopyTool.java | 10 ++++---- .../ToolboxImportFileGenerator.java | 25 +++++++++++++------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Toolbox Migration/src/com/bayer/edam/excelimport/CropAssetCopyTool.java b/Toolbox Migration/src/com/bayer/edam/excelimport/CropAssetCopyTool.java index 492c069..17af59f 100644 --- a/Toolbox Migration/src/com/bayer/edam/excelimport/CropAssetCopyTool.java +++ b/Toolbox Migration/src/com/bayer/edam/excelimport/CropAssetCopyTool.java @@ -42,13 +42,13 @@ public class CropAssetCopyTool { private static int skipLines = 0; - 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.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 toolboxExportFilePath = "C:\\Temp\\Migration CS - PhotoGallery\\export - 2017-08-25 - assets not included in first migration.csv"; + private static String toolboxExportUpdateFilePath = "C:\\Temp\\Migration CS - PhotoGallery\\export - 2017-08-25 - assets not included in first migration.copytool.csv"; + private static String logfilePath = "C:\\Temp\\Migration CS - PhotoGallery\\export - 2017-08-25 - assets not included in first migration.copytool.log"; + private static String assetPath = "D:\\ToolboxPhotoGallery-numbered"; // private static String videoPath = "D:\\Toolbox\\Movies\\"; - private static File targetDir = new File("D:\\ToolboxLogosAndTags-renamed"); + private static File targetDir = new File("D:\\ToolboxPhotoGallery"); // private static String videoTargetPath = "D:\\UploadVideos"; diff --git a/Toolbox Migration/src/com/bayer/edam/excelimport/ToolboxImportFileGenerator.java b/Toolbox Migration/src/com/bayer/edam/excelimport/ToolboxImportFileGenerator.java index 401c803..2b56f1f 100644 --- a/Toolbox Migration/src/com/bayer/edam/excelimport/ToolboxImportFileGenerator.java +++ b/Toolbox Migration/src/com/bayer/edam/excelimport/ToolboxImportFileGenerator.java @@ -27,15 +27,17 @@ import com.univocity.parsers.csv.CsvWriterSettings; * @author GEXCE */ public class ToolboxImportFileGenerator { + private static String[] selection = { }; + 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.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 toolboxExportFilePath = "C:\\Temp\\Migration CS - PhotoGallery\\all imported IDs - toolbox export.csvXXX"; + private static String logfilePath = "C:\\Temp\\Migration CS - PhotoGallery\\all imported IDs - toolbox export.problem with type import.generator.XXX.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.copytool.generator.csv"; - private static String uploadPath = "/Resources/Upload/ToolboxLogosAndTags"; + private static String importFilePath = "C:\\Temp\\Migration CS - PhotoGallery\\all imported IDs - toolbox export.problem with type import.generator.csv"; + private static String uploadPath = "/Resources/Upload/ToolboxMigration"; private static final Map brandMap; private static final Map unitMap; @@ -1139,8 +1141,7 @@ public class ToolboxImportFileGenerator { String categoryClassification = targetType.substring(0, targetType.indexOf(" : ")); String subCategoryClassification = targetType.substring(targetType.indexOf(" : ") + 3); - asset.appendClassification = asset.appendClassification - + "\n/Bayer/Crop Science/CategoryItem/" + categoryClassification + asset.appendClassification = "/Bayer/Crop Science/CategoryItem/" + categoryClassification + "\n/Bayer/Crop Science/CategoryItem/" + categoryClassification + "/" + subCategoryClassification; } else { @@ -1244,7 +1245,7 @@ public class ToolboxImportFileGenerator { List csvOutputList = new ArrayList(); for (CropScienceAsset asset : assets.values()) { - // XXX export only assets with license data +// // XXX export only assets with license data // if (asset.licenseRecords.size() == 0) // continue; @@ -1254,6 +1255,16 @@ public class ToolboxImportFileGenerator { // XXX This filename is broken (because of the question mark) if (asset.filename.equals("Texas Cotton Growers Achieve Excellence with FiberMax?.mp4")) asset.filename = "CR0715FIBMAXA232V00R0.MP4"; + + if (selection.length > 0) { + boolean found = false; + for (String s : selection) { + if (s.equals(asset.filename)) + found = true; + } + if (!found) + continue; + } String brands = ""; for (String brand : asset.brands) {