1
|
/**
|
2
|
* Copyright (C) 2009 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.v30_31;
|
10
|
|
11
|
import java.util.ArrayList;
|
12
|
import java.util.List;
|
13
|
import java.util.UUID;
|
14
|
|
15
|
import org.apache.log4j.Logger;
|
16
|
|
17
|
import eu.etaxonomy.cdm.database.update.ITermUpdater;
|
18
|
import eu.etaxonomy.cdm.database.update.ITermUpdaterStep;
|
19
|
import eu.etaxonomy.cdm.database.update.SingleTermUpdater;
|
20
|
import eu.etaxonomy.cdm.database.update.TermUpdaterBase;
|
21
|
import eu.etaxonomy.cdm.model.common.Language;
|
22
|
import eu.etaxonomy.cdm.model.name.HybridRelationshipType;
|
23
|
|
24
|
/**
|
25
|
* @author a.mueller
|
26
|
* @date 10.09.2010
|
27
|
*
|
28
|
*/
|
29
|
public class TermUpdater_311_312 extends TermUpdaterBase implements ITermUpdater {
|
30
|
@SuppressWarnings("unused")
|
31
|
private static final Logger logger = Logger.getLogger(TermUpdater_311_312.class);
|
32
|
|
33
|
public static final String startTermVersion = "3.0.1.1.201101310000";
|
34
|
private static final String endTermVersion = "3.0.1.2.201102090000";
|
35
|
|
36
|
// *************************** FACTORY **************************************/
|
37
|
|
38
|
public static TermUpdater_311_312 NewInstance(){
|
39
|
return new TermUpdater_311_312(startTermVersion, endTermVersion);
|
40
|
}
|
41
|
|
42
|
// *************************** CONSTRUCTOR ***********************************/
|
43
|
|
44
|
protected TermUpdater_311_312(String startTermVersion, String endTermVersion) {
|
45
|
super(startTermVersion, endTermVersion);
|
46
|
}
|
47
|
|
48
|
//
|
49
|
|
50
|
/* (non-Javadoc)
|
51
|
* @see eu.etaxonomy.cdm.database.update.ICdmUpdater#invoke()
|
52
|
*/
|
53
|
@Override
|
54
|
protected List<ITermUpdaterStep> getUpdaterList() {
|
55
|
List<ITermUpdaterStep> list = new ArrayList<ITermUpdaterStep>();
|
56
|
|
57
|
String description;
|
58
|
String label;
|
59
|
String abbrev;
|
60
|
String dtype;
|
61
|
boolean isOrdered;
|
62
|
UUID uuidVocabulary;
|
63
|
UUID uuidAfterTerm;
|
64
|
UUID uuidLang;
|
65
|
String stepName;
|
66
|
|
67
|
// sex.hermaphrodite
|
68
|
UUID uuidTerm = UUID.fromString("0deddc65-2505-4c77-91a7-17d0de24afcc");
|
69
|
description = "hermaphrodite";
|
70
|
label = "hermaphrodite";
|
71
|
abbrev = "h";
|
72
|
dtype = "Sex";
|
73
|
isOrdered = true;
|
74
|
uuidVocabulary = UUID.fromString("9718b7dd-8bc0-4cad-be57-3c54d4d432fe");
|
75
|
uuidAfterTerm = UUID.fromString("b4cfe0cb-b35c-4f97-9b6b-2b3c096ea2c0");
|
76
|
uuidLang = Language.uuidEnglish;
|
77
|
stepName = "Add 'hermaphrodite' to sex";
|
78
|
list.add( SingleTermUpdater.NewInstance(stepName, uuidTerm, description, label, abbrev, dtype, uuidVocabulary, uuidLang, isOrdered, uuidAfterTerm));
|
79
|
|
80
|
// sex.unknown
|
81
|
uuidTerm = UUID.fromString("4f5e4c51-a664-48ad-8238-2e9f49eaf8dd");
|
82
|
description = "Sex unknown";
|
83
|
label = "unknown";
|
84
|
abbrev = "sex ?";
|
85
|
dtype = "Sex";
|
86
|
isOrdered = true;
|
87
|
uuidVocabulary = UUID.fromString("9718b7dd-8bc0-4cad-be57-3c54d4d432fe");
|
88
|
uuidAfterTerm = UUID.fromString("0deddc65-2505-4c77-91a7-17d0de24afcc");
|
89
|
uuidLang = Language.uuidEnglish;
|
90
|
stepName = "Add 'unknown' to sex";
|
91
|
list.add( SingleTermUpdater.NewInstance(stepName, uuidTerm, description, label, abbrev, dtype, uuidVocabulary, uuidLang, isOrdered, uuidAfterTerm));
|
92
|
|
93
|
// hybridRelationshipType.thirdParent
|
94
|
uuidTerm = UUID.fromString("bfae2780-92ab-4f65-b534-e68826f59e7d");
|
95
|
description = "Third parent";
|
96
|
label = "Third parent";
|
97
|
abbrev = null;
|
98
|
dtype = HybridRelationshipType.class.getSimpleName();
|
99
|
isOrdered = true;
|
100
|
uuidVocabulary = UUID.fromString("fc4abe52-9c25-4cfa-a682-8615bf4bbf07");
|
101
|
uuidAfterTerm = UUID.fromString("0485fc3d-4755-4f53-8832-b82774484c43");
|
102
|
uuidLang = Language.uuidEnglish;
|
103
|
stepName = "Add 'third parent' to hybrid relationship type";
|
104
|
SingleTermUpdater hybridUpdater = SingleTermUpdater.NewInstance(stepName, uuidTerm, description, label, abbrev, dtype, uuidVocabulary, uuidLang, isOrdered, uuidAfterTerm);
|
105
|
hybridUpdater.setReverseRepresentation("Child", "Child", null);
|
106
|
list.add(hybridUpdater);
|
107
|
|
108
|
|
109
|
// hybridRelationshipType.fourthParent
|
110
|
uuidTerm = UUID.fromString("9e92083b-cb9b-4c4d-bca5-c543bbefd3c7");
|
111
|
description = "Fourth parent";
|
112
|
label = "Fourth parent";
|
113
|
abbrev = null;
|
114
|
dtype = HybridRelationshipType.class.getSimpleName();
|
115
|
isOrdered = true;
|
116
|
uuidVocabulary = UUID.fromString("fc4abe52-9c25-4cfa-a682-8615bf4bbf07");
|
117
|
uuidAfterTerm = UUID.fromString("bfae2780-92ab-4f65-b534-e68826f59e7d");
|
118
|
uuidLang = Language.uuidEnglish;
|
119
|
stepName = "Add 'fourth parent' to hybrid relationship type";
|
120
|
hybridUpdater = SingleTermUpdater.NewInstance(stepName, uuidTerm, description, label, abbrev, dtype, uuidVocabulary, uuidLang, isOrdered, uuidAfterTerm);
|
121
|
hybridUpdater.setReverseRepresentation("Child", "Child", null);
|
122
|
list.add(hybridUpdater);
|
123
|
|
124
|
|
125
|
// hybridRelationshipType.majorParent
|
126
|
uuidTerm = UUID.fromString("da759eea-e3cb-4d3c-ae75-084c2d08f4ed");
|
127
|
description = "Major parent";
|
128
|
label = "Major parent";
|
129
|
abbrev = "major";
|
130
|
dtype = HybridRelationshipType.class.getSimpleName();
|
131
|
isOrdered = true;
|
132
|
uuidVocabulary = UUID.fromString("fc4abe52-9c25-4cfa-a682-8615bf4bbf07");
|
133
|
uuidAfterTerm = UUID.fromString("8b7324c5-cc6c-4109-b708-d49b187815c4");
|
134
|
uuidLang = Language.uuidEnglish;
|
135
|
stepName = "Add 'major parent' to hybrid relationship type";
|
136
|
hybridUpdater = SingleTermUpdater.NewInstance(stepName, uuidTerm, description, label, abbrev, dtype, uuidVocabulary, uuidLang, isOrdered, uuidAfterTerm);
|
137
|
hybridUpdater.setReverseRepresentation("Child", "Child", null);
|
138
|
list.add(hybridUpdater);
|
139
|
|
140
|
// hybridRelationshipType.minorParent
|
141
|
uuidTerm = UUID.fromString("e556b240-b03f-46b8-839b-ad89df633c5a");
|
142
|
description = "Minor parent";
|
143
|
label = "Minor parent";
|
144
|
abbrev = "minor";
|
145
|
dtype = HybridRelationshipType.class.getSimpleName();
|
146
|
isOrdered = true;
|
147
|
uuidVocabulary = UUID.fromString("fc4abe52-9c25-4cfa-a682-8615bf4bbf07");
|
148
|
uuidAfterTerm = UUID.fromString("da759eea-e3cb-4d3c-ae75-084c2d08f4ed");
|
149
|
uuidLang = Language.uuidEnglish;
|
150
|
stepName = "Add 'minor parent' to hybrid relationship type";
|
151
|
hybridUpdater = SingleTermUpdater.NewInstance(stepName, uuidTerm, description, label, abbrev, dtype, uuidVocabulary, uuidLang, isOrdered, uuidAfterTerm);
|
152
|
hybridUpdater.setReverseRepresentation("Child", "Child", null);
|
153
|
list.add(hybridUpdater);
|
154
|
|
155
|
return list;
|
156
|
}
|
157
|
|
158
|
|
159
|
/* (non-Javadoc)
|
160
|
* @see eu.etaxonomy.cdm.database.update.ICdmUpdater#getNextUpdater()
|
161
|
*/
|
162
|
@Override
|
163
|
public ITermUpdater getNextUpdater() {
|
164
|
return TermUpdater_312_313.NewInstance();
|
165
|
}
|
166
|
|
167
|
/* (non-Javadoc)
|
168
|
* @see eu.etaxonomy.cdm.database.update.ICdmUpdater#getPreviousUpdater()
|
169
|
*/
|
170
|
@Override
|
171
|
public ITermUpdater getPreviousUpdater() {
|
172
|
return TermUpdater_31_311.NewInstance();
|
173
|
}
|
174
|
|
175
|
}
|