KickJava   Java API By Example, From Geeks To Geeks.

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


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.GroupControllerProxy;
28 import org.infoglue.cms.entities.management.GroupVO;
29 import org.infoglue.cms.security.InfoGlueGroup;
30 import org.infoglue.cms.util.ConstraintExceptionBuffer;
31
32
33 /**
34  * @author mgu
35  *
36  * To change this generated comment edit the template variable "typecomment":
37  * Window>Preferences>Java>Templates.
38  * To enable and disable the creation of type comments go to
39  * Window>Preferences>Java>Code Generation.
40  */

41
42
43 public class CreateGroupAction extends InfoGlueAbstractAction
44 {
45     private GroupVO groupVO;
46     private InfoGlueGroup infoGlueGroup;
47     private ConstraintExceptionBuffer ceb;
48
49     public CreateGroupAction()
50     {
51         this(new GroupVO());
52     }
53
54     public CreateGroupAction(GroupVO GroupVO)
55     {
56         this.groupVO = GroupVO;
57         this.ceb = new ConstraintExceptionBuffer();
58     }
59         
60     public String JavaDoc doInput() throws Exception JavaDoc
61     {
62         return "input";
63     }
64     
65     protected String JavaDoc doExecute() throws Exception JavaDoc
66     {
67         ceb.add(this.groupVO.validate());
68         ceb.throwIfNotEmpty();
69                     
70         this.infoGlueGroup = GroupControllerProxy.getController().createGroup(this.groupVO);
71         
72         return "success";
73     }
74     
75     public void setGroupName(String JavaDoc groupName)
76     {
77         this.groupVO.setGroupName(groupName);
78     }
79
80     public String JavaDoc getGroupName()
81     {
82         return this.groupVO.getGroupName();
83     }
84     
85     public void setDescription(java.lang.String JavaDoc description)
86     {
87         this.groupVO.setDescription(description);
88     }
89
90     public String JavaDoc getDescription()
91     {
92         return this.groupVO.getDescription();
93     }
94     
95
96
97 }
98
Popular Tags