fixed tree

This commit is contained in:
gexce
2017-10-17 17:05:21 +02:00
parent 9397cd17ee
commit f9cb742495
4 changed files with 17 additions and 15 deletions
@@ -1,4 +1,4 @@
# TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF # TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF
logging.level.com.bayer=DEBUG logging.level.com.bayer=DEBUG
logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} %-5level- %msg%n logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} %-5level- %msg%n
logging.file=entryDownload.log logging.file=application.log
@@ -29,7 +29,7 @@ import com.bayer.edam.migration.mam.Entry.Download;
import com.bayer.edam.migration.mam.Entrylist; import com.bayer.edam.migration.mam.Entrylist;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
@SpringBootApplication //@SpringBootApplication
@PropertySource("file:secret.properties") @PropertySource("file:secret.properties")
public class EntryDownloader implements CommandLineRunner { public class EntryDownloader implements CommandLineRunner {
@@ -34,7 +34,7 @@ import com.bayer.edam.migration.adam.WriteRecord;
import com.bayer.edam.migration.mam.Entry; import com.bayer.edam.migration.mam.Entry;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
//@SpringBootApplication @SpringBootApplication
@PropertySource("file:secret.properties") @PropertySource("file:secret.properties")
public class MamMigrationSelective implements CommandLineRunner { public class MamMigrationSelective implements CommandLineRunner {
@@ -42,7 +42,7 @@ public class MamMigrationSelective implements CommandLineRunner {
static final String adamHost = "https://edam-q.bayer.com:2015"; static final String adamHost = "https://edam-q.bayer.com:2015";
static final String mamHost = "https://service.media-assistant.animalhealth.bayer.com"; static final String mamHost = "https://service.media-assistant.animalhealth.bayer.com";
static final int[] selection = { /*71948, 71048, 70778, 70746, 70142,*/ 70361, /*63924, 71263, 63201, 56942, 57641, 70745, 70440, 70340, static final int[] selection = { 71948, /*71048, 70778, 70746, 70142,*/ 70361, /*63924, 71263, 63201, 56942, 57641, 70745, 70440, 70340,
70288, 71725*/ }; 70288, 71725*/ };
static final File entryLog = new File("C:\\Temp\\Migration AH\\entry.log"); static final File entryLog = new File("C:\\Temp\\Migration AH\\entry.log");
@@ -130,7 +130,7 @@ public class MamMigrationSelective implements CommandLineRunner {
// TODO HIER GEHT'S WEITER
// process table // process table
Set<String> keywords = new HashSet<String>(); Set<String> keywords = new HashSet<String>();
String status = "Status.Released"; String status = "Status.Released";
@@ -81,8 +81,8 @@ public class CategoryTree {
for (String[] row : inputRows) { for (String[] row : inputRows) {
rowNum++; rowNum++;
if (row[0] == null) { if (row[0] == null || row[0].equals("Action")) {
log.info(rowNum + " - skipping, first cell ist empty"); log.info(rowNum + " - skipping, first cell ist empty or heading");
continue; continue;
} }
@@ -97,13 +97,15 @@ public class CategoryTree {
} }
currentPath[rowLevel] = row[rowLevel + 3].trim(); currentPath[rowLevel] = row[rowLevel + 3].trim();
// int i = 1; /* // print node
// System.out.print("[" + currentPath[0]); int i = 1;
// while (i < currentPath.length && currentPath[i] != null) { System.out.print("[" + currentPath[0]);
// System.out.print(", " + currentPath[i]); while (i < currentPath.length && currentPath[i] != null) {
// i++; System.out.print(", " + currentPath[i]);
// } i++;
// System.out.println("]"); }
System.out.println("]");
*/
Node node = getNode(currentPath); Node node = getNode(currentPath);
@@ -204,7 +206,7 @@ public class CategoryTree {
public static void main(String[] args) { public static void main(String[] args) {
try { try {
new CategoryTree("C:\\Temp\\Migration AH\\categories.json", "C:\\Temp\\Migration AH\\Media Assistant Categories - Code.csv"); new CategoryTree("C:\\Temp\\Migration AH\\2017-10-17_categories.json", "C:\\Temp\\Migration AH\\Media_Assistant_Categories_131017_EDITED.csv");
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }