KickJava   Java API By Example, From Geeks To Geeks.

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


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
28 /**
29  * @author mgu
30  *
31  * To change this generated comment edit the template variable "typecomment":
32  * Window>Preferences>Java>Templates.
33  * To enable and disable the creation of type comments go to
34  * Window>Preferences>Java>Code Generation.
35  */

36
37 public class ConfirmAction extends InfoGlueAbstractAction
38 {
39     private String JavaDoc yesDestination;
40     private String JavaDoc noDestination;
41     private String JavaDoc dest;
42     private String JavaDoc header;
43     private String JavaDoc message;
44     private String JavaDoc extraParameters;
45     private String JavaDoc choice;
46
47     public ConfirmAction()
48     {
49         this.choice = "";
50     }
51
52     public void setYesDestination(String JavaDoc yesDestination)
53     {
54         this.yesDestination = yesDestination;
55     }
56     
57     public void setNoDestination(String JavaDoc noDestination)
58     {
59         this.noDestination = noDestination;
60     }
61     
62     public String JavaDoc getNoDestination()
63     {
64         return this.noDestination;
65     }
66     
67     public String JavaDoc getYesDestination()
68     {
69         return this.yesDestination;
70     }
71     
72     public void setMessage(String JavaDoc message)
73     {
74         this.message = message;
75     }
76     
77     public String JavaDoc getMessage() throws Exception JavaDoc
78     {
79         return this.message;
80     }
81     
82     public String JavaDoc getExtraParameters()
83     {
84         return extraParameters;
85     }
86
87     public void setExtraParameters(String JavaDoc extraParameters)
88     {
89         this.extraParameters = extraParameters;
90     }
91
92     public void setHeader(String JavaDoc header)
93     {
94         this.header = header;
95     }
96     
97     public String JavaDoc getHeader()
98     {
99         return this.header;
100     }
101     
102     public void setChoice(String JavaDoc action)
103     {
104         this.choice = action;
105     }
106     
107     public String JavaDoc getChoice()
108     {
109         return this.choice;
110     }
111     
112     public String JavaDoc getDest()
113     {
114         return this.dest;
115     }
116     
117     public void setDest(String JavaDoc dest)
118     {
119         this.dest = dest;
120     }
121     
122     private void Reroute()
123     {
124         if(this.choice.equalsIgnoreCase("yes"))
125         {
126             this.dest = this.yesDestination;
127         }
128         else
129         {
130             this.dest = this.noDestination;
131         }
132     }
133     
134     protected String JavaDoc doExecute() throws Exception JavaDoc
135     {
136         if(this.choice.length() > 0)
137         {
138             Reroute();
139             return "reroute";
140         }
141         
142         return SUCCESS;
143     }
144
145 }
146
Popular Tags