Merge branch 'release/4.11.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.bulkeditor / src / main / java / eu / etaxonomy / taxeditor / bulkeditor / input / NameRelationshipEditorInput.java
1 /**
2 * Copyright (C) 2007 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
10 package eu.etaxonomy.taxeditor.bulkeditor.input;
11
12 import java.util.Arrays;
13 import java.util.List;
14 import java.util.UUID;
15
16 import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
17 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
18 import eu.etaxonomy.cdm.model.name.NameRelationship;
19 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
20 import eu.etaxonomy.taxeditor.model.MessagingUtils;
21 import eu.etaxonomy.taxeditor.store.CdmStore;
22
23 /**
24 * <p>NameRelationshipEditorInput class.</p>
25 *
26 * @author n.hoffmann
27 * @created Oct 19, 2010
28 * @version 1.0
29 */
30 public class NameRelationshipEditorInput extends AbstractBulkEditorInput<NameRelationship> {
31
32 /**
33 *
34 */
35 private static final long serialVersionUID = -7453923697752787687L;
36
37 /** Constant <code>ID="bulkeditor.input.nameRelationship"</code> */
38 public static final String ID = "bulkeditor.input.nameRelationship";
39
40 private static NameRelationshipEditorInput instance;
41
42 /**
43 * <p>Getter for the field <code>instance</code>.</p>
44 *
45 * @return a {@link eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput} object.
46 */
47 public static AbstractBulkEditorInput<NameRelationship> getInstance(){
48 if(instance == null){
49 instance = new NameRelationshipEditorInput();
50 }
51 return instance;
52 }
53
54 @Override
55 public String getName() {
56 return BulkEditorInputType.NAME_RELATIONSHIP.label;
57 }
58
59 /* (non-Javadoc)
60 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#save(java.lang.Object)
61 */
62 /** {@inheritDoc} */
63 @Override
64 public NameRelationship save(NameRelationship entity) {
65 // TODO Auto-generated method stub
66 return null;
67 }
68
69 /* (non-Javadoc)
70 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#delete(java.lang.Object)
71 */
72 /** {@inheritDoc} */
73 @Override
74 public boolean delete(NameRelationship entity, DeleteConfiguratorBase config) {
75 // TODO Auto-generated method stub
76 return false;
77 }
78
79 /* (non-Javadoc)
80 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#listEntities(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
81 */
82 /** {@inheritDoc} */
83 @Override
84 protected List<NameRelationship> listEntities(
85 IIdentifiableEntityServiceConfigurator configurator) {
86 return CdmStore.getSearchManager().findNameRelationships(configurator);
87 }
88
89 /* (non-Javadoc)
90 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#loadEntity(java.util.UUID)
91 */
92 /** {@inheritDoc} */
93 @Override
94 protected NameRelationship loadEntity(UUID entityUuid) {
95 List<String> propertyPaths = Arrays.asList(new String[]{});
96 return null; // CdmStore.getNameService().load(entityUuid, propertyPaths);
97 }
98
99 /* (non-Javadoc)
100 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#createEntityCreator()
101 */
102 @Override
103 protected IEntityCreator<NameRelationship> createEntityCreator() {
104 MessagingUtils.notImplementedMessage(getClass());
105 return null;
106 }
107
108 /* (non-Javadoc)
109 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getTypeText(java.lang.Object)
110 */
111 @Override
112 public String getTypeText(Object entity) {
113 if(entity instanceof NameRelationship){
114 return ((NameRelationship) entity).getType().getTitleCache();
115 }
116
117 return super.getTypeText(entity);
118 }
119
120 /* (non-Javadoc)
121 * @see eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput#merge()
122 */
123 @Override
124 public void merge() {
125
126 }
127
128 }