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