Project

General

Profile

Download (1.29 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
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.
9
*/
10

    
11
package eu.etaxonomy.taxeditor.newWizard;
12

    
13
import eu.etaxonomy.cdm.api.service.IAgentService;
14
import eu.etaxonomy.cdm.model.agent.Person;
15
import eu.etaxonomy.taxeditor.store.CdmStore;
16
import eu.etaxonomy.taxeditor.ui.section.agent.PersonWizardPage;
17

    
18
/**
19
 * <p>NewPersonWizard class.</p>
20
 *
21
 * @author n.hoffmann
22
 * @created Jun 1, 2010
23
 * @version 1.0
24
 */
25
public class NewPersonWizard extends AbstractNewEntityWizard<Person> {
26

    
27
	/** {@inheritDoc} */
28
	@Override
29
	public void addPages() {
30
		addPage(new PersonWizardPage(formFactory, getConversationHolder(), getEntity()));
31
	}
32

    
33
	/** {@inheritDoc} */
34
	@Override
35
	protected Person createNewEntity() {
36
		return Person.NewTitledInstance("");
37
	}
38

    
39
	/** {@inheritDoc} */
40
	@Override
41
	protected void saveEntity() {
42
	    if(CdmStore.getCurrentSessionManager().isRemoting()) {
43
	        CdmStore.getService(IAgentService.class).merge(getEntity(), true);
44
	    } else {
45
	        CdmStore.getService(IAgentService.class).save(getEntity());
46
	    }
47
	}
48

    
49
	@Override
50
	protected String getEntityName() {
51
		return "Person";
52
	}
53
}
(14-14/23)