maintenance

This commit is contained in:
gexce
2017-09-11 14:29:53 +02:00
parent 1f6a7a48cd
commit 3857bbcb75
2 changed files with 23 additions and 12 deletions
@@ -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";
@@ -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<String, String> brandMap;
private static final Map<String, String> 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<Object[]> csvOutputList = new ArrayList<Object[]>();
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) {