Merge branch 'develop' into LibrAlign
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / newWizard / NewCollectionWizard.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.taxeditor.newWizard;
11
12 import eu.etaxonomy.cdm.api.service.ICollectionService;
13 import eu.etaxonomy.cdm.model.occurrence.Collection;
14 import eu.etaxonomy.taxeditor.store.CdmStore;
15 import eu.etaxonomy.taxeditor.ui.section.occurrence.CollectionWizardPage;
16
17 /**
18 * <p>NewCollectionWizard class.</p>
19 *
20 * @author n.hoffmann
21 * @created Oct 13, 2010
22 * @version 1.0
23 */
24 public class NewCollectionWizard extends AbstractNewEntityWizard<Collection> {
25
26 /** {@inheritDoc} */
27 @Override
28 public void addPages() {
29 addPage(new CollectionWizardPage(formFactory, getConversationHolder(), getEntity()));
30 }
31
32 /* (non-Javadoc)
33 * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#saveEntity()
34 */
35 /** {@inheritDoc} */
36 @Override
37 protected void saveEntity() {
38 CdmStore.getService(ICollectionService.class).merge(getEntity(), true);
39
40 }
41
42 /* (non-Javadoc)
43 * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#createNewEntity()
44 */
45 /** {@inheritDoc} */
46 @Override
47 protected Collection createNewEntity() {
48 return Collection.NewInstance();
49 }
50
51 @Override
52 protected String getEntityName() {
53 return "Collection";
54 }
55
56 }