Definitions

This commit is contained in:
gezvf
2017-09-14 14:59:41 +02:00
parent e982628d75
commit c5bf394af9
3 changed files with 79 additions and 23 deletions
@@ -0,0 +1,46 @@
package com.bayer.edam.migration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.bayer.edam.migration.adam.WriteRecord.Classification;
import com.bayer.edam.migration.adam.WriteRecord.Field;
import com.bayer.edam.migration.adam.WriteRecord.LocalizedValue;
public class Definitions {
public static final Map<String, Classification> classifications;
public static final Map<String, String> fieldIDs;
static {
classifications = new HashMap<String, Classification>();
classifications.put("Global", new Classification("dff7666b-326b-4e1c-912c-a7b4006c8500", 1));
classifications.put("Bayer AH", new Classification("8de5ef0e-3c6d-451c-b82b-a7b4006c954c", 1));
classifications.put("CAP", new Classification("306e050a-dd58-46ad-93a7-a73100a2547f", 1));
classifications.put("MediaType.Other", new Classification("7c13e620-7eb0-4c12-9dfb-a7b4008f19b1", 1));
classifications.put("Draft", new Classification("dfee7cb7-fffc-41cb-9ee9-a68a00d4f0c3", 1));
classifications.put("Unrestricted", new Classification("6b95a635-40e9-4782-ad5f-a73100a2bb94", 1));
fieldIDs = new HashMap<String, String>();
fieldIDs.put("byr_Title", "31f337fa-add6-4e25-a672-a68a00d4ff3b");
fieldIDs.put("byr_ah_projectLead", "5400d446-9d95-4158-ac06-a6dd00d06a12");
fieldIDs.put("byr_ah_licenseHolderList", "de3f83cb50e747228bfea731010bc27c");
}
public static Field createSingleValueField(String name, String value) {
String id = fieldIDs.get(name);
Field newField = new Field(id);
newField.localizedValues.add(new LocalizedValue("Happy Doggy"));
return newField;
}
public static Field createMultiValueField(String name, List<String> values) {
String id = fieldIDs.get(name);
Field newField = new Field(id);
newField.localizedValues.add(new LocalizedValue(values));
return newField;
}
}