KickJava   Java API By Example, From Geeks To Geeks.

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


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.controllers.kernel.impl.simple.AvailableServiceBindingController;
27 import org.infoglue.cms.entities.management.AvailableServiceBindingVO;
28 import org.infoglue.cms.exception.ConstraintException;
29 import org.infoglue.cms.util.ConstraintExceptionBuffer;
30
31
32 /**
33   * This is the action-class for UpdateAvailableServiceBinding
34   *
35   * @author Mattias Bogeblad
36   */

37 public class UpdateAvailableServiceBindingAction extends ViewAvailableServiceBindingAction //WebworkAbstractAction
38
{
39     
40     private AvailableServiceBindingVO availableServiceBindingVO;
41     private Integer JavaDoc availableServiceBindingId;
42     private String JavaDoc name;
43     private String JavaDoc description;
44     private String JavaDoc visualizationAction;
45     private Boolean JavaDoc isMandatory;
46     private Boolean JavaDoc isUserEditable;
47     private Boolean JavaDoc isInheritable;
48
49     private ConstraintExceptionBuffer ceb;
50     
51     public UpdateAvailableServiceBindingAction()
52     {
53         this(new AvailableServiceBindingVO());
54     }
55     
56     public UpdateAvailableServiceBindingAction(AvailableServiceBindingVO availableServiceBindingVO)
57     {
58         this.availableServiceBindingVO = availableServiceBindingVO;
59         this.ceb = new ConstraintExceptionBuffer();
60     }
61     
62     public String JavaDoc doExecute() throws Exception JavaDoc
63     {
64         super.initialize(getAvailableServiceBindingId());
65
66         // ceb.throwIfNotEmpty();
67
ceb.add(this.availableServiceBindingVO.validate());
68         ceb.throwIfNotEmpty();
69         
70         String JavaDoc[] values = getRequest().getParameterValues("serviceDefinitionId");
71         
72         AvailableServiceBindingController.getController().update(this.availableServiceBindingVO, values);
73                 
74         return "success";
75     }
76
77     public String JavaDoc doSaveAndExit() throws Exception JavaDoc
78     {
79         doExecute();
80                         
81         return "saveAndExit";
82     }
83
84     public void setAvailableServiceBindingId(Integer JavaDoc availableServiceBindingId)
85     {
86         this.availableServiceBindingVO.setAvailableServiceBindingId(availableServiceBindingId);
87     }
88
89     public java.lang.Integer JavaDoc getAvailableServiceBindingId()
90     {
91         return this.availableServiceBindingVO.getAvailableServiceBindingId();
92     }
93         
94     public java.lang.String JavaDoc getName()
95     {
96         if(this.name != null)
97             return this.name;
98     
99         return this.availableServiceBindingVO.getName();
100     }
101         
102     public void setName(java.lang.String JavaDoc name)
103     {
104         try
105         {
106             this.availableServiceBindingVO.setName(name);
107         }
108         catch(ConstraintException ce)
109         {
110             this.name = name;
111             this.ceb.add(new ConstraintExceptionBuffer(ce));
112         }
113     }
114
115     public String JavaDoc getDescription()
116     {
117         if(this.description != null)
118             return this.description;
119             
120         return this.availableServiceBindingVO.getDescription();
121     }
122         
123     public void setDescription(String JavaDoc description)
124     {
125         try
126         {
127             this.availableServiceBindingVO.setDescription(description);
128         }
129         catch(ConstraintException ce)
130         {
131             this.description = description;
132             this.ceb.add(new ConstraintExceptionBuffer(ce));
133         }
134     }
135     
136     public String JavaDoc getVisualizationAction()
137     {
138         if(this.visualizationAction != null)
139             return this.visualizationAction;
140             
141         return this.availableServiceBindingVO.getVisualizationAction();
142     }
143         
144     public void setVisualizationAction(String JavaDoc visualizationAction)
145     {
146         try
147         {
148             this.availableServiceBindingVO.setVisualizationAction(visualizationAction);
149         }
150         catch(ConstraintException ce)
151         {
152             this.visualizationAction = visualizationAction;
153             this.ceb.add(new ConstraintExceptionBuffer(ce));
154         }
155     }
156     
157     public Boolean JavaDoc getIsMandatory()
158     {
159         if(this.isMandatory != null)
160             return this.isMandatory;
161             
162         return this.availableServiceBindingVO.getIsMandatory();
163     }
164         
165     public void setIsMandatory(Boolean JavaDoc isMandatory)
166     {
167         try
168         {
169             this.availableServiceBindingVO.setIsMandatory(isMandatory);
170         }
171         catch(ConstraintException ce)
172         {
173             this.isMandatory = isMandatory;
174             this.ceb.add(new ConstraintExceptionBuffer(ce));
175         }
176     }
177
178
179     public Boolean JavaDoc getIsUserEditable()
180     {
181         if(this.isUserEditable != null)
182             return this.isUserEditable;
183             
184         return this.availableServiceBindingVO.getIsUserEditable();
185     }
186         
187     public void setIsUserEditable(Boolean JavaDoc isUserEditable)
188     {
189         try
190         {
191             this.availableServiceBindingVO.setIsUserEditable(isUserEditable);
192         }
193         catch(ConstraintException ce)
194         {
195             this.isUserEditable = isUserEditable;
196             this.ceb.add(new ConstraintExceptionBuffer(ce));
197         }
198     }
199     
200     public Boolean JavaDoc getIsInheritable()
201     {
202         if(this.isInheritable != null)
203             return this.isInheritable;
204             
205         return this.availableServiceBindingVO.getIsInheritable();
206     }
207         
208     public void setIsInheritable(Boolean JavaDoc isInheritable)
209     {
210         try
211         {
212             this.availableServiceBindingVO.setIsInheritable(isInheritable);
213         }
214         catch(ConstraintException ce)
215         {
216             this.isUserEditable = isInheritable;
217             this.ceb.add(new ConstraintExceptionBuffer(ce));
218         }
219     }
220
221 }
222
Popular Tags