Revision 324d38f7
Added by Alex Theys about 12 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesViewPart.java | ||
---|---|---|
75 | 75 |
import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart; |
76 | 76 |
|
77 | 77 |
|
78 |
|
|
78 |
/** |
|
79 |
* The context manager mediates context start/stop and workbench shutdowns to all registered listeners. |
|
80 |
* |
|
81 |
* @author a.theys |
|
82 |
* @created mar 13, 2012 |
|
83 |
* @version 1.0 |
|
84 |
*/ |
|
79 | 85 |
public class UsesViewPart extends AbstractCdmEditorViewPart implements IPartContentHasDetails, IPartContentHasSupplementalData { |
80 | 86 |
|
81 | 87 |
|
... | ... | |
110 | 116 |
TermVocabulary<Modifier> humanGroupVocabulary = (TermVocabulary<Modifier>) CdmStore.getService(IVocabularyService.class).find(UUID.fromString("ca46cea5-bdf7-438d-9cd8-e2793d2178dc")); |
111 | 117 |
ConversationHolder conversation = CdmStore.createConversation(); |
112 | 118 |
if (existingMarkertype == null) { |
113 |
//existingMarkertype.set("use") |
|
114 |
//existingMarkertype.setLabel("use"); |
|
115 |
//MarkerType useMarkerType = MarkerType.NewInstance("use", "use", null); |
|
116 |
//ConversationHolder conversation = CdmStore.createConversation(); |
|
117 | 119 |
existingMarkertype = MarkerType.NewInstance("use", "use", null); |
118 | 120 |
existingMarkertype.setUuid( UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039")); |
119 |
//CdmStore.getService(ITermService.class).save(existingMarkertype); |
|
120 |
//saveOrUpdate(existingMarkertype); |
|
121 |
//TermVocabulary<MarkerType> markerTypeVocabulary = (TermVocabulary<MarkerType>)CdmStore.getService(IVocabularyService.class).getVocabulary(VocabularyEnum.MarkerType); |
|
122 | 121 |
TermVocabulary<MarkerType> markerTypeVocabulary = (TermVocabulary<MarkerType>)CdmStore.getService(IVocabularyService.class).find((UUID.fromString("19dffff7-e142-429c-a420-5d28e4ebe305"))); |
123 |
//(UUID.fromString("19dffff7-e142-429c-a420-5d28e4ebe305")); |
|
124 |
//CdmStore. |
|
125 |
|
|
126 | 122 |
markerTypeVocabulary.addTerm(existingMarkertype); |
127 | 123 |
CdmStore.getService(IVocabularyService.class).saveOrUpdate(markerTypeVocabulary); |
128 | 124 |
conversation.commit(true); |
129 |
//conversation.close(); |
|
130 | 125 |
} |
131 | 126 |
if (stateVocabulary == null) { |
132 | 127 |
monitor.subTask("stateVocabulary empty"); |
... | ... | |
134 | 129 |
try { |
135 | 130 |
termSourceUri = new URI("eu.etaxonomy.cdm.model.description.State"); |
136 | 131 |
} catch (URISyntaxException e) { |
137 |
// TODO Auto-generated catch block |
|
138 | 132 |
e.printStackTrace(); |
139 | 133 |
} |
140 | 134 |
stateVocabulary = TermVocabulary.NewInstance("Use Category", "Use Category", null, termSourceUri); |
... | ... | |
152 | 146 |
try { |
153 | 147 |
termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier"); |
154 | 148 |
} catch (URISyntaxException e) { |
155 |
// TODO Auto-generated catch block |
|
156 | 149 |
e.printStackTrace(); |
157 | 150 |
} |
158 | 151 |
countryVocabulary = TermVocabulary.NewInstance("Country", "Country", null, termSourceUri); |
... | ... | |
169 | 162 |
try { |
170 | 163 |
termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier"); |
171 | 164 |
} catch (URISyntaxException e) { |
172 |
// TODO Auto-generated catch block |
|
173 | 165 |
e.printStackTrace(); |
174 | 166 |
} |
175 | 167 |
plantPartVocabulary = TermVocabulary.NewInstance("Plant Part", "Plant Part", null, termSourceUri); |
... | ... | |
185 | 177 |
try { |
186 | 178 |
termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier"); |
187 | 179 |
} catch (URISyntaxException e) { |
188 |
// TODO Auto-generated catch block |
|
189 | 180 |
e.printStackTrace(); |
190 | 181 |
} |
191 | 182 |
humanGroupVocabulary = TermVocabulary.NewInstance("Human Group", "Human Group", null, termSourceUri); |
... | ... | |
198 | 189 |
conversation.commit(true); |
199 | 190 |
} |
200 | 191 |
if(featureUseRecord == null) { |
201 |
//Feature usesFeature = (Feature) CdmStore.getService(ITermService.class).find(UUID.fromString("e5374d39-b210-47c7-bec1-bee05b5f1cb6")); |
|
202 | 192 |
featureUseRecord = Feature.NewInstance("Use Record", "Use Record", null); |
203 | 193 |
featureUseRecord.setUuid(UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599")); |
204 | 194 |
featureUseRecord.setSupportsCategoricalData(true); |
205 |
//featureUseRecord |
|
206 |
//featureUseRecord.setLabel("Use Record"); |
|
207 |
//featureUseRecord. |
|
208 | 195 |
TermVocabulary<Feature> featureVocabulary = (TermVocabulary<Feature>)CdmStore.getService(IVocabularyService.class).find((UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8"))); |
209 | 196 |
featureVocabulary.addTerm(featureUseRecord); |
210 | 197 |
CdmStore.getService(IVocabularyService.class).saveOrUpdate(featureVocabulary); |
... | ... | |
215 | 202 |
|
216 | 203 |
conversation.close(); |
217 | 204 |
} |
218 |
/*public void contextStop(IMemento memento, IProgressMonitor monitor) { |
|
219 |
monitor.subTask("Getting rid of search results"); |
|
220 |
NavigationUtil.hideView(SearchResultView.this); |
|
221 |
}*/ |
|
222 | 205 |
} |
223 | 206 |
|
224 | 207 |
public static final String ID = "eu.etaxonomy.taxeditor.editor.view.uses"; |
Also available in: Unified diff
AT: committing latest changes to the Tax Editor after a first round of Code review