3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.taxeditor
.bulkeditor
.input
.entitycreator
;
13 import java
.util
.HashMap
;
16 import org
.apache
.log4j
.Logger
;
18 import eu
.etaxonomy
.cdm
.model
.agent
.AgentBase
;
19 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
20 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
21 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
22 import eu
.etaxonomy
.taxeditor
.annotatedlineeditor
.IEntityCreator
;
25 * <p>TeamOrPersonCreator class.</p>
31 public class AgentCreator
implements IEntityCreator
<AgentBase
> {
32 private static final Logger logger
= Logger
33 .getLogger(AgentCreator
.class);
36 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#createEntity(java.lang.String)
39 public AgentBase
createEntity(String text
) {
41 logger
.error("FIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXME");
42 logger
.error("We can only create Persons at the moment. See #1820");
43 logger
.error("FIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXME");
44 return createEntity(Person
.class, text
);
48 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#createEntity(java.lang.Class, java.lang.String)
51 public AgentBase
createEntity(Object key
, String text
) {
52 TeamOrPersonBase teamOrPerson
= null;
53 if (Team
.class.equals(((Class
) key
))) {
54 teamOrPerson
= Team
.NewInstance();
56 if (Person
.class.equals(((Class
) key
))) {
57 teamOrPerson
= Person
.NewInstance();
59 if (teamOrPerson
!= null) {
60 teamOrPerson
.setTitleCache(text
);
66 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#getClassLabelPairs()
69 * <p>getKeyLabelPairs</p>
71 * @return a {@link java.util.Map} object.
73 public Map
<Object
, String
> getKeyLabelPairs() {
74 Map
<Object
, String
> result
= new HashMap
<Object
, String
>();
75 result
.put(Team
.class, "Author Team");
76 result
.put(Person
.class, "Author");