getting mature
This commit is contained in:
Binary file not shown.
+45
-32
@@ -94,7 +94,7 @@ campaign;;;;;;2016 - Giardia;;;;
|
|||||||
campaign;;;;;;2017 - Drontal Tasty Images;;;;
|
campaign;;;;;;2017 - Drontal Tasty Images;;;;
|
||||||
brand;;;;;Procox;;;;;
|
brand;;;;;Procox;;;;;
|
||||||
campaign;;;;;;2011 - Procox Launch Communication Concept ;;;;
|
campaign;;;;;;2011 - Procox Launch Communication Concept ;;;;
|
||||||
classify;MediaType.Packshot;;;;;;Packshots;;;
|
skip;;;;;;;Packshots;;;
|
||||||
campaign;;;;;;2012 - Brand Guideline;;;;
|
campaign;;;;;;2012 - Brand Guideline;;;;
|
||||||
campaign;;;;;;2012 - Easy digest 1, Coccidia;;;;
|
campaign;;;;;;2012 - Easy digest 1, Coccidia;;;;
|
||||||
campaign;;;;;;2014 - Procox Positioning Video;;;;
|
campaign;;;;;;2014 - Procox Positioning Video;;;;
|
||||||
@@ -202,9 +202,9 @@ brand;;;;;Ceffect;;;;;
|
|||||||
brand;;;;;Dairy Products;;;;;
|
brand;;;;;Dairy Products;;;;;
|
||||||
brand;;;;;Honey bee care;;;;;
|
brand;;;;;Honey bee care;;;;;
|
||||||
keyword;;;;;;Images;;;;
|
keyword;;;;;;Images;;;;
|
||||||
brand;;;;;Polyvar;;;;;Brand noch nicht im System
|
brand;;;;;Polyvar;;;;;
|
||||||
classify;Status.Archived;;;;Transforming Livestock Production;;;Wird archiviert;;Welche Brand?
|
classify;Status.Archived,BusinessUnit.FAP,Brand.FAP.Others;;;;Transforming Livestock Production;;;Wird archiviert;;
|
||||||
classify;Status.Archived;;;;;TLP Pictograms;;;;
|
classify;Status.Archived,BusinessUnit.FAP,Brand.FAP.Others;;;;;TLP Pictograms;;;;
|
||||||
brand;;;;;Victrio;;;;;
|
brand;;;;;Victrio;;;;;
|
||||||
brand;;;;;Zelnate;;;;;
|
brand;;;;;Zelnate;;;;;
|
||||||
campaign;(2016);;;;;Brand Guide;;;;
|
campaign;(2016);;;;;Brand Guide;;;;
|
||||||
@@ -212,12 +212,14 @@ campaign;(2016);;;;;Digital;;;;
|
|||||||
campaign;(2015);;;;;Logo;;;;
|
campaign;(2015);;;;;Logo;;;;
|
||||||
campaign;(2015-2016);;;;;Print;;;;
|
campaign;(2015-2016);;;;;Print;;;;
|
||||||
campaign;(2016);;;;;Videos;;;;
|
campaign;(2016);;;;;Videos;;;;
|
||||||
classify;MediaType.Guideline;;;Copyright Templates;-> unter Guidelines;;;;;
|
skip;BusinessUnit.General,Brand.General,MediaType.Guideline;;;Copyright Templates;-> unter Guidelines;;;;;"war: classify/MediaType.Guideline
|
||||||
classify;MediaType.Guideline;;;Guidelines;;;;;;
|
Guidelines ist ein Media Type --> überschreiben? Wohin in der Struktur? Bspw. entry 34711
|
||||||
|
braucht: Business Unit und Brand"
|
||||||
|
skip;BusinessUnit.General,Brand.General,MediaType.Guideline;;;Guidelines;;;;;;
|
||||||
skip;;;;;AH Meeting Culture;;;;;
|
skip;;;;;AH Meeting Culture;;;;;
|
||||||
skip;;;;;Agency Briefing Templates;;;;;
|
skip;;;;;Agency Briefing Templates;;;;;
|
||||||
skip;;;;;BAH eDetailer Template;;;;;
|
skip;;;;;BAH eDetailer Template;;;;;
|
||||||
classify;BusinessUnit.CAP;;;;CAP Brand/Packaging Design;;;;;
|
classify;BusinessUnit.CAP;;;;CAP Brand/Packaging Design;;;;;kann eine Guideline in Brand.General, aber in BusinessUnit CAP sein?
|
||||||
campaign;(2009-2017);;;;;Advantage Family;;;;
|
campaign;(2009-2017);;;;;Advantage Family;;;;
|
||||||
campaign;(2003-2012);;;;;Bolfo/Bayopet (OTC);;;;
|
campaign;(2003-2012);;;;;Bolfo/Bayopet (OTC);;;;
|
||||||
campaign;(2012-2017);;;;;Drontal Product Family;;;;
|
campaign;(2012-2017);;;;;Drontal Product Family;;;;
|
||||||
@@ -281,39 +283,40 @@ motives;;;;;;Zoo and other animals;;;;
|
|||||||
motives;;;;;Worms (Helminths);;;;;
|
motives;;;;;Worms (Helminths);;;;;
|
||||||
motives;;;;;;Roundworms;;;;
|
motives;;;;;;Roundworms;;;;
|
||||||
motives;;;;;;Tapeworms;;;;
|
motives;;;;;;Tapeworms;;;;
|
||||||
scan;;;;Logos;;;;;;bitte den Brands zuordnen
|
skip;;;;Logos;;;;;;bitte den Brands zuordnen
|
||||||
skip;;;;Packshots;;;;;;
|
skip;;;;Packshots;;;;;;
|
||||||
brand;;;;;Advantage;;;;;
|
classify;BusinessUnit.CAP,Brand.Advantage;;;;Advantage;;;;;
|
||||||
brand;;;;;Advantix;;;;;
|
classify;BusinessUnit.CAP,Brand.Advantix;;;;Advantix;;;;;
|
||||||
brand;;;;;Advocate;;;;;
|
classify;BusinessUnit.CAP,Brand.Advocate;;;;Advocate;;;;;
|
||||||
brand;;;;;Baycox;;;;;
|
classify;BusinessUnit.FAP,Brand.Baycox;;;;Baycox;;;;;
|
||||||
brand;;;;;Baytril;;;;;
|
classify;BusinessUnit.FAP,Brand.Baytril;;;;Baytril;;;;;
|
||||||
brand;;;;;Bolfo/Bay-o-Pet;;;;;
|
classify;BusinessUnit.CAP,Brand.Bolfo/Bay-o-Pet;;;;Bolfo/Bay-o-Pet;;;;;
|
||||||
brand;;;;;Byemite;;;;;
|
classify;BusinessUnit.FAP,Brand.FAP.Others;;;;Byemite;;;;;
|
||||||
brand;;;;;Catosal;;;;;
|
classify;BusinessUnit.FAP,Brand.Catosal;;;;Catosal;;;;;
|
||||||
brand;;;;;Clavobay;;;;;
|
classify;BusinessUnit.FAP,Brand.FAP.Others;;;;Clavobay;;;;;
|
||||||
brand;;;;;Droncit;;;;;
|
classify;BusinessUnit.CAP,Brand.Droncit;;;;Droncit;;;;;
|
||||||
brand;;;;;Drontal;;;;;
|
classify;BusinessUnit.CAP,Brand.Drontal;;;;Drontal;;;;;
|
||||||
brand;;;;;Procox;;;;;
|
classify;BusinessUnit.CAP,Brand.Procox;;;;Procox;;;;;
|
||||||
brand;;;;;Profender;;;;;
|
classify;BusinessUnit.CAP,Brand.Profender;;;;Profender;;;;;
|
||||||
brand;;;;;Seresto;;;;;
|
classify;BusinessUnit.CAP,Brand.Seresto;;;;Seresto;;;;;
|
||||||
brand;;;;;Veraflox;;;;;
|
classify;BusinessUnit.CAP,Brand.Veraflox;;;;Veraflox;;;;;
|
||||||
scan;;;;Video Library;;-> alles was nicht brand-related ist, bitte unter Space General;;;;Wenn möglich, Brand zuordnen, sonst General/unassigned
|
classify;BusinessUnit.General,Brand.General;;;Video Library;;-> alles was nicht brand-related ist, bitte unter Space General;;;;Wenn möglich, Brand zuordnen, sonst General/unassigned
|
||||||
keyword;;;;;Events;;;;;
|
keyword;;;;;Events;;;;;
|
||||||
brand;;;;;;CVBD;;;;
|
brand;;;;;;CVBD;;;;
|
||||||
skip;;;;;Films by Brand;;;;;
|
skip;;;;;Films by Brand;;;;;
|
||||||
brand;;;;;;Advantage;;;;
|
brand;;;;;;Advantage;;;;
|
||||||
brand;;;;;;Advantix / K9 Advantix;;;;
|
classify;Brand.Advantix;;;;;Advantix / K9 Advantix;;;;
|
||||||
skip;;;;;;;No Bite;;;
|
skip;;;;;;;No Bite;;;
|
||||||
skip;;;;;;;Repel & Kill - 2014;;;
|
skip;;;;;;;Repel & Kill - 2014;;;
|
||||||
brand;;;;;;Advocate/Advantage Multi;;;;
|
classify;Brand.Advocate,Brand.Advantage;;;;;Advocate/Advantage Multi;;;;
|
||||||
brand;;;;;;Baycox;;;;
|
brand;;;;;;Baycox;;;;
|
||||||
brand;;;;;;Bayer Parasite Solutions;;;;
|
keyword;;;;;;Bayer Parasite Solutions;;;;
|
||||||
brand;;;;;;Catosal;;;;
|
brand;;;;;;Catosal;;;;
|
||||||
brand;;;;;;Drontal;;;;
|
brand;;;;;;Drontal;;;;
|
||||||
|
brand;;;;;;Polyvar;;;;
|
||||||
brand;;;;;;Procox;;;;
|
brand;;;;;;Procox;;;;
|
||||||
brand;;;;;;Profender Cat;;;;
|
classify;Brand.Profender;;;;;Profender Cat;;;;
|
||||||
brand;;;;;;Profender Dog;;;;
|
classify;Brand.Profender;;;;;Profender Dog;;;;
|
||||||
brand;;;;;;Seresto;;;;
|
brand;;;;;;Seresto;;;;
|
||||||
brand;;;;;;Veraflox;;;;
|
brand;;;;;;Veraflox;;;;
|
||||||
brand;;;;;;Victrio;;;;
|
brand;;;;;;Victrio;;;;
|
||||||
@@ -332,8 +335,8 @@ keyword;;;;;;;Dirofilaria repens;;;
|
|||||||
keyword;;;;;;;Toxocara;;;
|
keyword;;;;;;;Toxocara;;;
|
||||||
keyword;;;;;;Zoonosis;;;;
|
keyword;;;;;;Zoonosis;;;;
|
||||||
skip;;;;;TV Commercials;;;;;
|
skip;;;;;TV Commercials;;;;;
|
||||||
brand;;;;;;Advantix / K9 Advantix;;;;
|
classify;Brand.Advantix;;;;;Advantix / K9 Advantix;;;;
|
||||||
brand;;;;;;Advocate / Advantage Multi;;;;
|
classify;Brand.Advocate,Brand.Advantage;;;;;Advocate / Advantage Multi;;;;
|
||||||
brand;;;;;;Seresto;;;;
|
brand;;;;;;Seresto;;;;
|
||||||
not migrated;;;BAH Image series;;;;;;;wird nicht migriert
|
not migrated;;;BAH Image series;;;;;;;wird nicht migriert
|
||||||
skip;;;;Image series 1;;;;;;
|
skip;;;;Image series 1;;;;;;
|
||||||
@@ -377,7 +380,7 @@ skip;;;;Veterinary Parasitology;;;;;;
|
|||||||
skip;;;;WAAVP Congress ;;;;;;
|
skip;;;;WAAVP Congress ;;;;;;
|
||||||
skip;;;;WBC Congress;;;;;;
|
skip;;;;WBC Congress;;;;;;
|
||||||
skip;;;;Watches ;;;;;;
|
skip;;;;Watches ;;;;;;
|
||||||
classify;Status.Archived;;BAH archive;;;-> muss gesondert nochmal besprochen werden;;;;
|
not migrated;Status.Archived;;BAH archive;;;-> muss gesondert nochmal besprochen werden;;;;
|
||||||
skip;;;;Advertising Media;;;;;;
|
skip;;;;Advertising Media;;;;;;
|
||||||
classify;BusinessUnit.CAP;;;;CAP;;;;;
|
classify;BusinessUnit.CAP;;;;CAP;;;;;
|
||||||
keyword;;;;;;Acticam;;;;Frage: Im Archiv sind brands, die es nicht mehr gibt.
|
keyword;;;;;;Acticam;;;;Frage: Im Archiv sind brands, die es nicht mehr gibt.
|
||||||
@@ -389,6 +392,14 @@ skip;;;;;;;;2015;;
|
|||||||
brand;;;;;;Advocate;;;;
|
brand;;;;;;Advocate;;;;
|
||||||
keyword;;;;;;;Poster;;;
|
keyword;;;;;;;Poster;;;
|
||||||
keyword;;;;;;BPS;;;;
|
keyword;;;;;;BPS;;;;
|
||||||
|
keyword;;;;;;;2015 - BPS Finder for iPads;;;
|
||||||
|
keyword;;;;;;;2014 - BPS Advertisement;;;
|
||||||
|
keyword;;;;;;;2007 - UK / Lucy and Banjo;;;
|
||||||
|
keyword;;;;;;;BPS Screensaver;;;
|
||||||
|
keyword;;;;;;;2009 - BPS Poster;;;
|
||||||
|
keyword;;;;;;;2012 - BPS Finder;;;
|
||||||
|
keyword;;;;;;;BPS Artwork;;;
|
||||||
|
keyword;;;;;;;2008 - Manual for small mammals;;;
|
||||||
brand;;;;;;Baytril;;;;
|
brand;;;;;;Baytril;;;;
|
||||||
keyword;;;;;;Catosal;;;;
|
keyword;;;;;;Catosal;;;;
|
||||||
keyword;;;;;;Clavobay;;;;
|
keyword;;;;;;Clavobay;;;;
|
||||||
@@ -409,6 +420,7 @@ keyword;;;;;;;OTC;;;
|
|||||||
keyword;;;;;;;POM;;;
|
keyword;;;;;;;POM;;;
|
||||||
keyword;;;;;;;Seresto Profender;;;
|
keyword;;;;;;;Seresto Profender;;;
|
||||||
keyword;;;;;;;Seresto e-detailer;;;
|
keyword;;;;;;;Seresto e-detailer;;;
|
||||||
|
keyword;;;;;;;Vet/Nurse Material;;;
|
||||||
brand;;;;;;Veraflox;;;;
|
brand;;;;;;Veraflox;;;;
|
||||||
classify;BusinessUnit.FAP;;;;FAP;;;;;
|
classify;BusinessUnit.FAP;;;;FAP;;;;;
|
||||||
brand;;;;;;Baycox;;;;
|
brand;;;;;;Baycox;;;;
|
||||||
@@ -463,6 +475,7 @@ keyword;;;;;;;Trust Pinkt Toolkit 2008;;;
|
|||||||
skip;;;;;;;;Images;;
|
skip;;;;;;;;Images;;
|
||||||
brand;;;;;;Dairy Products;;;;
|
brand;;;;;;Dairy Products;;;;
|
||||||
brand;;;;;;Biosecurity;;;;
|
brand;;;;;;Biosecurity;;;;
|
||||||
|
brand;;;;;;Polyvar;;;;
|
||||||
keyword;;;;;;Prolongal;;;;
|
keyword;;;;;;Prolongal;;;;
|
||||||
brand;;;;;;Transforming Livestock Production;;;;
|
brand;;;;;;Transforming Livestock Production;;;;
|
||||||
skip;;;;;;;Images;;;
|
skip;;;;;;;Images;;;
|
||||||
|
|||||||
|
BIN
Binary file not shown.
+12638
-12638
File diff suppressed because it is too large
Load Diff
@@ -3,14 +3,16 @@ package com.bayer.edam.migration;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import com.bayer.edam.migration.adam.UploadRecord.WriteClassification;
|
|
||||||
import com.bayer.edam.migration.adam.UploadRecord.Field;
|
import com.bayer.edam.migration.adam.UploadRecord.Field;
|
||||||
import com.bayer.edam.migration.adam.UploadRecord.LocalizedValue;
|
import com.bayer.edam.migration.adam.UploadRecord.LocalizedValue;
|
||||||
|
import com.bayer.edam.migration.adam.UploadRecord.WriteClassification;
|
||||||
|
|
||||||
public class Definitions {
|
public class Definitions {
|
||||||
|
|
||||||
public static final Map<String, WriteClassification> classifications;
|
public static final Map<String, WriteClassification> classifications;
|
||||||
|
public static final Map<String, String> classificationGuidToKeyMap;
|
||||||
public static final Map<String, String> fieldIDs;
|
public static final Map<String, String> fieldIDs;
|
||||||
public static final Map<Long, String> mediaTypes;
|
public static final Map<Long, String> mediaTypes;
|
||||||
|
|
||||||
@@ -42,12 +44,15 @@ public class Definitions {
|
|||||||
classifications.put("Status.Archived", new WriteClassification("4306204af75442fda297a7b4006b4a87", 1));
|
classifications.put("Status.Archived", new WriteClassification("4306204af75442fda297a7b4006b4a87", 1));
|
||||||
|
|
||||||
// /Bayer/Animal Health/Brands
|
// /Bayer/Animal Health/Brands
|
||||||
|
classifications.put("Brand.General", new WriteClassification("92b4b27a09f2487dbba6a70f00f7baa3", 1));
|
||||||
|
|
||||||
classifications.put("Brand.Advantage", new WriteClassification("b3f04996de1644df9d08a6dd00cff70e", 1));
|
classifications.put("Brand.Advantage", new WriteClassification("b3f04996de1644df9d08a6dd00cff70e", 1));
|
||||||
classifications.put("Brand.Advantix", new WriteClassification("dc758de7d91e44d6a768a6dd00cff7ad", 1));
|
classifications.put("Brand.Advantix", new WriteClassification("dc758de7d91e44d6a768a6dd00cff7ad", 1));
|
||||||
classifications.put("Brand.Advocate", new WriteClassification("c7979fc30bb843e486bba6dd00cff835", 1));
|
classifications.put("Brand.Advocate", new WriteClassification("c7979fc30bb843e486bba6dd00cff835", 1));
|
||||||
classifications.put("Brand.Baytril", new WriteClassification("9c8a43adf3324ca6adb0a7d000f427f5", 1));
|
classifications.put("Brand.Baytril", new WriteClassification("9c8a43adf3324ca6adb0a7d000f427f5", 1));
|
||||||
classifications.put("Brand.Bolfo/Bay-o-Pet", new WriteClassification("922a46fc3f6a44bfb025a7d000f428ac", 1));
|
classifications.put("Brand.Bolfo/Bay-o-Pet", new WriteClassification("922a46fc3f6a44bfb025a7d000f428ac", 1));
|
||||||
classifications.put("Brand.CVBD", new WriteClassification("fc84b38665a44291a24ba70f00f7aa1f", 1));
|
classifications.put("Brand.CVBD", new WriteClassification("fc84b38665a44291a24ba70f00f7aa1f", 1));
|
||||||
|
classifications.put("Brand.Droncit", new WriteClassification("86251780660d4faf95cda7cb010c40fe", 1));
|
||||||
classifications.put("Brand.Drontal", new WriteClassification("ca18ffb9735e4f1691cfa6dd00cffb07", 1));
|
classifications.put("Brand.Drontal", new WriteClassification("ca18ffb9735e4f1691cfa6dd00cffb07", 1));
|
||||||
classifications.put("Brand.Procox", new WriteClassification("a64abb14f3fc461ab973a6dd00cffb8f", 1));
|
classifications.put("Brand.Procox", new WriteClassification("a64abb14f3fc461ab973a6dd00cffb8f", 1));
|
||||||
classifications.put("Brand.Profender", new WriteClassification("6be697c82ec34354b0c3a6dd00cffc04", 1));
|
classifications.put("Brand.Profender", new WriteClassification("6be697c82ec34354b0c3a6dd00cffc04", 1));
|
||||||
@@ -67,8 +72,9 @@ public class Definitions {
|
|||||||
classifications.put("Brand.Dairy Products", new WriteClassification("a54fcbb0dd4741059f95a6dd00d00289", 1));
|
classifications.put("Brand.Dairy Products", new WriteClassification("a54fcbb0dd4741059f95a6dd00d00289", 1));
|
||||||
classifications.put("Brand.Honey bee care", new WriteClassification("996f2d1656f44368a87ba6dd00d00353", 1));
|
classifications.put("Brand.Honey bee care", new WriteClassification("996f2d1656f44368a87ba6dd00d00353", 1));
|
||||||
classifications.put("Brand.Victrio", new WriteClassification("9d260d0e9e864ab3b3a4a6dd00d005f1", 1));
|
classifications.put("Brand.Victrio", new WriteClassification("9d260d0e9e864ab3b3a4a6dd00d005f1", 1));
|
||||||
|
classifications.put("Brand.Polyvar", new WriteClassification("d41b837d516a49c0be05a81200e160cb", 1));
|
||||||
classifications.put("Brand.Zelnate", new WriteClassification("b3887552c9554d6991e4a6dd00d006ee", 1));
|
classifications.put("Brand.Zelnate", new WriteClassification("b3887552c9554d6991e4a6dd00d006ee", 1));
|
||||||
classifications.put("Brand.Droncit", new WriteClassification("86251780660d4faf95cda7cb010c40fe", 1));
|
classifications.put("Brand.FAP.Others", new WriteClassification("ac169c77ab944a03bfada70f00f7ac43", 1));
|
||||||
|
|
||||||
classifications.put("MediaType.Other", new WriteClassification("7c13e620-7eb0-4c12-9dfb-a7b4008f19b1", 1));
|
classifications.put("MediaType.Other", new WriteClassification("7c13e620-7eb0-4c12-9dfb-a7b4008f19b1", 1));
|
||||||
classifications.put("MediaType.Banner", new WriteClassification("eb786339a5de44679ff6a7b4008f1ee0", 1));
|
classifications.put("MediaType.Banner", new WriteClassification("eb786339a5de44679ff6a7b4008f1ee0", 1));
|
||||||
@@ -91,6 +97,12 @@ public class Definitions {
|
|||||||
classifications.put("MediaType.Video", new WriteClassification("4f9d38b889eb46f58d79a73100a2b55a", 1));
|
classifications.put("MediaType.Video", new WriteClassification("4f9d38b889eb46f58d79a73100a2b55a", 1));
|
||||||
classifications.put("MediaType.Image", new WriteClassification("58f655cbd4214a72bb2aa73100a2a3dd", 1));
|
classifications.put("MediaType.Image", new WriteClassification("58f655cbd4214a72bb2aa73100a2a3dd", 1));
|
||||||
classifications.put("MediaType.Packshot", new WriteClassification("ba5a96a7d94245e48f14a73100a2a97c", 1));
|
classifications.put("MediaType.Packshot", new WriteClassification("ba5a96a7d94245e48f14a73100a2a97c", 1));
|
||||||
|
classifications.put("MediaType.Guideline", new WriteClassification("a3c6732752274a99817ba7dd007a207f", 1));
|
||||||
|
|
||||||
|
classificationGuidToKeyMap = new HashMap<String, String>();
|
||||||
|
for (Entry<String, WriteClassification> entry : classifications.entrySet()) {
|
||||||
|
classificationGuidToKeyMap.put(entry.getValue().id, entry.getKey());
|
||||||
|
}
|
||||||
|
|
||||||
mediaTypes = new HashMap<Long, String>();
|
mediaTypes = new HashMap<Long, String>();
|
||||||
mediaTypes.put(1L, "MediaType.unassigned");
|
mediaTypes.put(1L, "MediaType.unassigned");
|
||||||
|
|||||||
@@ -52,7 +52,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";
|
||||||
private List<Integer> entrySelection = new ArrayList<Integer>(Arrays.asList( 28861, 28860, 71948, /*71048, 70778, 70746, 70142,*/ 70361/*, 63924, 71263, 63201, 56942, 57641, 70745, 70440, 70340,
|
private List<Integer> entrySelection = new ArrayList<Integer>(Arrays.asList( 28861, 28860, 71948, 71048, 70778, /*70746, 70142,*/ 70361/*, 63924, 71263, 63201, 56942, 57641, 70745, 70440, 70340,
|
||||||
70288, 71725*/));
|
70288, 71725*/));
|
||||||
|
|
||||||
static final String categoryJson = "resources/2017-10-19_categories.json";
|
static final String categoryJson = "resources/2017-10-19_categories.json";
|
||||||
@@ -85,7 +85,7 @@ public class MamMigrationSelective implements CommandLineRunner {
|
|||||||
@Override
|
@Override
|
||||||
public void run(String... strings) throws Exception {
|
public void run(String... strings) throws Exception {
|
||||||
|
|
||||||
// readEntryIDsFromFile();
|
readEntryIDsFromFile();
|
||||||
|
|
||||||
log.info("Write log headers for " + entryLog.getAbsolutePath());
|
log.info("Write log headers for " + entryLog.getAbsolutePath());
|
||||||
FileUtils.writeStringToFile(entryLog, "Location" + fieldSeparator + "Entry" + lineSeparator, Charset.forName("utf-8"));
|
FileUtils.writeStringToFile(entryLog, "Location" + fieldSeparator + "Entry" + lineSeparator, Charset.forName("utf-8"));
|
||||||
@@ -109,7 +109,7 @@ public class MamMigrationSelective implements CommandLineRunner {
|
|||||||
for (Classification yearClassification : campaignYears) {
|
for (Classification yearClassification : campaignYears) {
|
||||||
List<Classification> campaignClassifications = restTemplate.exchange(adamHost + "/classification/" + yearClassification.id + "/children", HttpMethod.GET, adamHeadersEntity, ClassificationList.class).getBody().items;
|
List<Classification> campaignClassifications = restTemplate.exchange(adamHost + "/classification/" + yearClassification.id + "/children", HttpMethod.GET, adamHeadersEntity, ClassificationList.class).getBody().items;
|
||||||
for (Classification campaignClassification : campaignClassifications) {
|
for (Classification campaignClassification : campaignClassifications) {
|
||||||
log.debug(yearClassification.name + ": " + campaignClassification.name + ", " + campaignClassification.labels[0].value + ", " + campaignClassification.id);
|
//log.debug(yearClassification.name + ": " + campaignClassification.name + ", " + campaignClassification.labels[0].value + ", " + campaignClassification.id);
|
||||||
Campaign campaign = new Campaign(campaignClassification.name, campaignClassification.labels[0].value, yearClassification.name);
|
Campaign campaign = new Campaign(campaignClassification.name, campaignClassification.labels[0].value, yearClassification.name);
|
||||||
campaign.guid = campaignClassification.id;
|
campaign.guid = campaignClassification.id;
|
||||||
campaigns.add(campaign);
|
campaigns.add(campaign);
|
||||||
@@ -118,6 +118,18 @@ public class MamMigrationSelective implements CommandLineRunner {
|
|||||||
|
|
||||||
HttpEntity<String> entity = new HttpEntity<String>("", mamHeaders);
|
HttpEntity<String> entity = new HttpEntity<String>("", mamHeaders);
|
||||||
for (int id : entrySelection) {
|
for (int id : entrySelection) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// XXX
|
||||||
|
if (id > 80000 || id < 72048)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
log.info("GET entry " + id);
|
log.info("GET entry " + id);
|
||||||
|
|
||||||
Entry entry = restTemplate.exchange(mamHost + "/rest/migration/entry/{id}", HttpMethod.GET, entity, Entry.class, id).getBody();
|
Entry entry = restTemplate.exchange(mamHost + "/rest/migration/entry/{id}", HttpMethod.GET, entity, Entry.class, id).getBody();
|
||||||
@@ -125,7 +137,11 @@ public class MamMigrationSelective implements CommandLineRunner {
|
|||||||
log.debug("Name: " + entry.name.get("en"));
|
log.debug("Name: " + entry.name.get("en"));
|
||||||
|
|
||||||
// check exclusion criteria
|
// check exclusion criteria
|
||||||
if (entry.stateId == 7) {
|
if ((entry.stateId == 5 || entry.stateId == 4) && entry.fileName == null && entry.categories.size() == 0) {
|
||||||
|
log.info("RESULT Skipping entry " + entry.id + ": Status " + entry.stateId + ", no file attached, no category set");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (entry.stateId == 7) {
|
||||||
log.info("RESULT Skipping entry " + entry.id + ": Status " + entry.stateId + " (LOCKED_BY_ADMIN)");
|
log.info("RESULT Skipping entry " + entry.id + ": Status " + entry.stateId + " (LOCKED_BY_ADMIN)");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -185,7 +201,39 @@ public class MamMigrationSelective implements CommandLineRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (n.action.equals("classify")) {
|
if (n.action.equals("classify")) {
|
||||||
record.addClassification(n.parameter);
|
String[] parameters = n.parameter.split(",");
|
||||||
|
|
||||||
|
for (String p : parameters) {
|
||||||
|
|
||||||
|
// TODO what if "Released" is assigned after "Archived"? (Multiple category problem)
|
||||||
|
if (p.startsWith("Status.")) {
|
||||||
|
if (!p.equals("Status.Released"))
|
||||||
|
record.removeClassification("Status.Released");
|
||||||
|
else if (record.hasClassificationStartingWith("Status.")){
|
||||||
|
log.warn("Classification Status.Released not added, different status already set");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (p.startsWith("BusinessUnit.")) {
|
||||||
|
record.removeClassification("BusinessUnit.CAP");
|
||||||
|
record.removeClassification("BusinessUnit.FAP");
|
||||||
|
record.removeClassification("BusinessUnit.General");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (p.startsWith("Brand.")) {
|
||||||
|
// always use the most specific brand
|
||||||
|
if (p.equals("Brand.General") && record.hasClassificationStartingWith("Brand.")) {
|
||||||
|
log.warn("Classification Brand.General not added, different brand already set");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
record.removeClassification("Brand.General");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
record.addClassification(p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (n.action.equals("brand")) {
|
else if (n.action.equals("brand")) {
|
||||||
String brandClassificationId = "Brand." + n.name.trim();
|
String brandClassificationId = "Brand." + n.name.trim();
|
||||||
@@ -273,7 +321,13 @@ public class MamMigrationSelective implements CommandLineRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fields
|
// Fields
|
||||||
|
if (entry.name.get("en") != null) {
|
||||||
record.addField("byr_Title", entry.name.get("en"));
|
record.addField("byr_Title", entry.name.get("en"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
log.warn("Entry " + entry.id + ": No title");
|
||||||
|
record.addField("byr_Title", "No title");
|
||||||
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
record.addField("byr_ah_projectLead", Collections.singletonList(Definitions.defaultProjectLead));
|
record.addField("byr_ah_projectLead", Collections.singletonList(Definitions.defaultProjectLead));
|
||||||
@@ -289,8 +343,10 @@ public class MamMigrationSelective implements CommandLineRunner {
|
|||||||
if (entry.comment.get("en") != null)
|
if (entry.comment.get("en") != null)
|
||||||
description += "Comment: " + entry.comment.get("en") + "\n\n";
|
description += "Comment: " + entry.comment.get("en") + "\n\n";
|
||||||
|
|
||||||
String migrationDescription = "Migrated from Media Assistant ID " + entry.id + "\nDate of Issue: "
|
String migrationDescription = "Migrated from Media Assistant ID " + entry.id;
|
||||||
+ stringDate.format(entry.creationDate);
|
if (entry.creationDate != null)
|
||||||
|
migrationDescription += "\nDate of Issue: " + stringDate.format(entry.creationDate);
|
||||||
|
|
||||||
description += migrationDescription;
|
description += migrationDescription;
|
||||||
record.addField("byr_ah_description", description);
|
record.addField("byr_ah_description", description);
|
||||||
|
|
||||||
@@ -305,43 +361,47 @@ public class MamMigrationSelective implements CommandLineRunner {
|
|||||||
|
|
||||||
// License Information
|
// License Information
|
||||||
record.addField("byr_ah_licenseHolderList", Collections.singletonList(Definitions.defaultLicenseHolder));
|
record.addField("byr_ah_licenseHolderList", Collections.singletonList(Definitions.defaultLicenseHolder));
|
||||||
|
|
||||||
// if license holder is not "Bayer Animal Health GmbH" put on review list
|
|
||||||
if (!entry.copyright.organization.get("id").equals("3740")) {
|
|
||||||
log.warn("Entry " + entry.id + ": License Holder is not set to 'Bayer Animal Health GmbH' (organization 3740)");
|
|
||||||
}
|
|
||||||
|
|
||||||
record.addField("byr_ah_licenseAdditionalPermittedUse", Collections.singletonList(Definitions.defaultAdditionalPermittedUse));
|
record.addField("byr_ah_licenseAdditionalPermittedUse", Collections.singletonList(Definitions.defaultAdditionalPermittedUse));
|
||||||
|
|
||||||
|
if (entry.copyright != null && entry.copyright.organization != null) {
|
||||||
String licenseDescription = "";
|
String licenseDescription = "";
|
||||||
if (entry.copyright.use != null)
|
if (entry.copyright.use != null)
|
||||||
licenseDescription += entry.copyright.use;
|
licenseDescription += entry.copyright.use;
|
||||||
record.addField("byr_ah_licenseComments", licenseDescription);
|
record.addField("byr_ah_licenseComments", licenseDescription);
|
||||||
|
|
||||||
// if (entry.gpc != null)
|
// if license holder is not "Bayer Animal Health GmbH" put on review list
|
||||||
// record.addField("byr_ah_approvalNumber",entry.gpc.gpcNumber);
|
if (!entry.copyright.organization.get("id").equals("3740"))
|
||||||
|
log.warn("Entry " + entry.id + ": License Holder is not set to 'Bayer Animal Health GmbH' (organization 3740)");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// if license information is missing put on review list
|
||||||
|
log.warn("Entry " + entry.id + ": Copyright information missing");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entry.gpc != null)
|
||||||
|
record.addField("byr_ah_approvalNumber",entry.gpc.gpcNumber);
|
||||||
|
|
||||||
|
// XXX
|
||||||
// Create record
|
// Create record
|
||||||
HttpEntity<UploadRecord> httpEntity = new HttpEntity<UploadRecord>(record, adamHeaders);
|
// HttpEntity<UploadRecord> httpEntity = new HttpEntity<UploadRecord>(record, adamHeaders);
|
||||||
try {
|
// try {
|
||||||
URI location = restTemplate.postForLocation(adamHost + "/records", httpEntity, UploadRecord.class);
|
// URI location = restTemplate.postForLocation(adamHost + "/records", httpEntity, UploadRecord.class);
|
||||||
log.info("RESULT Entry " + entry.id + " migrated to record " + location);
|
// log.info("RESULT Entry " + entry.id + " migrated to record " + location);
|
||||||
|
//
|
||||||
FileUtils.writeStringToFile(entryLog, location.toString() + fieldSeparator + entryJson + lineSeparator,
|
// FileUtils.writeStringToFile(entryLog, location.toString() + fieldSeparator + entryJson + lineSeparator,
|
||||||
Charset.forName("utf-8"), true);
|
// Charset.forName("utf-8"), true);
|
||||||
}
|
// }
|
||||||
catch (HttpStatusCodeException hsce) {
|
// catch (HttpStatusCodeException hsce) {
|
||||||
log.error("RESULT Skipping entry " + entry.id + ": Error while creating record " + hsce.getStatusCode().toString());
|
// log.error("RESULT Skipping entry " + entry.id + ": Error while creating record " + hsce.getStatusCode().toString());
|
||||||
log.error(hsce.getResponseBodyAsString());
|
// log.error(hsce.getResponseBodyAsString());
|
||||||
FileUtils.writeStringToFile(problemLog, entry.id + fieldSeparator + entryJson + lineSeparator, Charset.forName("utf-8"), true);
|
// FileUtils.writeStringToFile(problemLog, entry.id + fieldSeparator + entryJson + lineSeparator, Charset.forName("utf-8"), true);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void readEntryIDsFromFile() throws IOException {
|
private void readEntryIDsFromFile() throws IOException {
|
||||||
File idFile = new File("resources/entrylist_2017-10-25.txt");
|
File entryIdListFile = new File("resources/entrylist_2017-10-25.txt");
|
||||||
log.debug("Reading entry IDs from " + idFile.getAbsolutePath());
|
log.debug("Reading entry IDs from " + entryIdListFile.getAbsolutePath());
|
||||||
List<String> entryIdList = FileUtils.readLines(idFile, Charset.forName("utf-8"));
|
List<String> entryIdList = FileUtils.readLines(entryIdListFile, Charset.forName("utf-8"));
|
||||||
|
|
||||||
entrySelection = new ArrayList<Integer>();
|
entrySelection = new ArrayList<Integer>();
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,23 @@ public class UploadRecord {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removeClassification(String name) {
|
||||||
|
boolean removed = classifications.addOrUpdate.remove(Definitions.classifications.get(name));
|
||||||
|
|
||||||
|
if (removed)
|
||||||
|
log.debug("Removed classification " + name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasClassificationStartingWith(String prefix) {
|
||||||
|
for (WriteClassification c : classifications.addOrUpdate) {
|
||||||
|
String key = Definitions.classificationGuidToKeyMap.get(c.id);
|
||||||
|
if (key != null && key.startsWith(prefix))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void addField(String name, String value) {
|
public void addField(String name, String value) {
|
||||||
fields.addOrUpdate.add(Definitions.createSingleValueField(name, value));
|
fields.addOrUpdate.add(Definitions.createSingleValueField(name, value));
|
||||||
}
|
}
|
||||||
@@ -93,5 +110,4 @@ public class UploadRecord {
|
|||||||
public void addField(String name, List<String> values) {
|
public void addField(String name, List<String> values) {
|
||||||
fields.addOrUpdate.add(Definitions.createMultiValueField(name, values));
|
fields.addOrUpdate.add(Definitions.createMultiValueField(name, values));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user