42070ebc2d77ed1a00b866a1bcefcedd2fcd4a22
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / config / TermDeletionConfigurator.java
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.api.service.config;
10
11 import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
12
13 import eu.etaxonomy.cdm.api.service.ITermService;
14
15 /**
16 * This class is used to configure term deletion.
17 *
18 * @see ITermService#delete(eu.etaxonomy.cdm.common.DefinedTermBase)
19 *
20 * @author a.mueller
21 * @since 09.11.2011
22 */
23 public class TermDeletionConfigurator extends DeleteConfiguratorBase {
24
25 private static final long serialVersionUID = 213038079829537335L;
26 @SuppressWarnings("unused")
27 private static final Logger logger = LogManager.getLogger(TermDeletionConfigurator.class);
28
29 private boolean deleteIncludedTerms = false;
30
31 private boolean deleteIncludedRelations = false;
32
33 private boolean deletePartOfRelations = true;
34
35 private boolean deleteGeneralizationOfRelations = false;
36
37 private boolean deleteKindOfRelations = true;
38
39 private boolean deleteMediaIfPossible = false;
40
41 // /**
42 // * If <code>true</code> all included terms are also deleted (recursivly).<BR>
43 // * Default value is <code>true</code>.
44 // */
45 // public boolean isDeleteIncludedTerms() {
46 // return deleteIncludedTerms;
47 // }
48 // public void setDeleteIncludedTerms(boolean deleteIncludedTerms) {
49 // this.deleteIncludedTerms = deleteIncludedTerms;
50 // }
51
52 /**
53 * If <code>true</code> included terms will be attached to the parent
54 * of <code>this</code> term. If <code>this</code> term has no parent, included terms
55 * will become top level terms. <BR>
56 * Default value is <code>false</code>.
57 */
58 public boolean isDeleteIncludedRelations() {
59 return deleteIncludedRelations;
60 }
61 public void setDeleteIncludedRelations(boolean deleteIncludedRelations) {
62 this.deleteIncludedRelations = deleteIncludedRelations;
63 }
64
65 /**
66 * If <code>true</code> <code>this</code> term will be detached from its parent
67 * term. If <code>false</code> the deletion will be aborted if <code>this</code>
68 * term is part of another term.<BR>
69 * Default value is <code>true</code>.
70 */
71 public boolean isDeletePartOfRelations() {
72 return deletePartOfRelations;
73 }
74 public void setDeletePartOfRelations(boolean deletePartOfRelations) {
75 this.deletePartOfRelations = deletePartOfRelations;
76 }
77
78 /**
79 * If <code>true</code> more specific terms will be detached from this term prior to
80 * deletion. If <code>this</code> term has a generalization itself the specific terms will be
81 * attached to this generalization.<BR>
82 * If <code>false</code> deletion will be aborted if <code>this</code>
83 * term is a generalization of any another term.
84 * <BR>
85 * Default value is <code>false</code>.
86 */
87 public boolean isDeleteGeneralizationOfRelations() {
88 return deleteGeneralizationOfRelations;
89 }
90 public void setDeleteGeneralizationOfRelations( boolean deleteGeneralizationOfRelations) {
91 this.deleteGeneralizationOfRelations = deleteGeneralizationOfRelations;
92 }
93
94 /**
95 * If <code>true</code> <code>this</code> term will be detached from the general term.
96 * If <code>false</code> the deletion will be aborted if <code>this</code>
97 * term is kind of another term.<BR>
98 * Default value is <code>true</code>.
99 */
100 public boolean isDeleteKindOfRelations() {
101 return deleteKindOfRelations;
102 }
103 public void setDeleteKindOfRelations(boolean deleteKindOfRelations) {
104 this.deleteKindOfRelations = deleteKindOfRelations;
105 }
106 }