1 |
dd7f4987
|
Katja Luther
|
/**
|
2 |
|
|
* Copyright (C) 2009 EDIT
|
3 |
c7dae22d
|
Katja Luther
|
* European Distributed Institute of Taxonomy
|
4 |
dd7f4987
|
Katja Luther
|
* http://www.e-taxonomy.eu
|
5 |
c7dae22d
|
Katja Luther
|
*
|
6 |
dd7f4987
|
Katja Luther
|
* 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 |
68788da9
|
Katja Luther
|
package eu.etaxonomy.cdm.api.service.config;
|
10 |
|
|
|
11 |
c7dae22d
|
Katja Luther
|
import eu.etaxonomy.cdm.api.service.ITaxonService;
|
12 |
|
|
|
13 |
dd7f4987
|
Katja Luther
|
/**
|
14 |
|
|
* This class is used to configure taxonbase deletion.
|
15 |
c7dae22d
|
Katja Luther
|
*
|
16 |
|
|
* @see ITaxonService#deleteTaxon(eu.etaxonomy.cdm.model.taxon.Taxon) and ITaxonService#deleteSynonym(eu.etaxonomy.cdm.model.taxon.Synonym)
|
17 |
|
|
*
|
18 |
dd7f4987
|
Katja Luther
|
* @author k.luther
|
19 |
53db84af
|
Andreas Müller
|
* @since 09.11.2011
|
20 |
dd7f4987
|
Katja Luther
|
*
|
21 |
|
|
*/
|
22 |
68788da9
|
Katja Luther
|
public class TaxonBaseDeletionConfigurator extends DeleteConfiguratorBase{
|
23 |
|
|
|
24 |
|
|
private boolean deleteNameIfPossible = true;
|
25 |
c7dae22d
|
Katja Luther
|
private boolean deleteSynonymRelations = true;
|
26 |
|
|
|
27 |
68788da9
|
Katja Luther
|
private NameDeletionConfigurator nameDeletionConfig = new NameDeletionConfigurator();
|
28 |
c7dae22d
|
Katja Luther
|
|
29 |
68788da9
|
Katja Luther
|
/**
|
30 |
|
|
* If true the taxons name will be deleted if this is possible.
|
31 |
|
|
* It is possible if the name is not linked in a way that it can not be deleted.
|
32 |
|
|
* This depends also on the {@link NameDeletionConfigurator}
|
33 |
|
|
* @see #getNameDeletionConfig()
|
34 |
|
|
* @return
|
35 |
|
|
*/
|
36 |
|
|
public boolean isDeleteNameIfPossible() {
|
37 |
|
|
return deleteNameIfPossible;
|
38 |
|
|
}
|
39 |
|
|
|
40 |
|
|
public void setDeleteNameIfPossible(boolean deleteNameIfPossible) {
|
41 |
|
|
this.deleteNameIfPossible = deleteNameIfPossible;
|
42 |
|
|
}
|
43 |
c7dae22d
|
Katja Luther
|
|
44 |
68788da9
|
Katja Luther
|
/**
|
45 |
|
|
* The configurator for name deletion. Only evaluated if {@link #isDeleteNameIfPossible()}
|
46 |
|
|
* is <code>true</code>.
|
47 |
|
|
* @see NameDeletionConfigurator
|
48 |
|
|
* @see #isDeleteNameIfPossible()
|
49 |
|
|
* @see #isDeleteSynonymsIfPossible()
|
50 |
|
|
* @return
|
51 |
|
|
*/
|
52 |
|
|
public NameDeletionConfigurator getNameDeletionConfig() {
|
53 |
|
|
return nameDeletionConfig;
|
54 |
|
|
}
|
55 |
|
|
|
56 |
|
|
public void setNameDeletionConfig(NameDeletionConfigurator nameDeletionConfig) {
|
57 |
|
|
this.nameDeletionConfig = nameDeletionConfig;
|
58 |
|
|
}
|
59 |
c7dae22d
|
Katja Luther
|
|
60 |
|
|
/**
|
61 |
|
|
*
|
62 |
fbeefcaf
|
Andreas Müller
|
* If <code>true</code> all Synonym relations from taxon to synonyms will be
|
63 |
c7dae22d
|
Katja Luther
|
* removed.
|
64 |
|
|
* Synonyms itself will be removed depending on {@link #deleteSynonymsIfPossible}.
|
65 |
|
|
* @return
|
66 |
|
|
*/
|
67 |
|
|
public boolean isDeleteSynonymRelations() {
|
68 |
|
|
return deleteSynonymRelations;
|
69 |
|
|
}
|
70 |
|
|
|
71 |
|
|
/**
|
72 |
|
|
* @param deleteSynonymRelations the deleteSynonymRelations to set
|
73 |
|
|
*/
|
74 |
|
|
public void setDeleteSynonymRelations(boolean deleteSynonymRelations) {
|
75 |
|
|
this.deleteSynonymRelations = deleteSynonymRelations;
|
76 |
|
|
}
|
77 |
68788da9
|
Katja Luther
|
}
|