4 package eu
.etaxonomy
.taxeditor
.newWizard
;
6 import eu
.etaxonomy
.cdm
.api
.service
.IPolytomousKeyService
;
7 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKey
;
8 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
14 public class NewPolytomousKeyWizard
extends AbstractNewEntityWizard
<PolytomousKey
> {
16 private PolytomousKeyWizardPage polytomousKeyPage
;
19 public void addPages() {
20 polytomousKeyPage
= new PolytomousKeyWizardPage(formFactory
, getConversationHolder(), getEntity());
21 super.addPage(polytomousKeyPage
);
24 public String
getPolytomousKeyName() {
25 return polytomousKeyPage
.getPolytomousKeyName();
29 * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#saveEntity()
32 protected void saveEntity() {
33 if(!polytomousKeyPage
.getPolytomousKeyName().equals("")) {
34 if(CdmStore
.getCurrentSessionManager().isRemoting()) {
35 CdmStore
.getService(IPolytomousKeyService
.class).merge(getEntity(), true);
37 CdmStore
.getService(IPolytomousKeyService
.class).save(getEntity());
43 * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#createNewEntity()
46 protected PolytomousKey
createNewEntity() {
47 PolytomousKey pkey
= PolytomousKey
.NewInstance();
48 pkey
.setTitleCache("");
53 protected String
getEntityName() {
54 return "Polytomous Key";