|
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.v532_533;
|
|
10 |
|
|
11 |
import java.util.ArrayList;
|
|
12 |
import java.util.List;
|
|
13 |
import java.util.UUID;
|
|
14 |
|
|
15 |
import org.apache.logging.log4j.LogManager;
|
|
16 |
import org.apache.logging.log4j.Logger;
|
|
17 |
|
|
18 |
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
|
|
19 |
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
|
|
20 |
import eu.etaxonomy.cdm.database.update.SchemaUpdaterBase;
|
|
21 |
import eu.etaxonomy.cdm.database.update.TermRepresentationUpdater;
|
|
22 |
import eu.etaxonomy.cdm.database.update.v529_532.SchemaUpdater_5290_5320;
|
|
23 |
import eu.etaxonomy.cdm.model.common.Language;
|
|
24 |
import eu.etaxonomy.cdm.model.metadata.CdmMetaData.CdmVersion;
|
|
25 |
|
|
26 |
/**
|
|
27 |
* @author a.mueller
|
|
28 |
* @date 30.09.2022
|
|
29 |
*/
|
|
30 |
public class SchemaUpdater_5320_5330 extends SchemaUpdaterBase {
|
|
31 |
|
|
32 |
@SuppressWarnings("unused")
|
|
33 |
private static final Logger logger = LogManager.getLogger(SchemaUpdater_5320_5330.class);
|
|
34 |
|
|
35 |
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_22_00;
|
|
36 |
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_33_00;
|
|
37 |
|
|
38 |
// ********************** FACTORY METHOD *************************************
|
|
39 |
|
|
40 |
public static SchemaUpdater_5320_5330 NewInstance() {
|
|
41 |
return new SchemaUpdater_5320_5330();
|
|
42 |
}
|
|
43 |
|
|
44 |
protected SchemaUpdater_5320_5330() {
|
|
45 |
super(startSchemaVersion.versionString(), endSchemaVersion.versionString());
|
|
46 |
}
|
|
47 |
|
|
48 |
@Override
|
|
49 |
public ISchemaUpdater getPreviousUpdater() {
|
|
50 |
return SchemaUpdater_5290_5320.NewInstance();
|
|
51 |
}
|
|
52 |
|
|
53 |
@Override
|
|
54 |
protected List<ISchemaUpdaterStep> getUpdaterList() {
|
|
55 |
|
|
56 |
String stepName;
|
|
57 |
|
|
58 |
List<ISchemaUpdaterStep> stepList = new ArrayList<>();
|
|
59 |
|
|
60 |
//#10163
|
|
61 |
stepName = "Change label + desc. 'Conserved Desig' => 'Conservation Designated'";
|
|
62 |
String uuidTerm = "4e9c9702-a74d-4033-9d47-792ad123712c";
|
|
63 |
String description = "Conservation Designated";
|
|
64 |
String label = "Conservation designated";
|
|
65 |
String abbrev = null;
|
|
66 |
UUID uuidLatin = Language.uuidLatin; //not really true but all nom. status currently use Latin representations
|
|
67 |
TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, UUID.fromString(uuidTerm), description, label, abbrev, uuidLatin);
|
|
68 |
|
|
69 |
stepName = "Revert label + desc. for orth. cons. from incorrect 'Conservation Designated' => 'Orthography Conserved'";
|
|
70 |
uuidTerm = "34a7d383-988b-4117-b8c0-52b947f8c711";
|
|
71 |
description = "Orthography Conserved";
|
|
72 |
label = "Orthography Conserved";
|
|
73 |
// abbrev = null;
|
|
74 |
uuidLatin = Language.uuidLatin; //not really true but all nom. status currently use Latin representations
|
|
75 |
TermRepresentationUpdater.NewInstanceWithTitleCache(stepList, stepName, UUID.fromString(uuidTerm), description, label, abbrev, uuidLatin);
|
|
76 |
|
|
77 |
return stepList;
|
|
78 |
}
|
|
79 |
}
|
fix #10163 fix labels for "Orthography Conserved" and "Conserved Desig"