Project

General

Profile

Download (1.57 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.ICollectionService;
14
import eu.etaxonomy.cdm.model.occurrence.Collection;
15
import eu.etaxonomy.taxeditor.store.CdmStore;
16
import eu.etaxonomy.taxeditor.ui.section.occurrence.CollectionWizardPage;
17

    
18
/**
19
 * <p>NewCollectionWizard class.</p>
20
 *
21
 * @author n.hoffmann
22
 * @created Oct 13, 2010
23
 * @version 1.0
24
 */
25
public class NewCollectionWizard extends AbstractNewEntityWizard<Collection> {
26

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

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

    
46
	/* (non-Javadoc)
47
	 * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#createNewEntity()
48
	 */
49
	/** {@inheritDoc} */
50
	@Override
51
	protected Collection createNewEntity() {
52
		return Collection.NewInstance();
53
	}
54

    
55
	@Override
56
	protected String getEntityName() {
57
		return "Collection";
58
	}
59

    
60
}
(7-7/23)