Merging r13268 through r14040 from trunk/cdmlib into branches/cdmlib-unitils3
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / config / TermDeletionConfigurator.java
1 // $Id$
2 /**
3 * Copyright (C) 2009 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10 package eu.etaxonomy.cdm.api.service.config;
11
12 import org.apache.log4j.Logger;
13
14 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
15
16 /**
17 * This class is used to configure taxon node deletion.
18 *
19 * @see ITaxonNodeService#delete(eu.etaxonomy.cdm.model.taxon.TaxonNode)
20 *
21 * @author a.mueller
22 * @date 09.11.2011
23 *
24 */
25 public class TermDeletionConfigurator extends DeleteConfiguratorBase {
26 @SuppressWarnings("unused")
27 private static final Logger logger = Logger.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 /**
80 * If <code>true</code> more specific terms will be detached from this term prior to
81 * deletion. If <code>this</code> term has a generalization itself the specific terms will be
82 * attached to this generalization.<BR>
83 * If <code>false</code> deletion will be aborted if <code>this</code>
84 * term is a generalization of any another term.
85 * <BR>
86 * Default value is <code>false</code>.
87 */
88 public boolean isDeleteGeneralizationOfRelations() {
89 return deleteGeneralizationOfRelations;
90 }
91 public void setDeleteGeneralizationOfRelations( boolean deleteGeneralizationOfRelations) {
92 this.deleteGeneralizationOfRelations = deleteGeneralizationOfRelations;
93 }
94
95 /**
96 * If <code>true</code> <code>this</code> term will be detached from the general term.
97 * If <code>false</code> the deletion will be aborted if <code>this</code>
98 * term is kind of another term.<BR>
99 * Default value is <code>true</code>.
100 */
101 public boolean isDeleteKindOfRelations() {
102 return deleteKindOfRelations;
103 }
104 public void setDeleteKindOfRelations(boolean deleteKindOfRelations) {
105 this.deleteKindOfRelations = deleteKindOfRelations;
106 }
107
108 }