2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.taxeditor
.bulkeditor
.input
;
11 import java
.util
.ArrayList
;
12 import java
.util
.Arrays
;
13 import java
.util
.List
;
14 import java
.util
.UUID
;
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
;
25 * @created Oct 19, 2010
27 public class NameRelationshipEditorInput
extends AbstractBulkEditorInput
<NameRelationship
> {
29 public static final String ID
= "bulkeditor.input.nameRelationship";
31 private static NameRelationshipEditorInput instance
;
33 public static AbstractBulkEditorInput
<NameRelationship
> getInstance(){
35 instance
= new NameRelationshipEditorInput();
41 protected List
<String
> getPropertyKeys_internal() {
42 List
<String
> propertyKeysInternal
= new ArrayList
<>();
43 return propertyKeysInternal
;
47 public String
getName() {
48 return BulkEditorInputType
.NAME_RELATIONSHIP
.label
;
52 public NameRelationship
save(NameRelationship entity
) {
53 // TODO Auto-generated method stub
58 public boolean delete(NameRelationship entity
, DeleteConfiguratorBase config
) {
59 // TODO Auto-generated method stub
64 protected long countEntities(IIdentifiableEntityServiceConfigurator configurator
) {
65 //TODO there is neither a service for name relationships nor any concrete
66 //method for counting them
67 return CdmStore
.getCommonService().count(NameRelationship
.class);
71 protected List
<NameRelationship
> listEntities(
72 IIdentifiableEntityServiceConfigurator configurator
) {
73 return CdmStore
.getSearchManager().findNameRelationships(configurator
);
77 protected NameRelationship
loadEntity(UUID entityUuid
) {
78 List
<String
> propertyPaths
= Arrays
.asList(new String
[]{});
79 return null; // CdmStore.getNameService().load(entityUuid, propertyPaths);
83 protected IEntityCreator
<NameRelationship
> createEntityCreator() {
84 MessagingUtils
.notImplementedMessage(getClass());
89 public String
getTypeText(Object entity
) {
90 if(entity
instanceof NameRelationship
){
91 return ((NameRelationship
) entity
).getType().getTitleCache();
94 return super.getTypeText(entity
);