Project

General

Profile

Download (1.32 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.IOccurrenceService;
14
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
15
import eu.etaxonomy.taxeditor.store.CdmStore;
16

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

    
26
	/* (non-Javadoc)
27
	 * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#createNewEntity()
28
	 */
29
	/** {@inheritDoc} */
30
	@Override
31
	protected FieldUnit createNewEntity() {
32
		return null;
33
	}
34

    
35
	/* (non-Javadoc)
36
	 * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#saveEntity()
37
	 */
38
	/** {@inheritDoc} */
39
	@Override
40
	protected void saveEntity() {
41
	    if(CdmStore.getCurrentSessionManager().isRemoting()) {
42
	        CdmStore.getService(IOccurrenceService.class).merge(getEntity(), true);
43
	    } else {
44
	        CdmStore.getService(IOccurrenceService.class).save(getEntity());
45
	    }
46
	}
47

    
48
	@Override
49
	protected String getEntityName() {
50
		return "Field Unit";
51
	}
52
}
(9-9/23)