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.
10 package eu
.etaxonomy
.taxeditor
.bulkeditor
.input
.entitycreator
;
12 import java
.util
.HashMap
;
15 import org
.apache
.log4j
.Logger
;
17 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
18 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
19 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
20 import eu
.etaxonomy
.taxeditor
.annotatedlineeditor
.IEntityCreator
;
23 * <p>TeamOrPersonCreator class.</p>
29 public class AgentCreator
implements IEntityCreator
<TeamOrPersonBase
> {
30 private static final Logger logger
= Logger
.getLogger(AgentCreator
.class);
34 public TeamOrPersonBase
createEntity(String text
) {
36 logger
.error("FIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXME");
37 logger
.error("We can only create Persons at the moment. See #1820");
38 logger
.error("FIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXME");
39 return createEntity(Person
.class, text
);
43 public TeamOrPersonBase
createEntity(Object key
, String text
) {
44 TeamOrPersonBase teamOrPerson
= null;
45 if (Team
.class.equals((key
))) {
46 teamOrPerson
= Team
.NewInstance();
48 if (Person
.class.equals((key
))) {
49 teamOrPerson
= Person
.NewInstance();
51 if (teamOrPerson
!= null) {
52 teamOrPerson
.setTitleCache(text
, true);
58 * <p>getKeyLabelPairs</p>
60 * @return a {@link java.util.Map} object.
62 public Map
<Object
, String
> getKeyLabelPairs() {
63 Map
<Object
, String
> result
= new HashMap
<Object
, String
>();
64 result
.put(Team
.class, "Team");
65 result
.put(Person
.class, "Person");
70 public boolean savesEntity() {
71 // TODO Auto-generated method stub