diff --git a/AH MAM Migration/notes.txt b/AH MAM Migration/notes.txt index f552a0f..3597be0 100644 --- a/AH MAM Migration/notes.txt +++ b/AH MAM Migration/notes.txt @@ -1,15 +1,21 @@ # 2017-10-27 - Vermerke im Excel nachziehen -- Brand Baytril existiert für CAP und FAP!! +- Brand Baytril existiert für CAP und FAP!! [erledigt] - CAP.Baytril scheint defekt (zeigt Motives an). Martin klärt via Megan. - evtl. Check einbauen für Widerspruch Brand <-> Business Unit +- Delivery Date in eDAM befüllen mit Date of Issue aus MAM [erledigt] +- Status 4 (Created) und 5 (Assigned) auf Status "Draft" setzen [erledigt] +- Problem: + {"exceptionMessage":"The collection already contains an item with the specified key." + 72 mal im Log, bspw. 63701, 63711, 43182 +- File upload +- Selections - Bilder hochladen für Assets von Claudias Liste -- Delivery Date in eDAM befüllen mit Date of Issue aus MAM -- Status 4 (Created) und 5 (Assigned) auf Status "Draft" setzen +- Umsetzen für PROD + - User müssen vorhanden sein! + - Definitions anpassen + - Check: Hotfix nötig auf PROD? - Go-Live AH 15. November -- Check: Hotfix nötig auf PROD? - - diff --git a/AH MAM Migration/resources/Media_Assistant_Categories_131017_EDITED_without_archive.csv b/AH MAM Migration/resources/Media_Assistant_Categories_131017_EDITED_without_archive.csv index f238d98..24695ef 100644 --- a/AH MAM Migration/resources/Media_Assistant_Categories_131017_EDITED_without_archive.csv +++ b/AH MAM Migration/resources/Media_Assistant_Categories_131017_EDITED_without_archive.csv @@ -212,78 +212,78 @@ campaign;(2016);;;;;Digital;;;; campaign;(2015);;;;;Logo;;;; campaign;(2015-2016);;;;;Print;;;; campaign;(2016);;;;;Videos;;;; -skip;BusinessUnit.General,Brand.General,MediaType.Guideline;;;Copyright Templates;-> unter Guidelines;;;;;"war: classify/MediaType.Guideline +classify;BusinessUnit.General,Brand.General,MediaType.Guideline;;;Copyright Templates;-> unter Guidelines;;;;;"war: classify/MediaType.Guideline 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;;;;;Agency Briefing Templates;;;;; -skip;;;;;BAH eDetailer Template;;;;; -skip;BusinessUnit.CAP;;;;CAP Brand/Packaging Design;;;;;kann eine Guideline in Brand.General, aber in BusinessUnit CAP sein? -campaign;(2009-2017);;;;;Advantage Family;;;; -campaign;(2003-2012);;;;;Bolfo/Bayopet (OTC);;;; -campaign;(2012-2017);;;;;Drontal Product Family;;;; -campaign;(2014);;;;;Ethical Pack;;--> Cap.Others;; -campaign;(2005);;;;;Kiltix Products;;;; -campaign;(2017);;;;;Lifestyle Photography 2017;;;; -campaign;(2009-2012);;;;;Profender Products;;;; -campaign;(2011-2017);;;;;Seresto Packaging;;;; -skip;BusinessUnit.FAP;;;;FAP Brand/Packaging Design;;;;; -campaign;(2011);;;;;Farm Animal Products;;;; -campaign;(2006);;;;;Farmhygiene Products;;;; -skip;;;;;Global Exhibit Design Manual;;;;; +classify;BusinessUnit.General,Brand.General,MediaType.Guideline;;;Guidelines;;;;;; +keyword;;;;;AH Meeting Culture;;;;; +keyword;;;;;Agency Briefing Templates;;;;; +keyword;;;;;BAH eDetailer Template;;;;; +classify;BusinessUnit.CAP;;;;CAP Brand/Packaging Design;;;;; +classify;Brand.Advantage;;;;;Advantage Family;;;(2009-2017); +classify;Brand.Bolfo/Bay-o-Pet;;;;;Bolfo/Bayopet (OTC);;;(2003-2012); +classify;Brand.Drontal;;;;;Drontal Product Family;;;(2012-2017); +classify;Brand.CAP.Others;;;;;Ethical Pack;;--> Cap.Others;(2014); +classify;Brand.CAP.Others;;;;;Kiltix Products;;;(2005); +classify;Brand.CAP.Others;;;;;Lifestyle Photography 2017;;;(2017); +classify;Brand.Profender;;;;;Profender Products;;;(2009-2012); +classify;Brand.Seresto;;;;;Seresto Packaging;;;(2011-2017); +classify;BusinessUnit.FAP;;;;FAP Brand/Packaging Design;;;;; +classify;Brand.FAP.Others;;;;;Farm Animal Products;;;(2011); +classify;Brand.FAP.Others;;;;;Farmhygiene Products;;;(2006); +keyword;;;;;Global Exhibit Design Manual;;;;; not migrated;;;;;Training Tools - MediaAssistant;;;;; classify;BusinessUnit.General,Brand.General;;;Images;;;kommt komplett in Space General;;;Nach Motives-Baum unter Images -motives;;;;;Applications;;;;; -motives;;;;;Different animals together;;;;; -motives;;;;;Disease Symptoms;;;;; -motives;;;;;;Organs;;;; -motives;;;;;;Skin;;;; -motives;;;;;Examination/Sampling;;;;; -motives;;;;;Illustrations;;;;; -motives;;;;;;Animals and people;;;; -motives;;;;;;Application;;;; -motives;;;;;;Art;;;; +classify;Motive.Applications;;;;Applications;;;;; +classify;Motive.DifferentAnimalsTogether;;;;Different animals together;;;;; +classify;Motive.DeseaseSymptoms;;;;Disease Symptoms;;;;; +classify;Motive.DeseaseSymptoms.Organs;;;;;Organs;;;; +classify;Motive.DeseaseSymptoms.Skin;;;;;Skin;;;; +classify;Motive.Examination,Motive.Examination.Sampling;;;;Examination/Sampling;;;;Im neuen Baum aufgeteilt!; +classify;Motive.Illustrations;;;;Illustrations;;;;; +classify;Motive.Illustrations.AnimalsAndPeople;;;;;Animals and people;;;; +classify;Motive.Illustrations.Application;;;;;Application;;;; +classify;Motive.Illustrations.Art;;;;;Art;;;; keyword;;;;;;;Cat and DogART, Portugal;;; keyword;;;;;;;Cat and DogART, Prague;;; keyword;;;;;;;CattleART;;; keyword;;;;;;;PigART;;; keyword;;;;;;;PoultryART;;; keyword;;;;;;;SheepART;;; -motives;;;;;;Cells and microorganisms;;;; -motives;;;;;;Lifecycles & Routes of infection;;;; -motives;;;;;;Maps;;;; -motives;;;;;;Parasites;;;; -motives;;;;;;Pictograms;;;; -motives;;;;;Insects and arachnids;;;;; -motives;;;;;;Fleas;;;; -motives;;;;;;Flies;;;; -motives;;;;;;Lice;;;; -motives;;;;;;Mites;;;; -motives;;;;;;Mosquitoes;;;; -motives;;;;;;Ticks;;;; -motives;;;;;Laboratory;;;;; -motives;;;;;Microorganism;;;;; -motives;;;;;People;;;;; -motives;;;;;People with animals;;;;; -motives;;;;;Target animals;;;;; -motives;;;;;;Birds;;;; -motives;;;;;;Cats;;;; -motives;;;;;;Cattle;;;; -motives;;;;;;Dogs;;;; -motives;;;;;;Honey bees;;;; -keyword;;;;;;;Flowers;;; -motives;;;;;;Horses;;;; -motives;;;;;;Poultry;;;; -motives;;;;;;Reptiles and turtles;;;; -motives;;;;;;Sheep;;;; -motives;;;;;;Small furry animals;;;; -motives;;;;;;Swine;;;; -motives;;;;;;Zoo and other animals;;;; -motives;;;;;Worms (Helminths);;;;; -motives;;;;;;Roundworms;;;; -motives;;;;;;Tapeworms;;;; -not migrated;;;;Logos;;;;--> Nachbereitung;;bitte den Brands zuordnen +classify;Motive.Illustrations.CellsAndMicroorganisms;;;;;Cells and microorganisms;;;; +classify;Motive.Illustrations.Lifecycles;;;;;Lifecycles & Routes of infection;;;; +classify;Motive.Illustrations.Maps;;;;;Maps;;;; +classify;Motive.Illustrations.Parasites;;;;;Parasites;;;; +classify;Motive.Illustrations.Pictograms;;;;;Pictograms;;;; +classify;Motive.InsectsAndArachnids;;;;Insects and arachnids;;;;Motive.InsectsAndArachnids.Pictograms löschen?; +classify;Motive.InsectsAndArachnids.Fleas;;;;;Fleas;;;; +classify;Motive.InsectsAndArachnids.Flies;;;;;Flies;;;; +classify;Motive.InsectsAndArachnids.Lice;;;;;Lice;;;; +classify;Motive.InsectsAndArachnids.Mites;;;;;Mites;;;; +classify;Motive.InsectsAndArachnids.Mosquitoes;;;;;Mosquitoes;;;; +classify;Motive.InsectsAndArachnids.Ticks;;;;;Ticks;;;; +skip;;;;;Laboratory;;;;Existiert nicht im neuen Baum; +skip;;;;;Microorganism;;;;Existiert nicht im neuen Baum; +classify;Motive.People;;;;People;;;;; +classify;Motive.PeopleWithAnimals;;;;People with animals;;;;; +classify;Motive.TargetAnimals;;;;Target animals;;;;; +classify;Motive.TargetAnimals.Birds;;;;;Birds;;;; +classify;Motive.TargetAnimals.Cats;;;;;Cats;;;; +classify;Motive.TargetAnimals.Cattle;;;;;Cattle;;;; +classify;Motive.TargetAnimals.Dogs;;;;;Dogs;;;; +classify;Motive.TargetAnimals.HoneyBees;;;;;Honey bees;;;; +classify;Motive.TargetAnimals.Flowers;;;;;;Flowers;;"Flowers als ""Target Animal""?"; +classify;Motive.TargetAnimals.Horses;;;;;Horses;;;; +classify;Motive.TargetAnimals.Poultry;;;;;Poultry;;;; +classify;Motive.TargetAnimals.ReptilesAndTurtles;;;;;Reptiles and turtles;;;; +classify;Motive.TargetAnimals.Sheep;;;;;Sheep;;;; +classify;Motive.TargetAnimals.SmallFurryAnimals;;;;;Small furry animals;;;; +classify;Motive.TargetAnimals.Swine;;;;;Swine;;;; +classify;Motive.TargetAnimals.ZooAndOtherAnimals;;;;;Zoo and other animals;;;; +classify;Motive.Worms;;;;Worms (Helminths);;;;; +classify;Motive.Worms.Roundworms;;;;;Roundworms;;;; +classify;Motive.Worms.Tapeworms;;;;;Tapeworms;;;; +classify;BusinessUnit.General,Brand.General,Migration.Logos;;;Logos;;;;;--> Nachbereitung;bitte den Brands zuordnen skip;;;;Packshots;;;;;; classify;BusinessUnit.CAP,Brand.Advantage;;;;Advantage;;;;; classify;BusinessUnit.CAP,Brand.Advantix;;;;Advantix;;;;; @@ -341,7 +341,7 @@ brand;;;;;;Seresto;;;; not migrated;;;BAH Image series;;;;;;;wird nicht migriert skip;;;;Image series 1;;;;;; skip;;;;Image series 2;;;;;; -not migrated;Status.Archived;;BAH Internal Videos;;"alle ins Archiv -> unter classification ""interne Videos""";;;--> General;;BusinessUnit? Brand? +classify;Status.Archived,BusinessUnit.General,Brand.General,MediaType.InternalTrainingVideo;;BAH Internal Videos;;"alle ins Archiv -> unter classification ""interne Videos""";;;--> General;;BusinessUnit? Brand? not migrated;;;BAH Webshop;;;;;;;wird nicht migriert skip;;;;Advantage;;;;;; skip;;;;Advantix;;;;;; diff --git a/AH MAM Migration/resources/Media_Assistant_Categories_131017_EDITED_without_archive.xlsx b/AH MAM Migration/resources/Media_Assistant_Categories_131017_EDITED_without_archive.xlsx index 91a0d23..b940ce2 100644 Binary files a/AH MAM Migration/resources/Media_Assistant_Categories_131017_EDITED_without_archive.xlsx and b/AH MAM Migration/resources/Media_Assistant_Categories_131017_EDITED_without_archive.xlsx differ diff --git a/AH MAM Migration/src/com/bayer/edam/migration/Definitions.java b/AH MAM Migration/src/com/bayer/edam/migration/Definitions.java index 5a34663..89c59a9 100644 --- a/AH MAM Migration/src/com/bayer/edam/migration/Definitions.java +++ b/AH MAM Migration/src/com/bayer/edam/migration/Definitions.java @@ -27,9 +27,11 @@ public class Definitions { static { classifications = new HashMap(); - classifications.put("MediaAssistant-Migration", new WriteClassification("2bd24882-b7d8-4d30-8e6f-a7ef00eb33e7", 1)); + classifications.put("Migration", new WriteClassification("2bd24882-b7d8-4d30-8e6f-a7ef00eb33e7", 1)); + classifications.put("Migration.Logos", new WriteClassification("de96f8db1de44cc6841ba81c00b9db8e", 1)); classifications.put("Test-GEXCE", new WriteClassification("f1d058987a3043d5b021a819007ff3c0", 1)); + classifications.put("Country.Global", new WriteClassification("dff7666b-326b-4e1c-912c-a7b4006c8500", 1)); // /Definitions/Animal Health/Country classifications.put("Agencies.Bayer AH", new WriteClassification("8de5ef0e-3c6d-451c-b82b-a7b4006c954c", 1)); // /Definitions/Agencies/Bayer classifications.put("Usage.Unrestricted", new WriteClassification("6b95a635-40e9-4782-ad5f-a73100a2bb94", 1)); @@ -52,7 +54,7 @@ public class Definitions { classifications.put("Brand.Advantage", new WriteClassification("b3f04996de1644df9d08a6dd00cff70e", 1)); classifications.put("Brand.Advantix", new WriteClassification("dc758de7d91e44d6a768a6dd00cff7ad", 1)); classifications.put("Brand.Advocate", new WriteClassification("c7979fc30bb843e486bba6dd00cff835", 1)); - classifications.put("Brand.Baytril", new WriteClassification("9c8a43adf3324ca6adb0a7d000f427f5", 1)); + classifications.put("Brand.CAP.Baytril", new WriteClassification("9c8a43adf3324ca6adb0a7d000f427f5", 1)); classifications.put("Brand.Bolfo/Bay-o-Pet", new WriteClassification("922a46fc3f6a44bfb025a7d000f428ac", 1)); classifications.put("Brand.CVBD", new WriteClassification("fc84b38665a44291a24ba70f00f7aa1f", 1)); classifications.put("Brand.Droncit", new WriteClassification("86251780660d4faf95cda7cb010c40fe", 1)); @@ -61,6 +63,7 @@ public class Definitions { classifications.put("Brand.Profender", new WriteClassification("6be697c82ec34354b0c3a6dd00cffc04", 1)); classifications.put("Brand.Seresto", new WriteClassification("2aea5f8d28294cde8346a6dd00cffc75", 1)); classifications.put("Brand.Veraflox", new WriteClassification("c2bd6003fa6b4093a50fa6dd00cffd3e", 1)); + classifications.put("Brand.CAP.Others", new WriteClassification("90ffb7a44897480aa2eaa70f00f7a8db", 1)); classifications.put("Brand.miscellaneous", new WriteClassification("bc9d93616c0548f99f7fa6dd00cff69d", 1)); classifications.put("Brand.Miscellaneous", new WriteClassification("bc9d93616c0548f99f7fa6dd00cff69d", 1)); @@ -68,7 +71,7 @@ public class Definitions { // FAP classifications.put("Brand.Baycox", new WriteClassification("ef3028f6ba8744508035a6dd00cffe45", 1)); classifications.put("Brand.Bayticol", new WriteClassification("bd1819c976e643bf916ba6dd00cffec4", 1)); - classifications.put("Brand.Baytril", new WriteClassification("1053978a142742ad8033a6dd00cfff42", 1)); + classifications.put("Brand.FAP.Baytril", new WriteClassification("1053978a142742ad8033a6dd00cfff42", 1)); classifications.put("Brand.Bayvarol", new WriteClassification("4f4816c552e04630b575a6dd00cfffcf", 1)); classifications.put("Brand.Biosecurity", new WriteClassification("ea123567d7174daf8a7ca6dd00d0008a", 1)); classifications.put("Brand.Catosal", new WriteClassification("55fba5b1c9084c74905ba6dd00d0011c", 1)); @@ -100,9 +103,55 @@ public class Definitions { classifications.put("MediaType.Toolkit", new WriteClassification("463c194bd93b4a6caa63a73100a2a2e4", 1)); classifications.put("MediaType.unassigned", new WriteClassification("6995d663c07f406c8b45a6dd00cff466", 1)); classifications.put("MediaType.Video", new WriteClassification("4f9d38b889eb46f58d79a73100a2b55a", 1)); - classifications.put("MediaType.Image", new WriteClassification("58f655cbd4214a72bb2aa73100a2a3dd", 1)); + classifications.put("MediaType.Image", new WriteClassification("7d1e20b9f244423b9214a7f400d3ae68", 1)); classifications.put("MediaType.Packshot", new WriteClassification("ba5a96a7d94245e48f14a73100a2a97c", 1)); classifications.put("MediaType.Guideline", new WriteClassification("a3c6732752274a99817ba7dd007a207f", 1)); + classifications.put("MediaType.InternalTrainingVideo", new WriteClassification("b5c1b8b0ad8a41aebbb8a7b4008f2faa", 1)); + + // Motives + classifications.put("Motive.Applications", new WriteClassification("3c7a687b5c7e4450994fa6dd00d00b7e", 1)); + classifications.put("Motive.DifferentAnimalsTogether", new WriteClassification("cadd6c53ad7e411a838ea6dd00d00d28", 1)); + classifications.put("Motive.DeseaseSymptoms", new WriteClassification("62dd3a2a2cfe4266a93da6dd00d00dda", 1)); + classifications.put("Motive.DeseaseSymptoms.Organs", new WriteClassification("1f8f1d29b64f4ba897c5a6dd00d00e5d", 1)); + classifications.put("Motive.DeseaseSymptoms.Skin", new WriteClassification("1583970b4a0c4a648a7ba6dd00d011d3", 1)); + classifications.put("Motive.Examination", new WriteClassification("d601204f0177418eb42fa6dd00d012c2", 1)); + classifications.put("Motive.Examination.Sampling", new WriteClassification("b3eef1efba974c4d8d26a6dd00d01338", 1)); + classifications.put("Motive.Illustrations", new WriteClassification("5222fed4a54f4098927da6dd00d0151f", 1)); + classifications.put("Motive.Illustrations.AnimalsAndPeople", new WriteClassification("9af3cab737a845bda757a6dd00d0168d", 1)); + classifications.put("Motive.Illustrations.Application", new WriteClassification("4f9017f9f2384e2a96a4a6dd00d01760", 1)); + classifications.put("Motive.Illustrations.Art", new WriteClassification("bbc2d76be6e14fcdba09a6dd00d018e9", 1)); + classifications.put("Motive.Illustrations.CellsAndMicroorganisms", new WriteClassification("21aba242e8394ac38e1ea6dd00d02012", 1)); + classifications.put("Motive.Illustrations.Lifecycles", new WriteClassification("fdd0f975332347f0b1d2a6dd00d02350", 1)); + classifications.put("Motive.Illustrations.Maps", new WriteClassification("a39238ab79ae46bd8b5aa6dd00d0242c", 1)); + classifications.put("Motive.Illustrations.Parasites", new WriteClassification("284f50ca98544ea890fda6dd00d02697", 1)); + classifications.put("Motive.Illustrations.Pictograms", new WriteClassification("27443cb009e94f27bb8ea6dd00d02863", 1)); + classifications.put("Motive.InsectsAndArachnids", new WriteClassification("32f8e74dc3334d689dbda6dd00d0293a", 1)); + classifications.put("Motive.InsectsAndArachnids.Pictograms", new WriteClassification("a92634ae638449b1b768a6dd00d029ed", 1)); + classifications.put("Motive.InsectsAndArachnids.Fleas", new WriteClassification("cfcb33174cf04feea597a6dd00d02a66", 1)); + classifications.put("Motive.InsectsAndArachnids.Flies", new WriteClassification("0dc040dd346c474585f6a6dd00d02b0a", 1)); + classifications.put("Motive.InsectsAndArachnids.Lice", new WriteClassification("c5cf728877b642239392a6dd00d02be7", 1)); + classifications.put("Motive.InsectsAndArachnids.Mites", new WriteClassification("35f9456f8d7a460f802fa6dd00d02d59", 1)); + classifications.put("Motive.InsectsAndArachnids.Mosquitoes", new WriteClassification("6be89e8457b748b7a32ba6dd00d02e8a", 1)); + classifications.put("Motive.InsectsAndArachnids.Ticks", new WriteClassification("b0b1fde8d5b34e1680f4a6dd00d02f33", 1)); + classifications.put("Motive.People", new WriteClassification("46bcb4b963194d4e9a40a6dd00d0303e", 1)); + classifications.put("Motive.PeopleWithAnimals", new WriteClassification("579bf5f6c03b43ed86b6a6dd00d03140", 1)); + classifications.put("Motive.TargetAnimals", new WriteClassification("8a14eb12dbe54fe0bfcfa6dd00d031df", 1)); + classifications.put("Motive.TargetAnimals.Birds", new WriteClassification("be13c44e72574f1092cba6dd00d03393", 1)); + classifications.put("Motive.TargetAnimals.Cats", new WriteClassification("a79655a321104441b15aa6dd00d033fa", 1)); + classifications.put("Motive.TargetAnimals.Cattle", new WriteClassification("eae408e2597e41469d9ba6dd00d034a3", 1)); + classifications.put("Motive.TargetAnimals.Dogs", new WriteClassification("87d3b6843cf24141b4c4a6dd00d0364d", 1)); + classifications.put("Motive.TargetAnimals.HoneyBees", new WriteClassification("4a95af72f0264e6b8d8aa6dd00d03704", 1)); + classifications.put("Motive.TargetAnimals.Flowers", new WriteClassification("b922f71a29e448e994caa6dd00d03a05", 1)); + classifications.put("Motive.TargetAnimals.Horses", new WriteClassification("600ed3e1e63445bfa132a6dd00d03b10", 1)); + classifications.put("Motive.TargetAnimals.Poultry", new WriteClassification("15d6bbf845e84602b883a6dd00d03bb9", 1)); + classifications.put("Motive.TargetAnimals.ReptilesAndTurtles", new WriteClassification("59112780491c41fe8061a6dd00d03c83", 1)); + classifications.put("Motive.TargetAnimals.Sheep", new WriteClassification("17961e4ff94c49e3b722a6dd00d03d47", 1)); + classifications.put("Motive.TargetAnimals.SmallFurryAnimals", new WriteClassification("85fc43e7877d4ff2b141a6dd00d041bf", 1)); + classifications.put("Motive.TargetAnimals.Swine", new WriteClassification("ee572615033549ef8672a6dd00d04268", 1)); + classifications.put("Motive.TargetAnimals.ZooAndOtherAnimals", new WriteClassification("ee28e01cfdf64e738360a6dd00d0436a", 1)); + classifications.put("Motive.Worms", new WriteClassification("be9e2b31ec4f424399f0a6dd00d04404", 1)); + classifications.put("Motive.Worms.Roundworms", new WriteClassification("176f6e972cc24445a34aa6dd00d04653", 1)); + classifications.put("Motive.Worms.Tapeworms", new WriteClassification("b7cdd4655c124e7394d8a6dd00d04755", 1)); classificationGuidToKeyMap = new HashMap(); for (Entry entry : classifications.entrySet()) { @@ -112,6 +161,7 @@ public class Definitions { // Fields fieldIDs = new HashMap(); fieldIDs.put("byr_Title", "31f337fa-add6-4e25-a672-a68a00d4ff3b"); + fieldIDs.put("byr_ah_deliveryDate", "b94fe50e-4a3b-4c40-9ac0-a731010bbb99"); fieldIDs.put("byr_ah_approvalNumber", "69d65b63-613b-49d6-bc11-a731010bbec8"); fieldIDs.put("byr_ah_description", "f9e40f87-493e-4f17-b129-a6dd00d063b2"); // Additional Information fieldIDs.put("byr_ah_projectLead", "5400d446-9d95-4158-ac06-a6dd00d06a12"); diff --git a/AH MAM Migration/src/com/bayer/edam/migration/MamMigrationSelective.java b/AH MAM Migration/src/com/bayer/edam/migration/MamMigrationSelective.java index 403a843..ecf4ace 100644 --- a/AH MAM Migration/src/com/bayer/edam/migration/MamMigrationSelective.java +++ b/AH MAM Migration/src/com/bayer/edam/migration/MamMigrationSelective.java @@ -52,7 +52,7 @@ public class MamMigrationSelective implements CommandLineRunner { static final String adamHost = "https://edam-q.bayer.com:2015"; static final String mamHost = "https://service.media-assistant.animalhealth.bayer.com"; - private List entrySelection = new ArrayList(Arrays.asList( 72048, 60984 )); + private List entrySelection = new ArrayList(Arrays.asList( 63701, 63711, 43182 )); // 72048, 60984 static final String categoryJson = "resources/2017-10-19_categories.json"; static final String categoryMapping = "resources/Media_Assistant_Categories_131017_EDITED_without_archive.csv"; @@ -73,7 +73,7 @@ public class MamMigrationSelective implements CommandLineRunner { HttpHeaders adamHeaders, mamHeaders; HttpEntity adamHeadersEntity; -// private SimpleDateFormat isoDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"); + private SimpleDateFormat isoDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"); private SimpleDateFormat stringDate = new SimpleDateFormat("yyyy-MM-dd"); private ObjectMapper jsonMapper = new ObjectMapper(); @@ -85,7 +85,7 @@ public class MamMigrationSelective implements CommandLineRunner { public void run(String... strings) throws Exception { // XXX - readEntryIDsFromFile(); +// readEntryIDsFromFile(); log.info("Write log headers for " + entryLog.getAbsolutePath()); FileUtils.writeStringToFile(entryLog, "Location" + fieldSeparator + "Entry" + lineSeparator, Charset.forName("utf-8")); @@ -161,7 +161,7 @@ public class MamMigrationSelective implements CommandLineRunner { Set keywords = new HashSet(); // globally applicable classifications - record.addClassification("MediaAssistant-Migration"); + record.addClassification("Migration"); record.addClassification("Country.Global"); record.addClassification("Agencies.Bayer AH"); record.addClassification("Usage.Restricted"); @@ -209,31 +209,41 @@ public class MamMigrationSelective implements CommandLineRunner { // Status "Released" is weaker than the other statuses if (p.startsWith("Status.")) { - if (!p.equals("Status.Released")) - record.removeClassification("Status.Released"); - else if (record.hasClassificationStartingWith("Status.Draft") - || record.hasClassificationStartingWith("Status.Archived")) { + if (p.equals("Status.Released") && record.hasClassificationStartingWith("Status.")) { log.warn("Classification Status.Released not added, different status already set"); continue; } + else { + record.removeClassificationsStartingWith("Status."); + } } + // Business unit "General" is weaker than the other business units if (p.startsWith("BusinessUnit.")) { - record.removeClassification("BusinessUnit.CAP"); - record.removeClassification("BusinessUnit.FAP"); - record.removeClassification("BusinessUnit.General"); + if (p.equals("BusinessUnit.General") && record.hasClassificationStartingWith("BusinessUnit.")) { + log.warn("Classification BusinessUnit.General not added, different business unit already set"); + continue; + } + else { + record.removeClassificationsStartingWith("BusinessUnit."); + } } + // Brand "General" is weaker than the other brands if (p.startsWith("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.removeClassificationsStartingWith("Brand."); } } + if (p.startsWith("MediaType.")) { + record.removeClassification("MediaType."); + } + record.addClassification(p); } } @@ -322,6 +332,13 @@ public class MamMigrationSelective implements CommandLineRunner { } + // Set Status.Draft for entries with stateId == 5 (Created) or 4 (Assigned) + if (entry.stateId == 4 || entry.stateId == 5) { + log.debug("Entry has status " + entry.stateId + ", setting record status to 'Draft'"); + record.removeClassification("Status.Released"); + record.addClassification("Status.Draft"); + } + // Fields if (entry.name.get("en") != null) { record.addField("byr_Title", entry.name.get("en")); @@ -331,6 +348,8 @@ public class MamMigrationSelective implements CommandLineRunner { record.addField("byr_Title", "No title"); } + record.addField("byr_ah_deliveryDate", isoDate.format(entry.creationDate)); + // Project lead if (entry.user != null && entry.user.get("id") != null) { if (Definitions.users.get(entry.user.get("id")) != null) { diff --git a/AH MAM Migration/src/com/bayer/edam/migration/adam/UploadRecord.java b/AH MAM Migration/src/com/bayer/edam/migration/adam/UploadRecord.java index 2d1596e..75cf42e 100644 --- a/AH MAM Migration/src/com/bayer/edam/migration/adam/UploadRecord.java +++ b/AH MAM Migration/src/com/bayer/edam/migration/adam/UploadRecord.java @@ -108,6 +108,24 @@ public class UploadRecord { log.debug("Removed classification " + name); } + public boolean removeClassificationsStartingWith(String prefix) { + List keysToRemove = new ArrayList(); + + for (WriteClassification c : classifications.addOrUpdate) { + String key = Definitions.classificationGuidToKeyMap.get(c.id); + if (key != null && key.startsWith(prefix)) + keysToRemove.add(key); + } + + if (keysToRemove.size() > 0) { + for (String key : keysToRemove) + removeClassification(key); + return true; + } + + return false; + } + public boolean hasClassificationStartingWith(String prefix) { for (WriteClassification c : classifications.addOrUpdate) { String key = Definitions.classificationGuidToKeyMap.get(c.id);