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
<TeamOrPersonBase
> {
32 private static final Logger logger
= Logger
.getLogger(AgentCreator
.class);
35 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#createEntity(java.lang.String)
38 public TeamOrPersonBase
createEntity(String text
) {
40 logger
.error("FIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXME");
41 logger
.error("We can only create Persons at the moment. See #1820");
42 logger
.error("FIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXME");
43 return createEntity(Person
.class, text
);
47 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#createEntity(java.lang.Class, java.lang.String)
50 public TeamOrPersonBase
createEntity(Object key
, String text
) {
51 TeamOrPersonBase teamOrPerson
= null;
52 if (Team
.class.equals((key
))) {
53 teamOrPerson
= Team
.NewInstance();
55 if (Person
.class.equals((key
))) {
56 teamOrPerson
= Person
.NewInstance();
58 if (teamOrPerson
!= null) {
59 teamOrPerson
.setTitleCache(text
, true);
65 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#getClassLabelPairs()
68 * <p>getKeyLabelPairs</p>
70 * @return a {@link java.util.Map} object.
72 public Map
<Object
, String
> getKeyLabelPairs() {
73 Map
<Object
, String
> result
= new HashMap
<Object
, String
>();
74 result
.put(Team
.class, "Author Team");
75 result
.put(Person
.class, "Author");
80 public boolean savesEntity() {
81 // TODO Auto-generated method stub