KickJava   Java API By Example, From Geeks To Geeks.

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


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.InterceptionPointController;
28 import org.infoglue.cms.entities.management.InterceptionPointVO;
29 import org.infoglue.cms.util.ConstraintExceptionBuffer;
30
31 /**
32  * This action represents the Create InterceptionPoint Usecase.
33  */

34
35 public class CreateInterceptionPointAction extends InfoGlueAbstractAction
36 {
37     private ConstraintExceptionBuffer ceb;
38     private InterceptionPointVO interceptionPointVO;
39   
40   
41     public CreateInterceptionPointAction()
42     {
43         this(new InterceptionPointVO());
44     }
45     
46     public CreateInterceptionPointAction(InterceptionPointVO interceptionPointVO)
47     {
48         this.interceptionPointVO = interceptionPointVO;
49         this.ceb = new ConstraintExceptionBuffer();
50             
51     }
52           
53     public String JavaDoc doExecute() throws Exception JavaDoc
54     {
55         ceb.add(this.interceptionPointVO.validate());
56         ceb.throwIfNotEmpty();
57         
58         this.interceptionPointVO = InterceptionPointController.getController().create(interceptionPointVO);
59         
60         return "success";
61     }
62
63     public String JavaDoc doInput() throws Exception JavaDoc
64     {
65         return "input";
66     }
67
68     /**
69      * @return Returns the InterceptionPointId if it's been created.
70      */

71     
72     public Integer JavaDoc getInterceptionPointId()
73     {
74         return this.interceptionPointVO.getInterceptionPointId();
75     }
76
77     /**
78      * @return Returns the category.
79      */

80     
81     public String JavaDoc getCategory()
82     {
83         return interceptionPointVO.getCategory();
84     }
85     
86     /**
87      * @param category The category to set.
88      */

89     public void setCategory(String JavaDoc category)
90     {
91         this.interceptionPointVO.setCategory(category);
92     }
93     
94     /**
95      * @return Returns the description.
96      */

97     
98     public String JavaDoc getDescription()
99     {
100         return this.interceptionPointVO.getDescription();
101     }
102     
103     /**
104      * @param description The description to set.
105      */

106     
107     public void setDescription(String JavaDoc description)
108     {
109         this.interceptionPointVO.setDescription(description);
110     }
111     
112     /**
113      * @return Returns the name.
114      */

115     
116     public String JavaDoc getName()
117     {
118         return this.interceptionPointVO.getName();
119     }
120     
121     /**
122      * @param name The name to set.
123      */

124     
125     public void setName(String JavaDoc name)
126     {
127         this.interceptionPointVO.setName(name);
128     }
129     
130     /**
131      * @return Returns the usesExtraDataForAccessControl.
132      */

133     
134     public Boolean JavaDoc getUsesExtraDataForAccessControl()
135     {
136         return this.interceptionPointVO.getUsesExtraDataForAccessControl();
137     }
138     
139     /**
140      * @param usesExtraDataForAccessControl The usesExtraDataForAccessControl to set.
141      */

142     
143     public void setUsesExtraDataForAccessControl(Boolean JavaDoc usesExtraDataForAccessControl)
144     {
145         this.interceptionPointVO.setUsesExtraDataForAccessControl(usesExtraDataForAccessControl);
146     }
147 }
148
Popular Tags