KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > applications > managementtool > actions > CreateSystemUserAction


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4  *
5  * ===============================================================================
6  *
7  * Copyright (C)
8  *
9  * This program is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License version 2, as published by the
11  * Free Software Foundation. See the file LICENSE.html for more information.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20  *
21  * ===============================================================================
22  */

23
24 package org.infoglue.cms.applications.managementtool.actions;
25
26 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction;
27 import org.infoglue.cms.controllers.kernel.impl.simple.UserControllerProxy;
28 import org.infoglue.cms.entities.management.SystemUserVO;
29 import org.infoglue.cms.security.InfoGluePrincipal;
30 import org.infoglue.cms.util.ConstraintExceptionBuffer;
31
32
33 /**
34  * This class represents the create user action
35  *
36  * @author Mattias Bogeblad
37  */

38
39
40 public class CreateSystemUserAction extends InfoGlueAbstractAction
41 {
42     private static final long serialVersionUID = 1L;
43     
44     private ConstraintExceptionBuffer ceb;
45     private SystemUserVO systemUserVO;
46     private InfoGluePrincipal infoGluePrincipal;
47     //private java.lang.Integer systemUserId;
48
/*private java.lang.String userName;
49     private java.lang.String password;
50     private java.lang.String firstName;
51     private java.lang.String lastName;
52     private java.lang.String email;*/

53
54
55     public CreateSystemUserAction()
56     {
57         this(new SystemUserVO());
58     }
59     
60     public CreateSystemUserAction(SystemUserVO systemUserVO)
61     {
62         this.systemUserVO = systemUserVO;
63         this.ceb = new ConstraintExceptionBuffer();
64     }
65     
66     public String JavaDoc doInput() throws Exception JavaDoc
67     {
68         return "input";
69     }
70     
71     protected String JavaDoc doExecute() throws Exception JavaDoc
72     {
73         ceb = this.systemUserVO.validate();
74         ceb.throwIfNotEmpty();
75         
76         this.infoGluePrincipal = UserControllerProxy.getController().createUser(this.systemUserVO);
77
78         return "success";
79     }
80     
81     public void setuserName(String JavaDoc userName)
82     {
83         this.systemUserVO.setUserName(userName);
84     }
85
86     public String JavaDoc getUserName()
87     {
88         return this.systemUserVO.getUserName();
89     }
90         
91     public java.lang.String JavaDoc getFirstName()
92     {
93         return this.systemUserVO.getFirstName();
94     }
95         
96     public void setFirstName(java.lang.String JavaDoc firstName)
97     {
98         this.systemUserVO.setFirstName(firstName);
99     }
100
101     public java.lang.String JavaDoc getLastName()
102     {
103         return this.systemUserVO.getLastName();
104     }
105         
106     public void setLastName(java.lang.String JavaDoc lastName)
107     {
108         this.systemUserVO.setLastName(lastName);
109     }
110     
111     public java.lang.String JavaDoc getEmail()
112     {
113         return this.systemUserVO.getEmail();
114     }
115     
116     public void setEmail(java.lang.String JavaDoc email)
117     {
118         this.systemUserVO.setEmail(email);
119     }
120     
121     public java.lang.String JavaDoc getPassword()
122     {
123         return this.systemUserVO.getPassword();
124     }
125     
126     public void setPassword(java.lang.String JavaDoc password)
127     {
128         this.systemUserVO.setPassword(password);
129     }
130     
131 }
132
Popular Tags