Project

General

Profile

Download (993 Bytes) Statistics
| Branch: | Tag: | Revision:
1
/**
2
 *
3
 */
4
package eu.etaxonomy.taxeditor.newWizard;
5

    
6
import eu.etaxonomy.cdm.api.service.IUserService;
7
import eu.etaxonomy.cdm.model.common.User;
8
import eu.etaxonomy.taxeditor.store.CdmStore;
9
import eu.etaxonomy.taxeditor.ui.section.user.UserDetailWizardPage;
10

    
11
/**
12
 * @author n.hoffmann
13
 *
14
 */
15
public class NewUserWizard extends AbstractNewEntityWizard<User> {
16

    
17
	private UserDetailWizardPage userPage;
18

    
19
	@Override
20
	public void addPages() {
21
		userPage = new UserDetailWizardPage(formFactory, getConversationHolder(), getEntity());
22
		addPage(userPage);
23
	}
24

    
25
	@Override
26
	protected void saveEntity() {
27
	    if(CdmStore.getCurrentSessionManager().isRemoting()) {
28
	        CdmStore.getService(IUserService.class).merge(getEntity(), true);
29
	    } else {
30
	        CdmStore.getService(IUserService.class).save(getEntity());
31
	    }
32
	}
33

    
34
	@Override
35
	protected User createNewEntity() {
36
		return User.NewInstance(null, null);
37
	}
38

    
39
	@Override
40
	protected String getEntityName() {
41
		return "Institution";
42
	}
43

    
44
}
(21-21/23)