1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2009 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
package eu.etaxonomy.cdm.database.update.v30_31;
|
11
|
|
12
|
import java.util.ArrayList;
|
13
|
import java.util.List;
|
14
|
import java.util.UUID;
|
15
|
|
16
|
import org.apache.log4j.Logger;
|
17
|
|
18
|
import eu.etaxonomy.cdm.database.update.ITermUpdater;
|
19
|
import eu.etaxonomy.cdm.database.update.ITermUpdaterStep;
|
20
|
import eu.etaxonomy.cdm.database.update.SingleTermUpdater;
|
21
|
import eu.etaxonomy.cdm.database.update.TermUpdaterBase;
|
22
|
import eu.etaxonomy.cdm.database.update.v25_30.TermUpdater_25_30;
|
23
|
import eu.etaxonomy.cdm.model.common.Language;
|
24
|
import eu.etaxonomy.cdm.model.common.MarkerType;
|
25
|
import eu.etaxonomy.cdm.model.description.Feature;
|
26
|
|
27
|
/**
|
28
|
* @author a.mueller
|
29
|
* @date 10.09.2010
|
30
|
*
|
31
|
*/
|
32
|
public class TermUpdater_30_31 extends TermUpdaterBase implements ITermUpdater {
|
33
|
@SuppressWarnings("unused")
|
34
|
private static final Logger logger = Logger.getLogger(TermUpdater_30_31.class);
|
35
|
|
36
|
public static final String startTermVersion = "3.0.0.0.201011170000";
|
37
|
private static final String endTermVersion = "3.0.1.0.201012150000";
|
38
|
|
39
|
// *************************** FACTORY **************************************/
|
40
|
|
41
|
public static TermUpdater_30_31 NewInstance(){
|
42
|
return new TermUpdater_30_31(startTermVersion, endTermVersion);
|
43
|
}
|
44
|
|
45
|
// *************************** CONSTRUCTOR ***********************************/
|
46
|
|
47
|
protected TermUpdater_30_31(String startTermVersion, String endTermVersion) {
|
48
|
super(startTermVersion, endTermVersion);
|
49
|
}
|
50
|
|
51
|
//
|
52
|
|
53
|
/* (non-Javadoc)
|
54
|
* @see eu.etaxonomy.cdm.database.update.ICdmUpdater#invoke()
|
55
|
*/
|
56
|
@Override
|
57
|
protected List<ITermUpdaterStep> getUpdaterList() {
|
58
|
List<ITermUpdaterStep> list = new ArrayList<ITermUpdaterStep>();
|
59
|
|
60
|
String description;
|
61
|
String label;
|
62
|
String abbrev;
|
63
|
String dtype;
|
64
|
boolean isOrdered;
|
65
|
UUID uuidVocabulary;
|
66
|
UUID uuidAfterTerm;
|
67
|
UUID uuidLang;
|
68
|
String stepName;
|
69
|
|
70
|
// // [unranked infragneric]
|
71
|
// UUID uuidTerm = UUID.fromString("994646a1-c2e7-461d-a1bc-2afd6ea51b40");
|
72
|
// description = "Unranked Infragneric Rank: The infrageneric name on purpose has no rank";
|
73
|
// label = "Unranked Infrageneric";
|
74
|
// abbrev = "[unranked]";
|
75
|
// dtype = Rank.class.getSimpleName();
|
76
|
// isOrdered = true;
|
77
|
// uuidVocabulary = UUID.fromString("ef0d1ce1-26e3-4e83-b47b-ca74eed40b1b");
|
78
|
// uuidAfterTerm = UUID.fromString("41bcc6ac-37d3-4fd4-bb80-3cc5b04298b9");
|
79
|
// uuidLang = Language.uuidEnglish;
|
80
|
// stepName = "Add 'unranked infrageneric' rank to ranks";
|
81
|
// list.add( SingleTermUpdater.NewInstance(stepName, uuidTerm, description, label, abbrev, dtype, uuidVocabulary, uuidLang, isOrdered, uuidAfterTerm));
|
82
|
//
|
83
|
//
|
84
|
// // [unranked infraspecific]
|
85
|
// uuidTerm = UUID.fromString("a965befb-70a9-4747-a18f-624456c65223");
|
86
|
// description = "Unranked Infraspecific Rank: The infraspecific name on purpose has no rank";
|
87
|
// label = "Unranked Infraspecific";
|
88
|
// abbrev = "[unranked]";
|
89
|
// dtype = Rank.class.getSimpleName();
|
90
|
// isOrdered = true;
|
91
|
// uuidVocabulary = UUID.fromString("ef0d1ce1-26e3-4e83-b47b-ca74eed40b1b");
|
92
|
// uuidAfterTerm = UUID.fromString("5c4d6755-2cf6-44ca-9220-cccf8881700b");
|
93
|
// uuidLang = Language.uuidEnglish;
|
94
|
// stepName = "Add 'unranked' rank to ranks";
|
95
|
// list.add( SingleTermUpdater.NewInstance(stepName, uuidTerm, description, label, abbrev, dtype, uuidVocabulary, uuidLang, isOrdered, uuidAfterTerm));
|
96
|
|
97
|
|
98
|
// endemic
|
99
|
UUID uuidTerm = UUID.fromString("efe95ade-8a6c-4a0e-800e-437c8b50c45e");
|
100
|
description = "endemic";
|
101
|
label = "endemic";
|
102
|
abbrev = "endemic";
|
103
|
dtype = MarkerType.class.getSimpleName();
|
104
|
isOrdered = false;
|
105
|
uuidVocabulary = UUID.fromString("19dffff7-e142-429c-a420-5d28e4ebe305");
|
106
|
uuidAfterTerm = null;//UUID.fromString("5c4d6755-2cf6-44ca-9220-cccf8881700b");
|
107
|
uuidLang = Language.uuidEnglish;
|
108
|
stepName = "Add 'endemic' rank to ranks";
|
109
|
list.add( SingleTermUpdater.NewInstance(stepName, uuidTerm, description, label, abbrev, dtype, uuidVocabulary, uuidLang, isOrdered, uuidAfterTerm));
|
110
|
|
111
|
// status feature
|
112
|
uuidTerm = UUID.fromString("86d40635-2a63-4ad6-be75-9faa4a6a57fb");
|
113
|
description = "Status";
|
114
|
label = "Status";
|
115
|
abbrev = "Status";
|
116
|
dtype = Feature.class.getSimpleName();
|
117
|
isOrdered = false;
|
118
|
uuidVocabulary = UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8");
|
119
|
uuidAfterTerm = null;//UUID.fromString("5c4d6755-2cf6-44ca-9220-cccf8881700b");
|
120
|
uuidLang = Language.uuidEnglish;
|
121
|
stepName = "Add 'status' feature to features";
|
122
|
list.add( SingleTermUpdater.NewInstance(stepName, uuidTerm, description, label, abbrev, dtype, uuidVocabulary, uuidLang, isOrdered, uuidAfterTerm));
|
123
|
|
124
|
// systematics feature
|
125
|
uuidTerm = UUID.fromString("bd9aca17-cd0e-4418-a3a1-1a4b80dbc162");
|
126
|
description = "Systematics";
|
127
|
label = "Systematics";
|
128
|
abbrev = "Systematics";
|
129
|
dtype = Feature.class.getSimpleName();
|
130
|
isOrdered = false;
|
131
|
//TODO is this a name feature or a taxon feature
|
132
|
uuidVocabulary = UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8");
|
133
|
uuidAfterTerm = null;//UUID.fromString("5c4d6755-2cf6-44ca-9220-cccf8881700b");
|
134
|
uuidLang = Language.uuidEnglish;
|
135
|
stepName = "Add 'systematics' feature to features";
|
136
|
list.add( SingleTermUpdater.NewInstance(stepName, uuidTerm, description, label, abbrev, dtype, uuidVocabulary, uuidLang, isOrdered, uuidAfterTerm));
|
137
|
|
138
|
|
139
|
//language labels
|
140
|
LanguageLabelUpdater langLabelUpdater = LanguageLabelUpdater.NewInstance();
|
141
|
list.add(langLabelUpdater);
|
142
|
|
143
|
return list;
|
144
|
}
|
145
|
|
146
|
|
147
|
/* (non-Javadoc)
|
148
|
* @see eu.etaxonomy.cdm.database.update.ICdmUpdater#getNextUpdater()
|
149
|
*/
|
150
|
@Override
|
151
|
public ITermUpdater getNextUpdater() {
|
152
|
return TermUpdater_31_311.NewInstance();
|
153
|
}
|
154
|
|
155
|
/* (non-Javadoc)
|
156
|
* @see eu.etaxonomy.cdm.database.update.ICdmUpdater#getPreviousUpdater()
|
157
|
*/
|
158
|
@Override
|
159
|
public ITermUpdater getPreviousUpdater() {
|
160
|
return TermUpdater_25_30.NewInstance();
|
161
|
}
|
162
|
|
163
|
}
|