KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > views > jsp > vui > FilledTag


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.webwork.views.jsp.vui;
6
7 import com.opensymphony.webwork.views.util.UrlHelper;
8 import org.apache.commons.logging.Log;
9 import org.apache.commons.logging.LogFactory;
10
11 import javax.servlet.http.HttpServletRequest JavaDoc;
12 import javax.servlet.http.HttpServletResponse JavaDoc;
13
14
15 /**
16  * Voice UI for filled tag
17  *
18  * @author Jeff Haynie (jhaynie@vocalocity.net)
19  * @version $Revision: 1.6 $
20  */

21 public class FilledTag extends AbstractVUITag {
22     //~ Static fields/initializers /////////////////////////////////////////////
23

24     // Attributes ----------------------------------------------------
25
protected static Log log = LogFactory.getLog(FilledTag.class);
26
27     //~ Instance fields ////////////////////////////////////////////////////////
28

29     protected String JavaDoc actionAttr;
30     protected String JavaDoc actionaudioAttr;
31     protected String JavaDoc modeAttr;
32     protected String JavaDoc namelistAttr;
33
34     //~ Methods ////////////////////////////////////////////////////////////////
35

36     public void setAction(String JavaDoc aName) {
37         actionAttr = aName;
38     }
39
40     public String JavaDoc getAction() {
41         return actionAttr;
42     }
43
44     public void setActionaudio(String JavaDoc aName) {
45         actionaudioAttr = aName;
46     }
47
48     public String JavaDoc getActionaudio() {
49         return actionaudioAttr;
50     }
51
52     public String JavaDoc getFooterTemplate() {
53         return "filled-footer.jsp";
54     }
55
56     // Public --------------------------------------------------------
57
public String JavaDoc getHeaderTemplate() {
58         return "filled-header.jsp";
59     }
60
61     public void setMode(String JavaDoc aName) {
62         modeAttr = aName;
63     }
64
65     public String JavaDoc getMode() {
66         return modeAttr;
67     }
68
69     public void setNamelist(String JavaDoc aName) {
70         namelistAttr = aName;
71     }
72
73     public String JavaDoc getNamelist() {
74         return namelistAttr;
75     }
76
77     protected void initializeAttributes() {
78         HttpServletRequest JavaDoc request = (HttpServletRequest JavaDoc) pageContext.getRequest();
79         HttpServletResponse JavaDoc response = (HttpServletResponse JavaDoc) pageContext.getResponse();
80
81         String JavaDoc url = ((actionAttr != null) ? UrlHelper.buildUrl((String JavaDoc) findValue(actionAttr), request, response, null) : null);
82
83         if (url != null) {
84             addParameter("action", url);
85             url = ((actionaudioAttr != null) ? UrlHelper.buildUrl((String JavaDoc) findValue(actionaudioAttr), request, response, null) : null);
86
87             if (url != null) {
88                 addParameter("actionaudio", url);
89             }
90         }
91
92         getSetParameter(namelistAttr, "namelist");
93         getSetParameter(modeAttr, "mode");
94     }
95 }
96
Popular Tags