cleanup
[cdmlib.git] / cdmlib-persistence / src / main / java / eu / etaxonomy / cdm / database / update / v515_518 / SchemaUpdater_5183_5184.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9 package eu.etaxonomy.cdm.database.update.v515_518;
10
11 import java.util.ArrayList;
12 import java.util.List;
13 import java.util.UUID;
14
15 import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
16 import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
17 import eu.etaxonomy.cdm.database.update.SchemaUpdaterBase;
18 import eu.etaxonomy.cdm.database.update.TermRepresentationUpdater;
19 import eu.etaxonomy.cdm.model.metadata.CdmMetaData.CdmVersion;
20
21 /**
22 * @author a.mueller
23 * @date 20.10.2020
24 */
25 public class SchemaUpdater_5183_5184 extends SchemaUpdaterBase {
26
27 private static final CdmVersion startSchemaVersion = CdmVersion.V_05_18_03;
28 private static final CdmVersion endSchemaVersion = CdmVersion.V_05_18_04;
29
30 // ********************** FACTORY METHOD *************************************
31
32 public static SchemaUpdater_5183_5184 NewInstance() {
33 return new SchemaUpdater_5183_5184();
34 }
35
36 protected SchemaUpdater_5183_5184() {
37 super(startSchemaVersion.versionString(), endSchemaVersion.versionString());
38 }
39
40 @Override
41 protected List<ISchemaUpdaterStep> getUpdaterList() {
42
43 List<ISchemaUpdaterStep> stepList = new ArrayList<>();
44
45 //#6589
46 ProtologMover.NewInstance(stepList);
47
48 //#9263 use lower case for specimen type designation status
49 updateSpecimenTypeDesignationStatus(stepList);
50
51 return stepList;
52 }
53
54 //#9263 use lower case for specimen type designation status
55 private void updateSpecimenTypeDesignationStatus(List<ISchemaUpdaterStep> stepList) {
56
57 //holotype
58 String stepName = "Holotype => holotype";
59 UUID uuidTerm = UUID.fromString("a407dbc7-e60c-46ff-be11-eddf4c5a970d");
60 UUID uuidLanguage = UUID.fromString("e9f8cdb7-6819-44e8-95d3-e2d0690c3523");
61 String label = "holotype";
62 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
63 label, label, null, uuidLanguage);
64
65 //lectotype
66 stepName = "Lectotype => lectotype";
67 uuidTerm = UUID.fromString("05002d46-083e-4b27-8731-2e7c28a8825c");
68 label = "lectotype";
69 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
70 label, label, null, uuidLanguage);
71
72 //isotype
73 stepName = "Isotype => isotype";
74 uuidTerm = UUID.fromString("93ef8257-0a08-47bb-9b36-542417ae7560");
75 label = "isotype";
76 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
77 label, label, null, uuidLanguage);
78
79 //isolectotype
80 stepName = "Isolectotype => isolectotype";
81 uuidTerm = UUID.fromString("7a1a8a53-78f4-4fc0-89f7-782e94992d08");
82 label = "isolectotype";
83 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
84 label, label, null, uuidLanguage);
85
86 //syntype
87 stepName = "Syntype => syntype";
88 uuidTerm = UUID.fromString("f3b60bdb-4638-4ca9-a0c7-36e77d8459bb");
89 label = "syntype";
90 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
91 label, label, null, uuidLanguage);
92
93 //isosyntype
94 stepName = "Isosyntype => isosyntype";
95 uuidTerm = UUID.fromString("052a5ff0-8e9a-4355-b24f-5e4bb6071f44");
96 label = "isosyntype";
97 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
98 label, label, null, uuidLanguage);
99
100 //neotype
101 stepName = "Neotype => neotype";
102 uuidTerm = UUID.fromString("26e13359-8f77-4e40-a85a-56c01782fce0");
103 label = "neotype";
104 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
105 label, label, null, uuidLanguage);
106
107 //isoneotype
108 stepName = "Isoneotype => isoneotype";
109 uuidTerm = UUID.fromString("7afc2f4f-f70a-4aa5-80a5-87764f746bde");
110 label = "isoneotype";
111 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
112 label, label, null, uuidLanguage);
113
114 //epitype
115 stepName = "Epitype => epitype";
116 uuidTerm = UUID.fromString("989a2715-71d5-4fbe-aa9a-db9168353744");
117 label = "epitype";
118 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
119 label, label, null, uuidLanguage);
120
121 //isoepitype
122 stepName = "Isoepitype => isoepitype";
123 uuidTerm = UUID.fromString("95b90696-e103-4bc0-b60b-c594983fb566");
124 label = "isoepitype";
125 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
126 label, label, null, uuidLanguage);
127
128 //paratype
129 stepName = "Paratype => paratype";
130 uuidTerm = UUID.fromString("eb7df2e5-d9a7-479d-970c-c6f2b0a761d7");
131 label = "paratype";
132 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
133 label, label, null, uuidLanguage);
134
135 //isoparatype
136 stepName = "Isoparatype => isoparatype";
137 uuidTerm = UUID.fromString("497137f3-b614-4183-8a22-97fcd6e2bdd8");
138 label = "isoparatype";
139 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
140 label, label, null, uuidLanguage);
141
142 //paralectotype
143 stepName = "Paralectotype => paralectotype";
144 uuidTerm = UUID.fromString("7244bc51-14d8-41a6-9524-7dc5303bba29");
145 label = "paralectotype";
146 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
147 label, label, null, uuidLanguage);
148
149 //paraneotype
150 stepName = "Paraneotype => paraneotype";
151 uuidTerm = UUID.fromString("0c39e2a5-2fe0-4d4f-819a-f609b5340339");
152 label = "paraneotype";
153 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
154 label, label, null, uuidLanguage);
155
156 //second step lectotype
157 stepName = "Second Step Lectotype => second step lectotype";
158 uuidTerm = UUID.fromString("01d91053-7004-4984-aa0d-9f4de59d6205");
159 label = "second step lectotype";
160 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
161 label, label, null, uuidLanguage);
162
163 //second step neotype
164 stepName = "Second Step Neotype => second step neotype";
165 uuidTerm = UUID.fromString("8d2fed1f-242e-4bcf-bbd7-e85133e479dc");
166 label = "second step neotype";
167 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
168 label, label, null, uuidLanguage);
169
170 //original material
171 stepName = "original material => original material";
172 uuidTerm = UUID.fromString("49c96cae-6be6-401e-9b36-1bc12d9dc8f9");
173 label = "original material";
174 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
175 label, label, null, uuidLanguage);
176
177 //iconotype
178 stepName = "Iconotype => iconotype";
179 uuidTerm = UUID.fromString("643513d0-32f5-46ba-840b-d9b9caf8160f");
180 label = "iconotype";
181 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
182 label, label, null, uuidLanguage);
183
184 //phototype
185 stepName = "Pphototype => phototype";
186 uuidTerm = UUID.fromString("b7807acc-f559-474e-ad4a-e7a41e085e34");
187 label = "phototype";
188 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
189 label, label, null, uuidLanguage);
190
191 //unspecified
192 stepName = "Unspecified => unspecified";
193 uuidTerm = UUID.fromString("230fd762-b143-49de-ac2e-744bcc48a63b");
194 label = "unspecified";
195 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
196 label, label, null, uuidLanguage);
197
198 //unknown type category
199 stepName = "Unknown Type Category => unknown type category";
200 uuidTerm = UUID.fromString("7194020b-a326-4b47-9bfe-9f31a30aba7f");
201 label = "unknown type category";
202 TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, uuidTerm,
203 label, label, null, uuidLanguage);
204
205 }
206
207 @Override
208 public ISchemaUpdater getPreviousUpdater() {
209 return SchemaUpdater_5182_5183.NewInstance();
210 }
211 }