KickJava   Java API By Example, From Geeks To Geeks.

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


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.AvailableServiceBindingController;
28 import org.infoglue.cms.entities.management.AvailableServiceBindingVO;
29 import org.infoglue.cms.exception.ConstraintException;
30 import org.infoglue.cms.util.ConstraintExceptionBuffer;
31
32 public class CreateAvailableServiceBindingAction extends InfoGlueAbstractAction
33 {
34     private static final long serialVersionUID = 1L;
35     
36     private AvailableServiceBindingVO availableServiceBindingVO;
37     private ConstraintExceptionBuffer ceb;
38     private String JavaDoc name;
39     private String JavaDoc description;
40     private String JavaDoc visualizationAction;
41     private Boolean JavaDoc isMandatory;
42     private Boolean JavaDoc isUserEditable;
43     private Boolean JavaDoc isInheritable;
44
45     
46     public CreateAvailableServiceBindingAction()
47     {
48         this(new AvailableServiceBindingVO());
49     }
50     
51     public CreateAvailableServiceBindingAction(AvailableServiceBindingVO availableServiceBindingVO)
52     {
53         this.availableServiceBindingVO = availableServiceBindingVO;
54         this.ceb = new ConstraintExceptionBuffer();
55             
56     }
57     public Integer JavaDoc getAvailableServiceBindingId()
58     {
59         return this.availableServiceBindingVO.getAvailableServiceBindingId();
60     }
61     public java.lang.String JavaDoc getName()
62     {
63         if(this.name != null)
64             return this.name;
65             
66         return this.availableServiceBindingVO.getName();
67     }
68         
69     public void setName(java.lang.String JavaDoc name)
70     {
71         try
72         {
73             this.availableServiceBindingVO.setName(name);
74         }
75         catch(ConstraintException ce)
76         {
77             this.name = name;
78             this.ceb.add(new ConstraintExceptionBuffer(ce));
79         }
80     }
81       
82
83     public String JavaDoc getDescription()
84     {
85         if(this.description != null)
86             return this.description;
87             
88         return this.availableServiceBindingVO.getDescription();
89     }
90         
91     public void setDescription(String JavaDoc description)
92     {
93         try
94         {
95             this.availableServiceBindingVO.setDescription(description);
96         }
97         catch(ConstraintException ce)
98         {
99             this.description = description;
100             this.ceb.add(new ConstraintExceptionBuffer(ce));
101         }
102     }
103
104     public String JavaDoc getVisualizationAction()
105     {
106         if(this.visualizationAction != null)
107             return this.visualizationAction;
108             
109         return this.availableServiceBindingVO.getVisualizationAction();
110     }
111         
112     public void setVisualizationAction(String JavaDoc visualizationAction)
113     {
114         try
115         {
116             this.availableServiceBindingVO.setVisualizationAction(visualizationAction);
117         }
118         catch(ConstraintException ce)
119         {
120             this.visualizationAction = visualizationAction;
121             this.ceb.add(new ConstraintExceptionBuffer(ce));
122         }
123     }
124
125
126     public Boolean JavaDoc getIsMandatory()
127     {
128         if(this.isMandatory != null)
129             return this.isMandatory;
130             
131         return this.availableServiceBindingVO.getIsMandatory();
132     }
133         
134     public void setIsMandatory(Boolean JavaDoc isMandatory)
135     {
136         try
137         {
138             this.availableServiceBindingVO.setIsMandatory(isMandatory);
139         }
140         catch(ConstraintException ce)
141         {
142             this.isMandatory = isMandatory;
143             this.ceb.add(new ConstraintExceptionBuffer(ce));
144         }
145     }
146
147
148     public Boolean JavaDoc getIsUserEditable()
149     {
150         if(this.isUserEditable != null)
151             return this.isUserEditable;
152             
153         return this.availableServiceBindingVO.getIsUserEditable();
154     }
155         
156     public void setIsUserEditable(Boolean JavaDoc isUserEditable)
157     {
158         try
159         {
160             this.availableServiceBindingVO.setIsUserEditable(isUserEditable);
161         }
162         catch(ConstraintException ce)
163         {
164             this.isUserEditable = isUserEditable;
165             this.ceb.add(new ConstraintExceptionBuffer(ce));
166         }
167     }
168
169     public Boolean JavaDoc getIsInheritable()
170     {
171         if(this.isInheritable != null)
172             return this.isInheritable;
173             
174         return this.availableServiceBindingVO.getIsInheritable();
175     }
176         
177     public void setIsInheritable(Boolean JavaDoc isInheritable)
178     {
179         try
180         {
181             this.availableServiceBindingVO.setIsInheritable(isInheritable);
182         }
183         catch(ConstraintException ce)
184         {
185             this.isUserEditable = isInheritable;
186             this.ceb.add(new ConstraintExceptionBuffer(ce));
187         }
188     }
189
190
191     public String JavaDoc doExecute() throws Exception JavaDoc
192     {
193         ceb.add(this.availableServiceBindingVO.validate());
194         ceb.throwIfNotEmpty();
195         
196         this.availableServiceBindingVO = AvailableServiceBindingController.getController().create(this.availableServiceBindingVO);
197         return "success";
198     }
199         
200     public String JavaDoc doInput() throws Exception JavaDoc
201     {
202         return "input";
203     }
204 }
205
Popular Tags