2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
;
13 import java
.util
.ArrayList
;
14 import java
.util
.Collection
;
15 import java
.util
.HashMap
;
16 import java
.util
.HashSet
;
17 import java
.util
.List
;
18 import java
.util
.Locale
;
20 import java
.util
.ResourceBundle
;
22 import java
.util
.UUID
;
24 import org
.apache
.log4j
.Logger
;
25 import org
.eclipse
.core
.databinding
.observable
.Realm
;
26 import org
.eclipse
.core
.databinding
.observable
.list
.WritableList
;
27 import org
.eclipse
.core
.databinding
.observable
.set
.IObservableSet
;
28 import org
.eclipse
.core
.databinding
.observable
.set
.WritableSet
;
29 import org
.eclipse
.core
.runtime
.FileLocator
;
30 import org
.eclipse
.core
.runtime
.IPath
;
31 import org
.eclipse
.core
.runtime
.Path
;
32 import org
.eclipse
.jface
.databinding
.swt
.SWTObservables
;
33 import org
.eclipse
.jface
.resource
.FontRegistry
;
34 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
35 import org
.eclipse
.jface
.resource
.ImageRegistry
;
36 import org
.eclipse
.swt
.SWT
;
37 import org
.eclipse
.swt
.graphics
.Color
;
38 import org
.eclipse
.swt
.graphics
.Font
;
39 import org
.eclipse
.swt
.graphics
.FontData
;
40 import org
.eclipse
.swt
.graphics
.Image
;
41 import org
.eclipse
.swt
.widgets
.Display
;
42 import org
.eclipse
.swt
.widgets
.Tree
;
43 import org
.eclipse
.ui
.forms
.FormColors
;
44 import org
.eclipse
.ui
.plugin
.AbstractUIPlugin
;
45 import org
.eclipse
.ui
.views
.properties
.PropertySheetPage
;
46 import org
.osgi
.framework
.BundleContext
;
47 import org
.springframework
.transaction
.TransactionStatus
;
49 import eu
.etaxonomy
.cdm
.api
.application
.CdmApplicationController
;
50 import eu
.etaxonomy
.cdm
.api
.service
.IDescriptionService
;
51 import eu
.etaxonomy
.cdm
.api
.service
.INameService
;
52 import eu
.etaxonomy
.cdm
.api
.service
.IReferenceService
;
53 import eu
.etaxonomy
.cdm
.api
.service
.ITaxonService
;
54 import eu
.etaxonomy
.cdm
.database
.CdmDataSource
;
55 import eu
.etaxonomy
.cdm
.database
.DataSourceNotFoundException
;
56 import eu
.etaxonomy
.cdm
.database
.DbSchemaValidation
;
57 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
58 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
59 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
60 import eu
.etaxonomy
.cdm
.model
.common
.OrderedTermVocabulary
;
61 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
62 import eu
.etaxonomy
.cdm
.model
.common
.init
.TermNotFoundException
;
63 import eu
.etaxonomy
.cdm
.model
.name
.BotanicalName
;
64 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationshipType
;
65 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
66 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatusType
;
67 import eu
.etaxonomy
.cdm
.model
.name
.Rank
;
68 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
69 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
70 import eu
.etaxonomy
.taxeditor
.model
.CdmUtil
;
71 import eu
.etaxonomy
.taxeditor
.navigation
.TaxonomicTreeViewer
;
74 * The class controlling the plug-in life cycle.
77 * <li>Initializes datastore as necessary.</li>
78 * <li>Initializes default preferences.</li>
79 * <li>Gateway to CDM service layer.</li>
80 * <li>Stores taxa for application session.</li>
81 * <li>Stores registries for colors, fonts, images.</li>
88 public class TaxEditorPlugin
extends AbstractUIPlugin
{
89 private static final Logger logger
= Logger
90 .getLogger(TaxEditorPlugin
.class);
95 public static final String PLUGIN_ID
= "eu.etaxonomy.taxeditor.plugin";
99 private static TaxEditorPlugin plugin
;
101 // private DbSchemaValidation dbSchemaValidation = DbSchemaValidation.VALIDATE;
102 private DbSchemaValidation dbSchemaValidation
= DbSchemaValidation
.UPDATE
;
107 public TaxEditorPlugin() {
108 // logger.fatal("Fatal");
109 // logger.error("Error");
110 // logger.debug("Debug");
111 // logger.info("Info");
112 // logger.warn("Warn");
113 // logger.trace("Trace");
119 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
121 public void start(BundleContext context
) throws Exception
{
122 super.start(context
);
125 // If the preferences INITIALIZED has not been set, the IF clause
126 // will return false, i.e. datastore will be initialized first
127 // time the application is run after being installed.
128 boolean initialized
= false;
129 if (getPreferenceStore()
130 .contains(ITaxEditorConstants
.INITIALIZED
)) {
131 initialized
= getPreferenceStore().getBoolean(
132 ITaxEditorConstants
.INITIALIZED
);
137 logger
.warn("Initializing datastore");
139 dbSchemaValidation
= DbSchemaValidation
.CREATE
;
141 if (getPreferenceStore().getBoolean(
142 ITaxEditorConstants
.INITIALIZE_W_TESTDATA
)) {
144 getPreferenceStore().setValue(
145 ITaxEditorConstants
.INITIALIZE_W_TESTDATA
, false);
149 .setValue(ITaxEditorConstants
.INITIALIZED
, true);
152 cdmApp
= getCdmApp();
154 Locale locale
= new Locale("en", "", "icbn");
155 Locale
.setDefault(locale
);
161 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
163 public void stop(BundleContext context
) throws Exception
{
171 void initDatastore() {
173 boolean useSoraya
= true;
174 // useSoraya = false;
177 genusTaxon
= getSorayasGenusTaxon();
180 BotanicalName botanicalName
= BotanicalName
.NewInstance(Rank
182 botanicalName
.setTitleCache("Hieracium L.");
183 botanicalName
.setGenusOrUninomial("Hieracium");
184 botanicalName
.setCombinationAuthorTeam(Person
.NewInstance());
185 botanicalName
.getCombinationAuthorTeam()
186 .setNomenclaturalTitle("L.");
187 genusTaxon
= Taxon
.NewInstance(botanicalName
, CdmUtil
188 .getSessionDefaultSec());
190 BotanicalName botSpecies
= BotanicalName
191 .NewInstance(Rank
.SPECIES());
192 botSpecies
.setTitleCache("Hieracium asturianum Pau");
193 botSpecies
.setGenusOrUninomial("Hieracium");
194 botSpecies
.setSpecificEpithet("asturianum");
195 botSpecies
.setCombinationAuthorTeam(Person
.NewInstance());
196 botSpecies
.getCombinationAuthorTeam().setNomenclaturalTitle("Pau");
197 Taxon childTaxon
= Taxon
.NewInstance(botSpecies
, null);
198 childTaxon
.setTaxonomicParent(genusTaxon
, null, null);
200 BotanicalName botSpecies2
= BotanicalName
.NewInstance(Rank
202 botSpecies2
.setTitleCache("Hieracium wolffii Zahn");
203 botSpecies2
.setGenusOrUninomial("Hieracium");
204 botSpecies2
.setSpecificEpithet("wolffii");
205 botSpecies2
.setCombinationAuthorTeam(Person
.NewInstance());
206 botSpecies2
.getCombinationAuthorTeam()
207 .setNomenclaturalTitle("Zahn");
208 Taxon childTaxon2
= Taxon
.NewInstance(botSpecies2
, CdmUtil
209 .getSessionDefaultSec());
210 // childTaxon2.setName(botSpecies2);
211 // childTaxon2.setSec(null);
212 childTaxon2
.setTaxonomicParent(genusTaxon
, null, null);
214 // Add some name relations to botSpecies2
215 botSpecies2
.addRelationshipFromName(botSpecies
,
216 NameRelationshipType
.BASIONYM(), null);
217 botSpecies2
.addRelationshipToName(botSpecies
, NameRelationshipType
218 .REPLACED_SYNONYM(), null);
219 logger
.warn("Name relations created");
221 // Add name status to botSpecies2
222 botSpecies2
.addStatus(NomenclaturalStatus
223 .NewInstance(NomenclaturalStatusType
.NOVUM()));
224 logger
.warn("Nom. status created");
227 getCdmApp().getTaxonService().saveTaxon(genusTaxon
);
233 * Returns the shared instance
235 * @return the shared instance
237 public static TaxEditorPlugin
getDefault() {
241 /***************************************************************************
243 **************************************************************************/
245 * All CDM services are called via the application controller
247 private CdmApplicationController cdmApp
;
248 private TransactionStatus txStatus
;
250 public CdmApplicationController
getCdmApp() {
251 if (cdmApp
== null) {
253 // cdmApp.getDatabaseService().getDatabaseEnum();
254 // cdmApp.getDatabaseService().saveDataSource(strDataSourceName, databaseTypeEnum, server, database, username, password)
256 // // Open ds by string
257 // CdmPersistentDataSource ds = CdmPersistentDataSource.NewInstance(dataSourceName)
259 // // Open default instance
260 // CdmPersistentDataSource ds = CdmPersistentDataSource.NewDefaultInstance();
262 // CdmPersistentDataSource.getAllDataSources();
264 // // Open CdmApp w default DB
265 // CdmApplicationController.NewInstance(dbSchemaValidation);
270 CdmDataSource
.NewH2EmbeddedInstance("cdm", "sa", "");
271 //// CdmDataSource.NewMySqlInstance("192.168.2.10", "cdm_editor_test1", "edit", "wp5");
272 //// CdmPersistentDataSource.NewLocalHsqlInstance();
273 cdmApp
= CdmApplicationController
274 .NewInstance(cdmDatasource
, dbSchemaValidation
);
276 // cdmApp = CdmApplicationController.NewInstance(dbSchemaValidation);
280 // cdmApp.commitTransaction((TransactionStatus) txStatus);
282 } catch (DataSourceNotFoundException e
) {
283 // TODO Auto-generated catch block
285 } catch (TermNotFoundException e
) {
286 // TODO Auto-generated catch block
293 public void startTransaction() {
294 if (cdmApp
!= null) {
295 txStatus
= cdmApp
.startTransaction();
299 public void commitTransaction() {
300 if (txStatus
!= null) {
301 cdmApp
.commitTransaction(txStatus
);
306 private ITaxonService taxonService
;
308 public ITaxonService
getTaxonService() {
309 if (taxonService
== null) {
310 taxonService
= getCdmApp().getTaxonService();
315 private INameService nameService
;
317 public INameService
getNameService() {
318 if (nameService
== null) {
319 nameService
= getCdmApp().getNameService();
324 private IDescriptionService descriptionService
;
326 public IDescriptionService
getDescriptionService() {
327 if (descriptionService
== null) {
328 descriptionService
= getCdmApp().getDescriptionService();
330 return descriptionService
;
333 private IReferenceService referenceService
;
335 public IReferenceService
getReferenceService() {
336 if (referenceService
== null) {
337 referenceService
= getCdmApp().getReferenceService();
339 return referenceService
;
342 private List
<ICdmDataSource
> dataSources
;
344 public List
<ICdmDataSource
> getDataSources() {
345 if (dataSources
== null) {
346 dataSources
= new ArrayList
<ICdmDataSource
>();
347 dataSources
.add(CdmDataSource
.
348 NewH2EmbeddedInstance("cdm", "sa", ""));
349 dataSources
.add(CdmDataSource
.
350 NewMySqlInstance("192.168.2.10", "cdm_editor_test1",
356 private ICdmDataSource cdmDatasource
;
358 public ICdmDataSource
getCdmDataSource() {
359 return cdmDatasource
;
362 /***************************************************************************
364 **************************************************************************/
366 private WritableList observableRecentNamesList
= null;
367 private WritableList observableFavoritesList
= null;
369 public WritableList
getObservableRecentNamesList() {
370 if (observableRecentNamesList
== null) {
371 observableRecentNamesList
= new WritableList();
373 return observableRecentNamesList
;
376 public WritableList
getObservableFavoritesList() {
377 if (observableFavoritesList
== null) {
378 observableFavoritesList
= new WritableList();
380 return observableFavoritesList
;
383 /***************************************************************************
385 **************************************************************************/
386 public ImageDescriptor
getImageDescriptor(String key
) {
387 return getImageRegistry().getDescriptor(key
);
390 public Image
getImage(String key
) {
391 return getImageRegistry().get(key
);
395 private ResourceBundle resourceBundle
;
396 private FormColors formColors
;
398 protected void initializeImageRegistry(ImageRegistry registry
) {
399 registerImage(registry
, ITaxEditorConstants
.EDIT_ICON
, "edit_16x16.ico");
400 registerImage(registry
, ITaxEditorConstants
.WARNING_ICON
,
402 registerImage(registry
, ITaxEditorConstants
.BLACK_SQUARE_ICON
,
403 "accepted_small.gif");
404 registerImage(registry
, ITaxEditorConstants
.HOMOTYPIC_SYN_ICON
,
405 "homosyn_no_bg.gif");
406 registerImage(registry
,
407 ITaxEditorConstants
.HOMOTYPIC_SYN_ORIGINAL_ICON
,
408 "homosyn_original_no_bg.gif");
409 registerImage(registry
, ITaxEditorConstants
.HETEROTYPIC_SYN_ICON
,
410 "heterosyn_no_bg.gif");
411 registerImage(registry
,
412 ITaxEditorConstants
.HETEROTYPIC_SYN_ORIGINAL_ICON
,
413 "heterosyn_original_no_bg.gif");
414 registerImage(registry
, ITaxEditorConstants
.MISAPPLIED_NAME_ICON
,
415 "misapplied_no_bg.gif");
416 registerImage(registry
, ITaxEditorConstants
.AUTONYM_ICON
,
417 "autonym_no_bg.gif");
418 registerImage(registry
, ITaxEditorConstants
.BASIONYM_ICON
,
419 "basionym_no_bg.gif");
420 registerImage(registry
, ITaxEditorConstants
.ORTHOGRAPHIC_VARIANT_ICON
,
421 "orthovariant_no_bg.gif");
422 registerImage(registry
, ITaxEditorConstants
.DB_ICON
, "db.gif");
423 registerImage(registry
, ITaxEditorConstants
.MOVE_ICON
,
424 "correction_change.gif");
425 registerImage(registry
, ITaxEditorConstants
.ACTIVE_DELETE_ICON
,
427 registerImage(registry
, ITaxEditorConstants
.SYNONYM_TO_TAXON_ICON
,
429 registerImage(registry
, ITaxEditorConstants
.OPEN_TAXON_ICON
, "open.gif");
430 registerImage(registry
, ITaxEditorConstants
.ADD_CHILD_TAXON_ICON
,
432 registerImage(registry
,
433 ITaxEditorConstants
.SWAP_SYNONYM_AND_TAXON_ICON
, "swap2.gif");
434 registerImage(registry
, ITaxEditorConstants
.QUICK_ADD_ICON
,
436 registerImage(registry
, ITaxEditorConstants
.TAXON_TO_SYNONYM_ICON
,
440 private void registerImage(ImageRegistry registry
, String key
,
443 IPath path
= new Path("icons/" + fileName
); //$NON-NLS-1$
444 URL url
= FileLocator
.find(getBundle(), path
, null);
446 ImageDescriptor desc
= ImageDescriptor
.createFromURL(url
);
447 registry
.put(key
, desc
);
449 } catch (Exception e
) {
453 /***************************************************************************
455 **************************************************************************/
456 private FontRegistry fontRegistry
;
458 private FontRegistry
getFontRegistry() {
459 if (fontRegistry
== null) {
460 fontRegistry
= new FontRegistry(Display
.getCurrent());
462 fontRegistry
.put(ITaxEditorConstants
.DATASOURCE_FONT
,
463 new FontData
[] { new FontData("Arial", 8, SWT
.NONE
) });
464 fontRegistry
.put(ITaxEditorConstants
.MENU_ITEM_ITALICS_FONT
,
465 new FontData
[] { new FontData("Arial", 9, SWT
.ITALIC
) });
466 fontRegistry
.put(ITaxEditorConstants
.ACCEPTED_TAXON_FONT
,
467 new FontData
[] { new FontData("Georgia", 12, SWT
.NONE
) });
468 fontRegistry
.put(ITaxEditorConstants
.SYNONYM_FONT
,
469 new FontData
[] { new FontData("Georgia", 10, SWT
.NONE
) });
470 fontRegistry
.put(ITaxEditorConstants
.MISAPPLIEDNAME_FONT
,
471 new FontData
[] { new FontData("Georgia", 10, SWT
.NONE
) });
472 fontRegistry
.put(ITaxEditorConstants
.CHOOSE_NAME_TEXT_FONT
,
473 new FontData
[] { new FontData("Arial", 12, SWT
.BOLD
) });
474 fontRegistry
.put(ITaxEditorConstants
.DEFAULT_PROMPT_FONT
,
475 new FontData
[] { new FontData("Georgia", 10, SWT
.ITALIC
) });
480 public Font
getFont(String key
) {
481 return getFontRegistry().get(key
);
484 /***************************************************************************
486 **************************************************************************/
487 private static HashMap
<String
, Color
> colorMap
;
489 public Color
getColor(String key
) {
490 return getColorMap().get(key
);
493 private HashMap
<String
, Color
> getColorMap() {
494 if (colorMap
== null) {
495 colorMap
= new HashMap
<String
, Color
>();
497 colorMap
.put(ITaxEditorConstants
.GROUP_GRAY_BKG_COLOR
,
498 new Color(null, 240, 240, 240));
499 colorMap
.put(ITaxEditorConstants
.PROP_SHEET_RED
,
500 new Color(null, 255, 0, 0));
505 private void disposeColors() {
506 if (colorMap
== null) {
509 for (Color color
: colorMap
.values()) {
515 /***************************************************************************
517 **************************************************************************/
519 public ReferenceBase
getSec() {
520 return getCdmApp().getReferenceService().getReferenceByUuid(
521 UUID
.fromString("f3593c18-a8d2-4e51-bdad-0befbf8fb2d1"));
524 private Set
<Taxon
> sessionRootTaxa
;
526 * The taxonomic tree content provider observes this set for changes, and
527 * makes the appropriate changes to the tree.
529 private IObservableSet observableSessionTaxonSet
;
531 * This map of taxa to their taxonomic children is used by
532 * NameTreeContentProvider's getChildren method.
534 * key = taxon, value = key's child taxa Note that a map can have a key ==
535 * null, i.e. no parent taxon
537 private HashMap
<Taxon
, Set
<Taxon
>> sessionTaxonomicChildrenMap
;
539 public Set
<Taxon
> getSessionRootTaxa() {
540 if (sessionRootTaxa
== null) {
542 sessionRootTaxa
= new HashSet
<Taxon
>();
543 // sessionRootTaxa.addAll(getCdmApp().getTaxonService().getRootTaxa(
544 // getSec(), null, false));
545 sessionRootTaxa
.addAll(getCdmApp().getTaxonService().getRootTaxa(
546 getSec(), null, true));
547 addSessionTaxa(sessionRootTaxa
);
550 return sessionRootTaxa
;
553 private Map
<Taxon
, Set
<Taxon
>> getTaxonomicChildrenMap() {
554 if (sessionTaxonomicChildrenMap
== null) {
555 sessionTaxonomicChildrenMap
= new HashMap
<Taxon
, Set
<Taxon
>>();
557 return sessionTaxonomicChildrenMap
;
561 * Returns a set of any child taxa for this taxon that have already been
562 * requested during this session.
567 public Set
<Taxon
> getSessionTaxonomicChildren(Taxon parentTaxon
) {
568 if (!getTaxonomicChildrenMap().containsKey(parentTaxon
)) {
569 if (parentTaxon
== null) {
570 getTaxonomicChildrenMap().put(parentTaxon
, getSessionRootTaxa());
573 // BUG deleted taxon were re-appearing as NULL children
574 Set
<Taxon
> childTaxa
= new HashSet
<Taxon
>();
576 // TransactionStatus tx = getCdmApp().startTransaction();
577 // getCdmApp().getTaxonService().saveTaxon(parentTaxon);
578 for (Taxon taxon
: parentTaxon
.getTaxonomicChildren()) {
580 childTaxa
.add(taxon
);
583 // getCdmApp().commitTransaction(tx);
585 getTaxonomicChildrenMap().put(parentTaxon
, childTaxa
);
588 return getTaxonomicChildrenMap().get(parentTaxon
);
594 public IObservableSet
getObservableSessionTaxa() {
595 if (observableSessionTaxonSet
== null) {
596 Realm realm
= SWTObservables
.getRealm(Display
.getDefault());
597 observableSessionTaxonSet
= new WritableSet(realm
);
599 return observableSessionTaxonSet
;
603 * Recursive function to clear the hashmap of a taxon's children used in
604 * this session, and the childrens' children, etc.
608 private void clearTaxonomicChildren(Taxon taxon
) {
609 Set
<Taxon
> children
= getSessionTaxonomicChildren(taxon
);
610 if (children
!= null) {
611 for (Taxon child
: children
) {
612 clearTaxonomicChildren(child
);
614 getTaxonomicChildrenMap().remove(taxon
);
615 getObservableSessionTaxa().removeAll(children
);
620 * Remove taxon from all session collections
624 public void removeSessionTaxon(Taxon taxon
) {
626 // Recursively remove all children, children's children, etc.
627 clearTaxonomicChildren(taxon
);
629 Taxon parentTaxon
= taxon
.getTaxonomicParent();
631 // Remove from parent's child map, or from root taxa
632 if (parentTaxon
== null) {
633 getSessionRootTaxa().remove(taxon
);
635 getSessionTaxonomicChildren(parentTaxon
).remove(taxon
);
638 // Remove from session taxa
639 getObservableSessionTaxa().remove(taxon
);
641 UiUtil
.getTreeViewer().remove(taxon
);
644 public void addSessionTaxa(Collection
<Taxon
> taxa
) {
645 for (Taxon taxon
: taxa
) {
646 addSessionTaxon(taxon
);
651 * Whenever a taxon is opened, either for editing or for display in the
652 * taxonomic tree, it should be added to the collections of taxa used during
657 public void addSessionTaxon(Taxon taxon
) {
659 // Add taxon to session taxa if not already there
660 if (!(getObservableSessionTaxa().contains(taxon
))) {
661 getObservableSessionTaxa().add(taxon
);
664 Taxon parentTaxon
= taxon
.getTaxonomicParent();
666 // If taxon has no parent, add it to root taxa
667 if (parentTaxon
== null) {
668 if (!(getSessionRootTaxa().contains(taxon
))) {
669 getSessionRootTaxa().add(taxon
);
673 // Add taxon to its parent's child map
674 getSessionTaxonomicChildren(parentTaxon
).add(taxon
);
676 TaxonomicTreeViewer viewer
= UiUtil
.getTreeViewer();
678 if (viewer
!= null) {
680 if (parentTaxon
== null) {
681 viewer
.setInput(getSessionRootTaxa());
683 viewer
.add(parentTaxon
, taxon
);
690 // private TaxonomicTreeView taxonomicTreeView;
692 // public void setTaxonomicTree(TaxonomicTreeView taxonomicTreeView) {
693 // this.taxonomicTreeView = taxonomicTreeView;
696 /***************************************************************************
698 **************************************************************************/
699 OrderedTermVocabulary
<Rank
> rankVocabulary
= null;
701 public OrderedTermVocabulary
<Rank
> getRankVocabulary() {
702 if (rankVocabulary
== null) {
703 rankVocabulary
= getCdmApp().getNameService().getRankVocabulary();
705 return rankVocabulary
;
708 /***************************************************************************
709 * NOMENCLATURAL STATUS
710 **************************************************************************/
711 TermVocabulary
<NomenclaturalStatusType
> nomStatusVocabulary
= null;
713 public TermVocabulary
<NomenclaturalStatusType
> getNomStatusVocabulary() {
714 if (nomStatusVocabulary
== null) {
715 nomStatusVocabulary
= getCdmApp().getNameService()
716 .getStatusTypeVocabulary();
718 return nomStatusVocabulary
;
721 /***************************************************************************
723 **************************************************************************/
724 TermVocabulary
<NameRelationshipType
> nameRelationshipTypeVocabulary
= null;
726 public TermVocabulary
<NameRelationshipType
> getNameRelationshipTypeVocabulary() {
727 if (nameRelationshipTypeVocabulary
== null) {
728 nameRelationshipTypeVocabulary
= getCdmApp().getNameService()
729 .getNameRelationshipTypeVocabulary();
731 return nameRelationshipTypeVocabulary
;
734 public Set
<NameRelationshipType
> getSortedNameRelationshipTypes() {
735 return getNameRelationshipTypeVocabulary().getTermsOrderedByLabels(
739 /***************************************************************************
741 **************************************************************************/
742 private Taxon
getSorayasGenusTaxon() {
744 String
[] children
= new String
[] {
745 "Heterospathe annectens H.E.Moore",
746 "Heterospathe arfakiana (Becc.) H.E.Moore",
747 "Heterospathe brevicaulis Fernando",
748 "Heterospathe cagayanensis Becc.",
749 "Heterospathe califrons Fernando, Palms 45: 118 (2001).",
750 "Heterospathe clemensiae (Burret) H.E.Moore",
751 "Heterospathe delicatula H.E.Moore",
752 "Heterospathe dransfieldii Fernando",
753 "Heterospathe elata Scheff.",
754 "Heterospathe elata var. elata.",
755 "Heterospathe elata var. guamensis Becc.",
756 "Heterospathe elata var. palauensis (Becc.) Becc.",
757 "Heterospathe elegans (Becc.) Becc.",
758 "Heterospathe elmeri Becc.",
759 "Heterospathe glabra (Burret) H.E.Moore",
760 "Heterospathe glauca (Scheff.) H.E.Moore",
761 "Heterospathe humilis Becc.",
762 "Heterospathe intermedia (Becc.) Fernando",
763 "Heterospathe kajewskii Burret",
764 "Heterospathe ledermanniana Becc.",
765 "Heterospathe lepidota H.E.Moore",
766 "Heterospathe longipes (H.E.Moore) Norup",
767 "Heterospathe macgregorii (Becc.) H.E.Moore",
768 "Heterospathe micrantha (Becc.) H.E.Moore",
769 "Heterospathe minor Burret",
770 "Heterospathe muelleriana (Becc.) Becc.",
771 "Heterospathe negrosensis Becc.",
772 "Heterospathe obriensis (Becc.) H.E.Moore",
773 "Heterospathe palauensis Becc.",
774 "Heterospathe parviflora Essig",
775 "Heterospathe philippinensis (Becc.) Becc.",
776 // "Heterospathe phillipsii D.Fuller & Dowe", // <--------------
777 "Heterospathe pilosa (Burret) Burret",
778 "Heterospathe pisifera (Gaertn.) Burret",
779 "Heterospathe pulchra H.E.Moore",
780 "Heterospathe ramulosa Burret",
781 "Heterospathe salomonensis Becc.",
782 "Heterospathe scitula Fernando", "Heterospathe sensisi Becc.",
783 "Heterospathe sibuyanensis Becc.",
784 "Heterospathe sphaerocarpa Burret",
785 "Heterospathe trispatha Fernando",
786 "Heterospathe uniformis Dowe",
787 "Heterospathe versteegiana Becc.",
788 "Heterospathe woodfordiana Becc." };
790 BotanicalName genusName
= BotanicalName
791 .PARSED_NAME("Heterospathe Scheff.");
793 Taxon genusTaxon
= Taxon
.NewInstance(genusName
, CdmUtil
794 .getSessionDefaultSec());
796 for (String child
: children
) {
797 BotanicalName speciesName
= BotanicalName
.PARSED_NAME(child
);
799 Taxon childTaxon
= Taxon
.NewInstance(speciesName
, CdmUtil
800 .getSessionDefaultSec());
801 childTaxon
.setTaxonomicParent(genusTaxon
, null, null);
803 if (child
.equals("Heterospathe elegans (Becc.) Becc.")) {
804 BotanicalName basionym
= BotanicalName
805 .PARSED_NAME("Barkerwebbia elegans Becc.");
806 speciesName
.addRelationshipFromName(basionym
,
807 NameRelationshipType
.BASIONYM(), null);
808 childTaxon
.addHomotypicSynonymName(basionym
, null, null);
811 if (child
.equals("Heterospathe humilis Becc.")) {
812 BotanicalName synonymName
= BotanicalName
813 .PARSED_NAME("Barkerwebbia humilis (Becc.) Becc. ex Martelli");
814 childTaxon
.addHomotypicSynonymName(synonymName
, null, null);
821 /***************************************************************************
823 **************************************************************************/
825 private Tree propertySheetTree
;
827 public void setPropertySheetTree(Tree tree
) {
828 this.propertySheetTree
= tree
;
831 public Tree
getPropertySheetTree() {
832 return propertySheetTree
;
835 private PropertySheetPage propertySheetPage
;
837 public void setPropertySheetPage(PropertySheetPage page
) {
838 this.propertySheetPage
= page
;
841 public PropertySheetPage
getPropertySheetPage() {
842 return propertySheetPage
;