KickJava   Java API By Example, From Geeks To Geeks.

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


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.RedirectController;
27 import org.infoglue.cms.entities.management.RedirectVO;
28 import org.infoglue.cms.util.ConstraintExceptionBuffer;
29
30
31 /**
32   * This is the action-class for UpdateRedirect
33   *
34   * @author Mattias Bogeblad
35   */

36 public class UpdateRedirectAction extends ViewRedirectAction //WebworkAbstractAction
37
{
38     
39     private RedirectVO redirectVO;
40     private Integer JavaDoc redirectId;
41     private String JavaDoc userAction = "";
42     private ConstraintExceptionBuffer ceb;
43     
44     public UpdateRedirectAction()
45     {
46         this(new RedirectVO());
47     }
48     
49     public UpdateRedirectAction(RedirectVO redirectVO)
50     {
51         this.redirectVO = redirectVO;
52         this.ceb = new ConstraintExceptionBuffer();
53     }
54
55         
56     public String JavaDoc doExecute() throws Exception JavaDoc
57     {
58         super.initialize(getRedirectId());
59
60         ceb.add(this.redirectVO.validate());
61         ceb.throwIfNotEmpty();
62         
63         RedirectController.getController().update(this.redirectVO);
64                 
65         return "success";
66     }
67
68     public String JavaDoc doLocal() throws Exception JavaDoc
69     {
70         super.initialize(getRedirectId());
71
72         ceb.throwIfNotEmpty();
73         
74         RedirectController.getController().update(this.redirectVO);
75         
76         return "successLocal";
77     }
78
79     public String JavaDoc doSaveAndExit() throws Exception JavaDoc
80     {
81         doExecute();
82                         
83         return "saveAndExit";
84     }
85
86     public String JavaDoc doSaveAndExitLocal() throws Exception JavaDoc
87     {
88         doLocal();
89                         
90         return "saveAndExitLocal";
91     }
92
93     public void setRedirectId(Integer JavaDoc redirectId) throws Exception JavaDoc
94     {
95         this.redirectVO.setRedirectId(redirectId);
96     }
97
98     public java.lang.Integer JavaDoc getRedirectId()
99     {
100         return this.redirectVO.getRedirectId();
101     }
102         
103     public java.lang.String JavaDoc getUrl()
104     {
105         return this.redirectVO.getUrl();
106     }
107         
108     public void setUrl(java.lang.String JavaDoc url)
109     {
110         this.redirectVO.setUrl(url);
111     }
112
113     public String JavaDoc getRedirectUrl()
114     {
115         return this.redirectVO.getRedirectUrl();
116     }
117         
118     public void setRedirectUrl(String JavaDoc redirectUrl)
119     {
120         this.redirectVO.setRedirectUrl(redirectUrl);
121     }
122     
123 }
124
Popular Tags