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.editor.newWizard;
|
12
|
|
13
|
import org.apache.log4j.Logger;
|
14
|
|
15
|
import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
|
16
|
import eu.etaxonomy.cdm.model.occurrence.Specimen;
|
17
|
import eu.etaxonomy.taxeditor.section.occurrence.DerivedUnitFacadeWizardPage;
|
18
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
19
|
|
20
|
/**
|
21
|
* <p>NewDerivedUnitBaseWizard class.</p>
|
22
|
*
|
23
|
* @author n.hoffmann
|
24
|
* @created Jun 16, 2010
|
25
|
* @version 1.0
|
26
|
*/
|
27
|
public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<DerivedUnitBase> {
|
28
|
private static final Logger logger = Logger
|
29
|
.getLogger(NewDerivedUnitBaseWizard.class);
|
30
|
|
31
|
/** {@inheritDoc} */
|
32
|
@Override
|
33
|
public void addPages() {
|
34
|
addPage(new DerivedUnitFacadeWizardPage(formFactory, getConversationHolder(), entity));
|
35
|
}
|
36
|
|
37
|
/* (non-Javadoc)
|
38
|
* @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#createNewEntity()
|
39
|
*/
|
40
|
/** {@inheritDoc} */
|
41
|
@Override
|
42
|
protected DerivedUnitBase createNewEntity() {
|
43
|
// TODO we do want to create different derivates of DerivedUnitBase but go with specimen for testing
|
44
|
// at the moment
|
45
|
// FIXME add wizard page that handles the selection of derived unit type
|
46
|
return Specimen.NewInstance();
|
47
|
}
|
48
|
|
49
|
/* (non-Javadoc)
|
50
|
* @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#saveEntity()
|
51
|
*/
|
52
|
/** {@inheritDoc} */
|
53
|
@Override
|
54
|
protected void saveEntity() {
|
55
|
CdmStore.getOccurrenceService().saveOrUpdate(entity);
|
56
|
}
|
57
|
}
|